Coop door opener with 2 way 12VDC motor

wayneh

Joined Sep 9, 2010
17,498
It doesn't matter where it is placed as long as you can control that transistor. An NPN is usually used as a low-side switch because any base voltage more than ~0.6V above the lower rail will turn that switch fully on. A PNP is used on the high side because any base voltage ~0.6V below the upper rail will turn it full on. In either case, you could use a different arrangement but then you have to ensure the right voltages on the bases of the switching transistors, relative to their emitters.

An NPN can sit on top a 5V load instead of below it, but that means its base needs to be at >5.6V to turn it on. That is a useful trick used in an emitter-follower configuration, but if you just want to switch the load, it's easier to place the NPN below the load.
 

Reloadron

Joined Jan 15, 2015
7,523
It doesn't matter where it is placed as long as you can control that transistor. An NPN is usually used as a low-side switch because any base voltage more than ~0.6V above the lower rail will turn that switch fully on. A PNP is used on the high side because any base voltage ~0.6V below the upper rail will turn it full on. In either case, you could use a different arrangement but then you have to ensure the right voltages on the bases of the switching transistors, relative to their emitters.

An NPN can sit on top a 5V load instead of below it, but that means its base needs to be at >5.6V to turn it on. That is a useful trick used in an emitter-follower configuration, but if you just want to switch the load, it's easier to place the NPN below the load.
And that is all you need to know. :)

Ron
 

Thread Starter

rfeyer

Joined Aug 24, 2014
126
That is actually very interesting - TY for that - I had read a couple of explanations NPN vs PNP and really did not get that out of what I read (though that would not be the first time in electronics).
TY, that really helps.
Can I expand on that and ask - is there an inherent preference using a transistor versus a SPST relay? I am not trying to get off the thread's target, I do have a couple of extra relays I can use instead of transistors.
 

Reloadron

Joined Jan 15, 2015
7,523
Each have their place. I can't amplify a signal using a relay. If I really need fast switching a relay isn't all that fast. Keep in mind, the use of transistors extends well beyond using them as a switch. This is keeping it simplified but the idea is each device has a place. I can build an H-Bridge to reverse a motor using relays or transistors. A Google will bring up dozens of circuits using both. Also, in design there is always the cost factor to figure into any project.

I am not trying to get off the thread's target, I do have a couple of extra relays I can use instead of transistors.
Your thread. :) Yeah, actually the two transistors I used could be replaced by small relays. The 2N2222 tiny little transistors can be had for less than a dime apiece. How would that work out for 5 volt coil SPST relays? :) How about size? :)

Ron
 

wayneh

Joined Sep 9, 2010
17,498
...is there an inherent preference using a transistor versus a SPST relay?
For typical hobby DC circuits, I would say yes. They are fast, cheap, have no moving parts, last a long time and don't need too much power to operate. But relays offer isolation between the relay coil circuit (small DC signal) and whatever it is switching (high voltage and power AC, for instance). So if you wanted to use a breadboard circuit to switch on an incandescent light, a relay is fine choice.
 

Thread Starter

rfeyer

Joined Aug 24, 2014
126
This electronics world is too amazing!
When I read your diagram, Ron, I did not understand how the top and bottom portions could be connected.
Now, looking at how SPDT relay pins are arranged) I not only found the answer to the pins, but also found a site which has numbers related tot he pins - and, Law and behold, they are the numbers in your diagram (85,86, etc).
Go figure, the next time I see a diagram with numbers, I will know just a little bit more again :)

Rainer
 

Thread Starter

rfeyer

Joined Aug 24, 2014
126
Just finished a breadboard version of Ron's diagram, but am not getting voltage from both COM pins whether Any or all coils are being activated.
Question: - AM I to physically 'jump' pins NC & NO? (on schematic there is a connection, but I imagine that is the schematic way of presenting that the coil will activate one or the other?)
 

Reloadron

Joined Jan 15, 2015
7,523
Sorry, just got back. OK, lets see. The numbering I used on the relays is standard automotive for that type of relay. Terminal 30 is the com of the N/O and N/C contacts, that is why the single #30 on each relay. I drew them connected but in real life they are internal;ly connected (inside the relay). So #30 is "Common" to each contact, the N/O and N/C not to be confused with common as in Negative or (-) or Ground for example. Both #87A go to Ground - and both #87 go to Power +. If wired correctly it should work fine. Terminal #30 should go to Power + on either relay when it is activated.

Also, before I forget that pin numbering scheme only works for those relays which are an automotive standard. Sometimes I might do a schematic and include pin numbers with the actual part number and manufacturer. That implies those designations are unique to that part number.

Ron
 
Last edited:

Thread Starter

rfeyer

Joined Aug 24, 2014
126
I did it again before I saw this and now am thinking my relay must be bad - I do not hear a switching noise which I used to (though it is not the automotive one, I am using two 5V and 5V 'play' motor. Or, the output of the Ardunio power board is not putting out enough. I will try again tomorrow and TY for re-iterating, I was pretty sure not to cross them, and thanx for the numbering, I did find this on an electronics for dummies site :)

Rainer
 

Reloadron

Joined Jan 15, 2015
7,523
I did it again before I saw this and now am thinking my relay must be bad - I do not hear a switching noise which I used to (though it is not the automotive one, I am using two 5V and 5V 'play' motor. Or, the output of the Ardunio power board is not putting out enough. I will try again tomorrow and TY for re-iterating, I was pretty sure not to cross them, and thanx for the numbering, I did find this on an electronics for dummies site :)

Rainer
Generally you can hear a relay click. Be careful how you load the Arduino board. Those boards are not an infinite source of current. Also when building projects using small motors, relays and solenoids avoid running them off the same power supply as your micro-controller. The diodes I placed across relay terminals are there for a reason. :)

Ron
 

Thread Starter

rfeyer

Joined Aug 24, 2014
126
Ron,
I made it work - had to use the real motor and bought two 12V relays. TYVM!

Now, hoping I will not offend anyone, I still would like to know if it can be done with a DPDT relay, this will be my second motor.
I tried making a real diagram, hoping it is close to what you all are used to. Will this work:

upload_2015-2-1_9-5-38.pngupload_2015-2-1_9-5-38.png
 

Reloadron

Joined Jan 15, 2015
7,523
That lower transistor is screaming so loud I can hear it in Cleveland. :)

Some of this goes back to your original design problem. The lower transistor being used for motor on/off will have all of the motor current running through it. Let me also ask you this, If your main relay is activated and the lower normally open contacts are closed what will happen? Right about then that little transistor quits screaming and explodes. Even a really big transistor would explode in a ball of flames. The good news is your drawing skills are improving. :) Additionally again lets say the motor relay is active, limit switches only open when they reach a limit. Your upper limit switch is closed as shown. I see bad things happening.

Ron
 

Thread Starter

rfeyer

Joined Aug 24, 2014
126
From here to Cleveland is pretty loud :)

So, obviously I am still misunderstanding the fundamentals of, especially, transistors.
I will look at this a while, then try to come up with some half intelligent questions about my mistakes.
Greatly appreciate your saving my electronic parts :)

Rainer
 

Reloadron

Joined Jan 15, 2015
7,523
No problem at all. Helping you is a pleasure because you put forth the effort in the learning curve. Me? Snowing like hell outside and I have a good supply of hard apple cider. :)

Ron
 

Thread Starter

rfeyer

Joined Aug 24, 2014
126
OK,
let me propose this:
1 - If i use a SPDT relay at the main negative power supply as a shut off, then I should be fine on that part, yes?
That would give me the ability to have a return 1 or 0 to the MC as well.
I now understand the difference, BTW, between the transistor and relay (as some of you have tried to explain to me I am sure): The relay works with two seperate currents independently, which I knew, but the transistor is truly interacting with the flow of current. I knew this as well but did not bother to think that it is at any point of the circuit different flow, of course.

2- I drew the NC/NO wrong - I had it correct, then added the limiting switch and had to flip the ddrawing of the STDP, this is how the NC/NO scheme should look: upload_2015-2-1_12-33-34.png 1+3 NO 2+4 NC, top two small lines to motor

With that in mind, would it work? I will redraw after getting some chores done.

Rainer
 

Reloadron

Joined Jan 15, 2015
7,523
OK,
let me propose this:
1 - If i use a SPDT relay at the main negative power supply as a shut off, then I should be fine on that part, yes?
That would give me the ability to have a return 1 or 0 to the MC as well.
I now understand the difference, BTW, between the transistor and relay (as some of you have tried to explain to me I am sure): The relay works with two seperate currents independently, which I knew, but the transistor is truly interacting with the flow of current. I knew this as well but did not bother to think that it is at any point of the circuit different flow, of course.

2- I drew the NC/NO wrong - I had it correct, then added the limiting switch and had to flip the ddrawing of the STDP, this is how the NC/NO scheme should look: View attachment 79738 1+3 NO 2+4 NC, top two small lines to motor

With that in mind, would it work? I will redraw after getting some chores done.

Rainer
On #1 Yes. The idea here is that using a DPDT single relay to control direction produces the problem that the motor is always On, be it forward or reverse the motor is On. So yes, you can toss a big transistor or another relay in series with the power source to turn it On or Off. This is just a poor way to go about it. Were this a real and serious design I would either do it as I drew it or I would use a large high power MOSFET H-Bridge.
Keep in mind that if this thing is to be micro controller controlled you will be writing code to control the ports on a uC as well as decision making procedures. Then we also go back to making things fail safe. Good fuses are also our best friend. :)
Finally when reversing a motor direction you always want a slight (or longer) pause. Running a motor forward to reverse directly is not a good idea. Motors hate that, relays hate that (contacts arc), and many power supplies hate that. Frequently it is not a matter of if a design will work on paper or looks good on paper but a matter of good design practice and what works well in the real world.

You redraw and I will eat! :)

Ron
 

Thread Starter

rfeyer

Joined Aug 24, 2014
126
Hope lunch was good - sorry for the mental grieve here :(

I think I got it, though:
- added a SPDT relay at PS with the Transistor only activating core of relay.
- changed the direction of NC/NO Lower limit momentary switch
- the PMP programming should include a 10 second (arbitrary) delay when activating motor, or changing action of reversal loop

Will this work?

Rainer
upload_2015-2-1_14-30-50.png
 

Reloadron

Joined Jan 15, 2015
7,523
One problem right off the top I see is you have motor current running through your limit switches. You can't do that. Well you can but as mentioned earlier the switch has to handle the DC current load of the motor. Most limit switches are designed to handle low DC current, they are more a signal switch than a load switch. You can find snap acting DC limit switches that will handle high DC current but they start getting expensive.

Ron
 
Top