logo elektroda
logo elektroda
X
logo elektroda

[Solved] Measuring values from a photoresistor and a thermistor via a single ADC

tanta1 588 7
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20031990
    tanta1
    Level 5  
    Good day ! I would like to be able to measure values from two different voltage dividers (one with a photoresistor and the other with a thermistor), and the choice of which value to measure at any given time should be made via the second digital pin. How could I do this ?
  • ADVERTISEMENT
  • #2 20032033
    czareqpl
    Level 33  
    Look for information on the analogue IC switch. Something like the MAX14689, for example
  • ADVERTISEMENT
  • #3 20032040
    mmmalecki
    Level 16  
    One option is a relay, the other a switch circuit.
  • #4 20032293
    khoam
    Level 42  
    Which ESP is it? The ESP8266 or the ESP32? In the latter, you can change the ADC channel assignment to a given pin programmatically.
  • ADVERTISEMENT
  • #5 20032317
    tanta1
    Level 5  
    khoam wrote:
    What ESP is this about?

    ESP8266
  • #6 20032354
    khoam
    Level 42  
    When switching between two voltage dividers, no additional multiplexers are needed. It is sufficient to switch on/off the power supply of the individual dividers. The role of the power supply is played by other "digital" pins. An example of such a solution together with a program: Link .
  • ADVERTISEMENT
  • #7 20032988
    tanta1
    Level 5  
    @khoam Clever solution, but I would only want to use one pin for this as the others are already used. Maybe just insert some MOSFET that will power the first divider when the pin is in the low state, and when it goes high to power the second divider then the transistor will disconnect the power supply to the first divider. Is this possible?
  • #8 20565252
    tanta1
    Level 5  
    In the end, I used the CD4051B chip as a multiplexer, because I needed to measure more than 2 values, but I also found it simpler and quicker than playing with diodes and powering each divider separately and fighting with voltage drops, which I wanted to avoid.

Topic summary

The discussion revolves around measuring values from a photoresistor and a thermistor using a single ADC, with the ability to switch between the two measurements via a digital pin. Suggestions include using an analogue IC switch like the MAX14689, employing a relay or switch circuit, and utilizing the ESP8266's capabilities. One proposed solution involves powering the voltage dividers with digital pins to avoid the need for additional multiplexers. A follow-up indicates the use of a CD4051B multiplexer for measuring multiple values, highlighting its simplicity over other methods that involve diodes and separate power supplies.
Summary generated by the language model.
ADVERTISEMENT