# FOGduino!



## corey872 (Jan 10, 2010)

EDIT - If you're here for demos and firmware, that is post #12:
https://www.hauntforum.com/showpost.php?p=934640&postcount=12

If you want the full story:

Well, if you followed the saga of my decades-old $29 fogger from Walmart, you know it ran into some troubles last year and ended up in a meltdown - Literally!:

https://www.hauntforum.com/showthread.php?t=46118

The short version - it originally blew a 'thermal fuse' cuts power when the barrel of the fogger gets too hot. I had plenty of time, so replaced that and checked it all out - working great. Then on the big night, right before show time, it blew the thermal fuse again.

In desperation, I jumpered the thermal fuse and my second suspicion was confirmed a few fog cycles later when the snap-disk thermostat stuck "on" and ran the fogger up to molten aluminum temperatures!

Molten aluminum out the barrel:









Source of the melt:









Even the bottom got a little juicy:










17 years of service - Rest in Peace!


----------



## corey872 (Jan 10, 2010)

Except the zombie corpse is coming back this year!

Chiseling off the molten aluminum, blowing out the burned on carbon, and giving it arduino zombie brains in an effort to get 'continuous' fog and possibly a few other modes as opposed to waiting for the dreaded reheat cycle to complete before generating fog again.

So first things first - clean up from the meltdown of 2019...

Heat exchanger, remove the carbon guts










After some wire brushing, shiny and clean!










Installing the nervous system - two thermocouples, sensing approximately 'inlet' and 'outlet' temps. This allows some interpretation of performance and a back-up reading. Should the TC's not agree relatively closely with each other, or fall out of a normal range, we can shut down in error mode.

some careful placement required - can't drill too deep!!










Found some suitable locations along the side. These are MAX6675 Type K Thermocouple modules for interface with arduino. Should be fine for the temps we intend to run.


----------



## corey872 (Jan 10, 2010)

Very rough install with some approximate component placements










Basic schematic of the ratsnest shown above. Goal is to keep all the original safety measures, and only add 3-4 more points of failure ...um I mean components...with an arduino, TC's and some solid state relays!:










But the main payoff is in more control of the fog. The arduino is more than capable of watching temps, running the heater and running the pump at the same time*, so that leaves open some things like:

- A standard interval fog timer ...eg: 5 seconds every 30 seconds, etc
- Fog on sensor activation... 10 seconds every PIR activation or mic detection
- Interval + sensor... background fogging plus a bigger burst when a sensor is tripped
- Random fog bursts...some random number of seconds burst every random number of seconds
- 'Simmer mode' constant low level fogging
- 'Max Mode' - as much as possible with the heater full on!

Here is the parts list I have so far, if anyone is considering. Obviously you need to be fairly familiar with and comfortable working on MAINS VOLTAGE components.

1x Arduino Uno, nano or similar clones
1x 0.96" I2C IIC Serial 128X64 White OLED LCD LED Display Module for Arduino
2x MAX6675 Type K Thermocouple Sense Module - SPI interface
2x SSR-10DA Solid State Relay 3-32VDC Input /24-380VAC Output
- 3-32V DC is critical. May be slightly lower or higher amps depending on your fogger needs, and may only need to be 120VAC output.
1x 10K, 3W resistor

Optional:
1x breadboard or protoboard of your choice for the arduino - or just ratsnest it!
1x HC-SR501 Infrared PIR Motion Sensor Module, LM393 Sound Detection Sensor, or other sensor can also trigger fog.

So that leads us to programming - Ugh - I know just enough to be dangerous! Will be posting more as that comes together!

* Note - OK, technically the arduino does not multi-task so the events aren't actually happening "at the same time" But with a 16mHz clock speed, we can easily do hundreds if not thousands of things every second... so essentially 'at the same time' as far as we're concerned!


----------



## corey872 (Jan 10, 2010)

Couple of other notes, too... if you're been following past posts, I've mentioned the original snap-disk thermostat running at 240°F and the thermal fuse blowing at 270°F.

Well, it turns out, running the fogger actually within these ranges - as measured by my thermocouples in the heat exchanger - doesn't work!

Looking back, the snap disk thermostat is actually on the little metal plate extension shown on the heat exchanger above, and the thermal fuse is actually on the support 'leg' below the heat exchanger. Possibly shown best in this photo:










So I suspect these devices are actually switching / sensing much lower temperatures with the expectation that things will be hotter in the core of the beast.

So what temps to actually run at ??

Here is one source which, by my eyeball, seems to show a 325-450°F 'typical operating range' (also some warnings on glycerine vs glycol based fog for 'theatrical/training - so something to consider if you have fog indoors with continual/repeated exposure over long periods)

https://simplyfog.com/wp-content/uploads/2018/05/Glycols-vs-Glycerin-Fog-Fluids.pdf

Here is a Big Clive teardown on a fog machine - at around the 2:00 minute mark he has a thermocouple in the barrel and reads "300°C" - 572°F !! ...and a teardown/exam of a fog machine which went into an even bigger meltdown than mine!






So that at least gives some range to shoot for. Based on the simplyfog article, it seems the best temp would be "the lowest temp which provides good fog, but doesn't spit excessive liquid out the nozzle". Best of all, with the arduino, the temp is completely tunable... just type in a different number and upload!


----------



## RoxyBlue (Oct 6, 2008)

Ya gotta admire someone who puts more than $29 worth of material, ingenuity, and effort into reviving a 17 year old fog machine. My dad would never get rid of anything that could possibly be fixed, and if he were still alive, he’d give you an engineer’s thumbs up:jol:


----------



## corey872 (Jan 10, 2010)

Well, thanks! I think I would have liked your dad! The fogger has been with me so long, it's sort of like an old friend or family dog - just hate to get rid of it and/or put it down! Plus, most everything I had laying around anyway, so $40 for a new fogger + $20 in parts to make it work, or $20 in parts to make this one work again...I have to take the cheap road, considering it's a one-night-per-year use for about 15-17 ToT's!

Anyway - programming is coming along... it is borderline official now! Has its own project box and splash screen! More to come!


----------



## corey872 (Jan 10, 2010)

Quick update tonight. Will have to settle for text - I was outside trying to set up for a video of some features and a neighbor came running over to "make sure everything was alright!" ...thought something was on fire from all the fog!

So programming is mostly complete - Fogging modes (XXX and YYY are seconds 0-999 (or more if you think your fogger could make a 16 minute burst of fog, or you want to wait more than 16 minutes between events):

Interval... The old standard...Fog XXX seconds every YYY seconds

Sensor... Fog XXX seconds every time a sensor is tripped, wait YYY seconds to re-trigger (though Y can be zero for continued tripping)

Simmer... Fog XXX milliseconds every YYY milliseconds (as close as you can get to 'constant' fog

"Sen-Sim"...combination of the two modes...simmer until the sensor is triggered, then fog the "sensor triggered" program. (probably the one I'll use the most...a background effect of fog, then a heavy dose when ToT's trip a PIR coming up the walkway.)

Boil... Pretty much fog at the max capacity of the fogger (got a source of 5 gallon buckets of fog fluid?)

Random...A random burst of fog up to XXX seconds in a random time of up to YYY seconds



Have the display pretty well lined out to show:

inlet temp, outlet temp, target/set temp and 'dead temp' (point where the pump shuts down to reheat.

Next portion shows the fog mode (from above) and a countdown timer of how long to the next fog event and how long it will last, or other timing info as appropriate.

Will try to slip outside closer to dusk and shoot some video when the smoke isn't as visible to neighbors - otherwise I'll just have to turn the pump off and watch the blinking lights of what 'should' be happening!


----------



## Batbuddy (Sep 3, 2014)

Ok Ok Corey, You just Wowed me... Again! I built a fog machine from scratch years ago before I knew anything about Arduino etc. I Built the heat exchanger from two stove burners and 1/4" copper tubing. Its patterned after a commercial stage unit that I used to service for a theater I worked at. Anyway, I always had a devil of a time getting it to manage heat properly and so I haven't used it for years. When I was heated just right it kicked out a TON of fog Just like the commercial unit it was patterned after. But it was always hard to get the right heat and would spit out liquid mostly. You have created a solution! I would love to get your code and specifics about the thermcouplers you used etc and add that to my old beast. Great job and I just love the write up.


----------



## corey872 (Jan 10, 2010)

Hey bud - thanks for the kind words! Sounds like quite the beast of a fog machine you built, too! 

The arduino can help with some control of the heat, but some has to be baked into the design, too. You will need a fair amount of thermal mass to help dampen out any large drops / spikes when fog fluid is flowing or not, respectively. Second, I was surprised at the heat range - I always suspected 'a bit above boiling' but the article I cited and the Big Clive tear down suggest high 300's to ~500 degrees. Third is an outlet restriction. In taking this fogger apart for cleaning, I found I had two brass fittings, one was sized for the standard 1/8" copper tube inlet, one had a restriction...down to ~1/16" or less. I had to go back to my original photos, but the restricted fitting was on the outlet. I suspect this causes pressure to build along the length of the heat exchanger so any liquid gets super heated along the way. When it bursts out of the nozzle it still flashes into fog across the pressure drop. 

On the thermocouples, MAX6675 is the module that interfaces with the arduino, then what ever type-k thermocouple suits your layout the best. When I bought my 6675's , they came with the 'screw-in' type thermocouple - as shown in the photo, it wasn't ideal for my fogger, but with some careful placement, I made it work. You can find all sorts of probes out there. There are some other 'temperature sensors' out there, but I'm not sure they all work up to 400-500 degrees. If they do, that might be sort of a 'red line' for them, so possibly they wouldn't like running there for hours on end. For the type-k, 500 degrees is warm bath water!

Anyway, hoping to get a video together soon (I think I still owe you a couple on the plasmaduino!) I'll give the code another good scrubbing and you can have a copy to try out.


----------



## Batbuddy (Sep 3, 2014)

Awesome! thanks for the info. I am looking forward to seeing the code and photo/video. My heat exchanger is a massive sandwich of aluminum plates and two 120 volt stove burners around the copper pipes. I will probably rebuild the exchanger and incorporate the recommended thermocouples etc. while I am at it.


----------



## corey872 (Jan 10, 2010)

Quick update. Was working on a quick video to show some of the FOGduino features and happened to notice the Sen-Sim mode I mentioned above wasn't working as intended.

Seemed simple in practice - combine two already existing modes...'simmer' which is regular but small puffs of fog for a 'background ambiance' and 'sensor' which delivers a big blast of fog when a sensor is tripped.

But as usual, the devil is in the details! So spent the past week tweaking and tuning that one function, plus rebuilding a bit so I could get the sensor on an interrupt. So will be working to shoot video #2 and get it up soon!

Here are a few photos until then. (You'll have to ignore the mic sensor hacked onto the side for some testing. Will probably set up with a remote PIR to trigger a big fog show whenever the random ToT trickles in on the big night)

Overall - SSRs for heat and pump fit nicely in existing spaces. 3D printed FOGduino box attached to the rear panel of the fogger.










FOGduino










Warm up. In this case, inlet temp of the heat exchanger (I) = 264°F, outlet (O) =250°, set temp (S) = 400°, minimum temp for fogger operation (M) = 370°. Fog mode is 'paused' and in the 'Warm up' phase.

A lot of info to cram on a tiny screen, but I'll likely only use this 1 - 2x per year, and most of that time it will be covered anyway!

Green LED = FOGduino power, orange = heater power, violet (not lit, far right) = fog pump on.










Ready - temps meet all set points.


----------



## corey872 (Jan 10, 2010)

Some video descriptions:

Hardware:






Firmware / Operation:






Firmware is pending one final tweak.

Standard disclaimer applies!!!


```
// Standard disclaimer:
//
// I am a novice programmer at best, believe this is serial# 0000003 on formal sketches I have made.
// There are probably better / easier / more correct ways to do almost everything here.
//
// Project
//
// This project blends arduino with LINE VOLTAGE components, though the arduino 'should' be isolated
// through solid state relays (SSRs) take extreme care when working with these high voltage components.
//
// This project activates a multi-hundred to multi-thousand watt heater in the fogger.  Multiple safety
// shutdown routines have been written into the code and in several hours of testing I have not found
// any 'hang ups' where the heater stays on.  However - BE SURE TO USE ALL ORIGINAL SAFETY FEATURES OF
// YOUR FOGGER.  This should include a current fuse as well as a thermal safety fuse.  If your fogger
// did not originally come with a thermal safety fuse, adding one would be cheap insurance against a
// literal ALUMINUM MELTDOWN of your fogger. 
//
// Feel free to change the timings at will, but USE EXTREME CAUTION IN CHANGING HEATER SETTINGS.
//
//                                   ***********************************************************************
// It is probably best to ASSUME THE *FOGGER WILL CATCH FIRE AND BURN THE SURROUNDINGS IF LEFT UNATTENDED. *
// Avoid unattended operation!       ***********************************************************************
//
// Other than that, have fun!
```


----------



## corey872 (Jan 10, 2010)

Code is attached -

[grab updated code in post #19]


----------



## Batbuddy (Sep 3, 2014)

This is so Dang Awesome, Corey! Soo ingenious. I love the menus and overall concept. I am going to implement this design on my Homemade fogger.


----------



## corey872 (Jan 10, 2010)

One last video to close out the series. FOGduino working on Halloween night. Unfortunately only 6 ToTs the whole night, but that gave me a bit of time to prowl through the graveyard and do a bit of documentary.

In watching the video, it looks like a firmware tweak might be in order. I noticed the heater shut off for a bit during boil mode. I see the inlet/outlet delta T went pretty high so triggered to shut off the heat, but really, we should just pump more fluid! So may have a slight revision.

Only thing is that it's hard to test boil mode in normal conditions... worried that someone will call the fire department due to all the 'smoke' !


----------



## David_AVD (Nov 9, 2012)

Excellent work.


----------



## Dreadmakr (Jun 20, 2018)

Very cool


----------



## Dreadmakr (Jun 20, 2018)

As Mr Spock would say...
Fascinating


----------



## corey872 (Jan 10, 2010)

Well, my typical luck continues to run true. In using Fogduino over the past year, I noticed one small glitch. Once or twice in 30-40 times I turned it on, it would lock out on 'emergcncy low temp' even though temp was well within range. A quick reset and the next load would be fine.

I think the arduino brain was kicking in before the thermocouple brain had a chance to wake up, so the arduino was seeing a garbage reading and shutting down.

Of course this year, it happens *every single time* I try to turn Fogduino on!

On the extreme outside chance anyone built this, and is running it, here is a firmware update to fix that!

As usual, strip off the .txt extension and that should get you what you need!


----------



## Batbuddy (Sep 3, 2014)

Thanks for the update. I still haven't had time to do this, but I want to.


----------



## corey872 (Jan 10, 2010)

You should give it a shot in the off season! I've really become fond of the 'Sen-Sim' mode. It keeps a low amount of background fog 'simmering' all the time, but puts out a big billowing cloud each time the sensor is triggered when someone walks up. Ran all night long on ~1/2 a tank of juice but had a nice thick layer in the cemetery for all the ToTs.


----------

