MQTT-AWARE USB CHARGING STATION

What? Why?

I got the idea of re-purposing an old Raspberry Pi power-supply into a multi-port USB charging station. It occurred to me that a useful extension to this would be to make each charging port controllable from my network, via MQTT. Two immediate reasons for this were: to have the charging station listen for my 'goodnight network' (MQTT) message, and respond by switching off all connected charging cables (and their annoying LEDs); and to have a platform whereby a connected device could request it's own power-supply be switched on/off.

Other design goals: I'd like to mount my PCB on a laser-cut 'cable-wrangler' that attaches to the back of my desk; as well as re-purposing an old (5V!) power-supply, I'd like to re-use an old NodeMCU ESP8266 module.

It is important to note that this is intended mainly as a relatively low-power charging station to manage my collection of 'weird' charging cables (looking at you, watch and headphones) - distributing more than a couple of amps via this PCB is not recommended.

Physical/Electrical/Code Assets

The platformio.ini for this project:
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
build_flags =
-DC_ADDRESS=### 4TH IP ADDRESS BLOCK - AS PER upload_port, BELOW ###
-DC_CLIENT=\"### MQTT CLIENT ID ###\"
-DC_TOPIC=\"### MQTT TOPIC FOR THIS DEVICE ###\"
-DC_SSID=\"### YOUR WIFI SSID ###\"
-DC_SSPW=\"### YOUR WIFI PASSWORD ###\"
-DC_HASH=\"### YOUR OTA PASSWORD HASH, AS PER 'upload_flags = --auth', BELOW ###\"
lib_deps =
knolleary/PubSubClient@2.8

[env:nodemcuv2_ota]
extends = env:nodemcuv2
upload_protocol = espota
upload_port = 192.168.4.###
upload_flags = --auth=### YOUR OTA PASSWORD ###

USB Hub v2
USB Hub v2
USB Hub: PCB
USB Hub: PCB
USB Hub: Assembled
USB Hub: Assembled
USB Hub: Installed
USB Hub: Installed

Creative Commons License

All MQTT-aware USB Charging Station assets by Chris Molloy are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.