need help with simple circut

WBahn

Joined Mar 31, 2012
30,075
See Post #23. Use a switcher to generate your supplies. You could use a single 1.5V cell if you really wanted to.
 

Ron H

Joined Apr 14, 2005
7,063
See Post #23. Use a switcher to generate your supplies. You could use a single 1.5V cell if you really wanted to.
I see no reason why a couple of phototransistors, a couple of comparators, and an H-bridge driving a motor would need ±power supplies.
I am not implying that you are implying that.:D
 

WBahn

Joined Mar 31, 2012
30,075
You're right, I'm not. I'm focusing on just the goal of getting positive and negative rail voltages from a single supply. But looking back at that query in context with earlier posts makes it pretty obvious that the question was asked from a point of misunderstanding.

So, as others have pointed out already, you don't need to run the opamp V- power pin from a negative supply and there doesn't appear to be any compelling reason to do so in this application.
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59


It seems like the bottom ldr is in series and dependent on the top ldr. If this is true how can the bottom activate it's comparator(s) and turn the motor without light also shining on the top. Should I assume that light is shining to some degree on top (enough to let current through) before I begin to imagine how current might be flowing through the circuit?
 

LDC3

Joined Apr 27, 2013
924


It seems like the bottom ldr is in series and dependent on the top ldr. If this is true how can the bottom activate it's comparator(s) and turn the motor without light also shining on the top. Should I assume that light is shining to some degree on top (enough to let current through) before I begin to imagine how current might be flowing through the circuit?
No, the LDRs change resistance from about 20K to about 5K (actually it depends on the specifications). There will always be some current going through the LDRs. What happens in this circuit is that the ratio can change from about 4:1 (2V for Vcc=10V) to 1:4 (8V).
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
Ok. I've made some drawings of what I'm imagining is going on when I think about this circuit. The first image is with the top ldr lit and the second is with the bottom one lit. Please excuse my doodles.

Light shining on top ldr:


Light shining on the bottom ldr:


Now, as I understand it, there will always be some current running through the both ldr in either situation, so I chose to illustrate what I imagine as the dominate electrical path. In either of these cases. It seems the bottom ldr doesn't do anything. It seems that any current traveling through the bottom ldr would just go straight to ground. I just need some confirmation that I'm not way off with how I'm imagining things.
 

Attachments

LDC3

Joined Apr 27, 2013
924
Reply to post #49:
You have the basic understanding of the right side of the circuit.
The lower LDR does serve a useful purpose. It changes the voltage on the comparator input from 8V to 2V. If it was replaced by a fixed resistor (10K), the voltage change would be much less 6.6V to 3.3V.

Reply to post #51:
Did you get LM339 or LM399? You should have LM339. The datasheet allows the LM339 to have a supply anywhere between 2V and 36V. So it should work if you are using 3V.
 

WBahn

Joined Mar 31, 2012
30,075
I'm trying to hook up a comparator and I'm pretty sure I got the wrong one because it's not working. I got an lm399 from radioshack. It says Vcc is (+36 or ±18V), I'm operating on 3 volts. Can any one point me to the right comparator? I'm having trouble finding one with a low supply voltage.

http://www.engineersgarage.com/electronic-components/lm339-datasheet
We are not mind readers. Just saying that "because it's not working" gives us absolutely nothing to go on when it comes to helping you.

Operating on 3V should be fine because the 36V is the MAXIMUM supply voltage you can use. The minimum is 2V.

I'm willing to go out on a limb and bet that you aren't taking into account that the LM339 (and it definitely appears that you are NOT using an LM399 since the link you gave goes to an LM399 and I would be surprised if Radio Shack carried anything but an LM339 any more) has open-collector outputs. This means that the outputs can only assert a LO level actively and, when they want to output a HI they basically disconnect the internal circuitry from the output pin, requiring that the external circuit pull the output node HI. This is usually done by connect a passive pullup resistor between the output and Vcc. Depending on your speed requirements and how capacitive the load is on the output pin, something like a 1kΩ is probably a reasonable place to start. Making is smaller will make the changes faster and get the output closer to Vcc, but will consume more power when you are outputing a LO. Conversely, making it bigger will make it slower and leave you with a lower output voltage when it is HI, but will consume less power. Like everything in engineering, it's a compromise.
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
Reply to post #49:
You have the basic understanding of the right side of the circuit.
The lower LDR does serve a useful purpose. It changes the voltage on the comparator input from 8V to 2V. If it was replaced by a fixed resistor (10K), the voltage change would be much less 6.6V to 3.3V.

Reply to post #51:
Did you get LM339 or LM399? You should have LM339. The datasheet allows the LM339 to have a supply anywhere between 2V and 36V. So it should work if you are using 3V.
LM339 it says. It says supply voltage: +36VDC or 18VDC. Hmm..

I'm chose to use one comparator and experiment. I hooked it up like this:

  • Vcc hooked to positive rail (3 volts)
  • GND to negative terminal on batteries
  • Input 3- (as reference) I first kept it disconnected thinking it should give me peak signal. I also tried with a 200k resistor.
  • Input 3+ to full 3 volts

After the above, I measured output voltage at 0.3V. Then I swapped
"input 3's" to try. Still nothing. Tried a phototransistor as the an input, shined a lazor on it. Output read a constant 0.3. Swaped photo-resitor, then tried similar configuration on the remainder of inputs and respective outputs. Same results.

 

Attachments

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
We are not mind readers. Just saying that "because it's not working" gives us absolutely nothing to go on when it comes to helping you.

Operating on 3V should be fine because the 36V is the MAXIMUM supply voltage you can use. The minimum is 2V.

I'm willing to go out on a limb and bet that you aren't taking into account that the LM339 (and it definitely appears that you are NOT using an LM399 since the link you gave goes to an LM399 and I would be surprised if Radio Shack carried anything but an LM339 any more) has open-collector outputs. This means that the outputs can only assert a LO level actively and, when they want to output a HI they basically disconnect the internal circuitry from the output pin, requiring that the external circuit pull the output node HI. This is usually done by connect a passive pullup resistor between the output and Vcc. Depending on your speed requirements and how capacitive the load is on the output pin, something like a 1kΩ is probably a reasonable place to start. Making is smaller will make the changes faster and get the output closer to Vcc, but will consume more power when you are outputing a LO. Conversely, making it bigger will make it slower and leave you with a lower output voltage when it is HI, but will consume less power. Like everything in engineering, it's a compromise.

I hadn't finished painting my next picture :)

*digesting
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
external circuit pull the output node HI.
Your light years ahead of me... This seems more complicated then I was imagining.... If the output can flip flop between positive and ground states, hooking a resistor between Vcc and the output pin seems scary. I don't think I'm in need of disconnecting the output pin though (I don't know). Maybe it is working and I'm getting confused by the LO signal. Could this be? I tried push this "LO" signal through a transistor but it didn't open the gate for actual work to be done.
 

Thread Starter

nitrosmd

Joined Jul 20, 2013
59
So when the output signal is "LO" I need to force it to go "HI" with a pull up resistor like you mentioned? And when the output is not "LO", it is OFF. So the output toggles between these two states: LO(0.3V)=ON and 0V=OFF. Is this correct?
 

WBahn

Joined Mar 31, 2012
30,075
LM339 it says. It says supply voltage: +36VDC or 18VDC. Hmm..

If you are refering to the table at the bottom of the page you linked where it says:

Supply voltage; 5V (+36 or ±18V)

Then what could the "5V" possibly mean?

That page and that table are NOT a datasheet. Read the datasheet (it is linked on that page).

The table on page 2 where that information is located is titled "MAXIMUM RATINGS".

I'm chose to use one comparator and experiment. I hooked it up like this:

  • Vcc hooked to positive rail (3 volts)
  • GND to negative terminal on batteries
  • Input 3- (as reference) I first kept it disconnected thinking it should give me peak signal. I also tried with a 200k resistor.
  • Input 3+ to full 3 volts

Do not leave ANY inputs unconnected (this pretty much applies to any chip, but there are exceptions). You want to define the + and - input signals for any comparator you are using, and you want to place any comparators you are not using into well defined states. This is most easily done by connecting the + input to Vcc and the - input to ground (or the negative supply rail). Do not connect them to the same level as this can result in them flailing around and injecting noise into the chip and, potentially, other circuits via the power supplies.
 

WBahn

Joined Mar 31, 2012
30,075
Your light years ahead of me... This seems more complicated then I was imagining.... If the output can flip flop between positive and ground states, hooking a resistor between Vcc and the output pin seems scary. I don't think I'm in need of disconnecting the output pin though (I don't know). Maybe it is working and I'm getting confused by the LO signal. Could this be? I tried push this "LO" signal through a transistor but it didn't open the gate for actual work to be done.
Why is it scary? The output stage of each comparator is nothing more than an NPN transistor with the collector tied to the output pin. When the internal circuitry wants to take the output LO, it turns on this transistor. When the internal circuit wants to allow the external circuitry to pull the output HI, it turns off this transistor.

I have no idea what you mean by "push this LO signal through a transistor". Could we PLEASE see a schematic?

Just trust me enough to put a 1kΩ (or anything remotely close, even a 10kΩ) resistor between Vcc and the output pin you are using (pin 14 in your case). Then see what happens. Tie pin 8 to Vcc and pin 9 to GND. What is the voltage at pin 14? Then reverse this and tie pin 8 to GND and pin 9 to Vcc. What is the voltage at pin 14?
 

WBahn

Joined Mar 31, 2012
30,075
So when the output signal is "LO" I need to force it to go "HI" with a pull up resistor like you mentioned? And when the output is not "LO", it is OFF. So the output toggles between these two states: LO(0.3V)=ON and 0V=OFF. Is this correct?
NO!!!!

Take a resistor an connect one end of it to Vcc. Now take your voltmeter and measure the voltage at the other end of the resistor relative to ground. What is the voltage?

When you have a resistor tied to Vcc and the output pin (pin 14), when the output is NOT asserting a LO (which will get you around 0.2V to 0.3V usually), the transistor is turned off, meaning it might as well be disconnected from the output pin, which means that ALL you have is a resistor tied on one side to Vcc and the other side, the side connected to the output pin, that is effectively floating.
 
Top