Xwhatsit solenoid driver alternative

kmnov2017

16 Nov 2019, 01:31

I thought this needs mentioning, you can use a 50 cent relay to drive the solenoid. Yes that’s all one needs!

Earlier this year, I tried to assemble a few solenoid drivers but abandoned the project as SMD soldering needs ninja soldering skills. So with a bit of research and reading around, the idea of a relay came along. A few weeks ago user ZedTheMan wrote to me that he already used a relay to get his solenoid running on his beamspring.

So what exactly is a relay? A relay is basically a device that triggers power on and off to a connected device. The input to trigger on/off will still come from the keyboard controller (Xwhatsit, Cypress, Arduino....). The device in this case is the actual solenoid. However, beamspring solenoids are rated at 8.5V - which means you can’t power it natively with USB. To get 8.5/9V you will need either an external power source (like a wall adapter or an external battery) OR boost the 5V output from USB to 9V using a DC DC boost converter (costs around 1 EUR).

That’s all one needs to get the solenoid working - 1.5 euros worth of parts. And now that one thinks of it, I wonder why xwhatsit didn’t just recommend using off the shelf products for the solenoid driver.

User avatar
ZedTheMan

16 Nov 2019, 05:38

I'm going to purchase a DC DC boost converter, and test out to see if that can be used to replace my 9v battery.

kmnov2017

17 Nov 2019, 00:28

So here's how the schematics look
solenoid_ed.jpg
solenoid_ed.jpg (298.07 KiB) Viewed 422 times
Updated: Added a Diode for safety.

Notice the Labels on the Relay. It is IMPORTANT that you connect the cables correctly. The sequence of pins will differ by manufacturer. For the output you will need to connect to "COM" and "NO". This is assuming you are using a Low Level Relay. Some relays will have a jumper to set High Level or Low level. Set jumper to Low Level Relay.
Input labels should read GND, VCC and IN or DC-, DC+ and IN.

Special thanks to user: ListofOptions for reviewing the circuit and ZedtheMan for the initial proof of concept
Last edited by kmnov2017 on 18 Nov 2019, 01:08, edited 5 times in total.

User avatar
ZedTheMan

17 Nov 2019, 02:15

Ive been working with kmnov on this. I should be able to start testing on Monday when DC DC boost converters come in.
I am willing to be the guinea pig to see if we can get this working without the USB external power as well. If it breaks a cypress, It'll suck but I will get another.

User avatar
hypkx
Chasing the Dream

17 Nov 2019, 13:20

I hope this thread becomes more popular, I thought about this solution since some time, but only have limited programmibilty skills and the power source was also the problem.

DMA

17 Nov 2019, 19:44

Erhm.. please don't drive inductive loads from GPIO. You'll fry the GPIO. They'e specced for 4mA source current and you're trying to pull SEVENTY, if datasheet doesn't lie: http://www.circuitbasics.com/wp-content ... asheet.pdf

The important parts of xwhatsit's solenoid driver is that it's a 9V boost converter with an input current limiter, huge-ass capacitor behind it, and 9V solid-state relay.

If you absolutely detest SMD components (they aren't that hard to solder, btw - just get a good iron and a lot of flux) - there are thru-hole versions for most of the stuff. Not current limiter though.

There are 2 reasons not to use "off-the-shelf products":
1) space.
2) cost - those modules were much more expensive back in the day. Although I've heard there are small prototype PCBA services nowadays which don't mind assembling small runs and have standard component library so you don't even need to source components. I forgot the name but will ask around.

kmnov2017

17 Nov 2019, 22:50

Personally I prefer to use a solid state relay as well. The diagram only represented the wiring against relay pins, I'll change it to a solid state relay. Also, I'll use a parallel usb for the source of power for the relay.

DMA

18 Nov 2019, 00:10

kmnov2017 wrote:
17 Nov 2019, 22:50
Personally I prefer to use a solid state relay as well. The diagram only represented the wiring against relay pins, I'll change it to a solid state relay. Also, I'll use a parallel usb for the source of power for the relay.
I was a bit incorrect - relay is high-side, so it will work with a power supply capable of delivering solenoid's "on" current (the "don't drive relay from GPIO" part still stands)

Boost converter, especially powered from the same USB socket, and especially not having a big buffer capacitor, will not be amused by suddenly increased load and will suck enough current out of USB socket to trip the (hopefully resettable) fuse - powering down the controller. Best case there is converter's own controller shuts down from self-inflicted undervoltage before fuse trips. PSoC is likely to ride out that voltage dip, because of 1uF buffer capacitors on it's core's power rails and because core actually runs at 1.71V.

kmnov2017

18 Nov 2019, 01:28

DMA wrote:
18 Nov 2019, 00:10
kmnov2017 wrote:
17 Nov 2019, 22:50
Personally I prefer to use a solid state relay as well. The diagram only represented the wiring against relay pins, I'll change it to a solid state relay. Also, I'll use a parallel usb for the source of power for the relay.
I was a bit incorrect - relay is high-side, so it will work with a power supply capable of delivering solenoid's "on" current (the "don't drive relay from GPIO" part still stands)

Boost converter, especially powered from the same USB socket, and especially not having a big buffer capacitor, will not be amused by suddenly increased load and will suck enough current out of USB socket to trip the (hopefully resettable) fuse - powering down the controller. Best case there is converter's own controller shuts down from self-inflicted undervoltage before fuse trips. PSoC is likely to ride out that voltage dip, because of 1uF buffer capacitors on it's core's power rails and because core actually runs at 1.71V.
How much is the total power draw by the Cypress board?

At 9V, the solenoid should draw around 200 to 250, lets say 250mA. The relay around 75mA. If the Cypress board draws a max 200mA, then a standard USB port with 500mA power output should be fine.

DMA

18 Nov 2019, 06:32

9V 250mA is 450mA from 5V, assuming 100% conversion efficiency. Just the solenoid blows you out of power budget.

CS by itself consumes ~25mA, up to 36mA in some modes.

DMA

24 Nov 2019, 02:04

btw, https://www.seeedstudio.com/fusion.html has free PCBA for 5 PCB copies. Shouldn't be dramatically more expensive than rigging from ebay-sourced modules.

User avatar
ZedTheMan

30 Nov 2019, 19:30

Good news all! I've been doing some testing, and managed to get this alternative working via only one USB port, using vdd and gnd from the cypress. (Admittedly, it required some tuning with the potentiometer. 8.5v output managed to work though without causing the cypress to turn off.) Edit: solenoid works fine with less voltage. I recommend this to give yourself more headroom.

That is, this is still a solution to use at your own risk, but initially it seems to work. If you do not feel comfortable using only 1 USB for powering all of it, you can use a second USB port/cable. Both have worked for me.
Attachments
1130191218-min (1).jpg
1130191218-min (1).jpg (1.21 MiB) Viewed 131 times
1130191152b-min (1).jpg
1130191152b-min (1).jpg (1.47 MiB) Viewed 131 times
1130191152a-min.jpg
1130191152a-min.jpg (1.06 MiB) Viewed 131 times

Post Reply

Return to “Workshop”