zaterdag 31 oktober 2009

Project: Building a light meter (1)

This is the first project I have started. Nothing to fancy, but something fun to do. Goal is to build a light meter, which measures the amount of light in the environment. It outputs the amount of light by lighting LEDs. The more light, the more LEDs will be lit. We will measure the amount of light with a LDR component.

The key component will be the PICAXE. This is a programmable IC (PIC) for low-end purposes. During the project we will be learning:

- How to use a LDR component
- How to program a PICAXE
- How to build the light meter


vrijdag 30 oktober 2009

Circuit basics: Resistance (2)

Last time I blogged about resistance. Today we are going to look at resistance within a circuit. Everything has basically to do with Ohm's Law, which states states:

the current through a conductor between two points is directly proportional to the potential difference or voltage across the two points, and inversely proportional to the resistance between them. (http://en.wikipedia.org/wiki/Ohm%27s_law)
This means that you can calculate the current if you know the voltage and the resistance. Also true is that you can calculate the voltage if you know the current and the resistance, and finally the resistance if you know the current and the voltage.

The formula for Ohm's law is: U = I x R, where U is voltage (in Volts), I is current (in Ampere) and R is resistance (in Ohm). You can also write this as I = U / R or R = U / I.

Given the following circuit:


Here we have the three variables:  U = 9 Volts, R= 450 Ohm and I = 0.020 Ampere (0.020 A = 20 mA). Let's check:

I x R = U
0.020 x 450 = 9 Volts


Ok, here are some circuits, which value is the missing variable? Rhe answers are at the bottom.


1. Given: U = 9, I = 0.0257. What is R?


2. Given: R= 350, I = 0.0143. What is U?



3. Given: U = 9, R=650. What is I?



4. How much resistance does the LED generate?


5. This circuit has a current of 23.6 mA. How much Ohm is the resistance of the resistor?






1. 9 / 0.0257 = 350 Ohm
2. 350 x 0.0143 = 5 Volts
3. 9 / 650 = 13.8  mA = 0.014 A
4. 1.9 / 0.0103 =   184 Ohm
5. As we have learned, the sum of the components in series is the total voltage. So  9 - 1.92 = 7.08 V.  7.08 / 0.0236 = 300 Ohm














dinsdag 27 oktober 2009

Circuit basics: Resistance

Last time we discussed the resistor. I promised to do a post on resistance as the resistor is quite useless if you don't know about resistance. So what is resistance?

If you imagine electrical current as a water flow, you can imagine the resistor as narrowing of the pipe as can been seen in the following image. We already learned that voltage can be seen as water pressure. At point A the water pressure could be, for example, 8 Volts. Because of the resistor, the water can not flow freely to point B. The pressure at point B would be lower, let's say 6 Volt. This means that the resistor resists 2 Volts.





Basically that's it. It's not very hard to understand resistance, but using it in your circuit is much harder. Next time we investigate resistance using resistors in a circuit.

maandag 26 oktober 2009

Electronic components: The resistor

Well, I'm back from Barcelona, so it's time for a new post. This time about the electronic component: the resistor. As one of the most common components (you will find one in almost every circuit), you should be familiar with it. As the name implies the resistor has much to do with resistance. Because it's a rather big topic, today I will talk about the resistor, resistance is coming up next.

A resistor can be made of a few materials, depending on it's use. Most common is the carbon based resistor. A resistor has one big feature: resisting. So how much does it resist? That depends on the materials used. The color bands on the resistor will tell you how much resistance you can expect (with a slight tolerance).



The resistor in the previous image has four color bands: black, red, brown and gold. The first two bands will give you a number. Black is 0, red is 2, together this will be 02. That number is multiplied by the third band x 10. Brown is 1, so 1 x 10 = 10. If we multiply 02 with 10, the result would be 20 Ohm. The fourth band will give you the tolerance. Gold will tell us that the resistor has a tolerance of 5%. In other words, the resistor will have an actual resistance between 19 and 21. This is an example, you will not find any resistor with black as first band. Under normal conditions you will have no problem with the tolerance. I borrowed the following table from http://en.wikipedia.org/wiki/Resistor:

Color
1st band
2nd band
3rd band (multiplier)
4th band (tolerance)
Temp. Coefficient
Black
0
0
×100


Brown
1
1
×101
±1% (F)
100 ppm
Red
2
2
×102
±2% (G)
50 ppm
Orange
3
3
×103

15 ppm
Yellow
4
4
×104

25 ppm
Green
5
5
×105
±0.5% (D)

Blue
6
6
×106
±0.25% (C)

Violet
7
7
×107
±0.1% (B)

Gray
8
8
×108
±0.05% (A)

White
9
9
×109


Gold


×10-1
±5% (J)

Silver


×10-2
±10% (K)

None



±20% (M)


I find it easier to use a resistor calculator site like http://www.samengstrom.com/nxl/3660/4_band_resistor_color_code_page.en.html.

That concludes today's topic, thanks for reading.

dinsdag 20 oktober 2009

Electronic components: The NE555 IC as a timer

Today we are going to build an astable flip-flop using the NE555 IC. IC stands for Integrated Circuit, which is miniaturized circuit (also called chip). The NE555 IC can be used as a timer. It will switch every X time, which makes it possible to do actions every X time. A flip-flop is a circuit that will switch states, in our example two LEDs which in turn go on and off. Astable means that will switch without external influences.

Let's talk a bit about ICs first. As said, IC stands for Integrated Circuit. You can use it by connecting the pins of the IC. You can figure out how to connect them by reading the datasheet. The following image is the NE555. An IC has a X number of pins, numbered anti-clockwise starting with the pin left of the notch or closed to a dot.




Note that the schematic symbol differs from the actual pin configuration as can been seen on the left.


For more information on what the pins mean see: http://en.wikipedia.org/wiki/555_timer_IC

The following circuit will put the NE555 to use in oscillator mode.
1 x 9V power supply
2 x 680 Ohm resistor (blue gray brown gold)
1 x 1 KOhm resistor (brown black red gold) 
1 x 10 KOhm resistor (brown black orange gold)
1 x Elco 35v 100 uF
1 x NE 555 IC
1 x red LED
1 x green LED


The Elco is a component which I will talk about later. For now it's enough to know it can store a certain amount of energy. The Elco will need to charge. While doing that, the red LED will be on. Upon the moment the energy stored in the Elco crosses 2/3 of the voltage put on pin 8 of the IC (in our case 6 V), the NE 555 will switch, discharging the Elco. This result in the green LED being lit. This continues until the voltage drops to 1/3 (3 volt in our case), in which case the charging starts and the red LED lights up again.






This is the end result, although I have to admit I blew a LED. Be careful when you are debugging the circuit, the Elco may contain voltages way more than  the LED can handle.

That's it for now. I'm on holiday for a few days, so expect new postings next week.

maandag 19 oktober 2009

Circuit basics: Voltage

Almost everyone knows voltage as something that's coming from the socket in the wall. But what does it do exactly?

Voltage is the difference in electronical potential between two points. For example a battery has two point, the + and the - poles.  You can imagine electronical potential as a large water tank under pressure. The amount of 'pressure' is measured in volts. The + pole is at full pressure (1.5V for example) the - pole is at zero pressure. Upon connecting the two tanks, water will flow between the tanks which is the current. When the pressure in tank + and tank - is equal, water will no longer flow between them.




Within our circuits the battery (or power supply) is delivering the voltage. In the following circuit a battery is connected to a voltmeter: 

1 x Multimeter
1 x 3V power supply



The volt meter should read the voltage between te + and - pole of the battery. Let's see how this works out in real situation:



As you can see, the volt meter read 2.9 volts. This is because the battery is not delivering the promised 3V and the volt meter has a tolerance of about 1-2%. In practice this doesn't really matter, as most electronic component have a tolerance too.

Next we'll see what happens when components are put in series:


1 x Multimeter
1 x 3V power supply
1 x 150 Ohm resistor (brown green brown gold)
1 x Red LED






The resistor and LED are put in series. Also three volt meters are shown. You will notice that the sum of the two voltmeters put in series is equal to the volt meter on the right. This means that sum of the voltage over each component put in series is equal to the voltage of the power source. So how is it possible that the LED has a different voltage than the resistor? That's because of the resistance. I will blog about it later.

Finally a circuit where two LED's are put in parallel:

1 x Multimeter
1 x 3V power supply
1 x 150 Ohm resistor (brown green brown gold)
2 x Red LED






As you can see, the voltage over both LEDs is equal. This means that components in parallel have the same voltage.

zondag 18 oktober 2009

Electronic components: the transistor as a switch

As one of the most important inventions in the field of electronics, the transistor today is found in almost any device. Basically the transistor can be used as a switch or as an amplifier. Today we will investigate the first function: the switch.

There are a few types of transistors, but I will use only the C547B. You should be able to find this transistor (or similar) at any electronics shop. Or you might find a few in a electronic device you want to get rid of.


The transistor has three terminals: base (b), collector (c) and the emitter (e). If you put current on the base, a current will flow from collector to emitter.


The following circuits will demonstrate the use of the transistor as a switch. Refer to the list of electronic components in one of my other blog posts for the meaning of the symbols used. The first circuit will light a LED when the button is pressed. The following components are required to build the circuit:

1 x 150 Ohm resistor (brown green brown gold)
1 x 1k Ohm resistor (brown black red gold)
1 x C547B transistor
1 x 3V power supply
1 x Red LED



As shown, the LED is placed in series with the 150 Ohm resistor and transistor. Also the transistor is placed in series with a 1KOhm resistor en button. Both resistors protect the LED and transistor. When the button is pressed a current will flow into the transistor, enabling the LED. Note that the current flowing trough the LED is much higher then the current trough the button.  This is one of the advantages of the transistor. The end result would look like this:


Now as a bonus I will show another example. We'll take the same circuit, but add another LED (green). When the button is up this LED will light up, when the button is down it will go off. The result is that either the red LED is on, when the button is pressed, or the green LED is on.  The shopping list for this circuit would be:


2 x 150 Ohm resistor (brown green brown gold)
1 x 1k Ohm resistor (brown black red gold)
2 x C547B transistor
1 x 3V power supply
1 x Red LED
1 x Green LED

 
I have placed the second transistor in parallel to the first transistor. The green LED is then placed in parallel to the transistor. That way the transistor will work as a NOT logic segment: when no current is placed on the transistor the LED will light up, otherwise it will go off.



Well that's it for today, thanks for reading.

zaterdag 17 oktober 2009

This is a list of components I've used. I'll only put a picture, the schematic symbol (if appropriate) and a really short description. In later blog postings I'll explain them more in detail. But I wanted to have a list I can refer to from other postings. This post will therefore be updated regularly. 
Batteryholder with two AA batteries (3V)

This is a holder for two AA batteries. As one AA battery is 1.5V, the two batteries will deliver 3V. This is enough to power basic circuits.



Battery connector

A battery connector makes it easy for you to power your circuit. The connector is useful in combination with a battery holder or a 9V battery.
Resistor

This is one of the most common electronic components. It does basically what it's name says: resisting. This component enables you to lower the voltage on other components placed in series with the resistor.

Light Emitting Diode (LED)

Also a very common component within a circuit. And a must have for anyone starting to learn electronics. As it's a cheap component you will probably break one or two in the proces. As it's name says it's a diode (see below) that emits light.

Diode

A component used in the more advanced circuits is the diode. It has one purpose: to make a wire one-way traffic.
Electrolytic capacitor

Not really a basic component, but much used. For now I'll stick to the description that it will stores energy and is able to release it quickly.


potentiometer

Handy component, especially for beginners. It enables you to adjust the resistance manually.
Transistor

The component that made everything else possible. It's function is easy to understand, but very useful. It's basically a button you can press by putting current on the middle connector.

NE555

Basic integrated circuit (IC) that can be used as a timer.
Multimeter

Also a must have for anyone learning electronics: the multimeter. Although you can build circuits without it, it will help you very much to understand things and debug your circuit.
Breadbord


Another must have for beginners is the breadbord. It will allow you to build circuits without soldering. No mess and infinite retries.
Press button


This is a pretty straightforward component. If you press the button a current will flow through it. Upon release the flow is broken.


Light Dependent Resistor (LDR)



This component will enable you to detect the amount of light. The more light, the less resistance it will generate.

Crystal oscillator





A Crystal will generate a electrical signal with a very precise frequency.

Atmega328


The Atmega328 is a PIC which is also used on the Arduino.

Ceramic capacitor


Like the electrolytic capacitor, it stores energy for a short period of time. These are better suited for high frequencies.


Voltage regulator


Component that keeps the voltage stable.