Table of Contents
Getting Started with ArduinoSteve tests the Arduino board with a "hello world" example. The Arduino is connected to the computer, and an example blink program is loaded, causing an LED to blink on and off.
Electricity & Hardware TerminologySteve explains a few electrical engineering concepts, including Ohm's law, polarity, and resistors. A color-coded chart is shown, which helps identify the ohm value of a resistor.
Wiring a Circuit to the BreadboardSteve introduces the breadboard, which allows circuits to be wired without soldering. They are helpful for prototyping. Students are then instructed to wire a single LED and resistor to the breadboard. Use the wiring diagram linked below.
Pulsing the LEDSteve uses the pulse method to demonstrate Pulse Width Modulation. Digital pins simulate pulsing or fading by rapidly sending on/off signals.
Wiring Button with LEDSteve adds a button to the circuit that logs messages to the console when pressed. Pressing the button completes the circuit and sends the voltage to a pin. Use the wiring diagram linked below.
Controlling LED with Button ExerciseStudents are instructed to modify the code so the button controls the LED light.
Communicating with a Web Server
Button with Web ServerSteve uses an Express server to read data from the Arduino. The Express server uses the Johnny-Five library to access the Arduino board. When the webpage is loaded, it checks to see if the button is pressed.
Toggling LED from the BrowserSteve challenges students to write the code to toggle an LED from the browser. The code is then moved to a client-side application, and a button is coded to toggle the LED using a POST request.
Communicating with Web SocketsSteve creates a web socket connection, allowing the Arduino to communicate directly with the web server without relying on GET or POST requests. When a message is received through a specific channel, the text in the browser is updated.
Sensors & Actuators
PotentiometerSteve introduces the potentiometer sensor, which emits values as a knob is turned. By default, the values are between 0 and 1023. The potentiometer is added to the breadboard with the other examples. The diagram linked below displays the individual wiring for the potentiometer.
Changing Color with the PotentiometerSteve uses the potentiometer sensor to change the background color of a web page. Since the color values are between 0 and 255, the scale method adjusts the minimum and maximum values emitted by the potentiometer.
Detecting Light with the PhotoresistorSteve uses the photoresistor to detect ambient light values from the room. The client code is refactored to adjust the browser's brightness based on the room's brightness.
Playing Notes on the PiezoSteve wires a piezo to the Arduino, which can detect vibration and create sound. Once the piezo is wired up, notes are sent to the play method, and the piezo plays the sequence.
Generating Audio with Face DetectionSteve uses a face detection library to track the position of the user's head. A frequency is generated based on the work so the user can play higher and lower frequencies by moving their head.
Face Expressions & LED Light ExerciseSteve wires a color LED into the breadboard and updates the application to change the color of the LED based on the user's expression. Note: Ensure the LED uses PWM (~) pins in the breadboard.
Working with an LCD ScreenSteve asks students to wire an LCD screen to the Arduino. Once the LCD is wired and configured, the cursor method can move locations on the screen, and the print method will write a message at that location.
Displaying System InformationSteve imports the "systeminformation" Node module and demonstrates how system information can be displayed on the LCD screen. Memory usage and battery percentage are two of the statistics shown.
Displaying Messages from GitHubSteve connects the Arduino with a GitHub webhook. An Express server is created, and ngrok is used to expose the server and the port to be called from the webhook when the repo is starred.
Web Serial APISteve introduces the Web Serial API and demonstrates how the web browser can communicate with serial devices without a web server as an intermediary.