vin & 5v. How do I use both simultaneously?

Hopefully this is an easy question to the veterans out there. I did search the forum but couldn't figure this out. I am creating a project where my Arduino Duemilanove is going to power a 12vdc door lock and a 5v rf id reader.

I am powering my arduino via a 12vdc connection via power jack.

Got reader working. Then got door locker working. Can't get them working at the same time. I busted out my multi meter and noticed that the vin and 5v aren't producing the 12v or the 5v. But they are both less? I am guessing the board is splitting the power, but I am confused how.

Thanks for the insight or if you have a link I am not afraid of reading and helping myself figure this out.

Vin allows you to connect a 5v supply TO the Arduino, it doesn't give you the voltage that you're supplying elsewhere. The 12v input goes straight to the 7805 regulator to be turned into the 5v that the Arduino uses exclusively.

To switch 12v, you will need an external transistor as a bare minimum. Do a search for "Arduino switch 12v" or similar, you will find loads of examples.

Ok you set me on the right track., but I have some follow ups. I am already using an NPN transistor with digital pin from the arduino to switch the voltage for the door lock but I was having all the power go through the arduino to the transistor. The reasoning for this is I have an 12v dc AC/DC wall adapter with a 2.1mm plug on hand.

My door lock just has two wires, no 2.1 mm plug. So how do most people do the power in this case? Can I just cut the 2.1 mm plug off my wall adapter and put the wires right into my breadboard (eventually a pcb)? Or is there a better product / item to do this?

Thanks for the help.

Ok here is a sample schema of just the doorlocker part that I am trying to build. As you can see I am powering the board with the AC/DC wall adapter and then using the VIN to power the door lock and sending it through the transistor to turn it on and off. Looks very similar to the schema you posted except I am using the vin on the arduino to connected to the door locker. This way I can have one AC/DC adapater and power my arduino and the door locker.

Question, does this not look correct or do I really need an external power supply for the adruino and a separate one for my door locker?

Question, does this not look correct or do I really need an external power supply for the adruino and a separate one for my door locker?

That wiring is correct, but if it will work requires knowing the current requirement specification for the door lock. Your 12vdc module also has a maximum current rating. The power module's current rating must be higher then the door locks current requirement. Also be aware that there is a series polarity protection diode on the Arduino board that is installed between the external power connector and the Vin pin, which normally is a 1 amp diode, so one risks damaging the diode if total current draw by the board and any external load on the Vin pin draws more then one amp.

Lefty

You can bring the power into a barrel Jack. 12v. Then split it. Use one of the 12v and gnd on the vin and gnd to power your ardunio and use the other 12v and gnd to send to the door lock.

That's what I did anyway....