Anyway, one of the early projects I posted here was my arduino pond pump timer.
It's time to drag that project kicking and screaming into 2025.
Here's the plan:
- Nice new colour display, with touch screen operation.
- Get the time from the internet (NTP).
- Retain the same pump options, manually off, manually on, on at sunrise off at sunset (Auto) or on at sunrise off an hour after sunset (Auto+1Hr).
- Store the current pump modes in EEPROM so it survives a power outage.
- Inhibit the pumps in the event of frost.
So I purchased a "Cheap yellow display", about £14 on eBay. It's got a 2.8" TFT display, with touchscreen, has a built in ESP 32 and exposes a couple of GPIO's to the outside world to control my pumps.
With the old controller, it had a dallas one-wire temperature sensor hanging out of a hole in the workshop wall, which I used for frost detection. Unfortunately, that wasn't going to work here, as not all ESP32 GPIO's are created equally, and one of the three exposed GPIO's wasn't much good. One of the draw-backs of the cheap yellow display (CYD), was the amount of in-built hardware; great if you're going to use it all, but the in-built SD card reader, RGB LED absorbed a lot of those valuable GPIO lines. (Quite why the SD card reader and LCD didn't share the same bus, I don't know, that would have freed up 3 pins, but anyway...)
My first issue was getting the damn thing to do anything. It turns out there are a few variants of the CYD, mine having two USB sockets, and the part number ESP32-2432SO28. Many have an R after the number and require a subtle change to the software to get them to behave.
After about a day of buggering about, I had a display. I'd managed to draw a little sun icon, which moved across an arc during the day, the current time and date, compensated for daylight saving time, and had calculated the sun rise and sunset times, based on my location. Nice.
The following day, I added in touch screen operation to swap between pump modes, and managed to get these stored. I used the ESP32's "Preferences" memory for this, and it works well.
Getting the temperature in was, well, a little more difficult.
I have a weather station on the roof. It drives a small display inside the house. The weather station transmits it's data using RF at 863MHz. Just over a year ago, I saw a project called WeeWX. It ran on a Raspberry Pi, and uses a cheap SDR dongle to receive the transmissions from the weather station and generates some lovely graphs. I always meant to document my journey in getting WeeWX to work, but even to this day, I'm not quite sure how I got it all to function. It was not a straightforward process! I ended up hacking the driver from a similar model of weather station to make it work. Anyway, now it is working it's been very reliable.
It generates this webpage, locally served to my network.
There was a couple of issues.
- It wasn't reliable.
- I don't want to go spamming someone else's server with requests.
I then got carried away. Once again with the help of ChatGPT, I added a web interface, which appears on the local network at http://pondpump.local
photo I also created a 3D printed case for it too.
Powering the CYD from the new 5V rail, involved connecting the 5V to the cathode of D1 on the CYD. It's the red wire in this photo.










No comments:
Post a Comment