I have a dehumidifier (Pro Breeze 1L) which works with a capacitative touch sensor. When the machine is plugged in, the two buttons (on/off, light) flash on, but it will not be on until the button is pressed. I want to basically turn it on by timer.

The chassis has space for a Pi Zero and it was cheap, so I gave hacking it a go.

The spring has a 1kΩ SMD resistor (102) before the microcontroller (FMD illegible product code). So I soldered a threaded 18AWG wire which I crudely jammed into the GPIO21 header pin of a Pi Zero (footnote 1). The Pi Zero is running Jupyter notebook, which I interface with and run code to switch the pin for 200 ms as a sink before switching back to a high-impedance state (less than 150 ms nothing happens).

I connected a MP1584EN step down from the 12V power supply to 5V connected to the Pi Zero's header pins (the variable resistor is fiddly, but I got it to 5.05V). Stealing the board's 5V does not power the Pi Zero.

Assuming it was a small difference in ground voltages, I also connected the chip's ground to the Pi's.

However, chip resets (LEDs for both buttons flash on) instead of turning on the dehumidifier cooler when

  • the Pi Zero is powered from the buck converter and when the grounds are connected
  • the Pi Zero is powered from the buck converter and when the grounds are not connected
  • the Pi Zero is powered by external USB and when the grounds are connected

Whereas when the Pi Zero is powered by external USB and when the grounds are not connected, the switch "hickups" for half a second toggling between on and off.

I tried different resistors between the GPIO21 and the switch. ≥5kΩ my finger no longer triggers it. ≥20kΩ the pi is unable to produce a response. So I went with 10kΩ. In desperation, I tried a rectifier both ways and it behaved as I expected.

Given the hickup behaviour when in a high-impedance state, I assume I am missing something obvious.

setup (The Pi had a previous life as a weather station, hence why it has a header on the boot RUN pins and its pins are a bit worn, but it's pins work fine —tested)

Footnote 1. The gauge is too low but I could not find my 24AWG and I am at the prototyping stage and would have done a proper crimped connector later.

Footnote 2. Code:

import RPi.GPIO as GPIO
import time

class Controller:
    def __init__(self, pin: int):
        pin = GPIO pin number (Broadcom SOC)

        The instance when called "presses the button", but transitly making pin ``pin`` act 
        as a sink and then going into a high-impedance state.

        There is a mode already but I don't remember how one does it.
        GPIO.setmode(GPIO.BCM)  # Use Pin numbers
        self.pin = pin

    def __call__(self, hold_ms:float=200):
        time.sleep(hold_ms * 1e-3)
        return self.deactivate_sink()

    def activate_sink(self):
        GPIO.setup(self.pin, GPIO.OUT)  # Set the pin as an output
        GPIO.output(self.pin, GPIO.LOW)  # Drive the pin low to act as a sink
    def deactivate_sink(self):
        GPIO.setup(self.pin, GPIO.IN)  # Set the pin as an input (high-impedance state)
        return GPIO.input(self.pin)

    def go_brief_high(self, hold_ms: float=1):
        GPIO.setup(self.pin, GPIO.OUT)
        GPIO.output(self.pin, GPIO.HIGH)
        GPIO.output(self.pin, GPIO.LOW)

# ------------------------------------
# to turn on:
controller = Controller(21)
  • 1
    don't fool yourself into thinking that the circuit board in the dehumidifier is safe to touch ... it can easily have full line voltage on all parts, and therefore be an electrocution hazard
    – jsotola
    Jan 20 at 18:43
  • It's not mains, it's a 12V 5.5mm barrel connector but at 3A max —although my multimeter measured 11V when I was twisting the potentiometer screw in the buck converter. Jan 20 at 18:52
  • Connecting a Pi to an unknown circuit is asking for trouble - expect to blow up a few Pi.
    – Milliways
    Jan 20 at 23:07
  • Yes, there should be a rectifier to GPIO21, you're right. But the Pi Zero is warn and the microSD 8GB. Re power management, the 12V -> 5V step down on the manufacture's board is okay (there are 2 100µF caps but at the back) as opposed to by two resistors —it's at 4.99±0.01V >200 mA so actually cleaner than the MP1584EN —I have had one powering a Pi 4 for two years now and had no issues, so it's probably fine. My project longevity worry is that there's no safeguards agains water flowing on the board if the machine were kicked. I've had a Pi die in an irrigation project that way. Jan 21 at 9:27

1 Answer 1


Due to the conflicting evidence, I tried again the tests: I got different results which explains what is happening.

Briefly closing the circuit

  • Without a rectifier and the ground from the machine's board's 5V circuit: the machine's board reset
  • With a rectifier facing the machine's board's 5V circuit ground, i.e. band towards, it's the cathode: it does nothing
  • With a rectifier facing away from the machine's board's 5V circuit ground, i.e. it's the anode: signal works

This means that my assumption that the circuit closes with a sink was wrong, it required a source (which is odd, right?).

As a results, connecting GPIO21 to a rectifier (facing away), a 10 kΩ resistor and a 10µF capacitor and briefly setting it to high (50µs) correctly toggles the system. As it's brief and about 1mV and >1mA it will not be happening frequently, I am happy with this solution.

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.