Power DC motor from 2 power sources

I am thinking about trying to hack a lock and power the dc motor from its original source (the lock itself) and also from a arduino and h-bridge circuit. I have a question about connecting both power sources to the motor. both power sources operate the motor at forward and reverse directions. What I am afraid of is if I just connect the wires together from both sources at the motor that voltage from one source will feed into the other source and possibly short it out. Is it safe to assume that would be the case? Also could I add a couple of relays to the circuit, put lock power source on the NC contacts, h-bridge source on NO contacts and turn on the relay from a pin on the arduino when I need to operate the motor from the h-bridge? Would that work just fine (what is max current from a pin on arduino and which pin has highest capability) or could I get by using diodes in some manner?

Thanks for the any input.

swilson:
I am thinking about trying to hack a lock and power the dc motor from its original source (the lock itself) and also from a arduino and h-bridge circuit. I have a question about connecting both power sources to the motor. both power sources operate the motor at forward and reverse directions. What I am afraid of is if I just connect the wires together from both sources at the motor that voltage from one source will feed into the other source and possibly short it out. Is it safe to assume that would be the case? Also could I add a couple of relays to the circuit, put lock power source on the NC contacts, h-bridge source on NO contacts and turn on the relay from a pin on the arduino when I need to operate the motor from the h-bridge? Would that work just fine (what is max current from a pin on arduino and which pin has highest capability) or could I get by using diodes in some manner?

Thanks for the any input.

All Arduino pins have the same capability (max 40mA, suggested 20mA) and are not suitable for running a relay directly.
You'll have to switch your relay using a transistor and power it from one of your two sources.
You haven't told us the voltages on those two sources.
You haven't told us how much current your lock takes.

Sorry about that. The lock I am working with is a Schlage BE469NX motorized electronic deadbolt with keypad. It uses 4 x AA batteries and supplies ~6V to the motor when you activate it. Not sure about the current it draws.

I will be using a 9V battery powering arduino and esp8266 via voltage regulator and the 9V will be powering the h-bridge as well. H-bridge will output ~6V to motor when activated.

For some reason, when a 9v battery comes up, I always tend to think of the little 216 transistor battery.
If this is the case then you need to look a bit more closely at current requirements, especially when you're driving motors and then you mention esp8266.
Your drawings are incomplete also.

9V battery through the Arduino 7805 regulator simply wastes 45% of the power cutting 9V down to 5V.
Same with 12V only you lose 7/12ths instead of 4/9ths.

If you use a high efficiency DC DC converter, the excess voltage is turned into moar current that you can feed directly to board 5V. But make sure you adjust the converter or it is fixed 5V output.

What converter you do get, check the current limit. I got cheap adjustable ones for less than $2 ea. They have an output limit of 3A which is more than enough for my needs. However, if I need more current then I can wire more converters in parallel as long as my source can supply the Watts plus small losses.

You should get the motor power all the same voltage (or use a single stronger supply) wired in parallel (series adds Volts, parallel adds Amps), running on a common ground (Arduino too unless you have it isolated) and only only only take signal from the Arduino and not more than about 200 mA (less desired!) from the Arduino.

Thanks for all the replies. I am not powering the h-bridge through the arduino. I am powering the arduino from the 9v through a regulator and then the h-bridge directly from the 9v itself. I will use the arduino to enable the h-bridge when needed.

In this thread I am mostly asking if I should isolate the h-bridge output to the motor from the lock output to the motor to keep from frying anything. If so what is the best solution to do this, relays, diodes, etc.

Yes, isolate the two power circuits from each other. It is possible that they don't interact but it's more likely that there will be problems involving smoke and flames.

While a 9v battery looks 'only a bit smaller' than 4AA batteries, if you look inside a 9v you will find a cluster of really tiny cells. This may or may not be able to provide the peak current that the motor requires. A DC-DC converter will be essential, plus it provides a significant gain (40%) in battery life.

Ok so what you are saying is I will get more current from 6 AA batteries rather that a 9V? That is perfectly doable and I can use 6 AA's instead of the 9V if they will work better. No big deal. The lock itself currently uses only 4 AA's so the motor definitely draws less current than 4 AA's can provide.

I don't think that you know what isolation means here. It means that nothing touches, not even ground and that's not happening through the H-bridge or transistors you need a Common Ground to run. Take away the common ground, you'd better find out what that's going to take besides drawing lines that don't meet.

Separate, yes. Isolate takes more. That's why there are opto-isolators and isolation transformers, etc.

4 AA's as 6V provides the same current as 1 AA at 1.5V. It can be significant for a while, but not terribly long. The lock isn't using current for long.

You could use a converter to draw the little current that the Arduino needs but it's going to run the batteries down sooner than if it wasn't there. You mentioned two sources and there's things you do for that so I let you know as much as I do. That does not pertain to different conditions, don't compare apples to oranges and go off into synonym electronics.

Thanks, will just have to keep the AA batteries in mind and maybe find a way to keep the current draw down to a minimum. I could always run dc voltage from a AC-DC wall adapter and run it along the door to the hinges. All of that I will figure out.

The question remains the best way to keep each circuit from smoking the other as they are both connected to the motor the same way.

Use Arduino pins through resistors to limit current draw to control transistors, chips/boards that handle the motor power (power power as opposed to signal power that can run leds).

When you do circuit motive power through transistors there are extra parts needed to protect your delicate parts from back surge and many sites on the subject.

Remember to connect all the grounds that are not electrically isolated. Without a common ground for all voltages to be relative to, voltages that should be the same probably won't.

Here's Grumpy Mike's pages. The first few short lessons will probably clear a lot of the subject up for you and you can tell me what all I likely missed. No kidding, I open different sites before and during trying to wire anything I'm not completely sure of.

http://www.thebox.myzen.co.uk/Tutorial/Introduction.html

As I said before, DO NOT CONNECT YOUR RELAYS DIRECTLY TO AN ARDUINO PIN.
That's a sure way of melting your Arduino.

GoForSmoke, thanks for the link. I will check it out.

Henry_Best, so you are saying the following will not work using 2 pins from the arduino?

Look, you can source 200 mA through an UNO which is pushing it, 100 mA will run toys.

OTOH I have relay boards with circuiitry to trigger on led current. They wire and switch like leds, except nowhere near as fast. You can get those to switch 5A to 10A 120/240VAC for less than $2 for one channel and save on dual and quad boards. Do you mean relays like that? Then a pin can do it.

If you need more, use a pin to switch a FET to channel the power to do the job. Nerve to muscle. Flesh out your project.

Henry_Best:
As I said before, DO NOT CONNECT YOUR RELAYS DIRECTLY TO AN ARDUINO PIN.
That's a sure way of melting your Arduino.

The Arduino can drive small "reed" relays quite reliably. However, in this case, even reed relays will probably use more power than the motor does.

You are probably right but the relay's will help keep the sources from getting into each other. I get this going so I can control it from the inet and then I am going to try to implement rfid as well.

Thanks guys.