Pool Temperature Monitor - DS18B20,white 0.96 inch OLED module, Wemos D1 Mini

I want to make an MQTT sensor to monitor my pool’s temperature and send it to HA, but I also want it to send the temperature (in Celsius) to this little OLED display that will be hooked up to the sensor. I will have the unit boxed up and placed in my kitchen somewhere with the OLED visible and run the temperature probe out to the pool. I want the pool temp to be accessible both in Home assistant as well as on that display.

Is this possible and if so, can someone assist in coding it?

edit: extra points if there is some way to have the OLED cycle through other relevant data (outside temp, time, weather info, etc)
edit2: previous discussion on the topic: Pool Temperature Monitoring

I have an OLED attached to a NodeMCU that I am using as a “messageboard”.

Just have it listen for MQTT topics, then show on the screen.

Use some rules in HASS to send topics to the screen. EG if temperatures are updated, if CPU is too high, if plants need watering. I only have 3 lines of text in the oled (0.96" like yours), so setup a rolling methodology

I can post my project if anyone is interested. One caveat is that it needs rebooting every couple of days … likely my use of Strings letting memory kill the sketch over time!

I do have a sensor like yours for temp (in my box of “stuff to try one day”) … my intention was always to have that rigged up to a separate ESP8266 as my pool is too far from my house. Challenge is plumbing it in for me - want it neat, so was toying with using a gauge embedded in a flow meter … although the diameter of the meter is too small for the pool pump so I need to add some parallel plumbing before I rig it up.


That sounds a lot like what I want to do. I’d appreciate it if you could post the details.


you can find the arduino code for my mqtt drive oled display here:

I assume you know how to load the relevant libraries that are required in arduino

Hope it helps


ps - also stuck it in as a project - in case someone can use it:


I am trying to figure out how to connect the pins but can’t determine which ones you used by looking at the code. Plus, I assume my pins will be different (wemos d1 mini). Will it just work if I hook it up as per this site: http://automatedhome.party/wp-content/uploads/2017/04/WemosOLED.png?
The rest I believe I can figure out.

I have it working now! Need help with something though; I am only using it to display the pool temp and my son’s room temp, so only 2 lines, and I think the max font size is 24pt. I am trying to have it display only those two lines but I want it to take up the whole screen. Do you know the best way to accomplish this?

Increase the font size - which is tested in the function fontsetter

change the number of lines to 2 I assume (as they may not fit otherwise) - set that in DoUpdateDisplay function

Will take trial and error - I think there is a couple of font sizes included in the display library

Keen to hear how it goes and what you got working!

I have it working but for some reason the oled display stops updating after some time even though the mqtt is still sending updates. It’s not that it requires a certain threshold to be reached either because I’ve held the ds18b20 in my hand and watched the screen update instantly. It’s not so bad now because I can hit the reset switch on the wemos and it is rebooted in seconds but it does defeat the whole point of it being automated if I constantly have to reset it.

1 Like

Looks great!

Mine freezes too - I think it is running out of memory in the arduino code.

Probably some bad String coding ot being tidy with memory.

You could use a timer to reset every xx milliseconds (about once a day) - I do intend to look at the code one day - but only know it is a bit “freezy”, not why!

I changed the automation to update the oled every 5min (before it was updating continuously), it seems to have helped but has a few hiccups every now and then and if I manually reset the wemos, I have to manually fire the automation to get it to update the first time.

If you make your updates to the OLED persistent in MQTT, they should update immediately after restarting the wemos.

I would not necessarily recommend that though, as it may give you stale data if it has not been updated for a while (ie due to a sensor not working)