Build your own Wifi operated water thermometer [Homeyduino – English version]
![Build your own Wifi operated water thermometer [Homeyduino – English version]](https://huisvanvandaag.nl/wp-content/uploads/2018/08/Vijver-1.jpg)
Build your own water- or regular thermometer that you can read out digitally via WiFi and even use as a trigger for your Homey Pro or Homey Bridge.
After a lot of trying and experimenting, we’ve finally managed to make a functioing DIY WiFi Water Thermometer today. This DIY project took way longer to complete than anticipated. I had already started this over two months ago but at the time I ran into some problems, especially with coding. Today, because of the bad weather, I figured it was time to give it another go, and to my surprise it actually worked.

Via Homey Insights, Homey will hopefully show a nice temperature trend with fluctuations during the year. This way you can easily keep track when the water temperature is high enough for the Koi to breed. Or you can set this temperature as a trigger in Homey, to not forget to cover it against freezing over.
Replicating this project will take you no more than 15 minutes of your time and with a total cost of around $ 10,-.
Below you can read what you need and how to connect it.
Normal thermometer or thermometer with hygrometer
With the code below you can also make a normal thermometer, just follow all the steps as described below, except for throwing it into the water. Rather build a thermometer and humidity sensor (hygrometer) in one?We’ve got you covered!

The necessities on Amazon or Aliexpress:
- Microcontroller with WiFi and 5V: D1 Mini NodeMcu
- Micro USB Charger
- DS18B20 water temperature sensor
- breadboard
- Resistor
- Homey Smart Home HUB with Homeyduino app installed
If you prefer to buy on Aliexpress, you can use these links:
Also necessary, but only to be configured once, a computer or laptop with installed:
- Arduino IDE
- NodeMcu Flasher
- Homeyduino on your Homey Pro or Homey Bridge
Connect
Follow the diagram below to connect the sensor to your board. The image below shows an Arduino Uno but connecting to an ESP8266 NodeMCU or D1 Mini is almost the same, voltage also works at 3.3V.


Code
Below is the code as I compiled it myself from code already available for Arduino and Homeyduino. It works, but since I have little or no experience with coding myself, this can most probably be done more efficiently.If you do have this knowledge and have suggestions, please let me know!
Uploading is done via Arduino IDE, if you are not familiar with this, read here for an extensive manual. Make sure you have selected the right board in settings in Arduino IDE and that you upload the code at 115200 baud. If your ESP8266 board doesn’t work, you can try flashing it first with the NodeMcu Flasher.
// Code for Homeyduino made by Smart Home Blog https://huisvanvandaag.nl.
// Take a look at my site for more Homeyduino en other Smart Home projects.
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <Homey.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS D3 // in case this doesn't work replace D3 with: 0, which is the GPIO pin number
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
float Celcius=0;
float Fahrenheit=0;
void wifi() {
if (WiFi.status() != WL_CONNECTED) {
WiFi.begin("<SSID>", "<PASSWORD>");
uint8_t timeout = 30;
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
if (timeout<1) break;
}
if (WiFi.status() == WL_CONNECTED) {
//Print IP address
Serial.print("Verbonden met WiFi! (");
Serial.print(WiFi.localIP());
Serial.println(")");
}
}
}
void setup(void){
Serial.begin(115200); // In case it doesn't work, change baud to 9600
Homey.begin("SENSOR NAME"); // Fill in sensor name
Homey.setClass("sensor");
Homey.addCapability("measure_temperature");
}
void loop(void)
{
wifi();
Homey.loop();
// unsigned long currentMillis = millis();
sensors.requestTemperatures();
Celcius=sensors.getTempCByIndex(0);
Fahrenheit=sensors.toFahrenheit(Celcius);
Serial.print(Celcius);
Serial.print (" C ");
Homey.setCapabilityValue("measure_temperature", (int) Celcius);
delay(1000);
}
To test
After you have successfully uploaded the code, we will try and test it. Put the sensor in a glass of water and open the Serial Monitor in Arduino IDE, click Tools and then the Serial Monitor or hotkey CTRL+SHIFT+M.
A new screen will then open on which you can read the values from the sensor. If you see values that don’t seem to be correct, such as -126 or something like that, you have to upload the code again.



And Voila
Your home-made WiFi Water Thermometer is now up and running and you should be able to read it from anywhere in the world via the internet or, if desired, even used as a trigger in your Homey flows. As mentioned above, I use it for reading the pond. Let me know what applications can you think of for this handy WiFi thermometer.

More projects coming soon! Sign up here so you don’t have to miss anything!