ESP32 Wemos D1 Mini – Sprinkler Controller Open Source
github.comApart from the fact that sprinkler systems are almost always 24VAC and every commercial sprinkler controller I have ever used or investigated use optocouplers/fets/triacs I don’t really have a good reason to get irritated by homebrew designs that use relays, but I do get irritated. I think the irritation comes from wanting to really learn-by-copying how to design these circuits and many hours searching for exemplars and reading datasheets left me pretty confounded (though most of this was during the great supply chain squeeze so I couldn’t find the right combos of triacs and optocouplers ins stock and the datasheets led me to believe that subbing out a non zero cross would probably be a problem, or not being able to find logic level triacs)
Have you looked at OpenSprinkler?
https://opensprinkler.com/faq/ https://github.com/OpenSprinkler
Anyone else have reliability issues with the ESP32?
I have a few of them connected to various wifi networks, and after a couple of years they always seem to disconnect and need a power cycle before they'll reconnect.
I understand they might lose the wifi connection, or their DHCP lease, or there might be interference, or something blasts too many packets at them, or a TCP connection hangs or gets RST... But after any of those, I expect them to recover, reconnect, and continue working. However, even a hello world web server on ESP32 seems unable to do that.
However, it's really hard to track down bugs that only happen once a year when I only have ~10 of these devices.
We used a few thousand of the D1 mini (ESP8266) for our air quality monitor kits and had a couple of issues.
On some of them the WiFi would not work at all. Kind of like the onboard antenna was not properly connected. Other died after a few months without any special reason that we were aware of.
Another problem with these boards is that you do not know exactly the specs of the other components. For example we got different rated voltage regulators (5v to 3.3) that caused some issues because sensors we put on the 3.3v did have higher requirements.
Interestingly we had more issues with the "original" ones than the clones. I actually wrote a small blog post about it [1].
Another issue is that it is difficult to get proper ROHS and REACH certifications for these modules. This makes it difficult if you want to use them in a finished and certified product.
All of these issues added up and we made the switch away from the module and now put the ESP32-C3-MINI directly onto the PCBs of our indoor and outdoor air quality monitors. Together with an external hardware watchdog, this seems to pretty much eliminate all issues we had. If you are interested in the shematics, its all open source [2].
[1] https://www.airgradient.com/blog/d1-mimi/
[2] https://www.airgradient.com/open-airgradient/instructions/ov...
Mine just doesn't want to connect to WiFi anymore. I'm (or well: was) using this one [1]. Also it feels tricky to update the software, and keep it updated. I'm in the process of switching to a Bresser weather station [2], using SDR to receive the signal and feeding that into Home Assistant.
The other two I'm using (knowingly!) is with Flipper Zero, and they seems very reliable. But I wouldn't define those as traditional WLAN clients.
[1] https://thingpulse.com/product/espaper-plus-kit-wifi-epaper-...
[2] https://www.bresser.de/en/Weather-Time/Weather-Center/BRESSE...
You dont "expect" anything, you test the connection yourself and restart it when needed:
if uping.ping('8.8.8.8')[1]==0: machine.reset()I have three running around the house for years and I’ve never noticed one being offline. I just spot-checked them all and all are online.
I’ve had a couple Wemos D1 mini for garage door controls and they have just worked without issue for 3 years now.
You could set up a watchdog of some sort that reboots the system if it can't connect to the internet.
I don't think there's a D1-ESP32 board? The D1 Mini is Wemos' ESP8266 board. They do have ESP32 boards with the same footprint, but those are not D1 Mini but S2 Mini, S3 Mini and C3 Mini, depending on whether it's ESP32-S2/-S3/-C3.
You'll find many varieties of boards with different SoCs being sold mentioning the D1 Mini in their model number or product description, as it initially defined the form-factor being referred to. Similar to the ESP-12F, which you can also get with ESP32 SoCs, if you want, even though the ESP-12F originally is an ESP8266 board.
That's what I thought as well, it is not available at:
https://www.wemos.cc/en/latest/index.html
But the specific board from the post can be bought on Amazon:
https://www.amazon.com/CANADUINO-WEMOS-Minikit-240MHz-Blueto...
Indeed, there is no D1-ESP32 from Wemos. It's a name used by several non-Wemos clones that have an ESP32 chip in a module form factor that is compatible with the original Wemos D1 mini.
The challenge is that these modules are not all the same. The differences are for example in the voltage regulator and how much current you can draw from it. Which can make something work fine with one "D1-ESP32" while not working with another.
I thought about making one of these - actually I designed it, but never made the PCB for it - because the internet is full of similar ones: https://www.ebay.com.au/itm/195143066807
I have many similar projects. By far, the hardest part for anything I actually want to share is user friendly wifi provisioning. The rest is easy, displays, devices and power supply. (I have 5 different HL-tech radars on boards with 3 different displays, one using LVGL).
I am using the app based Espressive app based provisioning now and it's the best of the lot but still flakey on the Risk V chips like much of the IDF/Arduino wrappers. It's a hard problem.
Most of it works pretty well with the Extensa core so I suggest sticking with those.
NXP and STM make NFC<->I2C EEPROM chips that are <$1 which can easily be used to transmit data from a mobile device directly into the target.
https://www.nxp.com/products/rfid-nfc/nfc-hf/connected-nfc-t...
https://www.st.com/en/nfc/st25dv-i2c-series-dynamic-nfc-tags...
I’m in the thick of implementing Improv support, which uses Web Serial to configure WiFi. It’s worth checking out.
I'll add it and give it a try. Thanks.
I've been playing around with a few ESP32 projects recently and my biggest complaint is that it's hard to get off the ground with even the most basic peripherals. Like, an SD card reader - you need to get your own SPI reader and solder it in yourself.
Maybe I'm just spoiled but it feels like I shouldn't have to go design something on PCBWay.com to get an esp with any memory above the 4MB flash.
Still, really powerful cool devices for their form factor and power needs.
24V AC to me seems like a strange choice when using DC-DC power supplies allows for using any external adapter, including USB PD, without the need for a loose transformer.
An amusing feature of solenoid valves is that the inductance increases as the plunger is pulled into the coil. When driven by AC, it causes an initial "kick" of current that gets the slider moving, followed by a lower holding current. Thus it fortuitously optimizes the current budget of the power supply.
Also, when a plunger gets stuck, the coil continues to draw a lot of current, and could burn up. This is a failure mode of solenoid valves in industrial processes. You can get DC solenoid valves, but the coils are bigger and they're more expensive. It means you shouldn't run an AC solenoid on DC unless you're really thinking hard about what you're doing.
And speaking of failure modes, another amusing feature of solenoid valve systems is the sheer number of ways that they can fail. One thing that's always counterintuitive to beginners is that a valve or its control circuit (or firmware) can get stuck in the "on" position. This is true of solid state and mechanical relays. A well engineered system plans for this possibility. "Stuck" could mean releasing a lot of energy (e.g., if controlling a heater or motor), or flooding your garden, or your house.
24 VAC is a common voltage for irrigation control, which is likely why they chose to use it.
Agreed and it’s far easier to turn ac into dc than the other way around
A relic of the ancient days before everything ran on tiny switching converters! There's tons of 24Vac stuff that unfortunately doesn't seem to be interested in switching anytime soon.
Also, AC is easier to switch with physical switches, and there's a ton of stuff still using physical relays at low voltage. It would be nice to go DC but there seems to be inertia.
Worth noting that nearly everything that claims to run from 24 Vac also runs from 5Vdc. Nearly everything modern has a little circuit board which just detects 'voltage' or 'no voltage'.
The exception is 'dumb' solenoids, valves, pumps etc, which are actually powered by the 24Vac.
I think there is more to it than that— AC lets you move current over longer wires without voltage drop or having to use really thick wire. This is why Tesla triumphed over Edison. Honestly, there are a ton of applications that could benefit from low voltage AC that don’t leverage it because DC is king in on the test bench and that inertia creates the need for klunky workarounds to overcome its deficiencies in large, long series circuits.
AC used to let you step up voltage easier, and switch without as much arcing, and higher voltage allows one to send more power over longer wires.
We also rate AC voltage by RMS, which (for resistive loads) is the voltage that would transfer the same amount of power as the DC equivalent.
But really the peak voltage is higher, so we need parts with a higher rating despite the fact we are not using that peak the whole time.
And then there's issues with power factor. Modern gadgets don't draw power in the nice sine wave pattern without extra tech to make that happen. The extra tech is common now, but isn't needed with DC. Without PFC, you get more line resistance losses than you want.
But now we have solid state switching, and it's cheaper to convert DC with a SMPS than a bulky transformer.
We also don't use long series circuits commonly in anything I know about, except for Christmas lights, which are mostly LED now and work fine as they are(As long as nobody forgets a smoothing capacitor to get rid of that horrid flicker the cheap ones have).
Series circuits have the same current everywhere, but modern stuff is constantly changing the current it draws to save power. Which would be an issue if one device wants to be in sleep mode but the other wants to be full power.
I suppose we could do series circuits with constant current power supplies, so the supply pushes a constant 1 amp, and the devices alter their voltage drop to draw more or less current, rather than altering their current draw.
AC seems to be more suited for higher voltages(Where arcing is a problem) and analog stuff(if you don't want to use SMPSes and you have resistive loads to drive).
No, DC is more efficient over long distances than AC. AC transmission has huge losses due to capacitive effects caused by the alternating current.
AC also has WORSE voltage drop than DC because it exhibits something called the skin effect that causes the middle of your cable to not be used as much to carry current.
Tesla triumphed over Edison because we didn’t have the technology to step between voltages back then. DC transformers are still incredibly expensive. AC transformers are coils of wires.
You can get ESP-controlled relay boards on aliexpress.
For a classy sprinkler controller, you want 24VAC relay outputs with current monitoring, and you also want a pulse counting input for a flow sensor. Bonus points for rain gauge inputs and some way to collect evapotranspiration data.