You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • I suggest that you provide 0.00, 0.25, 0.50, 0.75 and 1.00 Volts and analog read each of them. You should get something linearly related to the voltage applied. If not, analog read is not doing anything for you... (anymore? ...may it is already be 'gone' due to having given it > 1 or 3.3V?)

    How to create these voltages?

    3.3V ------+------------------+--------------­-------
               |    ^             |
              .-.   |             |
           R1 | |   |             |
      100 Ohm | |   |             |
              '-'   |2.3V         |
               |    |             |
              .-.   |             |
           R2 | |   |             |
     2.2K Ohm | |   |             |
              '-'   V             |    NodeMCU
               |  -------       .-O------------------.
               |    ^           | 3.3V               |
              .-.   |1.0V       |                    |
           R3 | |   |           |                    |
       1K Ohm | |<--------------O  A0 analog input   |
    Potentio- | |   | ^         |                    |
        meter '-'   | |variable | GND                |
               |    | |0..1.0 V '-O------------------'
               |    V V           |
    GND -------+------------------+-------------­--------
    

    I assume you have a multi-meter to measure the voltage produced by the voltage divider established by the resistors R1, R2 and R3. If not - but with decent tolerances of the resistors (2..5%) - you can guess by the position of the wiper about what voltage between 0 and 1 Volt to expect.

About

Avatar for allObjects @allObjects started