How to Power my board and extra items

I am building a little Garden watering tool that is connected to the cloud for scheduling and monitoring.

v1 is to simply attach the Spark to a Solenoid valve and a Flow meter. Using the former to turn on/off the water and the later to track how much water was used.

I am considering: for the Solenoid

and for the flow sensor.

I am a Web guy, and can handle the cloud side but the hardware stuff is greek to me.

How would I power all three items all the time? I assume an AC adaptor of sorts but that is where I am stuck.

Many thanks to this great community for the help.


Wow, cool stuff! The power requirements for you “kit” is:

  • Solenoid = 24VAC @ 350MA max
  • Water flow sensor = 5V @ 15ma
  • Opto-coupled relay to control solenoid = 3.3V/5V
  • Spark Core, 5V (USB) at 350ma max

You could use a 120VAC to 24VAC step-down transformer to power the solenoid and use a 24VAC to 5VDC or 120VAC to 5VDC converter for the rest of the hardware.

The solenoid would controlled through a opto-isolated relay. There are breakout that will work at 3.3V (on/off voltage) while the relay itself is powered by 5V. That means you can drive the relay from a pin on the Spark. The water flow sensor only works at 5V but the digital inputs on the Spark are 5V tolerant so you could connect it directly without level shifting.

You can power the 5V stuff with a simple 120VAC USB charger cube and the 24VAC transformer for the solenoid. :smile:

1 Like

Ok if I understand you right:

The flow sensor can be powered from the sparkboard which is as simple as usb cube.

For the Solenoid I need something like:

Plus I’ll need a relay ( to control the solenoid from my Spark due to the difference in current required (I know thats the wrong way to say that).

Hi @ravenna

The same place that sells you the solenoid valves will likely have a transformer to drive them:

Ahh, thank you. I appreciate the help very much. I’ll post notes as soon as I have them.


I’m planning a very similar thing, a cloud-connected garden controller. The cloud part would give me charts of the soil moisture and let me set thresholds and timings for the irrigation system. If it comes out good, I plan on putting it on GitHub.

I’m also a software guy, who’s venturing into hardware thanks to the Arduino first and now the Core.

I already have a 230VAC to 24VAC 750mA transformer for the solenoid valves. I could use yet another power rail, adding a 5V cell phone switching PSU to power the Core, but I was wondering if it wouldn’t be nicer to power it from the 24VAC.

Do you have any links for that?

At first I was thinking of using a 3:1, 24V~ to 8V~ transformer (rated for the Spark’s 300mA peak consumption), then a rectifier bridge, a large capacitor to smooth the wave, and then a LM7805 with its two smaller capacitors.

But I’m having trouble finding the transformer and I’m not too confident about winding it myself, without blowing up stuff.

So I thought I could use one of these small switching regulators:
Apparently it only needs a tiny inductor, two capacitors and a “Schottky” diode. I’m still wondering whether I need to put a full wave rectifier and large capacitor in front of it, or if there are lighter configurations.

Any ideas?

@tobia, the 24VAC to 5VDC converter I had in mind was this one from eBay:

It is uses basically the same regulator you had in mind but comes complete for very cheap. :smile:

1 Like

It’s also sold with free shipping. It’s a no-brainer. Thanks!


I have another question related to this project.

Assuming that the GND coming out from that converter is actually the AC wave zero-point (I’m not sure how to ascertain it, but it should be so) then I should be able to use a TRIAC to switch the same 24VAC to the solenoid valves, right? Possibly with a transistor before the triac gate, in case it needs more current than an output pin can supply.

Is that right? If I can do that, it would spare me a few relays.

@tobia, using a triac to control your AC (inductive) relay will mean that you will have to use a snubber circuit to protect from inductive kickback. You may want to consider an opto-isolated relay module. That way you don’t have to worry about isolation or kickback.

I operate a small farm where we have 7 valves with the furthest valve being around 2000 feet away from the central controller–all of the valve solenoids are 24VAC. I’d love to experiment with a system just like this. Is there any way to communicate with the Spark Core over the same 2 wires that supply the 24VAC to the solenoids (kind of like powerline ethernet)? I’ve thought about using hardware from someone like Ubiquity Networks to supply wireless to each valve station but not sure that is practical as long as I have to physically trench the 24VAC lines anyway (I do not want to use DC solenoids). My flow meter is the following and has a reed switch register which I think the Spark can read?

I’d greatly appreciate any help!

Is there a system to control existingly?

I would love to try using a core with ufl and have an external antenna to provide greater range. :wink:

2000 feet is rather far for wifi though…

We currently use a Weathermatic Smartline controller with 8 zones total. There is an independent set of wires going to each valve from the central controller ( old standard) but they are becoming faulty due to age. Our controller can be upgraded to a 2 wire system where each valve is connected to the same pair of wires and you can add 99 valves but each valve station requires an expensive decoder at each valve box. Spark Core would be a cooler solution. We have Wifi at the central controller and there is pretty good line of site from the central controller to each valve. I still have to physically run 24VAC to each valve so being able to hard wire the Spark Core would be awesome.

Hmmm. Good stuff I’m seeing here but not really my area of know-how so let’s wait for other community members to chime in! :smiley: