I have a shop-bought, small, portable dehumidifier that is controlled by a 5V logic chip internally. I'd like to be able to control it remotely using an ESP8266 or ESP32 (i.e. 3.3V logic). I only need to be able to turn it on or off and check if the water container is full.

The dehumidifier has a hinge lever switch that is activated when a float rises in the water container. The switch is Normally Open and when the float rises it completes the circuit and appears to pull an IO pin on the internal 5V board low.

What I'd like to do is insert the ESP8266 in place of the switch and then connect the switch to other IO pins on the ESP8266. This way I can detect when the water container is full and then use the ESP8266 to somehow pull the IO pin on the internal logic board low. I can also turn the dehumidifer on/off that way (by pulling the pin low) as the dehumidifier turns itself off when the tank is full.

What I'm struggling with is the best way to get the ESP8266 to pull the other MCU's 5V pin low. The options I've thought of are as follows:

  1. Use a relay (can't do this because there's not enough space to fit one inside the unit)
  2. Use a logic level shifter between the two MCUs. Would this even work? It also means I need a few extra components and it seems like there should be a more elegant, simpler solution
  3. Use a BJT or MOSFET to somehow do it. I'm not sure if this will work, or if so which BJT or MOSFET would be right (in a package I can actually use without having to make a custom PCB)
  4. Voltage divider. Would this work? If so what would be the circuit?

Any help on the above would be much appreciated, or any other simple/elegant suggestions.

Thanks in advance!

  • 3
    \$\begingroup\$ I wouldn't break the link between float switch and control board and rely on your own software as any problems mean the unit could carry on running and flood the place. Make your control an additional feature. \$\endgroup\$
    – Finbarr
    Commented Feb 2 at 12:39
  • 1
    \$\begingroup\$ You might also find that the control board, although running at low voltage, is not isolated from the mains supply. Exercise caution until you've determined that it's safe. \$\endgroup\$
    – Finbarr
    Commented Feb 2 at 12:41
  • 1
    \$\begingroup\$ Thanks, noted. The dehumidifier is powered by a 9v wall adapter so well isolated from mains (it's a small portable unit made by Russell Hobbs) which also means that the amount of moisture the unit removes is pretty low so the risk of 'flooding' is limited (at worst it would be a small puddle). I'm also regularly in the area the unit is used so would spot a problem fairly quickly. If you have any suggestions for an appropriate circuit that could be used, that would be helpful, thanks. \$\endgroup\$
    – Thinqer77
    Commented Feb 2 at 12:52

1 Answer 1


Try this:


simulate this circuit – Schematic created using CircuitLab


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.