Maker Pro
Maker Pro

automatic light and curtain control circuit

BONGIE

Nov 22, 2014
5
Joined
Nov 22, 2014
Messages
5
I am working on a small school project and i am encounering problems on a circuit it is suppose to switch on the lights when it's dark by closing curtains first and switch them off when it light by oppening curtains but it is not doing as expected the LDR circuit works properly, when it's dark the output voltage is above 0.7V(i.e around4.7V) but the relay doesnt switch on even that one of the bulb doesn't switch on due the low output voltage at the and gateWP_20141123_004.jpg to switch on the transistor. When it is light the output voltage of the 555 timer is below 0.7V making it difficult for the transistor to be switched on.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Ho Bongie, welcome to Electronics Point.

The problem is the inverter ICya connected to the base of transistor Qx. This voltage will not rise much above 0.7V. You would be best advised connecting it to the output of ICx Pin 3, on the opposite side if the 470Ω Rx.

Another problem is that the base of Qy is connected directly to +5V. I suspect this is a drafting error. If not, I suspect the smoke had all gone out of it. AAAGH! EDIT2: You've drawn it that way for another transistor. RIP transistors :(

Oh, and if I read the supply voltage of ICz correctly, it's likely you'll drive the output below ground causing problems for ICyb, ICta, and ICz.

My explanation and your circuit would be more readable if you assigned identifiers to the components (Q1, Q2, IC1, IC2a, IC2b, R1, R2, etc.)

I have called the top 555 ICx, the bottom one ICz, the hex inverter ICy, oops, the comparator/op-amp also ICz, the top transistor Qx, and the bottom one Qy.

If you can't figure out what I meant, you need to:
  1. Label the components,
  2. Tell us what they are (I assume the logic is CMOS, what is the op amp??),
  3. and finally take a sharp image
THEN I can give you an explanation which is unambiguous.

edit: There are plenty of other problems. When you redraw the circuit we can work through them. Ask yourself if you need a base resistor on all three of the transistors.
 

BONGIE

Nov 22, 2014
5
Joined
Nov 22, 2014
Messages
5
Ho Bongie, welcome to Electronics Point.

The problem is the inverter ICya connected to the base of transistor Qx. This voltage will not rise much above 0.7V. You would be best advised connecting it to the output of ICx Pin 3, on the opposite side if the 470Ω Rx.

Another problem is that the base of Qy is connected directly to +5V. I suspect this is a drafting error. If not, I suspect the smoke had all gone out of it. AAAGH! EDIT2: You've drawn it that way for another transistor. RIP transistors :(

Oh, and if I read the supply voltage of ICz correctly, it's likely you'll drive the output below ground causing problems for ICyb, ICta, and ICz.

My explanation and your circuit would be more readable if you assigned identifiers to the components (Q1, Q2, IC1, IC2a, IC2b, R1, R2, etc.)

I have called the top 555 ICx, the bottom one ICz, the hex inverter ICy, oops, the comparator/op-amp also ICz, the top transistor Qx, and the bottom one Qy.

If you can't figure out what I meant, you need to:
  1. Label the components,
  2. Tell us what they are (I assume the logic is CMOS, what is the op amp??),
  3. and finally take a sharp image
THEN I can give you an explanation which is unambiguous.

edit: There are plenty of other problems. When you redraw the circuit we can work through them. Ask yourself if you need a base resistor on all three of the transistors.


The LDR circuit is able to detect darkness and light, when it is dark the ouput voltage of U1 is positive saturated(high) that output needs to be inverted by U4 before being fed into the 555 timmer (U3) since it is triggered by a low, the output voltage of U3 is greater than 0.7(around 4.7V) but transistor Q1 doesn't switch on and utput voltage @ U2A is less than 0.7V this also results in a transistor Q3 not switching on. When it is light the output from U1 is negative saturated(low) this results in U5being triggered but the output voltage of U5 is less than 0.7V resulting in a transistor not switching on.curtains.jpg
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Way better in terms of readability, but worse in terms of functionality. I note that you've changed the circuit.

Because this is homework, I'm not going to give you the answers, but I will ask you questions that you absolutely need to consider if you want to get this working.

  1. Do you have any base resistors in this circuit? (if so, name them) [for hints, see here]
  2. What purpose do R9 and R10 serve?
  3. When high (or ON), how much current will flow from pin 3 of U3 and/or U5? What limits that current? [hint: and exact numerical answer for the first part is not required]
  4. Consider the output of U2a in the light of points 1, 2, and 3 above. Is there a potential problem?
  5. What is the maximum voltage which can appear across R5 and R9? What does this mean?
  6. Does your 555 variant operate from 5V? Check the datasheet (hint: here's one)
  7. What are U4 and U2? What is there power supply (it should be shown)? Do you have their datasheets? (find them and include a link in your answer) [hint: see here]
  8. What are the limits on input voltages for the logic family you have chosen?
  9. What is U1? Please link a datsheet for it.
  10. For the power supply shown for U1, what are the limits on the output voltage?
  11. Compare the answer to Q10 with the answer to Q8. Is there a problem? Why?
  12. What is the purpose of R6 and C2, and the purpose for R7 and C3? Explain how it's going to work?
  13. Is there any reason for the 555's at all given the answer to 12? Is this a feature or a design fault?
  14. Is the discharge pin of the 666 an input or an output? What would be the effect of connecting it to Vcc? How much current could flow? [hint: don't need an exact numerical answer to the last part]
  15. Is RLY4 is switching the mains? The two connections are active and...? [hint: it's not normal]
  16. Do you know what limit switches are? Could your device benefit from some?
OK, that's a start. Hopefully it's not too overwhelming. Maybe just try answering the first 2 questions for a start.

Your schematic drawing skills are not awful, but they could stand some improvement. Have a look at posts by@KrisBlueNZ (as he often posts schematics). Do his look any clearer than yours? Can you see some things he does differently? (Here's one at random). Note that although Kris does in this example, there is no need to show the pins in the order or position they actually are on the package. You have not for U1, U2, or U4, for example).

When you answer, number your answers so I can compare them with the questions. It will help both of us. If you don't see any problems at all, go no further than question 2. If you decide you have to change something let's discuss it before you do, THEN change the schematic, and I'll revise my questions.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Great post Steve! And lucky you posted it before I posted my response... I didn't realise this was homework and I was going to give him some direct answers. Your approach is much better.

BTW my 'notsohot' design you linkd is not one of my more readable schematics... I squeezed it a bit to make it smaller. And I often use ICs with leads laid out as they are in the real world because I think it makes things easier for assembly and servicing. I specifically created a whole lot of outlines for my schematic EDA package for this reason, because the main use for my schematics was during servicing. And I found that the "logical" layouts sometimes caused as much of a tangle of wires anyway. I like to show the internals of the IC where possible - see https://www.electronicspoint.com/threads/rewiring-7-band-eq.263472/#post-1573235 and https://www.electronicspoint.com/th...n-battery-drops-below-3v.263739/#post-1574424 and https://www.electronicspoint.com/threads/resistance-monitor.268408/#post-1607395.


I have some more questions for Bongie - once you've absorbed Steve's questions! There's quite a few separate things you need to learn about to make this circuit work properly.

1. Would it be simpler to operate all of the circuit from +12V and 0V (the ground symbol) instead of running parts of it from 12V and parts from 5V?

2. Do you know what decoupling capacitors are, and where and when they should be used?

3. Do you know what hysteresis is, and why it is often used when detecting thresholds on measured quantities such as light intensity?

4. Can you explain the purpose of AND gate U2A? Is a gate needed?


Here's some information on the problem with driving Q1, Q2 and Q3.

A transistor's base-emitter junction behaves like a diode, and if the emitter is connected to 0V (as they are in your circuit), the base voltage can't be much more than about 0.7~0.8V. If it is, the transistor has been damaged. So the transistor will effectively clamp its base voltage to about 0.7V. If you connect U3's output, and U2's input, directly to the base of Q1, you risk damaging Q1 with uncontrolled current from U3, and you will not get a proper logic level on U2A's input.

Have a look at Steve's resource at https://www.electronicspoint.com/resources/using-a-bipolar-transistor-to-turn-a-load-on-and-off.30/ for more information.


Bongie, if you can, post schematics in GIF or PNG format, not JPG. JPG is designed for photographs (that's what the P in JPG stands for) and is not very suitable for line drawings. You will get a smaller, cleaner image if you use GIF or PNG.

While you're editing your schematic, you should spread out the connections to the 555s somewhat, so the components and lines aren't all squeezed up against them.
 

BONGIE

Nov 22, 2014
5
Joined
Nov 22, 2014
Messages
5
  1. Do you have any base resistors in this circuit? (if so, name them) [for hints, see here]
  2. What purpose do R9 and R10 serve?

This is not a homework steve it is electronics project and I am still learning on how electronics circuits and components work, I am a female not a male since i have been referred to as a male here.
1. I do not have it, but due to the information that you have reffered me to i will include it.
2. According to the data sheet the output of the 555 timer should be connected to the supply voltage through the resistor R9 and R10.
 

BONGIE

Nov 22, 2014
5
Joined
Nov 22, 2014
Messages
5
1. Would it be simpler to operate all of the circuit from +12V and 0V (the ground symbol) instead of running parts of it from 12V and parts from 5V?

4. Can you explain the purpose of AND gate U2A? Is a gate needed?
1. According to the data sheet the supply voltage of the 555 timer is 5V hence i powered this part of the circuit with 5V.
4.When it is dark the output voltage of U1 will be high, that high will then be fed into the first pin of an and gate U2A, and also into the inverter U4A so as to trigger U3 resulting in an output that is above 0.7V(which will then switch on the transistor Q1 driving the close curtain moto), output will also be fed into an and gate so as to produce a high which will switch on the transistor Q3 resulting in a bulb being switched on.
 
Last edited by a moderator:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
This is not a homework steve it is electronics project and I am still learning on how electronics circuits and components work

Well, you say it's for school and we have a policy of trying to get students to work through their own problems. Seriously -- it's the only way to get real knowledge. It seems hard (and maybe it is) but it's the sort of hard that makes you smarter than people who have been given the answers.

I am a female not a male since i have been referred to as a male here.

You are in a small minority here. Most people who identify as female are spammers (weirdly). I'll try not to refer to you as "he" in the future :)

1. I do not have it, but due to the information that you have reffered me to i will include it.

This is something that is *very* important. Kris has gone into more details as to why it is. The calculation of the size of this resistor is covered elsewhere and you probably should have a working knowledge of this.

2. According to the data sheet the output of the 555 timer should be connected to the supply voltage through the resistor R9 and R10.

I think you need to check this again carefully. Post a link to that datasheet and describe where it says to do this. It's possible you have some weird 555 variant, but I doubt it.

You note that you are still learning. What experience do you have? Did you design this circuit yourself or did it come from somewhere else. You are mixing logic, discrete transistors, linear devices, H bridges, timers, and have multiple power supplies -- that's a lot for a beginner to grapple with.

We can help you find the faults in this circuit, or we can help you design a circuit that does what I think you want to do (but simply). What's your preference?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Oops! I apologise for calling you a "him"!

The 555 data sheet shouldn't say that the supply voltage should be 5V. The normal range IIRC is 4.5~15V and 12V is very often used with a 555.

OK I don't understand the purpose of the lamp. How will it be labelled? What will it be used for? And when do you want it to light up, specifically?

Now I know this isn't a homework project, I have a lot more suggestions. Luckily I rescued my original comments! Here they are.


Hi there Bongie. Thanks for the tidy schematic; it makes everything clearer.

If you can, post schematics in GIF or PNG format, not JPG. JPG is designed for photographs (that's what the P in JPG stands for) and is not very suitable for line drawings. You will get a smaller, cleaner image if you use GIF or PNG.

I see you've fixed the connections to the relay contacts. That's all good now. But there are still quite a lot of problems with the design, as Steve pointed out.

A. Power supply voltage to the 555s.

Most of the circuit operates from the +12V rail. There is no need for a 5V rail; the LDR resistor circuit and the 555s will run just fine from 12V. U2A and U4A will need to be CMOS devices (CD4081 and CD4069 respectively) instead of 74HC or 74LS devices, which must operate at 5V. I don't know what devices you planned to use for U2 and U4 because they're not marked on the schematic. You should indicate this, as well as showing which power supply rail they're connected to.

B. Power supply to U1

U1 doesn't need a -12V power supply. It can (and should) be operated between +12V and 0V. Both of its inputs will be well within that voltage range, so powering it from -12V just causes problems because the output voltage will swing negative and this will damage the other components that it's connected to, because they use the 0V rail as their negative reference.

C. Base drive to Q1 and Q2.

A transistor's base-emitter junction is like a diode, and if the emitter is connected to 0V (as they are in your circuit), the base voltage can't be much more than about 0.7~0.8V. If it is, the transistor has been damaged.

So the transistor will effectively clamp its base voltage to about 0.7V. If you connect U3's output, and U2's input, directly to the base of Q1, you risk damaging Q1 with uncontrolled current from U3, and you will not get a proper logic level on U2A's input. The answer is to put your 4k7 resistor, R9, in series with Q1's base.

This allows the voltage on the left side of R9 to range from 0V to 12V without being clamped by Q1, and the resistor limits the current into Q1's base to prevent damage.

The R9 you had as a pullup is not needed.

The same applies to Q2 and R10 and U5. You also had the wire from the positive supply to R10 incorrectly shorted to the line from pin 6 of U5.

A base series resistor is also needed for Q3.

There are several more problems with that design. Steve or I will go into details when you've fixed the ones I've listed here. For my future reference they are:

1. LDR comparator needs hysteresis
2. Trigger circuits need differentiator to generate trigger pulse only
3. 555s are configured as astables not monostables
4. Need a clear definition of U2A's purpose; it probably isn't needed.


Also, you can actually replace both of the 555s with gates from a CD40106 and save quite a few components (two ICs and several passive components). Let me know if you want to see how that would work.


While you're editing your schematic, you should spread out the connections to the 555s somewhat, so the components and lines aren't all squeezed up against them. And while you're at it, each 555 should have a decoupling capacitor (0.1 µF) connected as directly as possible between pins 8 and 1 to ensure that it operates reliably.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Kris, I think the idea is that when it gets dark, the curtains are closed, and then the light is turned on. When it gets light, the light is turned off and the curtains are opened.

I can see numerous ways of solving this, all logic, all 555's, all linear, microcontroller, etc. As I've noted, combining these things is not making life easy for Bongie, but perhaps she wants to incorporate all these elements. I think she needs to be introduced to limit switches though :)
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Kris, I think the idea is that when it gets dark, the curtains are closed, and then the light is turned on. When it gets light, the light is turned off and the curtains are opened.
OK, that's fair enough. So a gate would be needed.
I can see numerous ways of solving this, all logic, all 555's, all linear, microcontroller, etc. As I've noted, combining these things is not making life easy for Bongie, but perhaps she wants to incorporate all these elements. I think she needs to be introduced to limit switches though :)
She should know about them, but sometimes it might be simpler to just generate fixed run drations and let a cord slip somewhere. I think a 40106 or some 4093s would be the simplest, most compact, and easiest to understand option for control. But as you say, there are a lot of other issues to address first. She's going to learn a lot from this project :)
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Limit switches remove the need for timing altogether -- makes for a simpler project in some respects -- especially if the time required to open/close the blinds is longer than you'd be happy to time with an RC delay.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Limit switches remove the need for timing altogether -- makes for a simpler project in some respects -- especially if the time required to open/close the blinds is longer than you'd be happy to time with an RC delay.
I know, but it might be simpler to have a slipping cord than adding two limit switches with associted wiring. Depends on the setup.
 
Top