Overview
For the "Grab a Byte" project, I first created a model circuit with an Arduino in TinkerCAD. After creating a functioning design, I proceeded to create a real-life version. I wired the circuit and uploaded the code to the Arduino, both teaching me about electrical wiring and programming.
Project
First, I practiced lighting up and LED and making it blink. In TinkerCAD, a website for CAD modeling, programming, and electrical wiring, I built a circuit (picture on the right) with an Arduino, LED, and resistor. At Arduino is a programmable, multi-purpose microcontroller that uses a programming language syntactically similar to C. The Arduino can output electrical signals from different "pins" numbered 0-13. Also, it has "ground" pins that act similarly to the negative side of a battery. This circuit will output a signal to pin 13, a wire will pass the signa through the LED, into the resistor, and to the ground pin, turning on the LED. Instead of connecting the wires directly to other components, I am using a "breadboard" which allows me to connect different components without soldering them together. The program (the picture on the right) blinks the LED on and off. First, in the setup function, I call the pinMode function and pass in the pin number and the type of applications that pin will be used for as arguments. In this case, I will be outputting a signal to pin 13. Then, in the loop function (which is called repeatedly after the setup function) calls the digitalWrite function with 13 and HIGH as arguments. This tells the Arduino to output a signal to pin 13. Then, the delay function pauses the program for 1000 milliseconds (one second). Afterwards, the LED is turned off and the microcontroller waits for another second. This will repeat, making the LED blink on and off.
Next, I recreated this circuit in real-life and used an IDE (Integrated Development Software) to upload my code onto an Arduino. Below is a picture of the LED flashing.
This next circuit turns on different LEDs in succession, acting similarly to a stoplight. The code is very similar, except that a for loop is used to iterate through the different LEDs in a more efficient manner. The code the the project is the picture on the left, and the actual circuit is on the right.
After the virtual design was working, I recreated it in real-life. I wired the components together the same way as on TinkerCAD and uploaded the code to an Arduino. Below there is a picture of the stoplight and a video of the lights changing.