To celebrate the successful first year of Powerbot, the algorithmic energy trading company, we decided to build a Powerbot robot which could continuously monitor the status of the Powerbot APIs. The robot’s left eye indicates the status of the primary API server and the right eye, the secondary API server.
The robot is low-power and fully autonomous – the CPU wakes out of deep-sleep every 30 seconds, connects to the configured wifi network, checks the REST APIs, indicates the status via the LEDs and then returns to sleep.
First step was to design a PCB with an ESP12E microcontroller small enough to fit inside the robot’s body. The PCB needed Wifi, two LEDs, a reset switch and a USB interface (firmware upload and power).
EasyEDA was used for the schematic design:
A few days later, the PCBs arrived by post (each PCB cost EUR 4, EUR 2 for the ESP12E microcontroller and EUR 2 for the rest of the parts). The PCBs come with the surface-mounted components on the front mounted, the components on the back (LEDs, buttons, dip switches) still need to be soldered.
Next step was to remove the robot’s insides to make room for the PCB, bore eye holes and connect the LEDs via wires so they can be glued in the robot’s eye sockets.
A few extra parts needed to be 3D-printed to fix the legs back on since they had been attached to the wind-up mechanism.
We also had to cut a hole in the robot’s back for the wifi antenna.
When the robot boots up and detects that is unconfigured, it creates its own wifi network with a captive portal which directs you to the setup screen, where you can configure parameters (wifi credentials, urls of the APIs you want to monitor etc).
The configuration is saved to flash and on next boot the robot enters its main lifecycle of connecting to the wifi, checking the REST APIs, showing the status on the LEDs and then returning to sleep for 30 seconds.
We used the PlatformIO VSCode module for the software development and upload.
You can find the schematic and sources online at https://github.com/benedict-armstrong/USB_Alert