Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Motors & Actuators

Solenoid Guide: Door Locks, Valves, and Automation Projects

Solenoid Guide: Door Locks, Valves, and Automation Projects

April 1, 2026 /Posted by / 0

A solenoid is an electromechanical device that converts electrical energy into linear motion. When you energise the coil, a plunger moves in or out — and this simple action powers everything from door locks and water valves to pinball machines and vending machine dispensers. This guide covers solenoid types, how to safely drive them with Arduino using relays and MOSFETs, and practical project ideas for automation.

Table of Contents

  • Solenoid Types
  • Understanding Specifications
  • Driving Solenoids Safely
  • Relay Circuit
  • MOSFET Circuit
  • Project Ideas
  • Frequently Asked Questions

Solenoid Types

Push-Type Solenoid

The plunger pushes out when energised and retracts via a spring when de-energised. Used for door lock bolts and ejector mechanisms.

Pull-Type Solenoid

The plunger pulls in when energised. Used for latches, lever actuation, and valve opening.

Solenoid Valves

Solenoid with an integrated valve body. Normally closed (NC) valves open when energised, normally open (NO) valves close when energised. Used for water, air, and gas flow control.

Electromagnetic Locks

Holding solenoids that create a strong magnetic field to hold a door or gate. Release when power is cut (fail-safe for fire safety).

🛒 Recommended: 12V DC Solenoid Door Lock (7.5W) — Standard push-type solenoid for electronic door lock projects. Compact and reliable.

Understanding Specifications

Specification Meaning
Voltage Operating voltage (5V, 12V, 24V). Must match your supply.
Current Continuous draw when energised. Typically 0.3-2A.
Force Push or pull force in Newtons or grams.
Stroke Distance the plunger travels (5-30mm typical).
Duty Cycle Maximum on-time percentage before overheating.

Driving Solenoids Safely

Never connect a solenoid directly to Arduino. Solenoids draw far more current than Arduino pins can supply (40mA max). Use a relay module or MOSFET with a flyback diode.

The flyback diode is critical — when a solenoid de-energises, its collapsing magnetic field generates a voltage spike (back-EMF) that can destroy transistors and microcontrollers. A diode placed across the solenoid absorbs this spike.

Relay Circuit

The simplest approach uses a relay module to switch the solenoid power:

  • Arduino digital pin → Relay module IN
  • Relay module VCC → Arduino 5V, GND → GND
  • Relay COM → 12V supply positive
  • Relay NO → Solenoid positive
  • Solenoid negative → 12V supply negative

const int relayPin = 7;

void setup() {
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin, HIGH); // Relay off (active low)
}

void loop() {
  digitalWrite(relayPin, LOW);  // Activate solenoid
  delay(1000);                   // Hold for 1 second
  digitalWrite(relayPin, HIGH); // Release
  delay(3000);
}
🛒 Recommended: 12V DC Solenoid Water Valve (Normally Closed) — Control water flow with Arduino. Opens when 12V is applied, great for automated irrigation and tank filling.

MOSFET Circuit

For faster switching and PWM control, use an N-channel MOSFET (like IRF540N):

  • Arduino PWM pin → 220 Ohm resistor → MOSFET gate
  • MOSFET drain → Solenoid negative
  • MOSFET source → GND
  • Solenoid positive → 12V supply
  • 1N4007 diode across solenoid (cathode to positive)
  • 10K resistor from gate to GND (pull-down)

Project Ideas

  • RFID Door Lock: Read an RFID card, verify the UID, activate the solenoid lock for 3 seconds.
  • Automatic Plant Watering: Solenoid valve opens based on soil moisture sensor readings.
  • Sorting Machine: Solenoid pushers activated by colour or weight sensors to sort objects into bins.
  • Smart Letterbox: Solenoid locks the letterbox; notifies via WiFi when mail is detected.
🛒 Recommended: 12V 8KG Lifting Electromagnet — A holding electromagnet for magnetic grippers, door hold-open mechanisms, and pick-up applications.

Frequently Asked Questions

Why does my solenoid get very hot?

Solenoids are designed for intermittent duty. Keeping them energised continuously overheats the coil. Use PWM to reduce holding current after initial pull-in, or choose a solenoid rated for continuous duty.

Can I control a solenoid valve with PWM?

Solenoid valves are binary (open/closed), so PWM does not provide proportional flow control. However, you can use PWM to reduce holding power after the valve opens — full power to open, then 50% PWM to hold, reducing heat.

What is a flyback diode and why is it important?

When a solenoid de-energises, its coil generates a reverse voltage spike that can reach hundreds of volts. A flyback diode (1N4007) placed across the solenoid absorbs this spike, protecting your MOSFET, relay, or Arduino from damage. Never omit this diode.

Conclusion

Solenoids are the simplest actuators for on/off linear motion. Whether you need to lock a door, open a valve, or push an object, a solenoid driven by a relay or MOSFET from Arduino provides a reliable, cost-effective solution. Just remember: use a flyback diode, never exceed the duty cycle, and always use external switching — never drive a solenoid directly from Arduino pins.

Shop solenoids, valves, and electromagnets at Zbotic.in.

Tags: Arduino, automation, Door Lock, Solenoid, Valve
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Arduino Level 4: WiFi and IoT ...
blog arduino level 4 wifi and iot with esp32 612702
blog number plate recognition system esp32 cam anpr project india 612709
Number Plate Recognition Syste...

Related posts

Svg%3E
Read more

Gear Motor Guide: N20, JGB37, and Planetary Motors Compared

April 1, 2026 0
When your project needs more torque than a bare DC motor can provide, a gear motor is the answer. By... Continue reading
Svg%3E
Read more

Miniature Pump Hydroponics: Automated Nutrient Dosing System

April 1, 2026 0
Hydroponics grows plants in nutrient-rich water instead of soil, and automating the nutrient dosing process with peristaltic pumps and Arduino... Continue reading
Svg%3E
Read more

Drone Motor Testing: Thrust Stand Build and KV Measurement

April 1, 2026 0
If you are building a drone, selecting the right motor-propeller combination is critical for flight performance. A drone motor thrust... Continue reading
Svg%3E
Read more

Pump Selection Guide: Peristaltic, Submersible, and Diaphragm

April 1, 2026 0
When your Arduino project needs to move liquid — whether for automated plant watering, hydroponics, aquarium management, or a coffee... Continue reading
Svg%3E
Read more

Motor Driver Comparison: L298N vs L293D vs TB6612 vs DRV8825

April 1, 2026 0
Choosing the right motor driver can make or break your project. The electronics market offers dozens of options, each suited... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now