The hysteresis of comparator.

Thread Starter

iONic

Joined Nov 16, 2007
1,662
I have built this tile circuit to test the hysteresis potential for turning on an LED and eventually a 110V AC socket with an LED light bulb(albeit dimable.)
After adjusting the 2k pot for the desired light sensitivity I still had trouble getting the LED to turn full on or full off. There are areas of light that make the LED on only partially.

Any clues as to what may be causing this?

Also: what would be the best isolation for interfacing this circuit with a socket with AC mains voltage...Opto > TRIAC?? Wait, I have a few SSR's...that should do it.

DALwH.PNG
 
Last edited:

Thread Starter

iONic

Joined Nov 16, 2007
1,662
You need to connect pin 1 to pin 4.
As per your instructions I tied pin1 to pin4(ground).

Observations:
When PR1 is tied to Vcc & R1 is tied to GND, varying the 2k Pot will "pop" the LED on or off, but no amount of light or darkness changes the LED's state.
When PR1 is tied to Vcc & PR1 is tied to GND, varying the 2k Pot will VERY SLOWLY turn the LED on or off, but no amount of light or darkness changes the LED's state.
 

Ylli

Joined Nov 13, 2015
1,086
Definitely need pin 1 grounded. Now add a 1K pull-up between 7 and pin 8. Change the 470 ohm on the base of Q1 to 4.7K. May need to reduce the hysteresis by increasing the 100k resistor up to as high as 1 meg. If the LED does not go out completely, add a signal diode (1N4148) between Q1 emitter and ground.
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Definitely need pin 1 grounded. Now add a 1K pull-up between 7 and pin 8. Change the 470 ohm on the base of Q1 to 4.7K. May need to reduce the hysteresis by increasing the 100k resistor up to as high as 1 meg. If the LED does not go out completely, add a signal diode (1N4148) between Q1 emitter and ground.
The output of the 311 seems to be transistor based. Do I need to drive an additional transistor to operate the LED?
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Actually, no you do not. May need to swap the LDR and R1 to get the direction of 'sense' you want.
:)Yes, I Tied the PR High and the resistor, R1, Low so that when darkness falls, the light comes on.
Also swapping the 470 Ohm resistor to 4.7k didn't do much, visually, nor did the 1N4148. Not sure if the pull-up resistor did anything, but the value of the hysteresis resistor(100k) was changes first to 470k(sometimes did not register the same on/off state with the same light. So I increased to 820k and all is working nicely right now! I should have known to look for this issue...the thought did pass through my skull, but I blew it off!

Looking good Ylli!
Thanks
 
Last edited:

BobaMosfet

Joined Jul 1, 2009
2,110
This is not a useful circuit for working with AC and mains voltages, particularly for light dimming. An SCR is the correct thing to use, but you need to understand that for A/C you must have a zero-cross detector circuit so that you switch only when AC is zero volts. This eliminates all kinds of problems, voltage spikes etc, and gives you a means to isolate using and opto-isolator.
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
This is not a useful circuit for working with AC and mains voltages, particularly for light dimming. An SCR is the correct thing to use, but you need to understand that for A/C you must have a zero-cross detector circuit so that you switch only when AC is zero volts. This eliminates all kinds of problems, voltage spikes etc, and gives you a means to isolate using and opto-isolator.
I was ready to use the output to drive a Solid State Relay. Was this not an acceptable method?
Does an SCR include a "zero-cross detector?"
Do you have any suggestions on where to obtain the knowledge you recommend?
 

danadak

Joined Mar 10, 2018
4,057
The LM311 is not RR (Rail to Rail) input, so operation outside the CM (common mode) limits
of the inputs not predictable. There are modern parts with RRI capability.

upload_2018-12-3_6-18-30.png


Regards, Dana.
 

AnalogKid

Joined Aug 1, 2013
10,986
1. The 311 has an open collector output stage. You need to add a pull up resistor from pin 7 to Vcc to supply base current to Q1.

2. The 311 does not have a "rail-to-rail" input stage. What is the resistance range of the photoresistor?

ak
 

eetech00

Joined Jun 8, 2013
3,858
I have built this tile circuit to test the hysteresis potential for turning on an LED and eventually a 110V AC socket with an LED light bulb(albeit dimable.)
After adjusting the 2k pot for the desired light sensitivity I still had trouble getting the LED to turn full on or full off. There are areas of light that make the LED on only partially.

Any clues as to what may be causing this?

Also: what would be the best isolation for interfacing this circuit with a socket with AC mains voltage...Opto > TRIAC?? Wait, I have a few SSR's...that should do it.

View attachment 164908
Hi

This circuit is really not appropriate for driving/dimming an AC load.

Should use a Triac with zero crossing trigger as suggested in Post #13.

eT
 

Ylli

Joined Nov 13, 2015
1,086
Come on guys. The TS is not using this to drive an AC load, he is going to use it to drive the input of a SS relay to turn a light on and off. It may not be the most elegant circuit to create the final results, but it will work OK and the TS challenged himself to come up with a functional circuit.

The relay will take care of the zero crossing issue, and keeping the inputs to the 311 within their common mode range should not be an issue.
 

BobaMosfet

Joined Jul 1, 2009
2,110
I was ready to use the output to drive a Solid State Relay. Was this not an acceptable method?
Does an SCR include a "zero-cross detector?"
Do you have any suggestions on where to obtain the knowledge you recommend?
Actually the ZC I'm referring to, does not use an SCR- It isn't a dimmer, it's just a detector. But many commercial dimmer designs do, which is OK. They use the SCR because the AC signal keeps causing it to unlatch. Which is fine, and you can use it to latch as well. But the best place to start your PWM is at ZC, and you need a detector for that.

And as it happens, I found it:

You can find answers in the forums here. I pointed one out in this thread that will give you exactly what you want, and is opto-isolated. Does not use an OpAmp, that's just the question the original TP had asked about.

https://forum.allaboutcircuits.com/...-ic-to-measure-frequency.146659/#post-1251323
 
Last edited:

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Hi

This circuit is really not appropriate for driving/dimming an AC load.

Should use a Triac with zero crossing trigger as suggested in Post #13.

eT
The circuit originally posted did not include any opto-isolation or TRIAC/MOSFET Driver parts yet. This was to be added in the second stage of the build.

Something to this effect...
isolation.PNG

Either the above or a SSR @ 3-15VDC > 240VAC 5A (CX240D5)

also: there will be no dimming of the lighting in this circuit. My mistake in mentioning that the LED 110V light bulb might be dimable. I want to make it "reverse" compatible to Tungsten and Florescent lighting as well.
 
Last edited:
Top