0

How to control Solenoids with Feather Huzzah / Breakout Huzz
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How to control Solenoids with Feather Huzzah / Breakout Huzz

by Munque on Sat Apr 13, 2019 6:16 pm

My first anything involving IoT...

Immediate project
I've got a latching solenoid, 4.5-9VDC
I want to control it via wi-fi.
(Also have an RPI)

The larger project:
Intending to set up several outdoor stations for automating garden watering scheduling
Each station would have between 2 and 5 solenoids
The idea is to centrally control the all the stations' solenoids via wi-fi from central system.
I'm hoping to dev the code that controls the schedules for each of the Solenoids.
Very familiar with JS / Node JS & PHP. A little familiar with Python. Completely unfamiliar with IDE and NodeMCU

Some Questions:
- Main questions: Just trying to figure out the minimum items necessary to start testing.
- Between the Adafruit HUZZAH ESP8266 Breakout (https://www.adafruit.com/product/2471) and the Adafruit Latching Mini Relay FeatherWing (https://www.adafruit.com/product/2923) -- are they each capable of controlling a solenoid, do the have to work in concert?
- Is there a wi-fi controller that can handle more than one solenoid at a time or is it necessarily one controller per solenoid?
- Additional products: I'm imagining
- https://www.adafruit.com/product/954
- Power source and necessary wiring / resisters for solenoid & controller
- Breadboard

How far off am I? Resisters? etc
Last edited by Munque on Sun Apr 28, 2019 12:16 pm, edited 1 time in total.

Munque
 
Posts: 11
Joined: Fri Apr 12, 2019 11:51 pm

Re: How to control Solenoids with Feather Huzzah

by franklin97355 on Sat Apr 13, 2019 7:08 pm

What signals do the solenoids need to latch and unlatch? If you plan to use the Featherwing I would recommend the Feather HUZZAH instead of the breakout. You might also use the Feather M0 WiFi

franklin97355
 
Posts: 21292
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: How to control Solenoids with Feather Huzzah

by Munque on Sat Apr 13, 2019 7:30 pm

franklin97355 wrote:What signals do the solenoids need to latch and unlatch? If you plan to use the Featherwing I would recommend the Feather HUZZAH instead of the breakout. You might also use the Feather M0 WiFi


Thank you franklin97355. The solenoids take between 4.5 to 9 VDC to switch, closing and opening depending on the polarity.

Why the Feather HUZZAH & Feather MO WiFi over the Breakout or Latching Mini Relay FeatherWing? What are the tradeoffs / benefits?

After I posting it occurred to me the voltage issue: The Breakout GPIOs are 3.3VDC, so I'm assuming they either have to be hooked up with transistors to handle the higher voltage of the Solenoid -- or can you run two GPIOs in series to double the voltage?

Munque
 
Posts: 11
Joined: Fri Apr 12, 2019 11:51 pm

Re: How to control Solenoids with Feather Huzzah

by Munque on Sat Apr 13, 2019 7:52 pm

More solenoid details...

50 ms (min) pulse opens valve
50 ms pulse (min) with reverse polarity closes valve
2.5 W power consumption at 4.5VDC
Pressure range: 3 to 115 PSI (0.2 to 8 BAR)
Max fluid temperature: 160° F
Brand: Ehcotech DDT-ML-4.5VDC.

Munque
 
Posts: 11
Joined: Fri Apr 12, 2019 11:51 pm

Re: How to control Solenoids with Feather Huzzah

by franklin97355 on Sat Apr 13, 2019 8:08 pm

Featherwings will sit on the Feather boards without resorting to using jumpers. You will need some form of polarity control like a motor controller to provide reversed voltages.

franklin97355
 
Posts: 21292
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: How to control Solenoids with Feather Huzzah

by Munque on Mon Apr 15, 2019 3:58 am

franklin97355 wrote:Featherwings will sit on the Feather boards without resorting to using jumpers. You will need some form of polarity control like a motor controller to provide reversed voltages.


So the pieces I'm understanding (sort of) so far...

Controller to handle solenoids: (e.g. https://www.adafruit.com/product/2821, https://www.adafruit.com/product/3010, https://www.adafruit.com/product/2471 -- not sure yet why choose one over another among these three)
Motor controller to handle polarity (e.g. https://www.adafruit.com/product/3190)

Munque
 
Posts: 11
Joined: Fri Apr 12, 2019 11:51 pm

Re: How to control Solenoids with Feather Huzzah

by Munque on Thu Apr 25, 2019 9:36 pm

franklin97355 wrote:Featherwings will sit on the Feather boards without resorting to using jumpers. You will need some form of polarity control like a motor controller to provide reversed voltages.


So I've got -- for now -- the Huzzah Breakout and an H-Bridge
Haven't gotten an motor controller yet. This is all new to me. Just learning. I got a few things running using Lua. But then got it running much more smoothly using Node JS / Johnny-Five.

I'm still learning the circuitry:

The H-Bridge page says it can "control up to 4 solenoids". Is that 4 latching or non-latching solenoids?
I've got latching, but I'll be buying non-latching as well, testing / hopefully learning both.
I've found a few tutorials, but haven't quite nailed it. Any assistance / references for how to connect the Huzzah using an H-Bridge to either the latching or non-latching solenoid would be greatly appreciated.

Munque
 
Posts: 11
Joined: Fri Apr 12, 2019 11:51 pm

Re: How to control Solenoids with Feather Huzzah

by adafruit_support_bill on Fri Apr 26, 2019 5:52 am

So I've got -- for now -- the Huzzah Breakout and an H-Bridge
Haven't gotten an motor controller yet.

"H-Bridge" and "motor controller" are the same thing. You don't need both.

The H-Bridge page says it can "control up to 4 solenoids". Is that 4 latching or non-latching solenoids?

Can you post a link to where it says that? That is not an accurate statement for the DRV8871 H-Bridge that you linked above.

In any case, if you need to reverse polarity, you will need to use the full H-Bridge. The DRV8871 breakout has one full H-Bridge. The Feather Motor Wing has 2 full H-Bridges.

Do you have a spec sheet for the solenoids you are intending to control? You need to understand the voltage and current requirements to make sure that you choose an H-Bridge that is capable of driving it.

adafruit_support_bill
 
Posts: 74907
Joined: Sat Feb 07, 2009 10:11 am

Re: How to control Solenoids with Feather Huzzah

by Munque on Fri Apr 26, 2019 9:17 am

adafruit_support_bill wrote:"H-Bridge" and "motor controller" are the same thing. You don't need both.

Thanks for that.

adafruit_support_bill wrote:
The H-Bridge page says it can "control up to 4 solenoids". Is that 4 latching or non-latching solenoids?

Can you post a link to where it says that? That is not an accurate statement for the DRV8871 H-Bridge that you linked above.

The link above points to Product 807 / Dual H-Bridge Motor Driver for DC or Steppers - 600mA - L293D
This is the item I have.
The "up to 4 solenoids" bit is in the 2nd paragraph, second sentence of the Description section: "Each chip contains two full H-bridges (four half H-bridges). That means you can drive four solenoids, two DC motors bi-directionally, or one stepper motor."

For reference, the links to the items you are referencing:
Product 3190 / Adafruit DRV8871 DC Motor Driver Breakout Board - 3.6A Max
Product 2927 / DC Motor + Stepper FeatherWing Add-on For All Feather Boards
Correct?
These I don't have.

adafruit_support_bill wrote:Do you have a spec sheet for the solenoids you are intending to control? You need to understand the voltage and current requirements to make sure that you choose an H-Bridge that is capable of driving it.

These should be the relevant specs. LMK if you need others:
    Brand / Model: EHCOTECH DDT-ML-4.5VDC
    Inlet / Outlet Port Size: 1/2" Parallel Pipe Thread Voltage: 4.5VDC (operates up to 9.0 VDC)
    Valve Body / Seal: Nylon / EPDM Rubber MPN
    Valve Type: 2-Way, Magnetically Latching
    Voltage: 4.5VDC (operates up to 9.0 VDC)
    Operation: 50 ms (min) pulse opens valve / 50 ms pulse (min) with reverse polarity closes valve
    Leads: 2 - 12" Electrical Leads
    2.5 W power consumption at 4.5VDC

Munque
 
Posts: 11
Joined: Fri Apr 12, 2019 11:51 pm

Re: How to control Solenoids with Feather Huzzah

by adafruit_support_bill on Fri Apr 26, 2019 9:33 am

The L293D can drive up to 2 devices with the ability to change polarity - or 4 devices with no polarity change.

Brand / Model: EHCOTECH DDT-ML-4.5VDC
Inlet / Outlet Port Size: 1/2" Parallel Pipe Thread Voltage: 4.5VDC (operates up to 9.0 VDC)
Valve Body / Seal: Nylon / EPDM Rubber MPN
Valve Type: 2-Way, Magnetically Latching
Voltage: 4.5VDC (operates up to 9.0 VDC)
Operation: 50 ms (min) pulse opens valve / 50 ms pulse (min) with reverse polarity closes valve
Leads: 2 - 12" Electrical Leads
2.5 W power consumption at 4.5VDC

2.5 W power consumption at 4.5VDC means it will draw 0.56A at 4.5v. If you powered it from 5v, it would draw about 0.62A.

The L293D is rated for up to 0.6A continuous, So you would be pushing the limits powering it with 5v. However, the solenoid only requires a 50ms pulse, so you should be OK if you keep the pulses short.

adafruit_support_bill
 
Posts: 74907
Joined: Sat Feb 07, 2009 10:11 am

Re: How to control Solenoids with Feather Huzzah

by Munque on Fri Apr 26, 2019 11:18 am

adafruit_support_bill wrote:The L293D can drive up to 2 devices with the ability to change polarity - or 4 devices with no polarity change.

Thanks for clarifying. Very helpful.

adafruit_support_bill wrote:The L293D is rated for up to 0.6A continuous, So you would be pushing the limits powering it with 5v. However, the solenoid only requires a 50ms pulse, so you should be OK if you keep the pulses short.

Thanks again. Suddenly making more sense the difference between the various H-Bridges. If we switch to non-latching solenoids, it would mean a different device.

Still trying to get clear on the Huzzah / H-Bridge / solenoid wiring.

Munque
 
Posts: 11
Joined: Fri Apr 12, 2019 11:51 pm

Re: How to control Solenoids with Feather Huzzah

by adafruit_support_bill on Fri Apr 26, 2019 11:39 am

Wiring for the L293D can be found here: https://learn.adafruit.com/adafruit-ard ... -reversing

Note that you will need 4 GPIO pins per L293D H-bridge. To control 5 bidirectional solenoids, you would need to have 20 GPIO pins.

The Feather/Motor Wing approach suggested by Franklin earlier would be a lot simpler. You can control a whole stack of wings with just 2 pins and each Wing can drive 2 of your solenoids. To connect them, you simply stack them. No jumper wires are required.

adafruit_support_bill
 
Posts: 74907
Joined: Sat Feb 07, 2009 10:11 am

Re: How to control Solenoids with Feather Huzzah

by Munque on Sun Apr 28, 2019 12:06 pm

adafruit_support_bill wrote:Wiring for the L293D can be found here: https://learn.adafruit.com/adafruit-ard ... -reversing

Wow, brilliant thanks for that. Between your link (and a few others) I managed to get a solenoid setup up and running. Amazing.

Re-capping what worked along with some additional questions
Key Devices:

Connections (With the L293D facing notch to top) (Diagram attached at the bottom)
    • Pos power for solenoid connects to L293D pins 1, 8, and 16
    • Neg for solenoid (ground) connects to L293D pin 4
    • One Huzzah PWM-Capable GPIO Pin connected to L293D pin 2 (PWM-Capable GPIO Pins on the Huzzah Breakout are 0, 2, 4, 5, 12, 13, 14 and 15)
    • A 2nd Huzzah PWM-Capable GPIO Pin connected to L293D pin 7
    • Solenoid Lead #1 (Polarity shouldn't matter) connected to L293D pin 3
    • Solenoid Lead #2 connected to L293D pin 6

Operation
Pulsing one of the two GPIO pins on, with the other off, will switch the solenoid
Solenoid on/off determined by which GPIO is pulsed.
The required duration of the pulse depends on the solenoid -- in my case 50ms
If both Huzzah GPIO pins are off (or on) the solenoid will remain in place.

QUESTIONS
    • Does power need to be attached to L293D's pin 16?
    • How would non-latching solenoids change the wiring? Any references / advice greatly appreciated.
    • Assuming the L293D can control 4 non-latching solenoids, would that mean 4 solenoids each controlled independently, or merely 2 pairs of 2, the pairs independent of one another? (I'm only half-understanding the H-Bridge logic / 'full' vs 'half-H-Bridges' issue at this point)
    • Per your/Franklin's suggestion I'm looking at other motor controllers. For stacking I'm seeing the Stepper FeatherWing. Are there others I haven't found? Also thinking through the following: DRV8833, DRV8871, and DRV2605L,
    • When does the issue of "PWM-capable GPIO Pins" into play? I was expecting to have to code something about frequency and square waves, but because the whole thing just worked I'm not sure what that's about. Perhaps it's not relevant to solenoids?

Again, thanks for all the pointers and insights. I got from cluelessness to a functioning solenoid setup in a few brain-racking days.

H-Bridge.jpg
Attached diagram
H-Bridge.jpg (54.12 KiB) Viewed 249 times

Munque
 
Posts: 11
Joined: Fri Apr 12, 2019 11:51 pm

Re: How to control Solenoids with Feather Huzzah / Breakout

by adafruit_support_bill on Sun Apr 28, 2019 2:00 pm

• Does power need to be attached to L293D's pin 16?

Yes. Pin 16 is used to power the circuits on the chip. Pin 8 is used to provide power to the motor.
How would non-latching solenoids change the wiring? Any references / advice greatly appreciated.
Assuming the L293D can control 4 non-latching solenoids, would that mean 4 solenoids each controlled independently, or merely 2 pairs of 2, the pairs independent of one another? (I'm only half-understanding the H-Bridge logic / 'full' vs 'half-H-Bridges' issue at this point)

You could wire one solenoid to each half-bridge. (the second solenoid wire would go to GND). You can control each of the half-bridges independently.
Per your/Franklin's suggestion I'm looking at other motor controllers. For stacking I'm seeing the Stepper FeatherWing. Are there others I haven't found?

www.pololu.com has a large selection of DC motor and stepper controllers.
When does the issue of "PWM-capable GPIO Pins" into play?

That is only needed if you want to modulate power to the solenoid. For you latching solenoids, it is a non-issue, since you can actuate them with just a pulse. For a conventional solenoid, you need to apply power continuously to hold position once actuated. It is often desirable to reduce current flow to the solenoid once actuated to reduce power requirements and limit heating of the coil.

adafruit_support_bill
 
Posts: 74907
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.