Greater of 2 voltages ...

Discussion in 'The Projects Forum' started by stubbornTryHard, Dec 19, 2012.

  1. stubbornTryHard

    Thread Starter New Member

    Dec 19, 2012
    7
    0
    Hello, well I am 2 days into 'electronics' so quite a newbie.

    That will explain why I've been sat here for most of the day trying to figure out a stupid problem and going around in circles.
    Any pointers on where to look for a solution, would be greatly appreciated.

    SO ..

    I'm aiming myself to build a 'sun tracker'.
    The plan so far, is to use 2 solar cells out of calculators, and depending which one is exposed to the most light, move a motor in the relative direction.

    Yes, I know this is a simplistic solution, but for a 1st project, I was hoping manageable.

    Problem is this.
    I simply cannot figure out how to 'compare' the 2 incoming voltages, and if A is higher, allow a current to output 1, and if voltage B is higher, send current to output 2.
    Sure, I can do it if there is only 1 incoming voltage at a time, but when there are 2 incoming, and I only need to 'recognize' the higher one - I'm stumped.

    In honesty, I have seen some 'fancy' solutions to this using chips, but was hoping there was an easy and 'obvious' solution just using resistors,diodes etc ...

    .. am I being naiive ?

    Hope there is a textbook answer !

    Many thanks for any guidance.
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,038
    Don't be afraid to use the right IC for this, a comparator. I understand that there is a learning curve to climb, and that it might be intellectually satisfying to build your own from discrete components, but once you master a particular IC, you never go back. Embrace the 555 timer, the comparator and the op-amp ICs. You'll love 'em once you know 'em.
     
  3. crutschow

    Expert

    Mar 14, 2008
    13,003
    3,232
    A comparator is the easiest way to go. Common comparators are the LM311 and the LM339. You put voltage A on the positive "+" input and voltage B on the "-" input. The comparator output will be "high" (maximum output voltage) when A is greater than B and "low" (ground) when A is less than B.

    Here's
    a circuit using an LM339 that may do what you want. It works slightly differently by connecting both sensors in inverse to one comparator input and using a bias reference voltage on the other input.
     
  4. stubbornTryHard

    Thread Starter New Member

    Dec 19, 2012
    7
    0
    Thank you for both of those inputs.

    I've had a look at maplin and they seem to have comparators in plenty so will give this a shot.

    I've also now seen some schematics of a comparator using OpAmps, which I might also have a stab at.

    The OpAmp solution I think will give me a better understanding and 'education' , but yes, simply throwing 1 little chip in to do the job makes a lot more sense going forward as a final solution.
    Indeed I am beginning to see how the fewer components I use, the more mangeable my projects will be !

    Crutschow's circuit look s a little scarey to me just at this time, but I'll sit and study until I fully understand what its doing !!

    Thanks again, at least I'm in the right direction now :)
     
  5. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,038
    One thing that most beginners miss about the comparator is that it has an open collector output. That means when the output goes "high", it's just floating and needs an external pull-up resistor to pull the output to the higher voltage. When the output goes low, the chip pulls the output pin as close to ground as possible. Current up to about 5mA will flow across the pull-up resistor into the output pin. That's just enough to light an LED, trigger a MOSFET, or send a signal to another chip, but not much else.
     
Loading...