Providing 24VAC and 3.3VDC - BitKnitting/should_I_water GitHub Wiki
The valves are powered by 24VAC. We will use this power supply to run our 3.3VDC Feather.
We go from 24VAC to 3.3VDC in two steps:
- Smooth AC to DC using a Full-Wave Bridge Rectifier.
- Step voltage down from 24V to 3.3V using a DC-DC Buck Converter.
Rectifier
Parts Used:
- 1 50V 330µF cap
- 1 prototype board
- 4 1N4007 diodes
To calculate the size of the capacitor, we use the formula:
- I = .035A. From previous tests, I'm putting the amount of current used by the Feather as 35mA.
- t = 1/120 Hz (full-wave) = .0083 s
- I'll use 1V for ripple. I recall I saw this used in other similar DIY projects. I'm not an expert and it has been awhile...but for now...
Resources
Rectifiers
- Afrotechmod's excellent YouTube video on rectifiers
- Awesome Instructable building a Full Wave Rectifier by Bits4Bots.
- Background on the electronics behind a rectifier - EEVBlog #490 Peak Detector Circuit. The rectifier's job is to take in AC and transform it into DC. DC can then be fed into the DC-DC Buck converter.
Overview
The diagram below shows the ins-and-outs of the components that go into:
- a 24VAC providing power to 3.3VDC components.
- a relay switch to control turning the water valve on/off through software:
Hardware Components
The hardware components include:
Plumbing
- a Valve hose connector - One of the connectors attaches to our gardening hose. The other attaches to the Orbit Valve(s).
- a 24V Orbit Valve - You can get either male or female threaded.
- a 24V adapter.
- Some type of enclosure. I don't have any one set thing. I keep going back and forth between some enclosure I 3D Print and some box I found around the house that (seems?) is empty.
Power To The Feather (3.3VDC)
The full-wave rectifier we'll be building is the one in the DIY Full Wave (Bridge) Rectifier Project Youtube video. Here's what it looks like:
Rectifier
A rectifier converts AC to DC Voltage.
The 24VAC adapter comes into a device with those awesome AC peaks and valleys. DC current comes in flat. The first step is to transform these +/- peaks into a flat line.
Step 1 - Flat Line
We start by setting up a full-wave bridge rectifier with four diodes.
The Instructable about building a Full Wave Rectifier by Bits4Bots makes putting together a full-wave rectifier easy peasy.
We add in a capacitor to keep the voltage at a constant value when a load is added to the circuit. But what size should it be? Using the formula:
- I = .035A. From previous tests, I'm putting the amount of current used by the Feather as 35mA.
- t = 1/120 Hz (full-wave) = .0083 s
- I'll use 1V for ripple. I recall I saw this used in other similar DIY projects. I'm not an expert and it has been awhile...but for now...
C = .035*.0083/1 = .0002905 = 291µF.
So we need a capacitory that is >= 291 µF. We'll also need it to spec'd to handle >= 40V.
Step 2: 3.3VDC
The Feather is powered by a 3.3V power source. Now that we have a constant voltage, we need to turn it down to 3.3V. We'll do this with a DC-DC Buck Regulator. I am using A Drok DC-DC Buck Converter.
Switch
At the request of a level change of a GPIO pin on the Feather, the relay turns on/off the 24VAC. When the 24VAC power is on, the valve is opened and irrigation begins.