Andres Lopez and I were finally able to complete the Magic Cooler project
and present it at the Freescale booth at
Austin Mini Maker Faire 2015! Here’s how we did it:
Last year in the
Makerspace, this project started out as something to help
teach kids to control Christmas lights and music using a microcontroller in an easy-to-use environment. At that
time, we used an Arduino Uno, but I was able to be pretty easily converted to
using the much more practical and powerful
Teensy 3.1 – thanks to the
Teensyduino software add-on.
The most challenging part of that Makerspace music project was the
AC circuit side of the hookup. To avoid the Christmas lights being controlled
separately, I had to cut off the plugs on some sacrificial Christmas lights to
serve as the controlled outlets!
I had since wanted to do a project upgrade, using regular AC duplex
outlets to control many more lights and fit it all into a portable,
rugged “box” of some sort.
Bright minds. Bright futures. NXP team members create breakthrough technologies that advance our world.
The future starts here.
As with any project, I started off with some thoughts:
Initially, I had wanted to use a cheap, black toolbox to house the AC
circuits. But after some measurements of the interior, it seemed a bit cramped
for what I wanted to add and the walls seemed too thin to support installing
the ‘blue boxes’ needed to properly contain the AC outlets.
Fortunately, I was cleaning out the garage around this time and taking stuff
to Goodwill. As I picked up this blue Coleman cooler with broken lid hinges,
it hit me that this would be the perfect container for a portable music and
It has 1″ thick walls, lots of room inside, a handle and wheels! The
broken lid was actually a plus as it allowed removal of the lid and made it
easier to work inside. Now to get to work!
Electricity and Safety
I wanted first and foremost for the AC part to be as safe as possible. Just
like in the walls in your house, what that means is containment of all
connections via blue boxes and a junction box. It also means having a
circuit breaker or a ground-fault circuit interrupter. I chose the
Step 1: Install the AC blue boxes and outlets in the sidewalls of the
I wanted to have 10 outlets total as I have 10 relays available for control,
which means having 5 duplex outlets. I also wanted a simple light switch to
help to turn off all exterior outlets if necessary, for safety reasons and to
permit debugging code and music without having to worry about driving the
external lights. The outlets were planned to be on the ‘back
side’ of the cooler.
Out came the cutting tools…
Normally, in a house wall you’d want to attach these blue boxes to a
stud behind the drywall. However, in this case the plastic exterior and
interior of the cooler were tense enough to support the boxes.
The next step was to loosely install the AC outlets to check the fit. I
planned to remove them again later when doing the final wiring so here I just
installed them as a placeholder.
Since I wanted to individually control the outlets, I removed the tab
connecting the hot sides together. I used pliers to wiggle the tab back and
forth to break it off. I then installed 10 outlets and one switch.
Step 2, wire up the AC circuit.
Here’s a diagram showing the AC side of the circuit:
Basically, power comes in to the cooler via a 3-prong wire
(hot-neutral-ground) and goes through a leader switch and a
GFCI outlet which will be located in a separate blue box inside the to protect
the remaining outlets downstream. Color coding when working with AC
circuits is VERY important: Black connects to black, red to red, ground to
ground. Let’s follow each line separately:
Ground (GREEN): Directly connects to every ground screw you can
find. Not shown above is the ground connection to the metal
junction box housing the 10 relays.
Neutral (WHITE): Connects to LINE side of GFCI outlet–
comes out of LOAD side of the GFCI receptacle and connects to the
Neutral connector of every downstream outlet.
Black (HOT): Connects to LINE side of GFCI outlet– comes out of
LOAD side of the GFCI receptacle and connects to the secondary Light Switch.
Hot leaves this light switch and connects via a bus terminal to the
Normally Open side of each of the 10 relays.
Red (SWITCHED HOT): Connects from the common terminal of each of
the 10 relays to the Hot screw for each of the 10 switched outlets.
I used #12 Romex to do the wiring, although I probably should have used
something for the short runs here as #12 isdifficult to work with (hard to
bend), but at least now I know the circuit is very robust!
I ran the 3-wire Romex box to box just as is done in a house wall. However,
after the first set of duplex outlets the hot (black) wire was removed from
the Romex bundle and brought down to where the future junction box would
be. Red wires were connected to the hot side of each of the 10
outlets and were also run down to where the junction box would eventually be.
I decided that the GFCI receptacle and leader switch should
be located inside the cooler. The GFCI provides some protection
from accidental touching, wires coming loose creating shorts, and would help
if I ever planned to take the cooler outside. It would also serve
as a standard outlet to power the microcontroller board and other accessories.
Since the cooler already had a nice, convenient drain hole, I decided to use
that to run the main power cord. I cut the power cord from a 10-outlet
power strip with confidence that it had sufficient current-carrying capacity.
A knot was added to prevent accidental tugs on the power cord from damaging
the internal wiring.
Next step, the junction box.
Junction Box Prep
The junction box was used to house
the bus terminal to expand the single hot (black) wire to the 10 relays and
the connection of those relays back to the switched outlets (red wire).
In case of any electrical fire or loose wire, the box would serve as
containment and/or ground.
Some electrical stuff is just cheaper to get on Ebay than at your local
hardware store, so I found a really nice and strong junction box on
Ebay that was the perfect size.
Next, I had to pop out the 1″ and 3/4″ holes in the box
(not easy!) in order to insert cable clamp connectors. These served to
hold any wires going into and out of the box and prevent them from rubbing
against the edge of the metal hole. I screwed the box to the bottom of
the cooler to hold it in place. I made the junction box door open to the
side opposite the blue boxes, to permit easy access.
Basically a bus terminal block is just a way to connect heavy gauge wire
By using short U-shaped pieces of the hot (black) wire and ring terminal
connectors, I was able to use the bus terminal block to help connect the line
hot wire to the Normally Open (NO) side of the 10 relays.
Since I had already mounted the junction box into the cooler, I made a
template out of an old box that had the same dimensions of the interior of the
box so I could do most of the the wiring in a more comfortable way.
Given that #12 Romex is very stiff, this was the best way to ensure that the
final assembly would in fact fit into the box. Although, if I had to do
it over again, I would probably have used a smaller gauge wire, as with #12 it
was very difficult to interface with the relay terminal blocks. I had to
‘encourage’ them to connect…
Or not. This is what happens when you force 12-gauge Romex into
relay terminal block. This board had to be replaced. However, we made it
in the end!
Now that the AC wiring was done, the next
step was to enclose all AC circuitry to prevent mishaps. Well, in reality, the
next step was to test all the connections with an ohmmeter before connecting
the AC! This step is vital during ALL stages of AC wiring.
To enclose the exterior outlets and light switch, we decided to add
weatherproof covers. These were readily available at the hardware store.
Note that we still need to caulk the gap (like you would at your house) around
these enclosures if we truly want the cooler to be waterproof. The covers were
numbered with which relay they were connected. I cared more about the relay
order being numbered sequentially than the outlets.
The next step for safety was to enclose the entire interior of the cooler with
an acrylic “lid”, so the curious could still
view the interior, but do so safely. The idea was that all AC circuitry
would be below the lid, and all DC or microelectronics and prototyping related
stuff would be sitting on the lid like a shelf.
The cooler provides a nice lip around the top of the inside where the
lid/shelf fits and since it’s very thin doesn’t interfere with
placing the cooler top/lid in place. The cooler lid actually has a large
interior as well so you can still fit several inches worth of stuff on the
In order to fit the hole exactly, we used a laser cutter to round off the
corners. Cardboard test pieces (not shown) were put into the laser cutter
until we got the corner exactly right then
the same design was reused on the acrylic. Due to limitations of the
interior of the laser cutter, we had to use two separate pieces of acrylic.
To join the two parts of the lid together, two handles were 3D printed and
attached. Holes were drilled to make room for additional wiring and a notch
was added to one side for the audio power plug.
Now we just needed to hook up the microcontroller to the relays to control the
lights and speakers!
Stay tuned for Part 2 of this article!
This post was originally published by Freescale engineer Daniel Hadad in