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:

  1. Print the enclosure
  2. Pre-cut the wires & crimp the connectors (optional)
  3. Attach the wires to the plugs (solder if not using quick connectors)
  4. Add the loop to the relay
  5. Attach wires to the power supply & secure to case
  6. Attach wires to the relay & secure to case
  7. Screw IEC-320 to case
  8. Connect +5v wires from power supply to BrewPi+ESP8266 PCB & secure to case
  9. Connect all lose like-colored wires together using wire nuts
  10. Attach LCD Display to case lid
  11. Use Dupont cables to connect relay to PCB
  12. Use Dupont cables to connect display to PCB
  13. Test using the test script
  14. 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:

2016-11-12-11-26-20

 

Build Instructions

Step 1 – Print the enclosure

ESP8266 Case Base

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.

 

Step 2 – Pre-cut the wires & crimp the connectors (optional)

Pre-cut Wires
Pre-cut Wires

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.

 

Step 3 – Attach the wires to the plugs (solder if not using quick connectors)

AC output wiring
AC output wiring
AC Input Wiring
AC input wiring

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.

Step 4 – Add the loop to the relay

Relay Loop & AC In Wire
Relay Loop & AC In Wire

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:

Close up of loop
Close up of loop

 

Step 5 – Attach wires to the power supply & secure to case

2016-11-12-09-14-33

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.

Power supply secured to case
Power supply secured to case

Step 6 – Attach wires to the relay & secure to case

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.

2016-11-12-09-37-31

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.

 

Step 7 – Screw IEC-320 to case

AC Input Attached

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.

 

Step 8 – Connect +5v wires from power supply to BrewPi+ESP8266 PCB & secure to case

+5v wires attached to PCB
Attach +5v wires to PCB

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

 

Step 9 – Connect all lose like-colored wires together using wire nuts

Use 3 wire nuts to connect the loose wires
Use 3 wire nuts to connect the loose wires

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.

 

Step 10 – Attach LCD Display to case lid

2016-11-12-11-21-26

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.

 

Step 11 – Use Dupont cables to connect relay to PCB

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.

 

Step 12 – Use Dupont cables to connect display to PCB

2016-11-12-11-22-23

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:

2016-11-12-20-56-19

 

Step 13 – Test using the test script

test-suite-large

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.

NOTEDO NOT connect the USB cable to a computer while there is AC power connected. This can result in damage to your computer!

 

Step 14 – Attach lid to case base with sheet metal screws & add the rubber feet

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!

2016-11-13-22-57-36

 

 

 

Published by Thorrak

Leave a Reply

Your email address will not be published.