This Arduino Solenoid Tutorial shows how to control a solenoid using pushbuttons and a relay with your Arduino compatible controller. Solenoids are electromagnetically driven actuators. When voltage is applied to the solenoid coil the electromagnetic force pulls the center plunger in. It is an excellent mechanical solution for all kinds of DIY projects requiring short quick linear actuation. Solenoids are most often found in latching and trigger-like mechanisms, such as door locking systems, paintball guns, pinball machines, dot matrix printers, and fuel injectors. Let's get started.
These are the parts recommended to follow through the tutorial while it is possible to complete this tutorial with other parts (or less parts, as in a single solenoid, relay, and pushbutton), and the concepts learned in this can be applied to other relays, solenoids, and Arduino compatible boards and shields, we recommend these parts for the easiest transfer of this knowledge.