Hello! I followed the youtube video titled " How To Control A Solenoid With A Raspberry Pi Using a Relay". I bought the identical components, except, I bought this solenoid: 6V Electric Push Rod - 10mm - 128N - ROB-18756 - SparkFun Electronics
I followed the set up process according to the youtube. When I ran the code the solenoid arm pushed out, but it will not retract. Now, when I run the code, the relay just clicks and nothing at all moves.
Can you push it back with your finger??
You might fine it depends on a spring or other resistance in the pushed object to push the armature back in. Like a larger push button switch. It will not return on its own unless it has a built in spring system.
Hi Bob! Thanks for your reply, shortly after posting this I also realized the same thing. The code requires it to have a spring. Also, I am powering the 6V actuator with a 12v PS, so I think that is a risk. I am going to get a 5v actuator with a spring and a 5v power supply and it should work just fine then.
Just for my knowledge…as I am pretty new to this…would I be able to write code involving GPIO that would make the current actuator retract?
Some types of actuators will reverse if you supply a reverse voltage. You could do this with a relay or switching arrangement - one GPIO is wired to the push rod with a particular polarity arrangement, and another GPIO is wired with the opposite arrangement, in much the same way that a DC motor can be arranged to go in either forward or reverse. However in this case if it was possible I would expect that at least one of the distributors would mention this option, and they don’t.
Not that one I don’t think. It would have to have a magnet for the armature and some indication of positive and negative connection. These types do exist but not all that common. The 2 red wires are an indication that this one is not polarised.
That is a bit silly and risky. It is marked 6V for a reason and although most will stand a bit of over voltage 100% is a bit much. The only thing that probably saved it is the 12v supply might not have been able to supply the current and the voltage sagged enough not to cause burn out.
True, but as I just pointed out the armature has to be a magnet and they are not all that common. Also you would think that some sort of polarity indication would be used. That one has 2 red wires and although I have not looked up the specs I don’t think it would be polarised.
A reversing relay or switch arrangement is usually a DPDT system so there is no chance of a short on the power supply. It is a common approach and sometimes easier and better than the H bridges in use to-day, especially if it is required to “creep” a motor very slowly from standstill which you can’t do with most H bridges. There is a reason for this which I won’t go into here but message if you are interested.
PS. I think some of the points actuators on model trains may be the reversing type solenoids or very small motors.