In the modern world USB has become a truly universal connector, with its inclusion on almost every major piece of consumer electronics. It has even expanded well beyond things that we’d think of as consumer electronics, like the solenoids on automatic sprinkler systems.
This project comes to us from [Ray Wang] at opensprinkler.org who has been working on various ways of controlling the old sprinkler standards, which generally rely on a 24 VAC power supply to drive solenoids. This tests uses the power available from USB-PD and closely examines four methods of energizing the solenoids: unipolar PWM, dual voltage, synthesizing an AC wave from a DC supply, and producing a bipolar square wave. The bipolar square wave had some interesting results, being able to get pretty close to the behavior of a true sine wave while minimizing the dedrmand on power electronics.
For those working on old sprinkler systems, or many other antiquated systems that still rely on 24 VAC, this project shows that USB can deliver a surprising amount of power in unique ways, and the fact that it’s near-ubiquitous and affordable makes it that much easier to adapt into situations it was never really designed for.
These old sprinkler systems have other ways of working on modern systems as well, like this one which replaces the AC source for a DC one, but with a few caveats.

Whats with the ai banner image…
From the OpenSprinkler site. That transformer does look sus.
But the post is great, and full of real-live scope traces and proper experimentation. Don’t judge a book by it’s cover, at least in this case.
It also uses multiple AI generated images of there setup jbstead if what they actuallt used. Article says they used a ESP8266 yet the image for the setup as an ESP-12F in it.
Let alone the fact its obvious AI rewrite that article into this werid state.
Looking into who is behind this project, it’s [Ray Wang]. He’s been in this game long enough that I’m giving him the benefit of the doubt here. I’ve added his name to the writeup to make it more obvious that there’s a real person behind the work.
Right, as opposed to inability to spell, apparently. I’m still waiting to hear which part of the article, other than the title image — simply an illustration of the topic — is AI-generated. Also, AI-generated is not equal to AI slop. Check the definition before the accusation. If you disagree with any technical content of the article, I’m all ears. Dismissing someone’s work because you don’t like an illustration in it is itself sloppy.
” ITs AI slOp duRRR”.
Have critical thinking skills really gone downhill that much recently? Takes 2 seconds and 3 brain cells to determine if it’s genuine or ……..Ah.
Nevermind, answered my own question….As you were.
An ESP-12F is an ESP8266 module.
Other than the title image, which other image is AI generated? The board photo is a real photograph. You just didn’t know ESP12-F is a common ESP8266 module. I hand-drew all diagrams in Google Drawings. All oscilloscope measurements are real captures on the bench. I spent 2 weeks building and modifying the prototype circuit, and did all the experiments. I don’t think it deserves this level of dismissal.
Right, as opposed to inability to spell, apparently. I’m still waiting to hear which part of the article, other than the title image — simply an illustration of the topic — is AI-generated. Also, AI-generated is not equal to AI slop. Check the definition before the accusation. If you disagree with any technical content of the article, I’m all ears. Dismissing someone’s work because you don’t like an illustration is itself very sloppy.
Perhaps William is an AI bot. Those spelling mistakes reek of an AI trying too hard to look like a human.
the problem you’re running into is a reputational problem. once we see an AI cover image, many of us are then skeptical of the whole project and instead of checking out your righteous (or insane, depending on POV) hack we are looking for signs that the rest of it is slop. or we’re saving ourselves the effort and assuming the whole thing is slop.
it’s not exactly a logical proof that something with AI parts has AI throughout, or that something with AI throughout is garbage. but the association is strong enough that your project fails the ‘smell test’ for a lot of viewers, due to this one — i trust you — innocuous choice.
shrug not sayig you should feel bad or anything, just, if you’re bewildered by the response, this is why. i make awful illustrations in gimp and i’ll never win any awards or (hopefully) be accused of being AI slop :)
Point taken. But I still think “AI-generated” and “AI slop” are being conflated here. The title image — the only AI-generated image in the entire article — went through no less than 20 rounds of revisions until everything looked exactly the way I wanted. At this level of human involvement, it does not qualify as “slop”.
This all reminds me of something from more than a decade ago: when I first posted a YouTube video about SquareWear, a little wearable-electronics board I made, half the comments were about the way I pronounced “US quarter”. Apparently, that single accent dwarfed the entire technical content and rendered everything else irrelevant. I guess life is like a box of chocolates…
The irony is that every other figure in the article is hand-made or captured: the diagrams were made in Google Drawings, scope traces on an oscilloscope. I could have made the title image the same way. I just wanted it to look a bit flashy, that’s all. I clearly underestimated how strong the negative reaction to AI-assisted image generation would be. Lesson learned.
I’ll actually shocked it deals with a big inductive device like that without burning out the teeny pd chips. I mean I guess 240 watts is 240 watts..
It goes to show that sometimes you should just give things a try
Nothing here is 240 Watt. A standard 24 VAC / 500 mA transformer is about 12 Watt. The USB-C adapter is rated 35 Watt. This shows from a raw power point of view, USB-C has enough juice to drive the solenoids. The current never passes through the PD chip itself – the PD chip just negotiates the voltage level – current is directly supplied from USB-C to the circuit.
All this article did was convince me that the transformer is best.
Care to elaborate?
Transformers last for decades. I trust them way more than cheaply made disposable consumer electronics.
Transformers last for decades if nothing happens in those decades. Irrigation systems aren’t always that well-behaved: solenoids can short over time, wiring gets damaged, people make wiring mistakes. Class 2 AC transformers generally have a one-shot non-serviceable fuse. Once it’s open, it’s a brick. Unless you are willing to crack open the case, it has to be tossed.
And I don’t think you should equate price with quality. USB-C adapters aren’t cheap because they are cheaply made – they are cheap because of the high demand and production volume. AC transformers are shirking legacy products. They aren’t cheap because there is far fewer demand.
Precisely this. I’ve replaced a lot of AC transformers in my time. Years ago the advice from the consumer counsel here when buying phone chargers was to buy something with hefty rather than light ones. In other words a big transformer is better than a small one, not considering modern switching transformers.
Anyway, I’ve found the same problem replacing older transformers, particularly in audio equipment or in equipment that requires sub 50v AC power. It’s getting increasingly harder to find something that doesn’t cost more than replacing the equipment. This, at the very least, presents me with some options! But obviously I’ll do my own checks to make sure! Nice work by the way. You know yourself best but pay no mind to trolls, if people have a real criticism for constructive reasons they’ll deliver it in an insightful and helpful way. Inner critics are hard enough to deal with without the cacophony of crazy out there.
👍
I was thinking that my archaic chunk of copper and steel will be working long after the USB-PD standard has been replaced by something else “better”.
Energy efficiency is probably better with switch mode power supplies, and cost might be lower.
Longevity and reliability would likely go the opposite way. Having said that, I did just recently have a transformer failure in an irrigation timer . . . from the mid 1980’s.
Not knocking the original source article. It was interesting and technically deep. Far more than I would have done, and I wouldn’t have taken the time to publish it for other people to learn from.
Yeah agreed, good work, nice with the whole electromagnetic black magic.
If power efficiency is a real concern, why not switch the power going IN to the transformer along with the output relays? Issue with sprinklers is that they operate in a brutal environment with brutal human beings chopping into wires with shovels. Fuses, relays, and dumb buzzing iron is hard to beat in terms of reliability. And snubbers. Don’t forget about those.
Pretty much all sprinkler controllers use a single power supply design – the same transformer powers solenoids as well as the logic board. Cut the power going IN to the transformer, the controller would need another power supply, which is inconvenient and adds more parts and costs.
I had the same thought, but it looks like a transformer is very efficient, high 95%. Switch mode power supplies run from 80% to low 90%.
Your numbers are misleading. 95% may be realistic for large grid transformers operating at rated load, but not for a small wall transformer that spends most of its time idling. An iron-core transformer has continuous core loss as soon as it’s plugged in, even if it isn’t supplying current to anything. That’t why it’s always warm. Modern switch-mode supplies, on the other hand, are typically around 90% efficient under load, often reaching the low-to-mid 90s with good designs, and their idle power consumption can be very small.
Another 24V niche, modern CPAP machines require 24V. Online retailers specializing in Medtech offer 24V powerbanks for 450USD. Not amazon, but niche websites that cater to less tech-savvy ”normies” that depend on CPAP sleep breathing assistance, for things like cardiovascular conditions.
Note that there are several inexpensive options at Amazon that boost convert to 24V with some vendor-specific connector, from the standard usb-c pd output of a modern powerbank.
24 V is actually supported by USB-C PD, assuming the adapter is EPR with AVS support. This is usually found in high-power adapter, like rated 140 Watt or above. The more common ones (rated below 100 W) top at 20 V.
CPAP machines actually run on 24V DC (switch-mode) power adapters, different from the AC transformers the article is about. The steep price tag is for regulatory reasons – anything certified for medical equipment is like 10x more expensive.
Yes, I know. There are legitimate issues, then there are the ridiculous ones, often to handle litigation risks. Like how US CPAP patients arevtold to only use distilled water in the evaporator 9f their CPAP machine. While the European versioned the machine’s water container (another article no) are approved for tap water, and can be cleaned ina dish-washer.
That’s less a regulation problem as that the standard tanks delivered in the US are cheap pieces of crap.
ResMed doesn’t (or can’t) guarantee that the heater plate in the standard tank won’t rust and leak if you use a descaler on the tank. Descaling is important if you use tap water – lime and stuff from the tap water will build up on the heater plate, preventing it from heating the water for the humidifier properly.
They sell a better tank that is marketed as dishwasher safe. You are also allowed to descale it. The guide specifically mentions using diluted vinegar when cleaning.
You can buy the dishwasher safe tank in the US, but most suppliers want to sell you the cheap tanks because they need to be replaced more often.
If you are in the US, get a dishwasher safe tank and clean it once in a while. You’ll save money by not replacing the tank all the time. You’ll save money by not buying distilled water. You’ll save time by not running to the store to buy distilled water.
I’ve been running Opensprinkler at my house for a out 3 months with the DC USB-C supply. It works awesome and Ray is awesome. He really knows what he’s talking about.
🙏
If the bridge uses ordinary MOSFET gate drive with no slew control, would expect EMC trouble. A 45-Hz square wave with deliberately slowed 10–50 µs edges, on the other hand, could be made very benign.
24VAC is well suited for the outdoor environment.
Good point. The experiment didn’t consider slew rate. At 45 Hz there’s plenty of room for it — gate resistors / RC shaping on the discrete MOSFETs, or a proper gate driver with controllable slew rate.
Now if only we could convince the world not to use 24VAC for doorbell chimes. Those transformers eventually burn out and fail plus continuously use power and run warm wherever you put them.
Hear, hear!
The one in my house has been in place for nearly 30 years. It has not failed.
The one in my in-laws house is at least 40 years old. It has not failed.
I have yet to see one fail. Not in homes I’ve lived in, nor have I heard from friends or coworkers that the doorbell transformer failed.
Is the company behind the Ring doorbells and cameras going to be serving user in 25 years? I wouldn’t bet on it. I’d be more inclined to bet on my 30 year old simple doorbell transformer still working in 25 years.
haven’t known these to fail, but don’t have a doorbell in my own house either.
but it is wild that they’re always energized. i guess i can see the reasons for that but it is a big negative.
I would much rather have the transformer. It’s extremely reliable, RF quiet and won’t cause corrosion issues like a DC power supply will.
Which is exactly why Methods 3 and 4 exist.
I have the KISS mentality, I just put a smart plug before the transformer and use the smart plug to turn on and off the transformer.
It’s simple, easy to repair, and I don’t have to program too much.
Only downside so far is each zone requires its own transformer and smart plug.
I’ll stick to the simple and reliable transformer. I work plenty with 24VAC and 120VAC solenoid valve systems in industry and they just keep working. The coil failing is the exception, and the guts of the valves can be replaced for a rebuild to new. I’ve repaired sprinkler valves too, and proper weatherproof connectors and standard rugged plugs are far more of a long term solution than usb-c.
Unless it’s a weird edge case too, they’re just an on-off device. Give them power or no power, running a solenoid off of PWM is needlessly overly complicated.
“PWM is needlessly complicated” — correct, which is precisely why Methods 2, 3 and 4 exist.
“They’re just an on-off device” — yes, but that describes the logic state, it says nothing about the waveform. Your transformer outputs a sine wave, which is not a flat line. Same with Methods 1, 3 and 4. Method 2 is the only one that’s actually a flat line.
Transformer’s reliability isn’t in dispute either. The tradeoff is that AC transformer pushes most of the fault-protection burden downstream to the controller, while USB-C brings regulated output and built-in overcurrent, short-circuit and thermal protection upstream.
Sure USB-C isn’t inherently weatherproof, but neither is an AC transformer — both live indoors or in an enclosure. The field wiring, the splices and the valves remain the same either way.
It’s not just my take. Rain Bird, one of the industry leaders, laid out several reasons for moving away from conventional iron-core transformers. See a patent they issued more than 10 years ago: https://patents.google.com/patent/US8901771B2
Why is Hackaday censoring those speaking out against making articles on AI Slop.