30ms is quite fast.
diyelectronics
Some of those water solenoids are made to run off 24VAC. What is the model of solenoid you are using, and have you confirmed operation without the pi?
Interesting. I've never seen a solenoid want an hbridge to drive it.
Give it what it asks for
https://arduinoyard.com/l298n-motor-driver-with-arduino/
Edit Forgot this was for a pico. Same basic ideas.
https://microdigisoft.com/control-dc-motor-using-l298n-raspberry-pi-pico-micropython/
Thanks for the help btw. Together with other comments I will look into this. I thought it was a nice and easy project to start with😅
They never go how we think they will. Learning along the way is what's fun, for me at least. Please update when you get there or get stuck again.
Could you clarify a few things? The circle symbol is meant to represent the voltage supply? Is it connected correctly? When you say solenoid, you mean an electromagnet, right? If so, why does it require that specific pulse with? You say you swapped out the LED for the coil, was the LED tested with MOSFET and diode in place? Does the solenoid engage when you take the connection off the RP2040 and drive it high directly? How did you ascertain the functioning of the solenoid by means of measuring resistance?
But if I connect it to the 5v power supply directly it will destroy the coil according to the specs https://www.tinytronics.nl/en/mechanics-and-actuators/solenoids/solenoid-valves/solenoid-valve-latching-5v-brass-g1-2
No, the diode was not tested with the led but with the voltage meter on diode mode, I verified the diode works (I even flipped the diode for testing).
I tested the solenoid by setting the multimeter to resistance and connect the testing probes to the solenoid
So the setup you have is not going to work. Even if you managed to get the valve to engage, it'll require a negative voltage pulse to disengage according to the specs you linked above.
Thanks, i see what you mean now. Would another valve like the one below work with my setup? My power adapter supports 12v so that is no problem.
The idea with the first valve is to drive it with an H-bridge. This allows for reversing polarity and is commonly used with motors to allow for spinning in two directions. This requires 4 MOSFETs. I'm not sure what type of MOSFET you are using but if you can find a simple dc motor to test this setup you can verify that it works with the one you have before you extend the circuit to an H-brigde configuration. This would be cheaper than buying another valve. You'd need two GPIO pins and careful design to not short circuiting the H-bridge.
Thanks for the help btw 🙂
Of course. Let me know how you're getting on.
I see. I have 4 valves for the system I want to make. I don't think my prototype board is large enough for 4 h bridges. Either I buy the other valves or some of these I suppose. https://www.tinytronics.nl/en/mechanics-and-actuators/motor-controllers-and-drivers/dc-motor-controllers-and-drivers/l298n-bipolar-stepper-motor-and-dc-motor-motor-controller
