Olin Lathrop wrote: > > > A cap C-B in that circuit is stupid, > > a cap B-E will fix his problem. > > Maybe. It depends on where the feedback is coming from that causes the > oscillations. He said the relay was "vibrating" or something like that > during the transition. The circuit is just a DC amplifier driving the > relay, and as you said, relays do have some inherent hysterisis. We also > know his input signal varies very slowly (outdoor ambient light at dusk). Yes he said it was vibrating when the relay was turning off, and that he had added a cap C-B which Peter suggested. Which would cause that problem exactly. > So, why does it oscillate at the threshold input? One possibility could > be AC noise coupled back into the amplifier from the switching transients. > Your cap from B to E should help with that. The LDR and resistors are some 10's of kohms and a 1uF or larger cap B-E would fix that due to the large RC time constant, it simply can't oscillate as the hysteresis of the relay is huge. Only back-emf or as you mentioned supply voltage rise could cause the oscillation on turnoff. Both would be fixed by adding a cap B-E. I also said if further filtering was needed to add another cap on the lower resistors which is basically a PI filter. I've built many one transistor relay driving circuits like this, they have enough gain for most uses as the 12v relay pulls in at about 9v and drops out at 4v or so. The low gain and slowly changing analogue voltage won't matter. > However, I suspect at least part of his problem is DC feedback via the > power supply when voltages change due to the relay switching on > significant power. A B-E cap won't fix that, only decrease the > oscillation frequency. Yes I assumed that his PSU had a decent size cap across it. Further decoupling the relay PSU from the LDR PSU would help. > I think the best way to address both problems > together is to spend a few more cents and add another transistor stage. > This will give him more gain and provide an easy opportunity for some > deliberate positive feedback in the amplifier to get some hysterisis. > This will always drive the relay solidly on or off, and should provide the > necessary noise immunity. It will also make insensitive to small > variations in light level at the thresholds, like a cloud momentarily > passing over the sun shortly after it has set. Sure another gain stage would be a step forward but might not really be necessary. It also might worsen the situation with clouds etc as the one stage system will rely on large relay hysteresis to mean that the relay won't pull in until a large difference in light levels. I built a 1-tran light relay once and had problems with too much sensitivity, one transistor may be ideal for this provided he has larger enough caps B-E. -Roman -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.