Basic Electronics

First introduction

Electronics is everywhere in our modern lives, from our computers and smartphones to our coffee machines. Learning electronics becomes more and more a useful skill to have in life. In this module, you will be reminded of the basics in electricity, the difference between DC and AC current, and you will learn the main electronics components, tools, actuators and sensors.

Practical relevance

– This is what you will need the knowledge and skills for

Knowing electronics can help you build your next project about the Internet of Things, create an interactive art project, or repair the devices in your home.

Overview of learning objectives and competences

Knowing electronics can help you build your next project about the Internet of Things, create an interactive art project, or repair the devices in your home.

Required skills for this module

Knowing electronics can help you build your next project about the Internet of Things, create an interactive art project, or repair the devices in your home.

Electricity Principles

Electricity is a set of phenomenons due to the displacement of charged particles, more generally electrons.
Electrons are atomic negatively charged elementary particles that can travel through electrically conductive materials, most notably in metals but not limited to.

There are three basic principles to know concerning electrons, or more specifically, the charge they create :

  • Current : It represents the rate at which charge is flowing. It‘s unit is the Ampere (A)
  • Voltage : It represents the difference  in charge between two points. It‘s unit is the Volt (V)
  • Resistance : It represents the tendency of a material to resist the flow of current.  It‘s unit is the 0hm (Ω)

The relation between Current, Voltage and Resistance inside a conductor is described by a formula known as « Ohm’s Law » and which states :

Definition
Ohm’s law is: U = R x I
with U being the voltage in Volts, R the resistance in Ohms, and I the current in Ampere.

DC & AC Current

The terms DC current and AC current describe how electric current’s waveform behaves. When connecting a device to a power supply, it is important to use the right kind of power supply (either DC or AC) as expected by the device, in order to avoid damaging the device. What follows is a reminder of the most important concepts concerning electricity.

Definition
When considering the flow of electric charges, either the direction of the flow stays the same, in which case this is direct current (DC), or it changes periodically, in which case this is alternating current (AC).

DC current is what you have with a battery or a USB port for example. The current only flows from the positive  end to the negative end. The voltage from a battery may decrease with time as the battery is drained, but it still flows only in one direction, and thus remains a DC current even if the voltage fluctuates.

On the other end, AC current can be found for example on wall plugs. The actual voltage on wall plugs may be 110v or 230v, depending on the country,  has a sinusoidal waveform, and the direction of the current may change 50 or 60 times per second between the two wires.

The number of times a waveform, the voltage in our case, repeats itself per second is called the frequency, and it is measured in Hertz (Hz).  For an AC sinusoidal current, the frequency corresponds to the number of times per second the direction changes.

Power is a useful notion in electricity, it allows for example to evaluate the energy consumed by a device, it is calculated easily in DC using the formula P=U x I, but it is a little more complicated with AC because the voltage in AC isn’t constant. There is a formula to get an equivalent voltage as DC to measure power which would dissipate the same amount of heat in a resistor. This formula is named “RMS”, which stands for Root Mean Square and is calculated as follows :

with T1tT2, and f(t) being the function of the waveform.

This formula may seem a little bit complicated, but fortunately you don’t have to remember this form as It simplifies a lot when dealings only with sinusoidal AC waveforms, and becomes :

Definition
Vrms = Vpk x 0,707
with Vpk being the peak voltage of the AC signal. This form works only for sinusoidal AC waveforms.

Main Electronic Components

Electronic components are divided in two categories. The ones called passives can’t introduce energy in the circuit and do not require an external source for their operation. Passive components include : resistors, capacitors, inductors, and transformers.

The others are called active components, and require an external source for their operation, and include :  diodes, transistors, thyristors, …

3.1 Resistors

3.1.1 Fixed value resistors

Resistors are two legged components that oppose the flow of current. Their main characteristic is their resistance, measured in Ohms. They exist in many shapes and forms, some are components meant to be soldered through holes on the circuit board, and some as SMD (surface mount device) which are meant to be soldered on the surface of the circuit board. 

Resistors are often used to limit the current to other components, reduce voltage with an arrangement called “resistor divider”, or heat something. As resistors dissipate power as heat and it is therefore important to not exceed their power rating to avoid burning them.

The type of resistor to use depends on the application : for example, if the application needs to dissipate a lot of power, cemented power resistor could be an option, if compactness is desired, then smd resistor should be used, if a quick prototype is being made, then ordinary through hole carbon resistor could be considered.

In the following table you can find various examples of common resistors.

Resistor Name

through hole carbon resistor

Cemented power resistor

SMD resistor

3.1.2 Potentiometer

Potentiometers are three legged variable resistors. There is a fixed resistor value between two leads of the device, and a movable cursor connected to the middle lead sliding along a track. This allows to get between that middle lead and one of the other, any resistor value between zero and the nominal value of the potentiometer. Potentiometer can be linear or rotary.

One can find a rotary potentiometer for example used in volume dial for amplifiers or speakers.

3.2 Capacitors

Capacitors are two legged components that can store and release back electric energy quickly. They oppose the rapid change of voltage between their leads. Their main characteristic is their capacitance, measured in Farads.

Some types of capacitors can be polarized, meaning that they have a positive and a negative lead, and failure to respect that polarity in a circuit can result in the destruction of the device. They are often used to store energy or to smooth voltage of power rails, in power supplies for example, or next to fast integrated circuits to quickly provide power in case of a current peak.

In the following table, you can find some examples of common capacitors.

Capacitor Name

through hole electrolytic capacitor

through hole polyester capacitor

a ceramic SMD capacitor

3.3 Inductors

Inductors are two legged components that can store some energy in the form of a magnetic field. In their simplest form, they can be just a coil of conductive wire. They oppose the rapid change of current between their leads. Their main characteristic is their inductance, measured in Henry.

They are very used in analog circuits for signal filtering, but not so much with digital circuits.

In the table below are some examples of inductors

Inductors Name

a linear inductor

a toroidal inductor

some SMD inductors

3.4 Diodes

3.4.1 Generalities about diodes

Diodes are polarized components that allow the current to flow only in one direction. They have a positive lead, called anode, and a negative lead named cathode.

When a voltage is applied between its leads, with the most positive potential at the anode the diode is said to be in forward direction, and the current can flow, and when the voltage is reversed, the diode is said to be in reverse and the current is blocked.

Unfortunately, ideal diodes don’t exist, and there is a voltage drop occurring between the anode and the cathode when the diode conducts. This voltage is often referred to as Vf. For classic silicon diodes, this is typically 0,7V, and can be a little bit less with special diodes like germanium diodes or schottky diodes. When the voltage is below the threshold of the diode, very little current flows through, and when the voltage is higher than the threshold a lot of current flows through the diode. These components have a very non linear behavior.

One very known type of diode is LED, which stands for Light Emitting Diode. Like regular diodes, they only let current flow in one direction, and have a voltage drop between their LEDs, but emit light doing so. LEDs can be found for different colors, like blue, red, green, yellow, purple… but they are not limited to the visual spectrum as they exist also for Infrared and Ultraviolet.

Some other types of specialized diodes exist like : Zener diode, which has a specific voltage drop when put in reverse, or TVS diode, which eliminates fast transient high voltage like ESD (Electrostatic Discharge) that may kill other components.

Diode Description

some colored LED

a through hole silicon diode

a SMD Schottky diode

Here are the typical characteristics of some diodes  :

diode forward voltage Vf max average current max reverse voltage
1N4148 silicon diode
0.7-1V
200mA
75V
1N5817 Schottky diode
0.45V
1A
20V
red or green LED
1.8V
20mA
5V
blue or white LED
3.0V
20mA
5V

3.4.2  Lighting a LED

If you want to power a blue LED (or any LED) from a 5V voltage source for example, then you have to put in series a current limiting resistor. Failure to do so may result in the burning of the LED.

The forward voltage in the LED being 3V, you have to drop the remaining 2V with a resistor using Ohm’s Law : U=RxI

with U=2V, I=0.02A, we have R=U/I = 2/0.02 = 100 ohms

This is the minimum value resistor to not destroy that LED.

The generic formula to calculate the minimum resistor to put in serie of a LED is the following :

R = (Vsource – Vf) / (current through the diode)

3.5 Transistors

Transistors are electronic components that can act like a switch, or an amplifier of current. They generally have 3 leads and exist in a variety of forms, sizes and technologies. 

Some of the most common ones are bipolar transistors, made of different silicon junctions that give these transistors their name : NPN and PNP (N being a negatively doped silicon, and P a positively doped silicon).

NPN and PNP transistors have their leads named emitter, base and collector. These devices are current-controlled, meaning the current flowing through their base controls how much current flows through from the collector to the emitter for NPN and from the emitter to the collector for the PNP, with a ratio between the 2 currents called gain.

One other common type of transistor is the MOSFET (Metal Oxide Semiconductor Field Effect Transistor). Their advantage compared to bipolar transistors is that they can be commanded with voltage instead of current, and are more efficient when used as a switch. Their drawback is that they are sensitive to ESD that can damage them.

Transistor Description

some small signals transistor in TO92 package

a power transistor in TO220 package

a SMD transistor in SOT23 package

3.6 Integrated circuits

Integrated circuits are lots of tiny components, like transistors, resistors and others, etched on a piece of silicon and protected by a package. Integrated circuits is the technique that allows manufacturers to miniaturize considerably electronic devices, putting for example millions or more of transistors in a processor of only a few square millimeters.

The types of functions that can be integrated are very large, for example : memory cells, computing units, sensors, drivers for motors, logic gates, …

Integrated circuit Description

a NE555 in DIP 8 (through hole) IC

a SOIC 14 smd IC

Tools

4.1 Multimeter

A multimeter is a device capable of measuring multiple electrical properties like voltage, current, resistance, frequency, diode forward voltage or capacitance. It can be analogue or digital, with manual range or autoranging.

That very useful tool allows someone for example to verify if a fuse is blown, check the value of a resistance, measure the voltage of a battery, or to know the consumption of a device.

As a simple exercise, you can measure the voltage of a 9V battery. To do so, you need to ensure that the black cable is plugged on the “COM” hole, and the red cable is on the “V” hole of the multimeter. Then, turn the dial to the proper position : V DC for an autoranging digital multimeter, or the caliber 20V DC or higher, for a non autoranging multimeter. Then put the tip of the black cable in contact with the “-”  terminal of the battery, and the tip of the red cable in contact with the “+” terminal of the battery. The screen should then display a value close to 9V, like on the following photo :

4.2 Oscilloscope

An oscilloscope is an electronic device that allows us to monitor fast moving voltage waveforms. Contrary to multimeter, oscilloscopes measure only voltage, and eventually current when equipped with special probes.  They can be used for example to monitor or decode serial protocol, visualize the responses of analog filters, or measure the rise time of signals.

4.3 Lab power supply

A lab power supply is a special power supply whose voltage can be freely adjusted, and whose current can be limited. When testing a circuit in the development phase, it is often useful to have some protection that cuts the power or limits the current when a fault occurs in order to avoid damaging your DUT (Device Under Test), and that is exactly what those devices are for.

a programmable lab power supply

4.4 Soldering iron

A soldering iron is a hand tool that melts solder alloy to make electrical and mechanical connections between two or more workpieces.

Actuators & Sensors

When considering an electronic device, it can contain components that interact with the real world in two ways : to get information in, or to act on something. The first is called a sensor, and the second an actuator. Sensor and actuator can either be analogous or digital. 

Here are some examples of sensor :

  • button
  • temperature sensor
  • humidity sensor
  • LDR (Light Dependent Resistor)
  • photodiode
  • magnetometer
  • accelerometer
  • gyroscope

Here are some examples of actuator :

  • motor
  • solenoid
  • leds
  • lamps
  • displays
  • loudspeaker
  • buzzer
Sensor or actuator Description

some buttons

an LCD display

a stepper motor

a buzzer

a loudspeaker

a PIR (Passive Infrared) sensor

an ultrasonic distance sensor

Summary

Knowing the basics of electricity with concepts like voltage, current, resistance and frequency is important to learn electronics. 

There are numerous electronic components, some passives like resistor, capacitor and inductors, some other actives like transistors and diodes.

You learned that resistors oppose the flow of current, capacitors store energy and oppose the change of voltage, inductors store energy and oppose the change of current. Diodes let the current flow in only one direction and some can emit light and are called LED. Transistors are like an electrically controllable switch.

The practice of electronics may require some tools like a lab power supply, a multimeter, an oscilloscope or a soldering iron.

And lastly, we learned about the difference between effectors and sensors.

Quizz