I got a project to show a group of kids in the community center with some circuits. I am not majoring in EE so I will instead to show something simple. I borrow a snap circuit kits and I am going to build a circuit of generating a tone in a speaker (the diagram is given by the manual of the product). The circuit is something like the following


simulate this circuit – Schematic created using CircuitLab

The whistle chip will generate a single tone which is played by the speaker.

I am trying to add a photoresistor as a switch such that it play the tone in darkness only. I find an idea online http://www.learningaboutelectronics.com/Articles/Dark-activated-switch.php for similar purpose. So I modify the circuit as follow


simulate this circuit

But I find that when I switch on the circuit, in the light, the LED will be on but no sound generated. When I shine a light on it, it beeps and the LED becomes so bright. But if I block the photoresistor, no sound and the LED is totally off. This is opposite to what I want. Any idea to fix it?


I think I figure out why it doesn't work. Actually, I test the circuit in room light, which confusing me. So I try the following. I turn off the room light and shine a bright torch light directly into the photoresistor, the LED is off. When I block the photoresistor or turn off the torch, LED is on. So the circuit works technically. However, I am looking a modification such that the LED should be off in ROOM light instead of bright torch and glows when the photoresistor is blocked.

I measure the current through R1, it is constant. The current flows into the base of Q2 depends on the current through the photoresistor. It seems that the current through into the LED in room light is too much so it is still bright. I am trying to add a variable resistor in series of R1, which increase the sensitivity of the dark-mode switch.

Above modification make the dark-activated switch works. But when I impose that onto the sound control so to switch the Q1 on/off, it doesn't work. I start to think am I suppose to control Q1 instead of Q2 because Q1 is connected to the speaker not Q2. Do you think it is correct? Anyway, here is what I try


simulate this circuit

In this schematic, if I replace the speaker with a wire, the photoresistor acts as a dark switch, blocking it will turn the LED (D1) on. But if I put the speaker back. This circuit doesn't work. Blocking the photoresistor will not change the LED any more. I wonder if it is because the inductance of the speaker has something to do.

update 2:

Lacking solid knowledge of circuit, I spend quite amount of time to learn something basic on the circuit. Before, I am trying to apply the dark switch to control the base of Q1 (PNP) or base of Q2 (NPN) based on the above circuit. Both scheme are not working well. I did some analysis. I think the emitter of Q1 connect to the speaker. Controlling the base of Q1 with photoresistor does not really kill the current into the speaker when there in dark, I hear chirping noise from the speaker. I don't want that. Similar case happens in Q2 when I use dark switch on the base of Q2, the base current change so the current split into the whistle chip change as well, it induces chirping noise as well. I want to make it like a sharp switch. After some try, I make the following change.


simulate this circuit

R2 is a variable resistor used to tweak the minimum current going into base of Q2. I separate the photoresistor from R1 and whistle chip so to reduce the chirping. But then it won't beep because Q2 needs the current input from whistle chip so to create the tone (sound at some frequency). So I add the R3 to couple the base of Q2 to the whistle chip. Now I have a bright light shinning on the photoresistor, the sounds stop (no chirping), if I block it, it beeps. But here comes the problem I have before, the dark switch is not sensitive enough in the room light; so it starts to beeps when I turn on the circuit. I am looking for an idea to stop the beep at the beginning in room light and starts to beep once the photoresistor is blocked.

  • \$\begingroup\$ can you please check the connection for Q2 and circuit diagram again once? Is what you have posted exactly matches with the circuit you have rigged up? \$\endgroup\$ – User323693 Aug 4 '16 at 5:13
  • \$\begingroup\$ Thanks for your reply. Yes, I copy (redraw) that from the manual. And I check my circuit, they match and work. Q1 is a PNP transistor, Q2 is a NPN transistor. \$\endgroup\$ – user1285419 Aug 4 '16 at 5:20
  • \$\begingroup\$ When light is shined, the photoresistor goes low-impedance. It lets current through. Your setup is a light activated, not a dark activated version. \$\endgroup\$ – Passerby Aug 4 '16 at 5:34
  • \$\begingroup\$ Where is this whistle chip from? \$\endgroup\$ – Passerby Aug 4 '16 at 5:34
  • \$\begingroup\$ Yes, it is a light activated. I still don't find a way to convert it into a dark activated version. According to the manual, the whistle chip is two separated thin plates, the electricity pass through will make then vibrate so to create some sound (tone). \$\endgroup\$ – user1285419 Aug 4 '16 at 5:48

Ignoring whistle chip for the moment...

  1. Connect D2 between (R1) and (P1) of Whistlechip.
  2. Short base of Q2 to R1 directly

When there is light, the Q2 will not turn on. (you have to size the resistor R1 appropriately, so that, the voltage across base of Q2 is less than 0.5 V when there is light).

When the Photoresistor is taken to dark, the resistance of the photoresistor increases, there by increasing the base to emitter voltage of Q2. this will turn on Q2 and will turn on Q1, thereby turning on the Speaker too.

Also, you can consider placing a small resistor (100 ohms) in series with the LED to control the base current of Q1.

Also, measure the voltage across the photo resistor both in dark mode and light mode.. you should solve the issue there

| improve this answer | |
  • \$\begingroup\$ Thanks. I did what suggested. But it still doesn't work. I wonder if the photoresistor's parameter may not be same as what the circuit in the link. I am not trying to reproduce the circuit in the link. I find that the LED is on when I turn on the circuit in the light. When I shine strong light onto the PR, the LED off. The manual said the resistance of the PR is nearly infinite and becomes about 1kOmh when a bright light shines on it. \$\endgroup\$ – user1285419 Aug 4 '16 at 6:39
  • \$\begingroup\$ Do you have datasheet of photo resistor? Can you please notedown the resistance (measured with switch turned off) across the photo resistor alone ( after removing it from the circuit)? Measure resistance in both dark mode and light mode and pls update here \$\endgroup\$ – User323693 Aug 4 '16 at 13:10
  • \$\begingroup\$ Unfortunately, I don't have the datasheet. But I test the resistance. In darkness, the resistance is about 2MOhm, in light mode it is about 2kOhm. I just find it very strange. If I use the PNP transistor instead and swap the 100kOhm resistor and the photoresistor. It works! I have no idea why the NPN case, as shown in the link, doesn't work (just opposite to what I expect). \$\endgroup\$ – user1285419 Aug 4 '16 at 17:14
  • \$\begingroup\$ Ok. After many trails, I think I figure the reason now. But I still have a question. I got my post updated. \$\endgroup\$ – user1285419 Aug 4 '16 at 22:33

I don't know how sensitive the whistle chip is, but if you replace R1 with a 100k potentiometer, and use the center leg to attach the photoresistor, that would give you quite an easy way to adjust the sensitivity of the circuit.

The existing circuit would be the equivalent of the pot turned all the way to minimal resistance on the whistle chip side, and turning the pot the other way should make the LED much more sensitive.

Quite possibly, the range of a 100K pot might be too much to be useful. (E.G. Turning it back 1/4 of a turn might make it so sensitive that the LED will be fully lit even in very dim light.) If this is the case, and you'd like to correct that, you can switch to a smaller pot and add back and R1 such that the resistance of the Pot + R1 = 100k. A 50k R1, plus a 50k pot (or similar based on experimenting) may give you a more useable range. If the pot is too hard to get "just right," consider using a trim pot that uses a screw gear to adjust the setting and hold it there.

| improve this answer | |
  • \$\begingroup\$ Thanks for the information. I updated my post. I actually did something very similar to your suggestion. I use a variable resistor to tweak the sensitivity similar to the way you suggest. It works well only for LED control. But if I use that as a switch of the speaker and whistle chip, it won't work. I tried a different scheme as shown in the update. \$\endgroup\$ – user1285419 Aug 5 '16 at 3:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.