All of this can be done with a simple outdoor electrical box from a hardware store. These are great because they have lots of thick yet soft plastic thats easy to work with and they come in many sizes. In this example I use a 8"x8"x4" box.
You can do all of this with a standard dremel tool but a few other tools will make it easier... so here is a basic tool list.
- Dremel or other rotary tool
- Spray adhesive (3m super 77 recommended, other glue could be used)
- Blue Painters tape (3m recommended)
- Metal or plastic stand-offs for mounting circuit boards
- Any electronic components for your project
- Any wires, sockets, or connectors needed for your project
- Drill Press (highly recommended)
- Printer (to print template)
- Gorilla Glue (good for some connectors that need to be glued)
All of this stuff should already be in your garage, if not you can find it all at the hardware store.
I'm building a box to hold a fermentation controller for beer. Here is a video of the finished working box.
OK so lets get started.
Step 1: Outside of the Enclosure
I would recommend using calipers and Adobe Illustrator or Inkscape to measure then draw accurate pictures or templates of how your parts will be laid out. Spend time in the planning phase to avoid problems later in the building phase. The enclosure is pretty cheap but if you make a layout mistake you will have to start over.
Here are some examples of my templates made with Illustrator and laying out the actual parts inside of the box. Remember to think about what devices will need to be connected and leave enough room for cables and connectors to fit.
Step 2: Transfer Template
- First take the 3M painters tape and cover the entire top of the surface you want to mount your parts onto.
- Then spray the 3M painters tape with the 3M super 77 spray adhesive. This will allow you to stick the template to the sufrace without it being permanent.
- Once you are happy with your templates position on the box use a hole punch or nail to mark the center of all of the areas that will need to be drilled out.
- Use a drill press, drill or dremel to drill a small center hole (~1/8") on all of the areas you marked.
- Use the correct size drill bit or dremel to roughly cut out each of the holes. Just like a coloring book, try to stay inside the lines. its better to make the holes too small then too large at this point.
Step 3: Finish up the rough cuts
Take the actual pieces you want to mount and keep cutting and test fitting them until they all fit.
From there you can make the box look as good as you want to. Sometimes the holes and rough edges will never show or they dont need alot of work. Its a good idea to take a file to knock off the rough edges and to get the corners perfect.
After a little bit of work and a good template you should have something that looks close to a laser cut piece of plastic that perfectly holds your buttons, switches and connectors.
Step 4: Connectors
I prefer to test fit all of my connectors, then wire some longer leads onto them if required before gluing or screwing into place.
The 3 pin silver MIC connectors shown actually screw into place. The box however was too thick for them to reach all the way through. Instead I use a very small amount of Gorilla Glue and clamped them in place overnight. Gorilla glue expands so a little goes a long way. This worked out perfect for a nice solid connection.
For other connectors that screwed into place I drilled and tapped the holes which I will cover in the next step.
Step 5: Electronics
Layout your electronics again in the exact spacing and configuration you want them. Remember to leave room for wires and connectors.
Their are companies who make PCB standoffs that have a sticker backing, if you want you can use them. I like to drill standoffs for a secure fit, just like on a computer motherboard.
Use a sharpie marker to make a small mark on each of the mounting holes for the circuit boards.
Use your punch to mark the sharpie marks to give you a place to start drilling.
Drill a pilot hole with a 1/8" or smaller bit to find the exact center
Use the correct drill bit for your tap set to drill out the holes from the bottom side (which is much easier)
Use the correct tap to tap the holes, again from the bottom side. The plastic is thick so go slowly when tapping and remember to back off the tap then start again, 2 steps forward, one back, kind of approach.
From there simply screw in your metal or plastic standoffs.
Step 6: Mount and test fit the electronics
You can use a compressor or a can of air to blow out any remaining debris from drilling and cutting and clean everything up.
If you are happy with everything then you can start wiring!
I would recommend having everything you need on hand before you start,
All of the correct colors and gauges of wire
I would also recommend a pair of forceps, this will make it easier to insert small wires into hard to reach places inside the box.
Step 7: Wire the electronics
Try to cut all of your wires slightly long then you think they need to be. Then route them to where they will go and cut off the excess so that its a perfect fit.
Route wires under PCB's if you can to save space. if you have different voltages like AC/DC try to keep them physically separated as much as possible. If wires do need to cross each other try to do it perpendicular like a + intersection.
Use zip ties and sticky mounts to keep cables out of the way or grouped together.
You can also use various quick disconnects to make it easy to detach components you may need to replace. This is also useful for connections between the door and the inside of the box.
I left lots of slack and added disconnects to all of the wires going from the door to inside the box so that I could easily access and troubleshoot or remove the lid completely if needed.
Step 8: Fit, Finish, and testing
If you can, try testing in phases. Disconnect the PSU from everything and test it alone to see if it performs as expected. Section by section, plug in and test each PCB and device to be connected to your electronics. If a problem does pop up you will hopefully be able to figure out where it is and fix it before it does any real dammage.
In my case, I was building a fermentation controller. I reversed two of the wires on my temperature sensors which caused them to not report any data. Luckily, I was able to trouble shoot and trace the issue and did no permanent dammage to the sensors. When I finished the box, I manually tested the unit to see if it was controlling my freezers compressor and my heat source for my fermentation. Once I verified everything was working I filled a fermentor with water and gave the unit a trial run overnight to see if it would do its job. When I was confidant it would work reliably I filled the fermentor with freshly brewed beer and I am happy to report it works flawlessly.
Here are some additional tips to help you out
- Take your time, think about what you are doing
- Build a prototype or digital model (cardboard, paper, sketchup)
- Its ok to mess up. The boxes are cheap
- Plan for expandability and robust connections if possible
- Keep things simple whenever possible, break things down to their core functionality, use multiple boxes if necessary
- Keep in mind interference and voltages when working with AC and sensitive electronics
- Label everything you can, you will forget what the red wire does in 6 months, keep your notes (evernote)