ESP8266 Aquarium Controller Part 2

In Part 1 we began assembling the case for our controller. Now we’ll move on to wiring it all together.

Warning and disclaimer: the information within this project is provided as is. No warranty or liability is expressed or implied. This project deals with potentially dangerous electronics. Do not attempt if you are not experienced with electronics wiring. Consult a professional before attempting this project.

Parts and Tools:


I started by soldering my ESP8266 to a solderable breadboard. I’ll be using DS18B20 waterproof probe to measure the water temperature. Rather than soldering it to the breadboard, I added some screw terminals to make it easier to connect and disconnect the sensor.

The completed board.

I also added some pins for my jumper wires that go to the relay board. In the picture above, note that there is a screw terminal on the positive and negative rails. I originally planned on powering the board with a 5v adapter, but ended up using the USB port instead. So those screw terminals are not used.

I soldered jumper wires from the ESP8266’s pins to the screw terminals on the back side of the board.

Here’s a picture of all the wiring that I made for the outlets.

Important Safety Notes:

  • The relays should be switching the hot line, not the neutral.
  • Always use drip loops when pluggin in your equipment.
  • Use insulated spade connectors (bare connectors are pictured but have been replaced with insulated connectors)

And here are all the grounds connected to the outlets.

Next the neutral and hot connections…

And here’s the final product with the control board and USB power supply.

The pinouts for the relays are:

  • D2 – Heater relay
  • D3 – Light relay
  • D4 – DS18B20 data wire
  • D5 – CO2 relay
  • Vin – positive rail – 5v relay pin & DS18B20 positive
  • GND – GND rail – GND relay pin & DS18B20 GND

Next up… programming the ESP8266 to communicate using MQTT!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *