31 Jan 2013

Getting components

After you bought the multimeter, breadboard, pliers, wire stripper, soldering iron (...) there is still something missing, the components! But from where should you get them?

You have a few options:

  • From a local store (in my case, they are too far from my place)
  • By salvaging old equipment (TVs, radio, etc...)
  • From Ebay
  • From small online stores
  • From a large online electronic component distributor

Local store

There are a lot of specialized shops to buy components. Usually, the prices are a lot higher than the other places, and the choice of component is limited. They are useful when you need a component right away and do not want to wait several days for the parts to arrive.

Salvaging and scavenging

Sometimes, you can find some little gems in broken and old electronic equipment. It may be hard to remove the component without breaking it though. You might want to search for power supplies, toroids, LCD screen, resistors/capacitors, connectors, switches etc...

Ebay

This one is my favorite! Components on Ebay are cheap... really cheap. Most of the time, you can get bulk parts for 1$, free shipping. I recommend Tayda2009, he got a lot of stuff at a bargain price. The only problem with Chinese and Thai sellers is that the shipping time is 2-3 weeks. For even better prices, you can visit his online store and use the voucher EB99922 for a 10% discount.  ;)

Small online stores

These stores are handy for specialized parts like sensors, motors and various purposes boards. Shipping prices can sometimes be a problem; maybe not in the US but in Canada it can often be something like 30$. On Cyber Monday, shipping was free at Sparkfun so I bought some interesting stuff. Take a look at this resistor kit. I suggest you try them by yourself and pick your favorites.

Large online distributors

For a professional service, try some of the large electronic retailers. Their parts selection is HUGE and shipping time are blazing fast (2-3 days). They are often the only choice when looking for a particular component. One nice tip : try findchips website, you can enter a part number and you will get a list of all the distributors that stock the component you are looking for.

If you do buy some parts, leave a comment and tell me which method worked for you :)



29 Jan 2013

Diodes fundamentals and LEDs


The diode is an non-linear (current vs. voltage not proportional) electronic component of the semiconductor class. It is a two leaded device that is primarily used to block the flow of current in one direction. The terminals of the diode are called the anode (positive) and the cathode (negative).

In the reverse mode, the diode will block current until the breakdown voltage is reached, then the device is destroyed. In the forward mode (conducting mode), the diode let the current flow and will drop some volts, this is called the forward voltage drop. In datasheets, this value is abbreviated Vf.

There are multiple diodes types;

Signal/Switching diode

This diode is the simplest of all. Some of them can carry only small current values (usually signal diodes). Some others like the rectifier diodes can carry larger amounts of current. Some of the most popular diodes are part of the 1N4000 series (1N4148; 1N4007; etc...). For this type of diode, you often see forward drop of 0.7 Volts.

Schottky and Zener

The Schottky diode is usually used where you need a small power dissipation. This is due to their low forward drop (often 0.2 Volts). The Zener is a special type, where the reverse mode will conduct at low voltage values : 24V, 12V, 5V, 3.3V etc... This is useful to create voltage references and small current capacity regulators.

The ubiquitous LED

I think everyone is familiar with the LED (Light Emitting Diode). This type of diode is available in a lot of different colours, shape and brightness. The most common is the discrete 5mm red LED. Here is what it looks like :


On this image, you can also see the schematic symbol of the LED and how to identify the terminals. For through hole parts, the longer lead is the anode. The forward voltage drop of the red LED is about 2 Volts. Other colours have different forward drop. To light the LED, current has to flow from it's anode to cathode. Here is the basic connection schematic :



The current through a LED usually has to bet set between 5mA and 15mA. Too much current will damage the LED. The formula to calculate the current is the following : (Vsource-Vforward)/R. I made a little html form (powered by javascript) so you can try different voltage source and resistor combination. You can choose the colour to change the forward drop. Results are approximative, consult the LED datasheet for more accurate values.


LED Current Calculator Voltage:V
Resistance:Ohm
LED Color:

I hope that diodes have no longer secrets for you!

28 Jan 2013

Resistive circuits calculations

In my last post, I introduced the basic quantities used in electronics. These notions are necessary to move further with electrical circuits calculation. It is easier to learn the Ohm's law with examples so here we go :


The picture above is what we call a circuit schematic. At the left of the schematic we have the DC source (batteries in this example). At the right you see the resistor schematic symbol. Keep in mind that the wire at the bottom is the ground net. We have a voltage source of 10 Volts and a resistance of 5 Ohms. We want to find the current that the supply will source through the resistor. If we recall that E = R x I we can solve for the current I = E/R then 10/5 = 2 Amps. But what if we've got multiple resistors?

Resistors in series

If you have multiple resistors in series, you just have to sum their values and replace all the resistors by one resistor that is the total of the others. See this circuit :



The 2 and 3 Ohms resistors can be replaced by a resistor of 5 Ohms. You then are I = E/R, 5/5 = 1  Amps.

Remember : what we are doing here is circuit reduction. In the above example, we reduced the circuit to find the total current the goes through the resistors. In a series circuit, the current is the same through the series component. This means that above, you have 1 Amps through R1 and R2. To completely solve the circuit, you would want to know the voltage accross the two resistors. Easy! Remember E = R x I ? For R1, E = 2 x 1 = 2 Volts. I hope you guess that we have Volts across R2.

Resistors in parallel

For parallel resistors, the formula is a little bit more complicated. When we have two resistors R1 and R2, the parallel resistance R3 is calculated with 1/R3 = 1/R1 + 1/R2. You can reduce the formula to R3 = (R1 x R2) / (R1 + R2). After a while, you will realize that if two resistors of the same value are in parallel, the result will be the half of the resisor value. Proof : (R0 * R0) / (R0 + R0) = (R0^2) / (2*R0) = R0/2, half of R0.


In the above circuit, the resistors are the same, 20 Ohms. R3 = (R1 * R2) / (R1 + R2) = ( 20 * 20) / (20 + 20) = 400 / 40 = 10 Ohms. The current sourced by the batteries : I = E/R, 24/10 = 2.4 Amps. 


Parallel Resistors Calculator R1:Ohms
R2:Ohms


Observe that the resulting resistor is always at a lower value than the smaller of the two resistors value.

Units in electronics

In the circuits above, we have several amps through the resistors. This means a lot of heat and big resistors (physically). Most of the time, in electronics circuits, we have currents about 1000 times smaller. The resistors used are several thousands times bigger than the ones used in the examples.

The most common SI (International System) units are : milli (1/1000) and kilo (1000x). Generally, we have milliamps, kiloohms, and volts stay the same. If you multiply kiloohms and milliamps, you end up with volts. The fun part is that you can calculate everything without caring too much about the units, just remember that you have milliamps and kiloohms. Example (from above) :  R = 5 kiloohms, E = 10 Volts : I = E/R ; 10/5 = 2 milliamps. See? The units are not the same but the numbers are. Don't worry, it will eventually sink into your brain...

Shortcut : voltage dividers

When you have 2 resistors in series (see example above) you can easily find the voltage across each resistors. This is needed to completely solve the circuit. V2 is going to be the voltage across R2. If R2 (3Ω) is next to GND (ground) and R1 (2Ω) is next to the positive supply : V2 = E * (R2 / (R1 + R2)). In the example of the series resistors : V2 = 5 * (3 / (2 + 3)) = 5 * (3 / 5) = 15 / 5 = 3. We then have Volts across R2, exactly what we found earlier. Here is a little form to test voltage dividers :

Voltage Divider Calculator V+:V
R1:Ohm
R2:Ohm



Conclusion

Okay, I have to admit that a lot of boring calculations were done in this post, but they are needed for the most simple circuits and this is the basis to understand all the later examples. This will help us to get lower voltages from a higher voltage source with the right combination of resistors. We will also be able the verify the current flowing through our components and be sure that the current ratings are respected.

The next post will quickly cover the operation of the diode, and we will see how to light some LEDs (Light Emitting Diodes). This will be a lot of fun =D

25 Jan 2013

Basic electrical quantities : the Ohm's law

Quantities

Everybody has heard about voltage, current and resistance electrical quantities. Here is what you have to know about them to get started.

Voltage - E

Voltage, also known as potential difference, is the initiator of current flow. The unit of the voltage is the Volt (V). In the nature, every systems seeks the equilibrium. Think about the temperature : you have some rooms at different temperature, if you open the doors, the temperature will settle at a value sitting in between the maximum and minimum temperature of the rooms. The same happens for electricity, pressure (i.e. water level in pots) and even odours. Voltage consist of an unbalance of electrical charges (electrons). So the electrical potential difference will create a flow (current) when a path exist between the positive and negative electrodes.

Voltage can be stable over time (DC) or varies over a period (AC). There are also transient voltages, that exists for a short amount of time. In electronics, we mostly use direct current. This is because of the transistors, which works only in DC (every digital integrated circuits are made of a lot of transistors).

Current - I

We already said that the current is the results of the electrical potential difference. The unit of the current is the Ampere (A) and correspond to a flow of a predefined quantity of electrons per second. For the curious, this predefined quantity is one coulomb and it contains 6.24x10^18 electrons. The electrical current is responsible of heat elevation in the different conductors. This is the principle of the electric heater. Current in a wire will also generate something invisible called a magnetic field. The same kinds of magnetics field are generated by magnets.

Resistance - R

The quantity that links voltage and current is known as the electrical resistance in Ohm (Ω). For a lower value of resistance, a higher value of current will flow for a certain voltage level. Materials with low resistance are called conductors (i.e. metals, plasmas); the ones with high resistance are called insulator (i.e. ceramics, glass, plastics...). In other words, the resistance limits the flow of current.

Power - P

The power is expressed in Watts (W) and is used to calculate the amount of energy consumed by a circuit. In fact, energy is the result of power over a certain amount of time. For example, you have one 100W light bulb, on for a period of 10 hours. This result of an electrical energy consumption of 1000W for one hour : 1kWh. The kilowatt hour is the unit of energy used by electrical distributors to bill their clients.

Ohm's law

The Ohm's law is the most basic and most used formula in the electrical domain. It was named after the German physicist Georg Ohm, in 1827. This law links the three principal electrical quantities.

E = R x

This is all you have to remember. By manipulating this formula with simple algebra, you can compute each quantity by knowing the other two. Here is an interesting picture that shows the possible equations we can generate with the Ohm's law (and by knowing that P = E x I).


I'm going to give various calculation examples, can you guess which equation is being used?

  • 8A flowing in a 3Ω resistor generates a 24V potential difference
  • 12V across a 4Ω resistor generates a current flow of 3A
  • To get 4A flowing with a 8V DC supply, you need to connect a 2Ω resistor across the supply contact 
  • There are 2A flowing in the filament of a 240W light bulb from the 120V AC main (wall outlet)

Take a look at this Ohm's law calculator, just let one blank field for the unknown value.


Ohm's Law Calculator Voltage:Volts
Current:Amps
Resistance:Ohms


 

I hope you learned something new by reading this post. The next step will be to fiddle with a power supply and resistors to get the grips with the Ohm's law. You will also learn about voltage dividers.

See you later friends and have fun!


Checklist for beginner electronics kit

Some of the Parallax "forumistas" told me that I should post a list of cheaper tools and instrument to get started with electronics. By the way, Parallax Inc. is a great place to buy sensors, robot parts, microcontroller development kit, etc... They also developped their own microcontroller, the Propeller, that I will cover extensively in the next weeks. Don't forget to take a look at their forum, the people there are really nice and can answer the most of your questions.

So here is what I came with for a budget beginner electronics kit (parts found on Newark) :


  • DURATOOL 22-8850 - WIRE STRIPPER - 4$
  • DURATOOL D00120 - WIRE CUTTER - 2.70$
  • DURATOOL TL10328 - LONG NOSE PLIERS - 2.60$
  • AMPROBE AM-500 - DIGITAL MULTIMETER - 30$
  • NTE WHS22-00-25 - HOOK-UP WIRE 25FT BLACK - 3.70$
  • NTE WHS22-02-25 - HOOK-UP WIRE 25FT RED - 3.70$
  • GLOBAL SPECIALTIES GS-830T - BREADBOARD - 9.30$
The good thing with the Amprobe multimeter is the auto-ranging feature, it automatically detects the value range of the voltage/current/resistance you are measuring. When buying wire for breadboarding, you have to get solid core wire, not stranded. I did this error with my last order. The part number looks the same for the 25 feet NTE 22 gauge; solid wire: whs22, stranded wire: wh22.

If you plan to do some soldering, you can take a look at :

  • WELLER WES51 - ANALOG SOLDERING STATION - 125$
  • KESTER 83-4000-0000 - POCKET PACK SOLDER - 3.70$
An benchtop oscilloscope is a more exotic beast. For low cost alternative, you can take a look at USB oscilloscope like this one. You can even find ones that you can directly embed in a breadboard :



Finally, here is an example BOM (Bill of Materials) of the beginner kit.


In the next tutorials, I will cover basic components needs along with circuit schematics.



23 Jan 2013

The lab : tools and test instruments

The lab

Even if you got the best skills, you can do next to none in electronics without a minimum of tools and instruments. In this post I will present the tools and instruments I have to work. Keep in mind, some of the things here are fancier than what you can get for a cheap price on the internet or at the hardware store. Though, this should give you an idea of what you might need to work efficiently.

Here is what my lab set-up looks like

Having a little workbench is a nice thing, because you want to get everything you need in your workspace (and you don't want to mess the dinner table). If your job is not finished, you can leave your stuff there without anyone to move your stuff around.

The tools and instruments

Multimeter

At first, you need to get a multimeter. You will then be able to read voltage, currents and resistance value. More advanced multimeter will let you take RLC measurements (inductance and capacitance), display the frequency etc... A pretty useful feature is the continuity test (beep a connection). This test let you know if the contacts you probe are shorted. This can be useful if you have a PCB (Printed Circuit Board) and want to look where are the grounds connections on the differents components.

Here is my benchtop multimeter (left) and power supply (right)

Power supply

Next would be a power supply. A poor man power supply (wall wart) can be found almost anywhere, but the problem with these is that they output a constant voltage (we will later how we can change that, cue : LM317). In a lab setup, we want a variable voltage power supply. The model shown (100W) is 0-36V with a 3A maximum output. The good thing with these supplies is that you can control the maximum allowed current output. This is really helpful when you want to protect a component by limiting the maximum current to be a little bit under the current rating of the component. Let's say you have a 1A transistor, not limiting the current would destroy it in case of a short-circuit (in this case 3A would flow).

Breadboard

The prototyper best friend, here is the protoboard. When you are not sure if the circuit you are building will work (in my case 90% of the time), you're better to make a prototype first. Most of the through hole components (diodes, resistors, caps, leds...), integrated circuits in DIP (dual in-line) package and wire should fit in.

An empty breadboard

Soldering iron/station

For through hole component soldering, you don't really need the best iron on the market. But when it is the time to solder tiny SMT (surface mounted) components, you will need a soldering station. I think it is a good choice to invest in one with numeric display and temperature feedback. Mine is a WESD51 from Weller : excellent and reasonably priced (200$). I aslo recommend buying a few spare soldering iron tips (around 4$ each). On the picture, you can see other accessories : tube of solder, desoldering braid, liquid flux pen, flux dispenser and PCB cleaning pen. The flux helps distributing the heat when soldering SMT IC.

Weller WESD51

Oscilloscope

Okay, this one is a bit more pricey. The oscilloscope is not really necessary to get started, but is a great addon in the future. It is your best friend to analyse analog and periodic signals and to debug serial data transfer. In other words, every signals that is not static (not measurable with a multimeter). You can do more advanced stuff to : get the frequency content of a signal (FFT), perform calculation between two signal (addition, substraction) and some other goodies. Mine can save screenshot on a USB drive, I think it will be useful in my future tutorials.

BK Precision 2530B entry level oscilloscope (450$)

Other tools


These are needed to cut and strip wires. The long nose plier is useful for bending resistor leads


For robotics, you need different sized screwdrivers 


Don't forget the wires, in different colors. Digital calipers are useful for precise measurements


Conclusion

That's all for tonight folks. Phew, that took me a while to write!
As you can see, a lot of stuff is needed to get serious in electronics. I'm sure it is possible to get working with less than what I showed here, but I think this novice lab is what it takes to get started.

Thanks for reading and see you soon!

22 Jan 2013

Greetings

Finally, I graduated in Electrical Engineering last December from UQAC, Qc, Canada. With some money now coming regularly in my bank account, I can buy some lab equipment and experiment with electronics. Lots of fun to come!

I plan to document some of my experiments, share useful circuits and tips. I might post on this blog at least once a week, maybe more in the beginning :)

At first, I will show you what my lab looks like, which tool and instrument I will be using. After some summer jobs and internships, I got a good idea of what is needed to develop and debug printed circuit boards.

Next, I will cover the basics of electronics with some formulas and explain the function of the most common components. This information is redundant, and can be found all over the web but I'll do it for the sake of completeness. I'll try to make it the shortest as possible and get straight to the points. It's going to be done with my understanding and approach of electronics. Look at it like a reference.

I will then describe some of the circuits I'm tinkering with and add some photos/videos here. I would also like to present the software I'm using most of the times, microcontrollers I like to use etc... I'm a fan of the Python programming language too, so I may post some scripts used to compute components value to use in the circuits.

If you have any request for topics to cover, project suggestion or simply help correct errors in my texts (I speak French) then you can contact me at fred_blais5[at]hotmail[dot]com

Stay tuned!


View Frédérick Blais's profile on LinkedIn