Re: build circuit



"gina" <led@xxxxxxxxxxxxx> wrote in message news:d6cf05ed-750c-4972-b4f0-4835fb67c408@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Apr 13, 9:07 pm, "Bob Monsen" <rcmon...@xxxxxxxxx> wrote:
> "gina" <l...@xxxxxxxxxxxxx> wrote in message
>
> news:e17f3200-7262-41ff-a419-c10453cbad1b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> >I want to build a simple circuit that will turn off a 120 volt light
> > for 5 minutes when my bird is too noisy. After that I would like the
> > light to go back on. Can anyone help or direct me to best newsgroup?
>
> how involved can you get? Do you know how to get parts, and solder a > simple
> circuit? Or, do you want an off-the-shelf solution?
>
> If you can build circuits, you can use a relay, an electret microphone, > a
> transistor, and a 555 monostable (along with a few resistors and > capacitors)
> to build something that would work.
>
> If you are interested in a circuit to build, please reply here.
>
> Regards
> Bob Monsen

I can solder but I have never built a circuit. If it's fairly easy I
would love to give it a try. Can you get me started? Thanks gina

(First, read this message in courier font, because there are ascii diagrams in it, which will make no sense
unless you are reading them with a fixed width font.)

Here is what you need:

The power supply:

1 12V DC wall adapter. Only needs to support about 100mA (more is fine). The cheaper, the better.
1 7805 integrated circuit
1 0.1uF (uF stands for microfarad) capacitor (10V minimum rating)
1 0.33uF (25V minimum rating) capacitor.
1 1N4148 diode (or any old diode, it does not matter much)

The sound detector:

1 electret microphone
1 15k Ohm resistor
1 2N3904 NPN transistor (or equivalent, small signal transistor, three terminals)
1 1Meg Ohm resistor
1 10k Ohm resistor (10,000 ohms)
1 0.1uF capacitor

The timing element:

1 cmos 555 integrated circuit (see here for more info: http://en.wikipedia.org/wiki/555_timer_IC)
1 220uF electrolytic capacitor (6.8V or higher voltage rating)
1 1Meg Ohm resistor
1 0.1uF capacitor (6.8V or higher voltage rating)

Connecting the detector to the timing element:

1 1uF capacitor
1 220k variable resistor trimmer you can set with a screwdriver

The light switch:

1 12V 'normally closed' relay that can handle the
current for your light bulb. A 220V/1A
capable relay should do it easily.
1 2N3904 NPN transistor (or equivalent)
1 1k resistor
1 1N4001 diode (or equivalent)

The circuit board:

1 prototyping board you can solder everything to. I like 'stripboard' for this kind of thing.
http://www.futurlec.com/ProtoBoards.shtml

Tools:

wire cutters
a digital multimeter
a soldering iron + solder
1 1k resistor
1 cheapo red LED
a tool to trim leads (wire cutters, but must be able to cut things very short)

-------------------------------------------------

Step 1: the power supply



Diode
.------|<-------.
| |
| |
| ____ |
12V | | | |
voltage + o----o----|7805|-----o----------------- 5V
| |____| |
| | |
0.33uF --- | --- 0.1uF
cap --- | --- cap
| | |
| | |
voltage -------o------o--------o----------------- ground
0V


.---------.
| 0 |
| |
|---------|
| |
| LM7805 |
| |
| |
'---------'
| | |
| | |
| | |
| | |
| | |
in g out
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

Take the wall transformer. There is a wall plug of some kind coming out of it, and another wire coming out of it. That other wire gives you the 12V (or more).

Note that the voltage coming out of the thing is not dangerous, but you should respect it, and not short circuit the output while the thing is plugged in, since they often have internal fuses which will blow if you do this, and you'll need to get another one.

Cut off the 12V plug (not the two pronged plug, but the other one that you would normally plug into a device to power it) coming out of the transformer, and strip the wires about 1/2 inch with the wirecutters. Solder the wires to the prototype board on different pads. The pads should be isolated from one another, so if you use a stripboard, use a different strip for this.

Now, determine which wire is + and which is - by carefully plugging in the transformer, and using your multimeter to measure the voltage. If it reads 0, either the transformer is defective, or it is an AC transformer. In either case, you need another one.

One way you measure it the multimeter will read something like 12V. The other way, it'll read -12V. For the +12V case, the black probe is now touching the - output, and the red probe is now touching the + output. Mark these on the top of the board somehow so you don't get them confused.

Solder the 0.33uF capacitor between these leads. (If you got one that looks like a little can with two leads, and has a little + and - on it, that is called an electrolytic capcitor.) Make sure it can handle at least 25V, as stated above. Solder the - lead (or one of the leads if there isn't a + or - on it) to the prototboard so it will connect to the minus power input from the transformer. Solder the other lead to the +12V input.

Now, connect up the 7805. If you hold it by the silver tab, so the writing is visible, the leads are left = input, middle = ground, right = output. So, connect up the left to the +12V, and the ground to the - input. Now, connect the 0.1uF capacitor between the center and right lead. Connect the diode from the right lead to the left lead, so that the line painted on the diode is nearer to the left side.

The -|<- is a diode, which lets current flow from right to left if right is higher than left. This is there to protect the LM7805, which will fail if you put voltage across it the wrong way.

So, now you've built a power supply. You should test it. Use the 1k resistor as a test part, and connect it between the Right and Center leads of the LM7805. Power it up by plugging it in. Keep you finger on the diode. If it starts to heat up, unplug it immediately, and figure out how you screwed up. If it does not heat up, measure the voltage between the left and center pin with your multimeter. If it is 5V, you are a winner! You now have a combination 12V unregulated, 5V regulated power supply.

Unplug the adapter.

Step 2: the sound detector

5V -----------o------------------.
| |
.-. .-. .-------.
| | 22k | | 10k | |
| | | | | 2N |
'-' '-' | 3904 |
| || ___ | | |
o--||---o--|___|---o- to 555 '-------'
| || | 1 MEG |c | | |
| 0.1uF | |/ | | |
| '------b-| | | |
| |> e | | |
|---. | | | | |
| |--' | | | |
| |--. | | | |
|---' | | | | |
GND ----------o------------------' e b c
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

Take the electret microphone, and look at it. One of the leads is visibly electrically connected (shorted) to the case, and one is isolated from the case. The one that is shorted to the case is the 'ground' lead. The other lead is the 'output' lead.

(NOTE: In our system, we are using the minus side of the wall adapter as ground. I'll refer to in as ground from now on. Nearly everything will somehow connect to ground, which forms a return for the electricity flowing out of the adapter and through the circuit.)

The electret microphone is really both a microphone and an amplifier put together. When the other lead of the microphone (the one NOT shorted to the case) is powered with a current, the microphone turns sound into a variable current draw. So, take the 15k resistor, and attach it to the right lead of the LM7805. Lets call this "5V" from now on. Solder the other side of the resistor to a pad on the protoboard, and connect that pad somehow to the non-ground lead of the electret microphone. Connect the ground lead to ground (ie, the center pin of the LM7805, which is also connected to the - input of the wall adapter).

At this point, you have the microphone connected, and if you plugged it in, it should be powered properly. Plug in the adapter, and measure the voltage between the microphone and the 15k resistor. It should be between 2 and 3 volts. If not, there may be a problem. Electret microphones are not all that consistent in how much current they take. If the microphone to resistor junction is below 1V, then it is taking too much current. If it is above 4 voltages, it is taking too little. In either case, it won't work very well. Try changing the value of the resistor by swapping out 4.7k, 10k, 15k, 22k, etc, until it is near 2.5V. That is where you want it to be.

When it is powered and your multimeter is measuring the voltage from ground to the microphone-resistor junction, try tapping on the electret. It should just register a tiny bit.

Now, connect the + side of the electret microphone to one side of the 0.1uF capacitor. Connect the other side of the 0.1uF capacitor to the base lead of the NPN 2N3904. If you really have a 2N3904 and not another transistor, then if you hold it so the pins are down, and you can read the writing on the front, the pins are left = emitter, middle = base, right = collector. I'll call them emitter, base, collector. So, connect the base to the other side of the 0.1uF capacitor. Also connect the base to one side of the 1MEG resistor. Connect the other side of that resistor to the collector. Now, connect the collector to one side of the 10k resistor, and the other side of the 10k resistor to 5V. Connect the emitter lead of the transistor to ground (the - input, and middle pin of the LM7805).

NOTE: not all transistors have the same pin assignments. So, when you get the transistor, read the number off the front, and then do a search on the internet for that number. It is usually 2Nxxxx, where the x can be any digit. Look at the data*** for the transistor, and it'll tell you which lead is the base, which is the emitter, and which is the collector.

Now, you have a microphone and an amplifier to amplify it. You should plug it in again, and feel the parts to make sure none of them are getting hot. If anything gets hot, unplug it now, because something is wrong. You should analyze the circuit, and make sure you don't have things connected improperly. One way to do this is to use the 'resistance' mode on your multimeter to make sure the resistances in the circuit are as you expect them to be. Another is to measure the voltages at various points, and ensure that they are reasonable when it is plugged in. For example, the collector of the NPN should be about 2.5V. If it is less than 1, or greater than 4, something is wrong.

If everything seems ok, then connect the red probe of the multimeter to the collector of the NPN, and the black probe to ground. The voltage should be between 1 and 4 volts. Now, tap the microphone. You should see bigger movements on the output of the multimeter than before when you do that. If you don't see these, something is wrong. Go back and look it over.

Step 3: the timing element

5V
--------o-------------o------------------o------.
| | | |
| | | |
| | | .-.
| | | | | 1MEG
| | | | |
| | | '-'
From | | 555 | |
Detector | | __ | |
|| | .--)----o| |o--------' |
---||----)----o-----)--)----o| |o----------o----o
|| | | | | .--o| |o----------' |
0.1uF | | | '-)--o|__|o- |
.-. | | | |
220k | |<--' | | | +
variable| | '---------- to relay --- 220uF
'-' | section ---
| | |
| | |
| | |
---------o----------o----------------------------'
GND
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

You have the 555 in your hand, and you are looking at it. It looks like somebody's idea of a joke bug, with its little metal legs. However, there are literally billions of these little bugs in the world today, calmly ticking away time. I believe it is the best selling integrated circuit every built. If you are looking down on it, you'll notice there is a little area cut out of the top of one side. If you hold it so that little cut is up, and the pins are on the sides, then the top left pin is pin 1, and they increase, going around the device till they get to pin 9 on the top right. The diagram above is set up so it is arranged in the same way.

The circuit above will give you a long pulse (ie, a long 'high' value out of pin 3) given a short downward pulse on pin 2 which is below 1.66 volts.

Most protoboards are designed to hold these. If you are using a stripboard prototype board, then you'll need to cut the traces between the pins on the right and the left. I use a dremel tool with a drill bit, but there are other ways.

Now, connect the 5V to pin 8 and pin 4. Also, connect one side of the variable resistor (the trimmer) to the 5V, and one side of the 1MEG resistor. Connect the other side of the variabel resistor to ground, and the middle pin, what is called the wiper, to the 0.1uF cap and pin 2. Connect pin 1 to ground.

Solder the other side of the 1MEG resistor to pin 7, and short pin 7 and pin 6 together. Connect the positive side of the 220uF capacitor to that, and the other side to ground.

The pulse will last for 1.1 * R * C, where R = 1,000,000, and C = 0.000220. So, the result is about 242 seconds.

The variable resistor is there to control the sensitivity.

The output comes out on pin 3. That goes to the next section.

Step 4: The light switch

NOTE: This is the part that can kill you, so please be careful.


12V (NOTE)
---------o------.
| | --------------- to lamp
| | \
| |_ o o
diode - ' )|
^ )|
| _)|
'----.--- --------------- to lamp
|
|
1k | c
___ b |/
555--|___|----|
|>
| e
|
|
GND -----------'


Not a good picture of a relay
You want a normally open relay, with two inputs and three outputs.

(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

A relay is a switch, which is turned on or off with a little electromagnet. They have two leads for the electromagnet, and two or three leads (or more) for the switch leads. Your circuit is trying to turn off a light for a while when it hears a loud sound, so it wants to be connected unless you power it. So, find a relay that has a 12V coil, and that has three output leads.

Get an extension cord with two prongs, and split it apart a bit near the wall plug end. Cut one of the wires. I'd suggest cutting the one attached to the big prong, not the one attached to the small prong. However, it doesn't really matter all that much.

Take your relay, and connect one side of the coil to the 12V input from the wall adapter. Do not connect it to the 5V supply you built above, use the input to that supply. Also, connect a diode in parallel across the coil, with the line nearest to the 12V side. You can determine which are the coil using your multimeter on resistance setting. It should have more than 100 but less than 1000 ohms of resistance between the two coil leads. The other leads will have either very small or very large resistances.

Connect the other side of the coil to the collector of the NPN (which is the same as the NPN above)

Connect the emitter of the npn to ground, and the base of the NPN through a 1k resistor to pin 3 on the 555.

Now, use your multimeter on the resistance setting to see which leads to connect your extension cord to. It'll be the leads with almost 0 resistance when the circuit is off.

Solder these to the relay. MAKE SURE that this part of the circuit is electrically isolated from the rest. Wrap electricians tape around the exposed wires, etc. Make sure it is not in a position to shake free and kill you. Etc etc.

Step 5: test it out

Now, plug in the lamp to the extension cord. Plug in the adapter. Plug in the extension cord. It should start out as being off. After about 4 minutes, it should come on.

Now, bring over the parrot, and make it squawk near the thing. It'll turn off if you are lucky.

You can adjust the sensitivity to parrot noise using the variable resistor you soldered in in step 3. If it is too sensitive, it'll always be off. If it isn't sensitive enough, it'll never turn off.

Have fun. Be careful.

Regards,
Bob Monsen

.