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
yes I have tried by connecting it a gnd .
1) If i am connecting to a gnd i am getting the values in the range of 260 - 280
2) without gnd connection i am getting the values in the range of 830 - 900
Thanks & Regards,
pspavi
above pic with ground connection
without ground connection , output values
1)Looks like a hardware connection issue to me. Ensure that the the IR sensor and DK share a common ground.Check other connections too. Your jumper settings are different from DK.
2) What is the output of your IR sensor.It should not exceed 3V(Vdd). Multiply the multi-meter output by 284, the output of this multiplication should be displayed on the terminal(assuming dc output of the sensor).
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
Verify the max output of your sensor. If it's above VDD you need to add a voltage-divider so that you don't overdrive the analog pin, this is very important.
Once you've verified that the IR-sensor can supply a safe voltage, you can connect the IR-sensor to the DK as you did before. (GND->GND, P.03->SENSOR-OUTPUT, ...)
Here's a link to Nordics SAADC documentation:
infocenter.nordicsemi.com/.../saadc.html