As part of an ongoing project to bring BrewPi to the ESP8266 I ended up designing & printing an enclosure to hold everything together – the LCD, ESP8266, Power Supply, and Relay. I got everything printed earlier this week, but didn’t get a chance to assemble everything until this weekend.
Here are the steps to assemble this thing:
- Print the enclosure
- Pre-cut the wires & crimp the connectors (optional)
- Attach the wires to the plugs (solder if not using quick connectors)
- Add the loop to the relay
- Attach wires to the power supply & secure to case
- Attach wires to the relay & secure to case
- Screw IEC-320 to case
- Connect +5v wires from power supply to BrewPi+ESP8266 PCB & secure to case
- Connect all lose like-colored wires together using wire nuts
- Attach LCD Display to case lid
- Use Dupont cables to connect relay to PCB
- Use Dupont cables to connect display to PCB
- Test using the test script
- Attach lid to case base with sheet metal screws
And here’s what that looks like. When I assembled this it took about an hour.
One note before we begin – Generally, I recommend inserting screws such that the screw head is on the bottom of the case (and the nuts will end up inside the case). Here is what that looks like when the case is complete:
This step should be pretty self-explanatory. Print the enclosure from Thingiverse /w the lid. Also – acquire the other parts if you haven’t done so already.
Assembling this project is much faster when you pre-cut the wires and pre-crimp the quick connectors. What you are looking to create is the following:
- 3x White wires /w quick connector & longer stripped end
- 1x White wire /w one shorter stripped end, one longer stripped end
- 2x Black wires /w quick connector & shorter stripped end
- 1x Black wire /w quick connector & longer stripped end
- 2x Black wires /w one longer stripped end, one shorter stripped end
- 1x Black wire (shorter) /w two shorter stripped ends
- 3x Green wires /w longer stripped end
The shorter stripped ends will generally be attached to screw terminals, the longer stripped ends will be used with wire nuts.
Attach all of the wires with quick connectors to the AC input plug & AC output plugs. Note the location of each color in the image above – Color placement is critical for safe operation.
To greatly simplify the wiring (and add safety!) we’re going to make it so that the heating relay can only receive power when the cooling relay is disengaged. For these relays, the center screw terminal is the power “input”. The right terminal (when facing you) is the terminal that’s connected when the relay is “off” and the left terminal is the terminal that’s connected when the relay is “on”.
We’re connecting the right terminal of the right relay to the center terminal of the left relay using the black wire with two shorter stripped ends.
Once this is done, we’re connecting the black wire with the one longer stripped end to the center terminal of the right relay.
Here’s a better photo of how the “loop” is wired:
Attach the black wire /w one longer stripped end & one shorter stripped end and the white wire /w one longer stripped end & one shorter stripped end to the power supply. Secure the power supply to the case using 4 of the machine screws & 4 of the nuts.
Before starting this step, gently thread the wires for the AC output plugs through their respective holes in the case (as shown in the photo just above).
Attach the black wire from the left AC output plug to the left screw terminal on the left side of the relay board. Attach the black wire from the right AC output plug to the left screw terminal on the right side of the relay board.
Once this is done, secure the relay board to the case using 2 of the machine screws & 2 of the nuts. Due to the design of the relay board, you will probably only be able to use the back two screws to secure the relay board. This is OK.
Thread the wires from the IEC-320 AC Input connector through the case, and use two of the machine screws and two of the nuts to secure the connector to the wall of the case.
Start with the bottom screw – clearance is tight, and this isn’t easy to attach.
Take the two +5v wires from the power supply, and attach to the correct screw terminals on the ESP8266 PCB. In this photo, black is ground, and red is +5v. Once this is done, attach the PCB to the case base using two of the machine screws & nuts
At this point, everything is inside the case base and is secured. You should have three loose green wires, four loose white wires, and three loose black wires. Use three wire nuts to connect the same colored loose wires together.
At this point, you’re almost done with the case base. Push the two AC output connectors into the case until you hear a “click” as they snap in place.
Using 4 of the machine screws & 4 of the nuts, attach the LCD display to the case lid.
NOTE – The tabs in the front of the lid will be on the bottom of the lid when attached to the case. Plan accordingly when attaching the display.
Use 4x female-to-female dupont connectors to connect the PCB to the relay board. Be mindful of the pin labels when connecting the two together.
Use 4x female-to-female dupont connectors to connect the LCD display to the PCB.
Once this is finished, you are done with all the wiring. Your case should look like this:
At this point, you’re almost done, but after the next step correcting any issues becomes significantly harder. Use the test script image to test the relay, LCD, and any temperature sensors you have to make sure everything works properly.
NOTE – DO NOT connect the USB cable to a computer while there is AC power connected. This can result in damage to your computer!
Now that your case is built, permanently attach the lid to the case base using the 2x sheet metal screws.
Congratulations – your case is finished and your BrewPi + ESP8266 build is ready for use!