User avatar
By RichardS
#42994 User
wickwire

Description
This setup allows me to control my 3D printer, by turning the power on/off for the printer and an aditional LED array that I installed in order to light up the printing area under poor lighting conditions.

The solution results in a web application which can be operated either Mobile/Desktop Web Browsers and over the LAN or Internet as well.

Although it was primarily designed to control my 3D printer, it can be used with mostly any other household appliance, following the same on/off switch principle.

As an extra I added some webcams to the setup in order to remotely keep track of my prints, cancel failed jobs, turn the printer on/off for power saving, etc. The webcams are being managed by a an array of small mini pc boards and for managing the print jobs, I use Octoprint.

- Architecture

* Free account on mLab (formerly known as MongoLab) https://mlab.com/
* Free account on CloudMQTT (https://www.cloudmqtt.com/)
* Free account on Heroku

A MEAN.js web application is running on Heroku, uses mLab mongoDB instances for persistance (user management, etc.) and interacts with the MQTT broker on CloudMQTT;

The web application uses the mqttjs node module to handle mqtt communication with the broker and consequently, the ESP unit. The MEAN.js version is 0.3 which is somewhat old, I did think about expanding this part of the solution to handle readings from the ESP as well if needed, so the app also has socket.io support and the UI updates in response to any mqtt received messages from ESPs as well (not used on this particular project);

The ESP8266-01 is registered to WLAN network and from there, to the CloudMQTT broker, in order to receive the messages;

The messages can be config type (changing some parameters on the ESP such as the broker endpoint and credentials) as well as the GPIO setup (which is the big part of the solution);

The ESP8266-01 connects the two GPIOs to the two relays, which in turn connect each to a fork on the printer power cord and the LED lighting strips cord. Bot the printer and the LED strips draw power from the wall socket on their own electrical cords, the relays are used just to switch the power on or off, according to the ESP GPIO states.

Parts
* A 3D printer in my case (CTC-3D dual extruder makerbot clone)
* 2x 1 Channel 5V Relay Module Board Shield For PIC AVR DSP ARM MCU Arduino IDXX
* 2x AMS1117 5V 1A Voltage Regulator
* 1x AMS1117 3.3V 1A Voltage Regulator
* 1x 12v DC Male&Female Power Balun Connector Adapter Plug For CCTV Camera
* 1x 12V 1.0A Power Supply, Europlug (Type C) to Type A Barrel (2.1 x 5.5mm) (P1B34)
* 1x ESP8266 Serial WIFI Wireless Transceiver Module Send Receive LWIP AP+STA
* 1x Ikea Dioder LED strip set

Links
Float firmware
Integer firmware
Google Drive

Video


Images
Attachments
3dprinterSchema_bb.png
ikea_dioder_led_strips.JPG
ikea_dioder_led_strips.JPG (11.21 KiB) Viewed 5866 times
relay.jpg
relay.jpg (11.42 KiB) Viewed 5866 times
esp8266-01.jpg
esp8266-01.jpg (10.7 KiB) Viewed 5866 times
architecture_diagram.png
User avatar
By wickwire
#43551 Hi,

Just a quick note: you don't have to use a 12V adapter, 5V would work just fine and only one 3.3 voltage regulator in that case, so simpler circuit.

I used a 12V because I had a couple of those laying around at the time, that I'd been using on other projects...!