A0 always returns 1024


#1

Hi everyone,

I just got my Bolt IoT and played a little bit.
Digital IO seems to work fine, but Analog IO always gives 1024 if Sensor is connected or Random Value if no Sensor is connected.

I did as described in QuickStartGuide Project 1 with an LDR, a Resistor and wired like explained in the PDF.

Here my wireing (had no Bolt for Fritzing, so used ESP8266, Yellow is connected to A0 on Bolt)

Any suggestions?

Kind regards
Manuel Ritter


#2

@ritter.net: HI.
There are only 2 possible ways you would get 1024 output

  1. The internal resistance of the LRD is less than 759ohms. This can happen if you have a bright light shining on the LDR.
  2. There is a loose connection in the 330 resistor. It could be that the resister is loose on the A0 pin, or on the GND pin.

I suggest checking the connections again.


#3

Hi vinayak.joshi,

thanks for your reply.
I don’t think its 1, as I tested with several light levels, from “direct smartphone led” to “covered inside a closed cardboard box”
I will check all connections when I’m back home tonight

Kind Regards
Manuel Ritter


#4

Hi @ritter.net,

Can you try reading the value of the LDR via the API in your browser and observing the output.
For E.g. the API call would be something like,

https://cloud.boltiot.com/remote/YOUR_API/analogRead?pin=A0&deviceName=YOUR_DEVICE_NAME

Assuming you have connected the LDR to pin A0.
You should receive an output something like,
{“value”: “79”, “success”: “1”}


#5

@ritter.net,
When you are trying the api call that @shoeb.ahmed mentioned, do remember to replace the words ‘YOUR_API’ with the api key that you can find in your dashboard.


#6

@vinayak.joshi Thanks for reminding me about that. I had forgotten to mention it.


#7

thanks for sharing such a nice post i also wanted to know good to know
with regards
https://kodi.software/