I have a device that is a custom made Arduino. I do not have access to the code. As it is there’s a function that happens where it turns a servo 45° then back in order to move an arm. I would like to change the servo to an electromagnet solenoid mainly due to size and weight of the servo. Is it possible to use the servo wires and the existing code to trigger the solenoid. I need the solenoid to activate for approximately 1-3 seconds then deactivate
no. servo and solenoid are controlled differently.
Welcome to the forum
The servo is controlled by a PWM signal so it is not directly applicable to driving a solenoid. It would be possible to read the PWM signal with another Arduino and convert it into a digital output to drive a solenoid via a relay or MOSFET
Even though you do not have access to the current code it could be rewritten to do what you want. What else does the system do ?
That's probably going to be even bigger than the servo whose size he has a problem with.
Of course it would, hence me saying
The best solution would be to rewrite the sketch to use the solenoid instead of the servo but that too would involve extra external hardware
If you are into Rube Goldberg, have a logically-exact replacement servo, and know the range of the servo horn, you might consider using servo movement to break a beam or press a button to activate a relay to move the solenoid. MOUSETRAP!
You could attach a linkage of length n to the end of the servo horn with a little J-shaped hook bent in the end (like a fishing hook) and allowed to swivel freely in the servo horn.
Then affix the other end of the linkage (where you'd thread fishing line in the fishing hook analogy) to the thing you want to lift.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.