need help with simple circut

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
I've been working on a very small project and I just need someone to point me in the right direction.

I'm attempting to wire a small dc circuit. The basic idea is: given two small phototransistors, spin a little dc motor either forward or backward. If the first phototransistor has light, spin the motor one way, if light is on the other transistor, spin the opposite direction.

I currently have a single phototransistor connected to the base of a medium power transistor which allows me to spin the motor in one direction. This works. That's it. The next part is a hurdle for me.

I've read online that an h-bridge configuration is roughly what I need to do this job. So I kinda started to imagine an h-bridge. I figured one pair of switches (running forward through the motor) would be controlled by the first phototransitor and the other set of switches (running through the motor in reverse) controlled by the second phototransistor Can't seem to wire it right so it works on a single battery.

I'd appreciate anyone's help.

Also, is their a recommend modeling software (using linux) where I could draw this type of thing?
 

ian field

Joined Oct 27, 2012
6,536
I've been working on a very small project and I just need someone to point me in the right direction.

I'm attempting to wire a small dc circuit. The basic idea is: given two small phototransistors, spin a little dc motor either forward or backward. If the first phototransistor has light, spin the motor one way, if light is on the other transistor, spin the opposite direction.

I currently have a single phototransistor connected to the base of a medium power transistor which allows me to spin the motor in one direction. This works. That's it. The next part is a hurdle for me.

I've read online that an h-bridge configuration is roughly what I need to do this job. So I kinda started to imagine an h-bridge. I figured one pair of switches (running forward through the motor) would be controlled by the first phototransitor and the other set of switches (running through the motor in reverse) controlled by the second phototransistor Can't seem to wire it right so it works on a single battery.

I'd appreciate anyone's help.

Also, is their a recommend modeling software (using linux) where I could draw this type of thing?
Make a H-bridge with 2 complementary pairs, but don't connect them as emitter followers. Put each phototransistor in series with a current limiting resistor, wire one from the top LH base to the bottom RH base and wire the other from the top RH base to the bottom LH base.

Depending on the sensitivity of the photo transistors (or lack of) - you may need to use darlington transistors in the H-bridge, bear in mind that Darlington transistors can't saturate, also if both photo transistors are illuminated at once - things will get pretty hot pretty quickly.

If you need some logic to prevent both transistors being on together (feed through) - take a look at the "dead time" logic in the datasheet for a switch mode chip like the SG2524 etc.

You might be able to make a more sensitive H-bridge with 2 complementary pairs of MOSFETs - they need a gate-leak resistor on each gate for the photo transistor to draw current through and develop a voltage across - this can get tricky if you don't have a lot of voltage headroom.
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
It will take me a bit to digest what you said. I'm not sure what an emitter followers is yet.

I think the "feed through" prevention logic mentioned, was the part that I was racking my brain on. I had imagined, in a feed through case, the motor would just short circuit near the motor contacts. I can't quite imagine how a current can go through a single motor in two different directions at once without short circuiting unless it's hooked up to two separate power supplies. Is it possible that the currents can "feed through" without a disaster?

Thanks for the Darlington tip and thanks for your response :)
 

Ron H

Joined Apr 14, 2005
7,063
It will take me a bit to digest what you said. I'm not sure what an emitter followers is yet.

I think the "feed through" prevention logic mentioned, was the part that I was racking my brain on. I had imagined, in a feed through case, the motor would just short circuit near the motor contacts. I can't quite imagine how a current can go through a single motor in two different directions at once without short circuiting unless it's hooked up to two separate power supplies. Is it possible that the currents can "feed through" without a disaster?

Thanks for the Darlington tip and thanks for your response :)
Can you guarantee that both phototransistors will not be on simultaneously?
 

absf

Joined Dec 29, 2010
1,968
An simplified H bridge looks something like the attached diagram...

When Sw1 and Sw4 is ON the motor would turn one direction and sw2 & sw3 ON would make it turn in opposite direction .

The switch can be replaced by relay contacts, BJT or MOSFET and be controlled by logic chips or mcu and the principle remains the same. ;)

Allen
 

Attachments

LDC3

Joined Apr 27, 2013
924
Can you guarantee that both phototransistors will not be on simultaneously?
It's easy to assure that is the case. Have the phototransistors feed the 2 inputs to a comparator. When phototransistor 1 is on greater than phototransistor 2, the motor runs forward. When phototransistor 2 is on greater than phototransistor 1, the motor runs in reverse. If need be, you can cause a delay in power to the motor when the direction changes.
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
Can you guarantee that both phototransistors will not be on simultaneously?
No I can't. Maybe once things have been formalized down the road, but until then, 1 transistor being more active then the other is all that's guaranteed.
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
An simplified H bridge looks something like the attached diagram...

When Sw1 and Sw4 is ON the motor would turn one direction and sw2 & sw3 ON would make it turn in opposite direction .

The switch can be replaced by relay contacts, BJT or MOSFET and be controlled by logic chips or mcu and the principle remains the same. ;)

Allen
Yes this makes sense to me. Excellent diagram too. Thank you.
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
It's easy to assure that is the case. Have the phototransistors feed the 2 inputs to a comparator. When phototransistor 1 is on greater than phototransistor 2, the motor runs forward. When phototransistor 2 is on greater than phototransistor 1, the motor runs in reverse. If need be, you can cause a delay in power to the motor when the direction changes.
A comparator you say. This sounds like it's exactly what I need. I'm defiantly looking into this. Thanks a lot.
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
The solar tracking unit by design is almost identical to what I'm trying to learn to make. I can see the comparators/op-amps in action there; as mentioned by LDC3.

Thanks bertus. I can defiantly roll with that schematic.
 

LDC3

Joined Apr 27, 2013
924
There is an advantage to the circuit over what I was thinking. Since the 2 comparators use different reference voltages, there is a gap when the photoresistors are nearly evenly illuminated and the motor doesn't run. It inhibits oscillation of the motor when they are evenly illuminated.
 

MaxHeadRoom

Joined Jul 18, 2013
28,700
Conductors crossing with no contact.
The alternative method is to cross without them (staright line) , but a junction has to show a termination point, identical to the end of the Ov & +v points.
I prefer the latter.
Max.
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
There is an advantage to the circuit over what I was thinking. Since the 2 comparators use different reference voltages, there is a gap when the photoresistors are nearly evenly illuminated and the motor doesn't run. It inhibits oscillation of the motor when they are evenly illuminated.
Very, interesting. I kinda of see what your talking about, but I need to study this more. I thought it was very odd that they used different resistor values.

I'm just now starting to wrap my mind around op-amps and I'm starting to see how and why you need two in order to open transistors at opposite corners. This is very cool.
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
Conductors crossing with no contact.
The alternative method is to cross without them (staright line) , but a junction has to show a termination point, identical to the end of the Ov & +v points.
I prefer the latter.
Max.
That's what I was thinking because it looks physically like the wire is going over the top :)
 

WBahn

Joined Mar 31, 2012
30,077
And that was the idea.

I think showing them this way is more reliable because it is clear that they do not connect.

If you don't do this, then you should avoid crossing lines that do connect where the only way to tell if they do or don't is whether there is a junction dot there. As schematics get copied and handled, it is very possible for it to become hard to tell if there is one there or not. Even viewing them on a computer screen can cause problems because of a bad pixel or a spec of dirt on the screen, not to mention people that don't have very good vision to begin with. So if you aren't going to use the "bridge" or " jump-over" representation, it is better to simply make a four-way connection into two three-way connections, even if they are only separated by a fraction of an inch.
 

LDC3

Joined Apr 27, 2013
924
Is there an advantage to an LDR over a phototransistor in this type of application?
The LDR changes its resistance with the amount of light shining on it.

A phototransistor allows more current to flow through it, so the configuration for a phototransistor is different. I believe that each phototransistor needs a resistor and is connected from Vcc to ground. Since there is some variation in the resistor and the phototransistors, it would be difficult to have the same amount of current through each one for the same amount of light.
 

WBahn

Joined Mar 31, 2012
30,077
I believe another big difference is that phototransistors respond much more quickly than LDR devices, but I could be outdated in that belief.
 
Top