Basic Electronics Hub · free lessons for makers and students
Learn it once, remember it for life.
Resistors, potentiometers, diodes, capacitors, transistors and inductors, taught the way a favourite teacher would: one story, one memory trick and one hands-on tool for each part.
Electricity is just water in a pipe.
Before any part makes sense, you need three words: voltage, current and resistance. Picture a water tank on the roof. Once you see the tank, you will never mix these up again.
Voltage is the push. Current is the flow. Resistance is the narrow pipe.
A higher tank pushes harder: that is more voltage (volts, V). The amount of water passing each second is the current (amps, A). A narrow pipe holds the flow back: that is resistance (ohms, Ω). Raise the tank and more flows. Narrow the pipe and less flows. That is all Ohm's law says.
V = I × R. Cover the one you want: I = V ÷ R, R = V ÷ I. And power, the heat a part makes, is P = V × I.
Fill the tank, squeeze the pipe
Move the sliders and watch the flow change.
6 volts pushing through 300 ohms gives 20 milliamps.
- Current, I = V ÷ R
- 0.020 A
- Power, P = V × I
- 0.12 W
- Resistor size to use
- ¼ W is fine
The VIR triangle
Choose what you want to find, type the other two.
The calculators on this page need JavaScript.
Current
I = V ÷ R = 9 ÷ 470
- Power
- 0.17 W
A multimeter shows volts, amps and ohms for real. It is the first tool every maker should own.
Read any resistor in ten seconds.
A resistor limits current. It is the most common part in electronics, and the cheapest. Its value is painted on as coloured bands, and one silly sentence lets you read every one of them.
A resistor does not stop the flow. It limits it.
Connect an LED straight to 5 V and it pulls all the current it can, glows bright for a second and dies. Put a resistor in the path and the current settles at a safe 10 to 20 mA. Resistors also split voltages, pull pins up or down, and set the gain of amplifiers.
Gold ±5%, silver ±10%. Gold is worth more, so it is the more accurate one.
Colour code reader
Tap the colours you see, or type a value to get its bands.
Resistor value
Yellow, violet, red, gold
- Tolerance
- ±5%
- Real value is between
- 4.47 kΩ – 4.94 kΩ
- Worked out
- 47 × 100
- Standard value?
- Yes, E12
Which resistor for my LED?
The most asked question in electronics, answered.
R = (supply − LED voltage) ÷ current. Always round up to the next standard value: a little dimmer is safe, a little brighter is not.
Use a
Red, red, brown, gold
- Exact maths
- (5 − 2) ÷ 0.015 = 200 Ω
- Real current
- 13.6 mA
- Heat in the resistor
- 0.04 W · ¼ W is fine
A voltage you can turn by hand.
Every volume knob, fan regulator and dimmer you have touched has a potentiometer, or "pot", inside. It is a resistor with a third pin that slides along it.
Think of a slide in a park: the top is 5 V, the bottom is 0 V, and the wiper is where you sit.
The two outer pins are the ends of a resistor track. The middle pin, the wiper, touches the track wherever you turn the knob. Halfway up the slide you are at 2.5 V. That is why a pot is the easiest way to give an Arduino a value you can change by hand.
B10K on the body means linear, 10 kΩ. A10K means logarithmic (audio). "103" on a small trimpot means 10 kΩ.
Turn the knob
5 V across the ends, the wiper goes to an Arduino analogue pin.
Voltage on the middle pin
- Pin 1 to wiper
- 5 kΩ
- Wiper to pin 3
- 5 kΩ
- Arduino analogRead()
- 512 of 1023
- Current through the pot
- 0.5 mA
A linear pot gives half the voltage at half a turn. Use it for sensors, settings and Arduino inputs.
use it as a divider
Volume, settings, joysticks
All three pins: ends to power and ground, middle to the input. The output glides from 0 V to full. Joysticks are simply two pots at right angles.
use it as a rheostat
A variable resistor
Use one end and the wiper only, to set a current, for example an LED's brightness. Always add a fixed resistor in series, or at zero the LED gets no protection.
set it and forget it
Trimpots & multi-turn
Small trimpots sit on a PCB and are set once with a screwdriver: LCD contrast, sensor thresholds. Multi-turn pots take 10 or 25 turns for very fine adjustment.
Shop pots & trimpots →A one-way street for current.
A diode lets current flow one way and blocks it the other way. That one trick turns AC into DC, protects circuits from a battery put in backwards, and saves transistors from relay coils. An LED is a diode that also glows.
A diode is the turnstile at a metro gate.
Walk in from the right side and it turns. Push from the wrong side and it will not move, however hard you push. Each pass costs a small toll: about 0.7 V for a silicon diode, 0.3 V for a Schottky, and about 2 V for a red LED.
ACID. Current goes in at the anode and out at the cathode, the end with the stripe. On the symbol the arrow shows the way, and the bar is the stripe.
Flip it and see
A 9 V battery, a diode and a lamp. Turn either one around.
The arrow points the way the current wants to go, so the diode opens. It keeps 0.7 V as its toll.
- Voltage across the diode
- 0.7 V
- Best used for
- Mains rectifiers, reverse protection
1N4007
Rectifier
1 A, 1,000 V. Turns AC into DC in power supplies, and stops a battery put in backwards from doing harm.
1N4148
Signal diode
Small and very fast. Logic circuits, clamps and protecting microcontroller pins.
1N5819
Schottky
Only about 0.3 V lost, so less heat. Solar panels, battery circuits and buck converters.
Zener
Voltage holder
Used the "wrong" way round on purpose: it conducts at its rated voltage, 3.3 V, 5.1 V, 12 V, and holds it there. A simple reference or clamp.
Shop diodes →Fit a flyback diode across every relay coil, motor or solenoid that a transistor switches: a 1N4007 with its stripe to the + side. When the coil switches off it kicks back a voltage spike, and the diode soaks it up. You will see why in chapter 07.
A tiny tank that fills in a flash.
A capacitor stores a small charge and gives it back fast. It smooths a bumpy supply, steadies a board when a motor starts, blocks DC while letting signals through, and with a resistor it becomes a timer.
A capacitor is the water tank on your roof.
The municipal supply comes and goes, but your tap keeps running because the tank fills when water comes and empties when it stops. A capacitor does the same for voltage, in thousandths of a second. Bigger tank, bigger capacitance, measured in farads: usually µF, nF or pF.
104 = 10 and four zeros = 100,000 pF = 100 nF = 0.1 µF. Each step pF → nF → µF is a thousand times.
Capacitor calculator
Four tools that cover nearly every capacitor question.
Capacitors add up the opposite way to resistors: side by side (parallel) they add, in a line (series) the total gets smaller.
C = I ÷ (f × ripple). India's mains is 50 Hz, so a bridge gives 100 bumps a second to fill in.
Value
10 followed by 4 zeros = 100,000 pF.
ceramic · 1 pF to 1 µF
Ceramic
Small, cheap, no polarity. Put a 100 nF (104) right next to the power pins of every IC to soak up noise. Also used with crystals and in filters.
electrolytic · 1 µF and up
Electrolytic
Big values in a can. It has polarity: the long leg is +, the stripe of − signs is −. Put it in backwards and it can swell or burst. Choose a voltage rating at least 1.5 times your circuit's voltage.
film, tantalum, super
The specialists
Film for audio and mains filters, tantalum for small high-value parts, supercapacitors of several farads for backup power that charges in seconds.
Shop capacitors →Big capacitors stay charged after you switch off. In a mains power supply or a camera flash they can hold a dangerous charge for minutes. Discharge them through a resistor before you touch the board.
A small current controls a big one.
An Arduino pin can give about 20 mA. A motor or LED strip needs hundreds. The transistor is the bridge: the pin drives a tiny current into the transistor, and the transistor switches the big current. It is also the part that amplifies sound, and there are billions of them inside every chip.
A transistor is a tap. A small twist of the handle controls a big flow of water.
The handle is the base (B). The water comes in at the collector (C) and leaves at the emitter (E). Twist a little and a little flows: the transistor amplifies. Twist all the way and the tap is wide open: it works as a switch. A BC547 lets through about 100 times its base current.
On the symbol, the emitter arrow points out on an NPN and in on a PNP. For switching from an Arduino, start with an NPN on the ground side of the load.
Open the tap
A BC547 switching a 12 V lamp that needs 100 mA.
0.4 mA in at the base lets 40 mA through the lamp: 100 times more.
- Gain (hFE)
- × 100
- Lamp brightness
- 40%
- Voltage across the transistor
- 7.2 V
- Heat in the transistor
- 0.29 W
Switch a load from an Arduino or ESP32
Tell us the load. We will pick the transistor and the base resistor.
We drive the base 5 times harder than the bare minimum, so the transistor switches fully on and stays cool.
BC547 · base resistor
Between the pin and the base.
flat face towards you, legs down
BC547
NPN, 45 V, 100 mA. Signals, LEDs, relays.
flat face towards you, legs down
2N2222
NPN, 40 V, 600 mA. A stronger BC547. Some makers swap the pins, so check the datasheet.
printed face towards you
TIP122
NPN Darlington, 100 V, 5 A. Motors and solenoids. Needs a heatsink above about 1 A.
printed face towards you
IRLZ44N
Logic-level MOSFET. Switched by voltage, not current, so it barely heats. LED strips and motors.
Hard to start, harder to stop.
An inductor is a coil of wire. Current through it builds a magnetic field, and that field resists any change in the current. This makes buck converters work, filters out noise, and explains the spark when you pull a plug.
An inductor is a loaded goods train.
It takes a long push to get it moving, and once it is moving it does not want to stop. Cut the engine suddenly and all that momentum has to go somewhere. In a coil it comes out as a sudden high voltage. A capacitor is the opposite: it resists changes in voltage, while an inductor resists changes in current.
In an inductor (L), voltage (E) comes before current (I). In a capacitor (C), current (I) comes before voltage (E). Small colour-banded inductors use the resistor code, read in µH.
Switch the coil on and off
A 12 V relay coil switched by a transistor.
Press Switch ON and watch the current climb, not jump.
- Time constant τ = L ÷ R
- 0.25 ms
- Full current, 12 V ÷ R
- 30 mA
- Kick if cut off in 1 µs
- ≈ 3,000 V
power
Buck & boost converters
The inductor stores energy while the switch is on and releases it while it is off, thousands of times a second. That is how a small module turns 12 V into 5 V without getting hot.
noise
Chokes & filters
Because it fights fast changes, an inductor blocks high-frequency noise while letting DC pass. The lump on a laptop charger cable is a ferrite choke.
magnetism
Relays, motors, radios
Every relay coil, motor and solenoid is an inductor, so each needs a flyback diode. With a capacitor it forms an LC circuit that tunes radios and wireless chargers.
Shop inductors →Read a colour-banded inductor with the reader in chapter 02 →
Ten cards. Read them twice, keep them forever.
Good teachers know that we remember what we test ourselves on. Tap a card to turn it over, then try the quiz.
The 8-question test
No marks lost, no time limit. Just see what stayed with you.
Question 1 of 8
Loading…
Your first parts drawer, sorted.
Every lesson on this page can be built on a breadboard with these parts. Start here, and you will have the right part on hand for most beginner projects.
Resistors
See all →Capacitors
See all →Transistors, diodes & inductors
See all →Potentiometers & trimpots
See all →LEDs
See all →Learning kits
See all →More to explore
All electronic components →Questions students ask us
How do I read a resistor colour code?
Hold the resistor so the gold or silver band is on the right. The first two bands are digits (three on a 5-band resistor), the next band is how many zeros to add, and the last band is the tolerance. Yellow, violet, red, gold is 4, 7 and two zeros: 4,700 Ω, or 4.7 kΩ, ±5%. To remember the colours in order from 0 to 9: "BB ROY of Great Britain had a Very Good Wife".
What does 104 mean on a capacitor?
The first two digits are the value and the third is the number of zeros, in picofarads. 104 is 10 followed by four zeros, which is 100,000 pF, or 100 nF, or 0.1 µF. A letter after it gives the tolerance: J is ±5%, K is ±10%, M is ±20%.
Why does an LED need a resistor?
An LED does not limit its own current. Connected straight to a supply it draws more and more current until it burns out. A resistor in series sets a safe current. Work it out as (supply voltage − LED voltage) ÷ current: for a red LED on 5 V at 15 mA that is (5 − 2) ÷ 0.015 = 200 Ω, so use the next standard value, 220 Ω.
What is a potentiometer used for?
A potentiometer is a resistor with a sliding middle contact, the wiper. With its two ends across a supply, the wiper gives any voltage from zero to full as you turn the knob. It is used for volume and tone controls, fan and light regulators, joysticks, and to give a microcontroller a value you can set by hand.
Which side of a diode is positive?
The end with the stripe is the cathode. Current flows into the anode and out of the cathode, so for a diode to conduct the anode must be more positive than the striped end. On an LED the longer leg is the anode (+) and the flat edge on the rim marks the cathode (−).
What is the difference between NPN and PNP transistors?
In an NPN transistor a small current flowing into the base switches on a bigger current from collector to emitter; it goes between the load and ground. A PNP works the other way round and goes between the supply and the load. On the symbol the emitter arrow points out on NPN ("Not Pointing iN") and in on PNP. For switching loads from an Arduino or ESP32, an NPN such as the BC547 or a logic-level MOSFET is the usual choice.
Why put a diode across a relay or motor?
A relay coil or motor is an inductor, and an inductor fights any sudden change in current. When the transistor switches it off, the coil produces a voltage spike that can destroy the transistor. A diode such as the 1N4007, fitted across the coil with its stripe towards the positive supply, gives that current a safe path and absorbs the spike. It is called a flyback diode.
What does an inductor do?
An inductor is a coil of wire that stores energy in a magnetic field and resists changes in the current through it. It is used in buck and boost converters, in filters and chokes that block noise, and in tuned circuits for radios. Small colour-banded inductors are read with the same colour code as resistors, with the value in microhenries (µH).
Stuck on a circuit? Ask us.
Send us a photo of your circuit or the part you cannot read, and we will help you work it out.
Learn. Shop. Share.































