Building your own HASPone
Clone this wiki locally
While the new hardware build docs are being re-written, check the original project site here.
A complete build that's ready to install will require the following components:
- Nextion 2.4" LCD Touchscreen display
- WeMos D1 Mini ESP8266 WiFi microcontroller
- 3D printed switch plate
- 3D printed rear cover
- Mean Well IRM-03-5 AC to 5VDC Power supply
- 2N3904 NPN Transistor
- 1k Ohm Resistor
- 4pin 2.54mm JST-XH PCB header
- Rubber grommet
- 6" each of white and black 300V 18AWG stranded power cables
- Two M2 self-tapping 6MM screws (or just any 4-6mm M2 screws) to mount PCB in rear enclosure
- Four 20mm M2 flathead screws and four 3mm M2 threaded inserts to fasten both halves of the enclosure together
This is what your PCB should look like from the top before you've placed any of the components.
Now place the components, taking care to orient the WeMos D1 Mini, Mean Well Power Supply, and JST-XH header as shown in the image below.
The transistor and resistor act as a switch on the GND connection for the Nextion LCD. This allows the HASP to reboot the LCD in the event of a failed LCD firmware update. The pads on the transistor are a little close together, so take care when soldering here and use as little solder as possible. The LCD will not power on until the ESP8266 code is flashed and running, sending power to the "switch" to turn on the LCD. If you've flashed the ESP8266 code to the WeMos, you've connected the LCD, you can see the program running in the serial console, and the display isn't powering on... you almost certainly have a problem with the soldering job on the transistor. If you just can't make it work, that's OK! Simply cut the resistor out of the circuit (important!), and then you can bridge the 3 pads for the transistor together with a glob of solder. This will disable the power switch for the LCD, which might mean pulling the device out of the wall if an LCD firmware update fails but will not otherwise impact daily operation.
The AC power cables should be at least 18AWG 300V stranded cable with a white jacket soldered to the
AC/N pad on the PCB and a similar wire with a black jacket soldered to
AC/L. These are fed through a rubber push-in grommet mounted into the rear enclosure. I've had good luck stripping an existing 3 conductor power cord and using the black/white wires inside.
The Nextion LCD can be modified to give a little extra room around the screw lugs which may help with mounting in some work boxes. If you have the means to do so, you can use a hot air gun to remove the 4-pin JST XHP connector from the PCB and then use the
lcdmod rear enclosure model for some extra room in your box. If you don't have hot air, some careful use of side cutters or a rotary tool may also do the job. Be careful not to lift any traces as it's easy to do when applying mechanical force the connector.
In any event, you're going to need to solder the cable harness included with the Nextion display directly to the pins as shown in the image below. This demonstrates a panel with the connector removed, but you also solder the cable harness directly to the legs of the existing connector with a simple soldering iron with little trouble. After soldering the cables in place and confirming everything works, I like to put a bit of hot glue over the wires to provide some measure of strain relief.
The Mean Well IRM-03-5 AC to 5VDC Power supply can be substituted with any of the following Mean Well SLC03-series DC-DC power supplies if you'd prefer a low-voltage DC option. This should be suitable for use over existing Cat5 cables, speaker cables, alarm cabling, etc already in your wall. Check to confirm that the existing cable wire gauge will be safe for the load you will be putting on the system, and try not to put voltage down a wire where other expensive and flammable things might be connected which aren't expecting it.
|Model||Input Voltage Range|
These DC-DC supplies are smaller than the AC-DC supply and have a different footprint on the board. Position the supply as shown below.
This project was initially built on a 4x6 protoboard and the enclosure should still accommodate this approach if you have boards on hand. Note that this approach is probably dangerous as 120VAC and protoboards are a bad mix.
The parts should be fit much as shown in the PCB images above. In my case the bottom-most row of 8 pins on the WeMos D1 mini as shown in this image would not fit on the perforated area of the board, instead I soldered the pin header with the pins projecting upward from the board to attach wires above. It wasn't pretty, it's likely not safe, and you really should use the PCB.