This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can't get correct value from sensor via saadc

Hi devzone!

I connected my flame detector sensor(szh-ek086) which sends data analog value to my nrf52840 DK.

To receive the analog value from sensor I used saadc module.

First, I run the saadc_pca10056 and wired the a0 pin to GND, 5V and It shows me the value correctly.

But, When I wired it with my flame detector sensor, the value doesn't change at all such as the floating value.

The moment when I unconnect it and connect it again, It shows me the correct value(ex, 700, 600) in very short time.

Do I need to change anything more in the code to use external sensor?

Best regards,

Parents
  • Hi,

    You should not connect the analog input to 5V, unless you have powered the board using high-voltage mode. The analog inputs support an input range of 0-VDD. By default the nRF52840 IC on the DK is powered by a regulated 3V supply, which you can measure on pin VDD_nRF.

    Can you post the code that you are using to measure the sensor? Note that the pin marked A0 on the DK is not the same as analog input AIN0, the naming of the board is the Arduino form factor pin naming. A0 (P0.03) corresponds to AIN1 on the nRF52840 IC.

    Best regards,
    Jørgen

Reply
  • Hi,

    You should not connect the analog input to 5V, unless you have powered the board using high-voltage mode. The analog inputs support an input range of 0-VDD. By default the nRF52840 IC on the DK is powered by a regulated 3V supply, which you can measure on pin VDD_nRF.

    Can you post the code that you are using to measure the sensor? Note that the pin marked A0 on the DK is not the same as analog input AIN0, the naming of the board is the Arduino form factor pin naming. A0 (P0.03) corresponds to AIN1 on the nRF52840 IC.

    Best regards,
    Jørgen

Children
Related