Arduino
Arduino lessons for ages 12+: electronics basics, measuring with a multimeter and C++ programming with real components, from an LED to traffic lights.
0 Safety in the Arduino workshop
We work like engineers — we plan, build, measure and test
1 Electric circuit - basic concepts
The basics of an electric circuit: what current, voltage and resistance are, their units, and how to measure them with an ammeter, voltmeter and ohmmeter.
- 1.1 Arduino, electronics and building your own devices From your first electric circuit and C++ program to devices, automation and your own printed circuit board.
- 1.2 Review of electronics basics and measurement Connect, measure, check: electronics basics through real components and hands-on experiments
2 Arduino - step by step
An automatic light like a fridge light: push button, NPN transistor and LDR, then an Arduino that reads the light on A0 and dims an LED with PWM.
- 2.1 Voltage divider, Arduino and PWM From measuring the voltage on a potentiometer to an LED that warns when a threshold is crossed
- 2.2 Traffic lights for cars and pedestrians The Arduino controls a traffic light for cars, a pedestrian light and a sound signal, and our own function keeps the program short and easy to read
- 2.3 Two traffic lights at a crossroads Two Arduinos talk over a wire: traffic light A controls the crossroads, B listens and reports when it has stopped, and with millis() both notice a fault.
3 Buttons done right
A button with INPUT_PULLUP, counting presses, contact bounce, debouncing with millis() and with the Bounce2 library, and telling a press from a hold
- 3.1 Reaction game A reaction game on the Arduino: a state machine with switch and case, a random wait with random(), timing with millis() and sounds with tone() that don't wait
- 3.2 Many switches on few pins A switch matrix on the Arduino: a 4 × 4 membrane keypad scanned by our own code, arrays and nested loops, ghost keys and the diodes that remove them
- 3.3 Detecting the ball The Arduino detects the ball: a microswitch on a ramp, a hit timed with micros(), why Bounce2 misses a short hit, a tilt and an infrared break-beam
4 LED matrix and MAX7219
An 8 × 8 LED matrix with the MAX7219 chip on the Arduino: multiplexing, our own send function with shiftOut(), a picture, an animation and scrolling text
