/pico_fogger_controller

Pi Pico Code to control a fog machine via variable timer or motion sensors

Primary LanguagePythonMIT LicenseMIT

pico_fogger_controller

Pi Pico Code to control a fog machine via variable timer or motion sensors

Background

I bought this fog machine for Halloween. It worked great, but almost too great. The automatic mode ran 30 seconds every 2-3 minutes which seems fine ... until after about 30 minutes and there's smoke all over our front yard into the street.

I wanted a way to control the duration it is on and off to not put out as much fog. But it didn't offer that. It only offered the automatic mode, a wireless button, and a mechanical button.

So I built a small microcontroller circuit to control it the way I wanted, with parts < $10.

Design

So I did the following:

  • Soldered two wire leads to the inside switch of the mechanical button,
  • Bought a Raspberry Pi Pico,
  • hooked it to a 5V relay module,
  • Hooked relay to the switch leads,
  • Wired this PIR sensor module to a GPIO pin, and
  • Set the pin as an interrupt to trigger the fogger on motion as well as timer.

The relay module was a useful way to activate that mechanical switch with circuit isolation.

Source Code

The main.py can be uploaded to the Pico via a tool like Thonny after you flash it with MicroPython firmware.

The main.py is a timer that switches the onboard LED and relay pin ON/OFF. When the pins are OFF, it can be optionally interrupted via the interrupt pin (i.e. with a PIR motion detection event), which will turn the LED/relay back on.

References