Unit Overview
In this unit, we covered the basics of computer programming through completing a Javascript-based gizmo, simulating circuits on Tinkercad, and finally building a physical Arduino to light up an LED (C++). To start, I went through the Programmable Rover gizmo, which tasked us to program a rover using Javascript and block codes. In this process, we had to undergo the warm up tasks, as well as the mission activities, using blocks such as moving (translating), rotating, jumping, pickup, and loop. The ultimate goal of the gizmo was to learn how to properly optimize code and save battery life. Next, I used the online coding and circuit simulator, Tinkercad, to design a stoplight and blinking LED circuit. It similarly used block to text coding with C++. Finally, using the Arduino Uno board and components from the Fablab (including 220 Ω resistors, a breadboard, light emitting diodes, and male-to-male jumper wires), I physically built the circuit models that were previously designed in Tinkercad. Below contains the documentation for that process:
Designing Circuits in Tinikercad
Single LED blinking in Tinkercad: For this build, I used four male-to-male jumper wires, a 470Ω resistor, a red LED, and the Arduino Uno board. I assembled the design by following the flow from pin 8 through the GND. I had also previously watched a video on how a breadboard is electrically connected, so I knew how to connect the LED to the buses. To run the simulation, I pressed the "Start Simulation" button at the top right corner.
Single LED blinking code: when I designed the circuit, the code was automatically loaded in. "HIGH" shows that the LED is lit up, and "LOW" shows that the LED is not lit up.
Stoplight in Tinkercad: Using my knowledge from the single LED blinking, I designed a stoplight with a parallel circuit. The positive LED legs connect to individual pins on the Arduino Uno board, and the negative legs all link to the single GND.
Stoplight code: I first set up the output for pins 3, 9, and 13, before using HIGH/LOW to regulate when the LEDs would light up or turn off. Between each digitalWrite() function, I added a delay() to shorten/extend the amount of time an LED would stay lit up - 1000 counted as 1 second.
Arduino
CLS Fablab Blinking LED: For the build, I used a breadboard, an Arduino Uno board, 1 red LED, 2 male-to-male jumper wires, and 1 220 Ω resistor. The design reflects the Tinkercad model.
Code of Blinking LED: This code was created on the Arduino application, which also operates on C++. I directly copied and pasted the code from Tinkercad and clicked "upload" to send it to the Arduino Uno board.
Video of Blinking LED
CLS Fablab Stoplight: For the build, I used a breadboard, an Arduino Uno board, 3 LEDs (1 red, 1 yellow, 1 green), 7 male-to-male jumper wires, and 3 220 Ω resistors. The design was also created based on the Tinkercad model.
Code of Stoplight: This code was copied and pasted from Tinkercad. I similarly uploaded it to the Arduino Uno board.
Video of Stoplight