# Question on AnalogRead

**URL:** <https://forum.xod.io/t/question-on-analogread/3621>\
**Category:** XOD Programming Questions\
**Created:** [March 13, 2020, 11:04am UTC](https://forum.xod.io/t/question-on-analogread/3621 "2020-03-13T11:04:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jovarasz](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/jovarasz/32/2086_2.png) [@jovarasz](https://forum.xod.io/u/jovarasz)\
**Post date:** [March 13, 2020, 11:04am UTC](https://forum.xod.io/t/question-on-analogread/3621/1 "2020-03-13T11:04:43Z")

</div>

Hello,  
I was working on my project with multiple analog capacitive soil humidity sensors. Therefore, I wanted to use analog read and was wondering how does the program works. Does it use for reference 5v or does it look for highest input value and use it for the ratio instead. That would be a problem in my case because my sensors output voltage from 0 to 3.3v. Consequently, it will never reach 100% humid. I took a look to c++ code but I was unsure. If its possible I would like to receive a node which would include one more input for highest expected input from a sensor.  
Thank you in advance

---

<div class="post-metadata">

**Author:** ![gabbapeople](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/gabbapeople/32/1517_2.png) [@gabbapeople](https://forum.xod.io/u/gabbapeople)\
**Post date:** [March 13, 2020, 1:00pm UTC](https://forum.xod.io/t/question-on-analogread/3621/2 "2020-03-13T13:00:34Z")

</div>

Hi, @jovarasz!

Analog read is based on the reference voltage of your board. You can find out your reference voltage on the `AREF` or `VREF` board pins.  
For example, for Arduino Uno, the reference voltage is 5V. It means that [`analog-read`](https://xod.io/libs/xod/gpio/analog-read/) outputs `1` at the voltage of 5V.  
For ESP8266, the reference voltage is 3.3V and [`analog-read`](https://xod.io/libs/xod/gpio/analog-read/) outputs `1` at 3.3V.

If your sensor changes voltage only in the range from 0 to 3.3V, try setting the new boundary conditions with the [`map`](https://xod.io/libs/xod/math/map/) node. From [0, 3.3] to [0, 5].

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [June 21, 2020, 5:47am UTC](https://forum.xod.io/t/question-on-analogread/3621/3 "2020-06-21T05:47:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
