Hello,
I have a device with momentary switches, this device is powered with 0/+5V.
I would like to simulate switch press with external mcu : ESP32
I know that esp32 pins can be configured in open drain mode to simulate a switch, but has the device to control is powered with grater voltage than esp32 should handle should I have to use a level converter?
My thought is that I should. I have some TSX0108E board laying around, according to data-sheet it should be fine to work in open drain mode but I doesn't manage to do it.
I don't understand how to make it work in open drain mode.
Do you have some advices for the setup ?
Should I connect the TSX0108E's OE pin to GND or VCCA with or without resistor ?
Should I drive the esp32 pin in open drain mode or as an output ?
How can I check if this setup work ?
With ohmmeter beetwen GND and TSX's output ? I should see the value changing from ~0_ohm and ~infinite_ohm right ?
open drain setup with level converter
open drain setup with level converter
nodemcu V2 (amica)
micropython firmware Daily build 05/31/2016
micropython firmware Daily build 05/31/2016
Re: open drain setup with level converter
I would use a single transistor/resistor inverter (e.g. 2N7000) in that case. Easy to set-up, robust.
Re: open drain setup with level converter
Thanks for your answer Roberthh,
According to the 2n7000 specification, how should I wire it ?
1: Source -> ground
2: Gate -> Esp32 pin (set as an output 0 or 3.3v)
3: Drain -> switch pin
According to the 2n7000 specification, how should I wire it ?
1: Source -> ground
2: Gate -> Esp32 pin (set as an output 0 or 3.3v)
3: Drain -> switch pin
nodemcu V2 (amica)
micropython firmware Daily build 05/31/2016
micropython firmware Daily build 05/31/2016
Re: open drain setup with level converter
Yes, that's a good wiring. You can also add a resistor between Drain and 5V, unless that already exists on the target board. So you would write a 1 to the GPIO port to get a low value and Drain, and a 0 to get a high impedance of the 2N7000.
Re: open drain setup with level converter
Thanks
nodemcu V2 (amica)
micropython firmware Daily build 05/31/2016
micropython firmware Daily build 05/31/2016