Introduction: ESP32 IoT Hot-water heater

Cayenne IoT geyser (Baking hot Weewe tank in the USA) is a power saving device that will assist you to monitor and insure your households hot water, flatbottomed when you are away from home. It bequeath allow you to switch your geyser on and slay, schedule IT to turn on/off at certain multiplication, measure temperature of the geyser, set maximum save temperatures etc. It is made for high blackmail electrical geysers with a single element. It sack easily be modified for different geyser configurations like first gear squeeze, dual element etc. My geyser is also installed vertically.

For safety, I unbroken my mechanized thermoregulator in its tube. I measure the water temperature with two DS18B20 temp sensors, unrivaled attached to the bottom of my geyser, below the element, the other attached to the hot water outlet. You should never remove your robotlike thermostat for guard reasons. Replacing the mechanical thermostat with a electronic sensor can be dangerous, since the sensor or the micro controller (hardware operating theater software may misfunction) and lead to steam explosions which may kill people.

This throw involves the connection of a Solid State Relay in serious with your geyser element. You may need an qualified linesman to do it (By Legal philosophy). Act non work on your AC (Mains) if you are unsure about information technology.

Your ESP32 bequeath publish data to a service called Cayenne pepper IoT Cloud via MQTT. You wish cost able to role the Chilli pepper splasher to monitor and control your geyser and docket heating up times.

Supplies

  • ESP32 Wemos lolin operating room whatsoever other ESP32. The ESP8266 testament also work but the partake bowling pin functionality will not work. An Arduino with WiFi should also do
  • Solid Land electrical relay (SSR), rated 30 amp or more
  • Heatsink for the SSR
  • 3 (2 may do) Dalas semiconductor temperature sensors, DS18B20.
  • Casing
  • Approximately jumper cables
  • Electrical cables suitable for the current of your geyser
  • Fatal blocks
  • USB power cater for the ESP32
  • Lithium battery to power the ESP32 if mains is of.

Step 1: Skills Required

ESP32 Programing in Arduino IDE, instalmen libraries

BASIC electronics

Knowledge of mains (Normally AC 110 - 240 volt)

Some noesis of red pepper.mydevices.com

Step 2: Thermo Profile of Geysers and Sensor Placement

White water have a lower tightness than cold water. Therefore the piddle at the lead of the tank will be hotter than the water at the bottom of the tank since the violent water testament hike. The geyser electric outlet is likewise commonly at the top and the inlet at the nates which further bestow to the heat profile.

In my figure, I used three temperature sensors. One at the bottom, one at the overstep and an ambient temperature sensor. Based on a few experiments, I definite to use the bottom temperature sensor as my indicator that the tank is tropical. The trouble with the top sensing element is that IT will rise with few degrees the moment a hot tab key is opened for a fewer seconds and there may righteous beryllium a little calefacient water unexpended at the top of the tank. You may decide to use some average between the two sensors.

Step 3: Build Your Ironware

Connect the SSR to Personal identification number 15 and GND

Connect totally 3 DS18B20 detector: Yellow to PIN 16, Black to GND, Red to 3.3volt. Use a 4.7KOhms displume up resister between PIN 16 and 3.3volt. (Remember, DS18B20 are one wire devices, and twofold one telegraph devices is allowed on one bus or pin).

Connect your restart touch wire to TO and Readjust wire to T2

Do non yet connect your build to mains (Actinium). Practise not yet attach the sensors to your Geyser. You first need to figure which sensing element must attend which put down.

Step 4: Register As a Cayenne User

This is not a cayenne.mydevices.com tutorial. Cayenne is the zero price interlingual rendition of mydevices.com

If you are non common with jalapeno, to a greater extent info is available at https://community.mydevices.com/?_ga=2.205257232.1695603717.1605354764-1503512272.1599609745

You first need to register at cayenne.mydevices.com and receive a login and password.

More info about cayenne is available at https://developers.mydevices.com/cayenne/docs/intro/

It is besides noteworthy to read through

https://developers.mydevices.com/cayenne/docs/cayenne-mqtt-api/#cayenne-mqtt-api-using-arduino-mqtt to bestow the Capsicum annuum longum library to the Arduino ID

Stride 5: Install the Mandatory Libraries in the Arduino IDE

WiFiManager

ArduinoJson version 6.9.0

CayenneMQTT

OneWire

DallasTemperature

ArduinoOTA

Step 6: Load the ESP32 Sketch

The ESP32 Study contains lots of encipher. It includes code for

  1. https://github.com/tzapu/WiFiManager. WiFi manager is misused to let your ESP32 jazz what your WiFi access points login certification is. It is farther used to capture the CayenneMQTT inside information, temperature limits for the geyser and to link the 3 Temperature sensors to its location (Top, bottom or ambient)
  2. Code for The cayenne API
  3. OTA (Over the air updates). You will be able to update firmware via Wireless fidelity. You need to get on your local WiFi, exploitation the unvaried computer that you used to upload your original sketch.
  4. DS18B20 temperature reading.

The ArduinoIDE Sketch is available at: https://github.com/JJSlabbert/IoT-Geyser

Step 7: Add Your ESP32 to Chilli pepper

You can now add a new device.

Log in to cayenne.mydevices.com. On your left-of-center you leave see a dropdown computer menu Add Young...... Select Device/Widget. A page will open were you need to pick out bring your own matter. A new page will open with your MQTT details. Put down your MQTT USERNAME, MQTT PASSWORD, CLIENT ID. You will need this to intercommunicate with the Cayenne MQTT Agent (Server). Your MQTT USERNAME and MQTT PASSWORD will always exist the same, but the CLIENT ID will constitute different for each inexperienced device like another ESP32, Arduino or Raspberry PI.

You can as wel give your device a mention happening this take shape.

Step 8: Run Your Study

Restart the ESP32

You should directly insure a new Wireless local area network access point called "Slim_Geyser_DEV". (The ESP 32 will glucinium in access point mode/ A.D.-hoc or hotspot mode) victimization your computers WiFi search/scan.

Lumber in to this new access manoeuver. The password/Security Key is watchword.

Your web browser should go to the landing Sri Frederick Handley Page "192.168.4.1", if not, coiffe it manual.

Attend Configure WiFi

The shape page should now open. It should have mechanically scanned for your internet access point, select it, type in the password, Jalapeno MQTT details. Leave the relaxation the same. All temp values is metric (Deg Celcius).

Press save. The ESP32 testament now render to unite to your wifi and the Cayenne server.

Disconnect from "Slim_Geyser_DEV" and connect your computer to your home admittance point.

Step 9: Building Your Cayenne Splasher

Now you should backlog in to cayenne.mydevices.com using your cayenne credentials.

Your device should be listed happening the left menu bar (Mine is Geyser_DEV).

You can now add entirely your sensors and the electrical relay (operating theater channels) to your dashboard by clicking the lend signs.

Along the channel 0 Icon, click settings and cvhange the distinguish to "Geyser Bottom Temporary". Chose a suitable Icon (Temperature Probe) and choice the number of decimals arsenic 1. Do the unvarying for channel 1, 2, 5,6

For Channel 4 and 8, change the number of decimals to 0 and name them "**Geyser Condition (1=Happening, O=OFF)**"

and "*Auto Heating Mode (0=Blue-collar, 1=Machine)*" respectively.

Channel 3 and 7 should beryllium buttons

Attend Add New menu detail along the left menu bar, go to Device/Gadget> Custom Widgets>Button

Describ the Button "Change over Geyser on/off", Pick out the Device epithet (Geyser_DEV), DATA=Digital actuator, Channel 3, Unit of measurement=Appendage I/O, Icon =toggle switch. Click add Thingamajig.

Do the same for Communication channel 7

Transport 9 should be converted to a slider

Attend ADD New menu item on the left carte du jour barricade, go to Device/Widget> Custom Widgets>Slider and choose the appropriate values as in the image.

You can now move your widgets around.

Footprint 10: Figuring Out the Positions of the Sensors

Since the three Temporary sensors is connected to the duplicate pin (One Wire Bus), you should figure out what sensor should go where.

Check your Jalapeno dashboard and note the three temperatures. They should be about the same. Heat peerless skyward with warm piss or your mitt. Note the sensing element that heats up on the splasher. Mark down your sensing element accordingly. Do this for the other 2 sensors.

Step 11: Playing Around (Examination) Your Splashboard

Play around with the controls happening the dashboard. Toggle switch the on/off switch and see if the SSR LED is lighting up. Besides turn on the Auto heating style, ignite the bottom sensor and imag if the SSR switch of when the desired temperature is reached.

You throne now join the 2 Sensors to the geyser and the ambient temp sensor to a right position. You can also connect the SSR to your mains.

Step 12: Scheduling Your Geyser

You commode now schedule on/ off events with your Geyser

On the Dashboard, select Add up New>Event

Be the First to Apportion

Recommendations

  • Anything Goes Contest 2022

    Anything Goes Contest 2022