Persistant noise from solenoid valve

dendad

Joined Feb 20, 2016
4,451
Changing to analog power supplies is a good start.
Use a separate one for the solenoid, and have it optically coupled to the RasPi so there is no electrical connection between them.
I think one problem is there are more that one ground paths.
Have you thought of a pneumatic operation, or have a length of plastic from the solenoid to the valve to isolate it that way?

You may find having all grounds run back to the milk dish can fix it. And that is the only place they all meet. This is very much like the single point ground in an audio amplifier.
If the milk tube has a metal (Stainless steel?) section that is grounded to the dish, the shield of the sensor also, so then the rat will be at the same ground potential as the Pi and the milk.

This will be interesting to see how it all works out. Please keep us posted.
 

Kjeldgaard

Joined Apr 7, 2016
476
I have been around some thoughts whether it is capacitive, inductive or acoustically transmitted?

Can a limitation of the rise and fall times on the actuator control signal give some dB better signal noise ratio?
 

Thread Starter

KG0403

Joined Oct 5, 2018
33
Can a limitation of the rise and fall times on the actuator control signal give some dB better signal noise ratio?
Do you mean the signal coming from the Pi to the transistor? That would be set by the GPIO pins and the transistor switching time, right? How would you limit it with external circuitry?
I actually attempted to increase the base/gate rise and fall time with a capacitor between gate and source, thinking that maybe it would lead to a more gradual turn off of the transistor. I was thinking maybe it could reduce the instantaneous kickback voltage from the solenoid current stopping. It didn't work, and I don't think my logic was fully baked on that one..


Changing to analog power supplies is a good start.
Use a separate one for the solenoid, and have it optically coupled to the RasPi so there is no electrical connection between them.
I think one problem is there are more that one ground paths.
I've ordered some parts to put together two linear power supplies, should be in Friday. My plan is to make one for the pre-amp and one for the solenoid.

Changing to analog power supplies is a good start.
You may find having all grounds run back to the milk dish can fix it. And that is the only place they all meet. This is very much like the single point ground in an audio amplifier.
If the milk tube has a metal (Stainless steel?) section that is grounded to the dish, the shield of the sensor also, so then the rat will be at the same ground potential as the Pi and the milk.
This is interesting. The milk dish, and in fact the entire chamber that the rat is in is acrylic. I had made it this way because that's just what I had seen before, and acrylic was available and easy to work with. If the floor was metal, and the milk dish was metal, and those plates were grounded, do you think that might help with grounding the rat?
 

Thread Starter

KG0403

Joined Oct 5, 2018
33
Hello everyone if you're still following this. During the debugging process I had a rat chew up an expensive part of my recording equipment and I had to fix that, then we had a hurricane and got kicked out of the lab for 5 days (everyone is safe, no problems here). In any case, it's been a longer process than I'd anticipated, but I didn't just want to leave the problem dangling for anyone interested.

I installed a 12V linear power supply, and switched my pre-amp power supply (+/- 5V) to a separate outlet from the RPi and the solenoid power supplies. It seemed to help a little but not completely.
12V linear power supply schematic:
upload_2019-7-16_14-48-2.png
I also added an air gap using an IV drip chamber, which initially seemed to work, but then introduced a huge voltage spike that saturated my signal amps and made everything worse. I suspect charge built up in the lower reservoir of fluid that was now disconnected from the upper one. Maybe there was some kind of static, I'm not sure.
I stuck with the air gap idea, and rigged up a little piece of acrylic to hold the pipette tip far enough away that the rat has no chance of touching it via direct contact or fluid buildup. Basically, when the solenoid is activated, it shoots milk through a hole in the wall into a divot in the floor, and any leftover drips just drop outside of the chamber. It seems to work, although testing is preliminary.

Thanks for all the help and suggestions, everyone. Fingers crossed that this solves my problems and I can wrap up this project in the not too distant future.
 

BobaMosfet

Joined Jul 1, 2009
2,110
Putting an air gap between the rat and the milk helped. I achieved this by retracting the tip a little bit from the hole in the wall of the chamber, so it might not have been perfect isolation, but it definitely helped:

Wide view:
View attachment 180904

Close-up solenoid open:
View attachment 180905

Close-up solenoid close:
View attachment 180906

I'll work on some ideas to get full isolation. The drip chamber is a great idea if I can get it to work. I'm using hydrostatic pressure, I just have to make sure the final delivery has adequate precision in the timing and the quantity.

I personally love the ground the milk idea, it seems simple to me. It's just that it makes the distortion worse when I try it, whether the 12V supply is grounded to the same supply as the pre-amp or left as its own ground. I don't know why that is. I will try the manual dispense idea, operating the solenoid from a battery. In the end though, I'll need to drive it from the Raspberry Pi GPIO. If I use the driver circuit shown in the original post, the grounds would have to be connected. But maybe I could optically isolate the input to the gate/base somehow..

As for an isolation amp on the rat, we use something called a "headstage" with is a set of JFETs with unity gain, but it's external to the rat itself. It attaches right into the plug on the rat's skull, and the cable attaches to that.

I'll report back with more information.

Thank you all.
I circled back on this, and saw your fascinating graphs. My question is this- How does your solenoid work? When do you apply power to it- on open or close pulse? Because if I look at your graph, it looks like you power the solenoid to open, and then turn it off to close it.

Did you notice that your spike is not noise? Did you notice that it is a shift in your entire voltage level on your signals? Which indicates to me that your solenoid is drawing too much current. I would measure the voltage and current of just the solenoid to see if it matches a) parameters of datasheet, and b) that it is getting enough current. If it isn't, voltage will drop while it's on, and rise, when it's off.
 

Thread Starter

KG0403

Joined Oct 5, 2018
33
I circled back on this, and saw your fascinating graphs. My question is this- How does your solenoid work? When do you apply power to it- on open or close pulse? Because if I look at your graph, it looks like you power the solenoid to open, and then turn it off to close it.
Yes, this is exactly how it works. The GPIO pin on the Raspberry Pi goes high (3.3V) for 250 msec. On the rising edge, the transistor turns on and the solenoid is powered, and on the the falling edge the transistor turns off and the solenoid is no longer powered.

Did you notice that your spike is not noise? Did you notice that it is a shift in your entire voltage level on your signals? Which indicates to me that your solenoid is drawing too much current. I would measure the voltage and current of just the solenoid to see if it matches a) parameters of datasheet, and b) that it is getting enough current. If it isn't, voltage will drop while it's on, and rise, when it's off.
I did notice that the voltage level shifts on all channels, and I was thinking that the solenoid circuitry might be doing something to my ground in this case. If I understand your logic, you're saying that the solenoid might not be getting enough current from the 12 V supply that it has, and is siphoning current from elsewhere? Sorry, I'm a little fuzzy. I know the DC resistance is correct, the datasheet lists 50 ohm, and it's right around there. Current would be 240mA, right?
 

Thread Starter

KG0403

Joined Oct 5, 2018
33
I would measure the voltage and current of just the solenoid to see if it matches a) parameters of datasheet, and b) that it is getting enough current. If it isn't, voltage will drop while it's on, and rise, when it's off.
Measured the current at 130-140 mA

So I need to boost the current somehow?

Edit:
This makes sense, I'm actually using the following driver circuit:
upload_2019-7-18_13-3-3.png

Diode is a 1n4001, actually
(from https://www.electronicdesign.com/analog/what-s-all-solenoid-driver-stuff-anyhow)

12V/83ohm = 144 mA
 
Last edited:
Did you ever manually release the milk without turning on the solenoid?

As the Rat drinks the milk, it's becoming more hydrated and more conductive.

Would it be easy to use an air operated solenoid valve with the electric pilot. It does not have to be air per se, Argon, Nitrogen etc.

I used this https://www.asco.com/ASCO Asset Library/asco-series-225-280-sub-miniature-catalog.pdf series of valves for a project I did.
Inert gas generally means you don't have to use lubricated air. The new AC versions hummed until they were taken apart and cleaned, so they were cleaned before putting them into service. I used the 24 VAC and 24 Vdc coils.

You have to buy the bases separate. Two pieces of allthread can manifold up to 10 valves.

==

In another application, where I had the potential of destroying a $1000.00 1-2mm thick glass filter. The solenoid was operated every 2-3 minutes for 2-3 minutes during the work day.

I used one of these https://www.jameco.com/z/K8004-Vell...h-Modulator-Kit-Control-DC-Motors_120539.html and a 24 VDC valve. The "PWM motor controller' had "soft start" built into it, so the solenoid opened slowly.

I also designed one of those "kick versions" for solenoids that was used in shutter applications. Cooling was available, so it was very insufficient.
 

djsfantasi

Joined Apr 11, 2010
9,156
Measured the current at 130-140 mA

So I need to boost the current somehow?

Edit:
This makes sense, I'm actually using the following driver circuit:
View attachment 181965

Diode is a 1n4001, actually
(from https://www.electronicdesign.com/analog/what-s-all-solenoid-driver-stuff-anyhow)

12V/83ohm = 144 mA
I think your 1KΩ resistor on the base of the transistor is too large.

You measure/calculate 144mA for the solenoid circuit. Using a BJT as s switch, you need 14.4mA on the base.

With a 1kΩ resistor, the base current is going to be 5mA but we’ve calculated that you need at least 14.4mA. I’d replace the 1kΩ resistor with a 330Ω resistor
 
Top