Wi Py 2.0 Internal Comparator?

  • Hello There

    Does anyone knows if the ESP32 has internal comparator for any of the pins?


  • @robert-hh said in Wi Py 2.0 Internal Comparator?:


    Hey Mate,

    Thank you very much for your reply. I will definitely will give it a go to the DS18B20, it looks way easier to use mate.
    I do agree that adding external components (resistor, comparator) adds extra burden to the limited power, and that is a killer for me.


  • @ColombianAus
    I'd say that this device is hard to use with an WiPy, especially w/o any additional circuits. You will always need at least an additional resistor to cope with the output signal (convert current to voltage). The counter interface is not present in Python, and no python software interface is fast enough to count pulses at about 90 kHz. Even if, the device requires 2 GPIO Pins, the same as a temp sensor with I2C interface. Or look at parts like the DS18B20. If you need a 2-Wire device, you could simply take a precision NTC resistor. Together with another resistor (and maybe a capacitor), then you can use the ADC to get the temperature. The good ones comes with a calibration sheet, and the temperature can be derived using parameters, given in that sheet too.

  • @ColombianAus
    The ESP32 and thus the WiPy don't have a traditional comparator, however it does have a pulse counter peripheral which could in theory work a treat for the LMT01 - you'd just set it to count rising edges within the 50ms read time and life would be good :)

    However for now the pulse counter is only available from C. The good news is you should be able to use a GPIO just by adding a simple NPN transistor as figure 31 in the datasheet suggests - you don't need a comparator.

    If adding a transistor is really a problem you might be able to use the ADC, using thresholds to figure out the high and low values - but I don't know if the timing would allow it, you'd have to test.

  • Hi there,

    I am going to interface a LMT01-Q1 Temperature sensor with the Wi Py 2.0. The following is taken from the data sheet

    The LMT01-Q1 temperature output is transmitted over a single wire using a train of current pulses that typically change from 34 uAmp to 125 uAmp. A simple resistor can then be used to convert the current pulses to a voltage AND a comparator or external transistor can be used to convert this signal to valid logic levels....

    I want to avoid adding a extra component to the system (comparator).


  • @ColombianAus
    Can you tell more what do you mean or require?
    You can compare two sources (voltage) with e.g. ADC.

Log in to reply

Pycom on Twitter