question for the seasoned

Alec_t

Joined Sep 17, 2013
14,335
I didn't make it work today
I'm not surprised. R6 and R7 are selected to give an output voltage of 9V to the load, so the circuit (in particular Q1 and Q2) needs a supply voltage greater than 9V. The circuit was designed for a 12V supply. You've just learned another lesson: if you don't operate a circuit as designed it won't work as designed :).
what should I try next?
Test one stage at a time. Using your 9V supply temporarily, shade the photocell so that just a small amount of light gets to it (i.e. simulate twilight). Connect your digital meter (on its 10Volt range if you have that) between pins 2 and 12 of U2. Now twiddle Trim1. You should find a point where the meter reading changes from ~9V to ~0V.
 

Thread Starter

fredric58

Joined Nov 28, 2014
252
Good morning, OK, designed for 12v. that's good to know. I originally tried a circuit based on an op amp. however I found with a 9v input that I couldn't get a full 9v output and why I chose to start with 12v thinking I would have some power left over. I am assuming some voltage got eaten up by the circuit. though I don't understand the protocol in it's entirety I can see how being designed for 12v it will not function properly with 9v and look forward to understanding the WHY. I will be picking up a new 12v battery today so I can study the circuit as designed. I did however attach a 9v power supply and check pins 2 and 12. I was unable to get the full 9v and unable to get 0v. it ranged from 8 (+-) to .5v, but I found a precise point where the change occurs. I will repeat when I have the proper input voltage. I must say that this is absolutely fascinating and even addictive. Since I am new to this it is extremely complicated, but after studying a branch or component and finally understanding what's happening, it's VERY rewarding.
 

Alec_t

Joined Sep 17, 2013
14,335
I am assuming some voltage got eaten up by the circuit.
You could say that. Any current flow through a component causes a voltage drop (Ohm's Law).
it ranged from 8 (+-) to .5v
Good. That at least shows the comparator is working ok. We await your repeat measurements. You're experiencing the 3 Fs of electronics: frustrating, fascinating and fun! :)
 

Thread Starter

fredric58

Joined Nov 28, 2014
252
12.59 v battery, pins 2 and 12, on the high side of trim v = 11.77 ambient light. on the low side of trim v = .062. voltage at output = 12.59 in either position and it should be 0, as the secondary device should be off when the sun comes up.
what's the next test?
OPPS, found a mistake, the base of Q2 was connected to R5 on the wrong side. now corrected. output still the same.

2N3906 is a PNP? (the arrow points toward the base)
2N3904 is a NPN? (arrow away)
Looking at the FLAT sides, legs 123 are the same for both 1. emitter, 2. base, 3 collector
as mentioned earlier I have seen the PNP represented different ways
 
Last edited:

Alec_t

Joined Sep 17, 2013
14,335
12.59 v battery, pins 2 and 12, on the high side of trim v = 11.77 ambient light. on the low side of trim v = .062
The 0.062 figure is good, but the 11.77 figure is a bit lower than expected. It may be low enough to cause Q1 to turn on when it shouldn't. You should be able to cure that by reducing the value of R3 to, say, 22k or thereabouts, or even 10k.
voltage at output = 12.59 in either position
By 'output' I assume you are referring to the Q2 emitter where the load connects? It should never be 12.59V. That suggests you have a direct connection between the output and the 12.59V supply. Check your circuit connections. If those are all correct then Q2 could be internally shorted (which it might well be if it was overloaded when R5 and R6 were the wrong values and got hot).
2N3906 is a PNP? (the arrow points toward the base). 2N3904 is a NPN? (arrow away)
Yes. As shown on the revised schematic, and as in the attached pic.
I have seen the PNP represented different ways
Not all PNP transistors have the same pinout. Nor do NPNs. You have to check the datasheets for the particular transistor numbers.
Pinouts.gif
 
Last edited:

Thread Starter

fredric58

Joined Nov 28, 2014
252
What a great day. I have Successfully finished my first electronics project that didn't just consist of a battery, switch and light bulb. Alec, I didn't change resistors, just tested Q2 and found it to be shorted out and replaced it. though I did add an led to "see" it work. Though I do not have a complete understanding of how it works, I have learned a great deal in this first endeavor. There are 2 things I would like to adjust. 1. is I am only getting 8.76v from the out. 2. I would like it to wait till it is a little darker to activate.

In review you stated R6 and R7 were designed to out put 9v. Can the "stack" vertically lined up 2n3904, R6 and R7 be considered as a whole, a voltage divider of sorts? I am sure 2n3904 has resistance, however, there are 2 additional factors. the BASE influence of 2n3904 and the ref v of TL431A. in other words, if Q2 were simply a resistor then the vm (or is it mv) between Q2 and R6 could easily be figured? just as the Vm of R6 and R7 could?

Am I on the right track?
 
Last edited:

Alec_t

Joined Sep 17, 2013
14,335
I am only getting 8.76v from the out
Resistor tolerances account for that. Simulation shows that if you connect another 56k resistor in parallel with R7 (2k2) it should bring the volts up to 9V.
I would like it to wait till it is a little darker to activate
Adjust Trim1 to reduce the pin 4 voltage slightly.

We want 9V at Q2 emitter. The TL431A conducts current when its control input exceeds 2.5V. Therefore we choose R6 and R7 such that 9V x R7/(R6+R7) = 2.5V. The TL431A thus adjusts Q2 base voltage automatically so that the emitter voltage is kept at 9V.
 

Thread Starter

fredric58

Joined Nov 28, 2014
252
what does simulation say if I use a 2K? in parallel a 56K and a 2.2k = 2.09k. I am only looking for a 1/4 volt, if it goes to 9.5 (+-) it's ok because a fresh 9V battery provides as much. CAN'T reduce the trim pot, if I do I lose the POP on, POP off. (hysteresis). Otherwise this thing works REALLY WELL! THE MATH? used to refigure the addition of the 56K. We ran (2) 56K's in parallel previously and the out come was 28K. was that based on another part of this circuit?
 

Alec_t

Joined Sep 17, 2013
14,335
what does simulation say if I use a 2K?
It says the output voltage is 9.47V if R7=2k (assuming the reference voltage generated inside the TL431A is exactly 2.5V).
CAN'T reduce the trim pot, if I do I lose the POP on, POP off. (hysteresis)
Try either increasing the value of R1 (to, say, 75k) or increasing the value of R2 (e.g. double it). That should enable you to set a 'darker' trip point for the comparator.
THE MATH? used to refigure the addition of the 56K
0.25V is about 3% of 8.75V. Hence R7 needs reducing by about 3%. Hence put about 33 x 2.2k = 72k in parallel with it. Nearest E12 value = 68k. Allowing a bit of extra boost, use next value down in the E12 series, i.e. 56k.
We ran (2) 56K's in parallel previously and the out come was 28K. was that based on another part of this circuit?
Yes. You weren't paying attention :).
 

Thread Starter

fredric58

Joined Nov 28, 2014
252
(2) 56 K's, In regards to the math, I found it interesting that when (2) 56K's are measured in parallel, the resistance is 25% of their combined value, 28K. However, if you run a 2K2 and a 56K in parallel the resistance isn't 25%. I just measured them and came out with 2.09 and rounded it to 2K. So restating the question would be, WHY would you run (2) resistors in parallel, Instead of just figuring out their combined value and using one of the same value? Unless of course, due to the increments that resistors are available in you could get a more precise value using a combination? just curious! It may be completely irrelevant.

If I replace R2 with a trim, that would also give me more latitude. YES?
Again Alec, I really appreciate your participation. This project has taught me a lot.

I spoke with one of the elders at my church last Sunday, a retired electronics engineer. He asked me why I was even bothering and said that "people don't do it like that anymore son, it's all done with micro processors". Could this be accomplished with a micro processor? Can you answer why one would be chosen over the other. If it is possible.

Is it possible to determine the power consumption of a circuit on paper? from the schematic. AND, in this circuit, when there is 0 out (not powering the secondary circuit) there is going be a small amount of power being used. What point do I measure in it's passive state so I can determine Amp hours of the battery I will require?
 
Last edited:

Alec_t

Joined Sep 17, 2013
14,335
their combined value
By that you must mean their total resistance when connected in series.
WHY would you run (2) resistors in parallel, Instead of just figuring out their combined value and using one of the same value?
You are unlikely to find one with exactly the right value, or if you do it will be a high precision 1% tolerance one probably costing more than a standard 10% tolerance type. Putting a high resistance in parallel with a low resistance allows fine adjustment of the total resistance; similarly, low and high resistances could be connected in series to give fine adjustment of the total resistance.
If I replace R2 with a trim, that would also give me more latitude. YES?
It would indeed.
Could this be accomplished with a micro processor?
The function of the comparator and associated trimmer(s) and the regulator's internal reference could be achieved by a micro, but you would still need additional components (e.g. a regulated supply for the micro, power-handling transistor for the load, programmer for the micro). All in all I think this particular project calls for a discrete-component solution rather than a micro. A project requiring more elaborate signal processing and multiple comparisons might well be done with fewer components if a micro were used. Horses for courses.
 

Thread Starter

fredric58

Joined Nov 28, 2014
252
Good Morning. The dark sensor 9v reg works GREAT and it powers my small pcb. Now that it is powered, I want to try my hand at further automating it. It has a push on / off button on it to activate one of it's functions. I am going to replace the push button with a relay circuit. The only thing that is different in the relay circuit is....the relay itself. I couldn't find one to exactly match the specs so I am using a 6v, 10A/. ((((which could be a PROBLEM, compared to 12mA?))) BUT give me a break, relays are new! I have built the circuit and it WORKS, just like it is supposed to, on 9volts. AND YES, I have already learned something. When designing a project, ALL components "probably" need to be taken into consideration. Now, you mentioned using a diode if using a coil/relay. I haven't put one on your circuit, there are however (2) on this one. It has something to do with the collapsing magnetic field, if I remember correctly. IN FACT I am going to put (2) timers on here. (1) that replaces the manual push button and (2) to operate a motor. But I will worry about the second one after I learn how to make the dark reg and this timer work together. Like I said, I have built it, I know it is pretty simple, but I built it without any help. Anyway, It works with a 9v battery, however it does NOT work with the dark switch 9v reg. That being said, I presume that I am going to need MORE amps? because this also runs on 9v, but the 9v from the switch won't drive it.

EDIT 1. instead of (2) a motor, perhaps an LED chaser........ who knows, it's ALL fun
 

Attachments

Last edited:

Thread Starter

fredric58

Joined Nov 28, 2014
252
AH_HA......I just discovered that this isn't an ALL OFF switch, while checking voltage at different points in the circuit I found it leaks 4.82v at the out, when "I assumed" it would to be (0). When the sun comes up and shuts down the power, if the pcb is in the middle of a cycle, instead of shutting off it continues to TRY and run on the leaking voltage and will try till the power comes back (it buzzes). Once the power comes back it will finish it's cycle and continue operating as planned. Is there a way to cut off the leak?
 

Alec_t

Joined Sep 17, 2013
14,335
Is there a way to cut off the leak?
In post #45 I said
The 0.062 figure is good, but the 11.77 figure is a bit lower than expected. It may be low enough to cause Q1 to turn on when it shouldn't. You should be able to cure that by reducing the value of R3 to, say, 22k or thereabouts, or even 10k.
Did you change R3 to 10k?
It works with a 9v battery, however it does NOT work with the dark switch 9v reg.
Try connecting a 100uF capacitor directly across the supply (pins 7 and 14) of the Interval Timer's 556 IC.
 

Thread Starter

fredric58

Joined Nov 28, 2014
252
Changed R3 to 22K & 10K, still 5v (+-) at OUT when the suns up? Sooooooooo close, frustratingly faraway, arghhhh!

Both the pcb and relay circuit run off the dark sensor 9v reg switch. just that voltage during sunlight..........
 

Alec_t

Joined Sep 17, 2013
14,335
Looks like there is a leakage current path between Q1 collector and emitter. Get a magnifier and make sure there is no flux residue, solder whisker or other gunk in that area of your circuit. Q1 itself may be leaky. Try replacing it.
 

Thread Starter

fredric58

Joined Nov 28, 2014
252
Alec, I changed all 3 transistors, and...............................IT WORKS! just like you said it would. (0) volts when the suns up, cept I am still only getting 8.75 v at the OUT when the suns down...). but it still WORKS! I think it was lack of attention to detail.....on my part. I have learned a great deal, A LOT! with this small project. The last component of this experiment will use the previous 556 timer relay (cause I understand it). HOWEVER.......instead of the relay pulsing for 3 seconds every 60 seconds, it's going to pulse 5 seconds every 3 seconds. I can do this because the pulse rate is determined by the trim because the trim determines the charge rate of the capcitors. NOW, in your opinion.... I am going to drive a tiny, TINY... DC motor, turn it on for 5 sec, off for 3. pretty simple and I can do that. except..... I don't want it to spin FULL BLAST! I want to make it spin at whatever RPM I choose. 5 seconds ON, it sloooooowly turns, 3 seconds OFF. repeat. What do I need to research to control the motor speed? could it be as simple as using a trim pot to regulate the voltage? Thanks again, it's working just like you said it would! I read a good article on transistors yesterday and have a MUCH better understanding of WHAT they do and HOW they work. it's SOOOOO much fun building stuff and seeing it work!
 

Alec_t

Joined Sep 17, 2013
14,335
I changed all 3 transistors, and...IT WORKS!
That suggests there was a leaky transistor. Good that that problem is solved. As for the output being 8.75V, did you connect 56k (or thereabouts) across R7 (2k2)?
could it be as simple as using a trim pot to regulate the voltage?
You'll need more than a trim pot.
Assuming the DC motor is a brushed type you could control its speed by controlling the current through it or by using PWM (google for tutorials on that if you aren't familiar with it).
 

Thread Starter

fredric58

Joined Nov 28, 2014
252
By across you mean both 2.2 & the 56K resistors go to ground and both resistors go to the reference point. Side-by-side versus end to end?

I found some PWM schematics, simple ones. But they don't list all the parts. No reference to what diodes to use, etc. I will post the schematic later and perhaps you can explain how to determine what value diodes to use.?
 

Alec_t

Joined Sep 17, 2013
14,335
By across you mean both 2.2 & the 56K resistors go to ground and both resistors go to the reference point. Side-by-side versus end to end?
Yes. In other words the two resistors are connected in parallel to provide a resistance slightly below 2.2k.
Post a link to the PWM circuit you are considering using.
 
Top