relay solenoid arduino

Hi Guys, We're doing project regarding on thesis . we just want to know how solenoid lock works using arduino. Our thesis is make the usb will be the key for the solenod lock :slight_smile: hope who knows or have an idea for this question will comment below. thanks for suggestion.

That's a thesis? About 3 minutes of coding to read data from the serial port, and an Arduino to control a transistor to drive the coil of a solenoid to let it unlock something?

We used Arduino mega to make this happen, a 12v solenoid lock and a 5v relay
and powersupply. but we cant make it i dont know why and we're lacking of knowledge.

We wanted to make a USB DOOR LOCK, The flash drive will be the key. Anyone can comment and suggestions are open thank you very much. we wanted to finish this. Your help is much appreciated and we will credit it on our thesis :slight_smile:

Do you really need a mega for this? You are dealing with only one pin.

It will be good not to drive the relay from Arduino IO pin.

Have a look at one of my post to see how to drive a relay module.

A schematic of your system also help us to trouble shoot the issue.

Also to drive a Solenoid, you might not require a relay module. As @CrossRoad suggested the transistor based approach will be enough. Also might require a flyback diode, to prevent any back emf.

how can we make the usb flash drive as a key? what codes will we use?

we here ah arduino mega, usb host shield, solenoid 12v, relay 5v and 12v, breadboard, power supply, flash drive. how can we make it? how to fix the circuit and how to program it?

I just did a google [search](http://"Google usb drive %2B arduino") and can see a lot of tutorials explaining how to read a USB drive. I haven't tried reading a USB drive, so i dont have any code.

I should say, start one piece at a time.

  • Try some experiments with the USB Shield and see how to ready a flash drive.
  • Try connecting the relay module and see how to control a relay.

There are different types of components and shields in the market, posting a link to the components you owned will help others to make some valid comments.

I dont think any one can help you in this area of forum, without you showing some progress on your own. If you want to get it done completely from some one, try Gigs and Collaboration section.

For electronics related questions, start in General Electronics section.

we are going to upset for this. hopefully we finish this in 5 days. We are planning to change the 12v solenoid lock to 5v lock. to make it directly to arduino. instead of using a relay for 12v to 5v of the arduino. Any suggestion for this idea so we can make a right decision. :slight_smile: thank you for all your suggestion and comments :slight_smile:

Solenoid is an inductor load, also it can draw more current than Arduino pin can provide, and might damage the pin. Try to drive the Solenoid using a Transistor and power it seperately, also use a flyback diode.

Link to the page

Connect the solenoid instead of Relay.