Arduino Uno lessons in the browser

The sketch runs in an ATmega328P emulator on the page: the current line is highlighted, the serial monitor prints, the numbers change on the fly. 11 lessons, in order from the board to a parking sensor.

  1. 1. Getting to know Arduino UnoThe Uno R3 board on a scene with labelled parts. The sketch blinks the L LED on the board and runs in an ATmega328P emulator on this page.8 min
  2. 2. Blink on Arduino UnoThe first breadboard circuit: pin D8, a 220 Ω resistor and an LED. The sketch runs in an ATmega328P emulator on this page, the flash and pause times change on the fly.10 min
  3. 3. A button on Arduino UnoA button on a breadboard between D2 and GND, the INPUT_PULLUP pull-up inside the board, an LED on D8 stays on for another second after release. You hold the button on the scene with a mouse or a finger.10 min
  4. 4. A potentiometer on Arduino UnoA potentiometer between 5V and GND, the middle pin on A0, an LED on D9. You turn the knob on the scene with a mouse or a finger, analogRead() reads the voltage, analogWrite() sets the brightness.12 min
  5. 5. An RGB LED on Arduino UnoA common cathode RGB LED: three LEDs in one bulb on D9, D10 and D11, each with a 220 Ω resistor. The brightness of each colour changes on the fly, the scene mixes the colour.10 min
  6. 6. A photoresistor on Arduino UnoA GL5528 photoresistor and a 10 kΩ resistor divide 5 V, the middle of the divider goes to A0. A night light LED on D9 turns on when the reading is below a threshold. You move the lamp on the scene with a slider, a tap on the photoresistor covers it with a palm.12 min
  7. 7. HC-SR04 on Arduino UnoThe HC-SR04 on a stand: VCC to 5V, TRIG to D9, ECHO to D10, GND to GND. In front of the sensor there is a track with a toy car, a box, a ball or a wall, the distance is set by a slider or the back and forth button.12 min
  8. 8. A buzzer on Arduino UnoA 12 mm passive buzzer: the plus through a 220 Ω resistor to D8, the minus to GND. A four-note melody sits in the notes and beats arrays. The sound is off by default, an icon on the scene turns it on.12 min
  9. 9. A motor on Arduino UnoA 130 motor with a fan blade powered by three AA batteries, the battery minus shared with the board GND. A MOSFET IRLZ44N turns the motor on: the gate through 220 Ω to D9 and 10 kΩ to GND, a 1N4007 diode across the motor with the stripe to the plus.12 min
  10. 10. An SG90 servo on Arduino UnoThe Uno sketch runs in an ATmega328P emulator on this page. The numbers in the code change on the fly, and the finished sketch is flashed to your own board.10 min
  11. 11. A parking sensor on Arduino UnoThe final project of the series. An HC-SR04 range finder on A1 and A2, a traffic light of green, yellow and red LEDs on D12, D11, D10, a buzzer on D8. A slider or the back and forth button moves the toy car on the scene, an icon turns the sound on.15 min