need help with simple circut

Discussion in 'General Electronics Chat' started by nitrosmd, Jul 20, 2013.

  1. nitrosmd

    Thread Starter Member

    Jul 20, 2013
    59
    0
    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?
     
  2. ian field

    Distinguished Member

    Oct 27, 2012
    4,415
    784
    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.
     
  3. nitrosmd

    Thread Starter Member

    Jul 20, 2013
    59
    0
    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 :)
     
  4. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Can you guarantee that both phototransistors will not be on simultaneously?
     
  5. absf

    Senior Member

    Dec 29, 2010
    1,492
    372
    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
     
  6. LDC3

    Active Member

    Apr 27, 2013
    920
    160
    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.
     
  7. nitrosmd

    Thread Starter Member

    Jul 20, 2013
    59
    0
    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.
     
  8. nitrosmd

    Thread Starter Member

    Jul 20, 2013
    59
    0
    Yes this makes sense to me. Excellent diagram too. Thank you.
     
  9. nitrosmd

    Thread Starter Member

    Jul 20, 2013
    59
    0
    A comparator you say. This sounds like it's exactly what I need. I'm defiantly looking into this. Thanks a lot.
     
  10. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,346
  11. nitrosmd

    Thread Starter Member

    Jul 20, 2013
    59
    0
    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.
     
  12. LDC3

    Active Member

    Apr 27, 2013
    920
    160
    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.
     
  13. nitrosmd

    Thread Starter Member

    Jul 20, 2013
    59
    0
    What are these doing?

    [​IMG]
     
  14. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,547
    2,372
    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.
     
  15. nitrosmd

    Thread Starter Member

    Jul 20, 2013
    59
    0
    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.
     
  16. nitrosmd

    Thread Starter Member

    Jul 20, 2013
    59
    0
    That's what I was thinking because it looks physically like the wire is going over the top :)
     
  17. nitrosmd

    Thread Starter Member

    Jul 20, 2013
    59
    0
    Is there an advantage to an LDR over a phototransistor in this type of application?
     
  18. WBahn

    Moderator

    Mar 31, 2012
    17,747
    4,796
    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.
     
  19. LDC3

    Active Member

    Apr 27, 2013
    920
    160
    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.
     
  20. WBahn

    Moderator

    Mar 31, 2012
    17,747
    4,796
    I believe another big difference is that phototransistors respond much more quickly than LDR devices, but I could be outdated in that belief.
     
Loading...