Hi ...
how to get the data from analog sensor and pass via ble app
Thanks&Regards
pspavi
Hi ...
how to get the data from analog sensor and pass via ble app
Thanks&Regards
pspavi
In the SDK there's an SAADC example that shows you how to read out a voltage on one of the analog pins. Depending on the application of the sensor you could use one of the existing services or create a custom BLE-service to read out and notify your data to the app. I personally used this tutorial to create a custom service.
In the SDK there's an SAADC example that shows you how to read out a voltage on one of the analog pins. Depending on the application of the sensor you could use one of the existing services or create a custom BLE-service to read out and notify your data to the app. I personally used this tutorial to create a custom service.
yes thank you ... i tried but i am not getting the correct readings from sensor . i am getting like this ...
please check with this
What Nordic board and which IR sensor are you using? Are you sure you connected the sensor to the correct pin? If possible could you provide a picture of your setup?
connections done between the analog ir sensor and nRF52840 ... BLUE (analog pin of sensor)
WHITE (Gnd)
GREY (Sensor supply)
Your setup looks OK but the values you're reading are floating a lot, especially if you tried connecting the P0.02 to ground and it gave you the values you posted below. What is the max output voltage of your IR sensor, is it possible you've blown that analog input pin?
Try disconnecting the IR-sensor, changing NRF_SAADC_INPUT_AIN0 to NRF_SAADC_INPUT_AIN1 in the saadc_init function. This changes the analog-pin which is being sampled to P.03. Connect P.03 to GND and you should get values close to 0, connect P.03 to VDD and you should get values around 850.
I just reproduced this example on my own DK and it's working fine so if you're still getting strange values you're probably dealing with a hardware issue.
thanks... i am getting the value above 800... now how to get the correct value of my ir sensor