This week's assignment was inspired by a tennis game tutorial I watched on YouTube using the same components that would be available to me, so I took a daring step to start thinking about how to do it and trying my effort with this big challenge i had. In the coming paragraphs, I will give a more elaborative demonstration of what I did and how I could face the challenges I faced. Keep informed!
I used TinkerCad to build and program the Arduino board and simulate the connections to test it out before trying the real components to make sure nothing is missing.
I also used materials/components such as the puzzer to generate the sound, the Arduino IDE to program the Arduino after taking the text code copy from TinkerCad, a push button to control the emitted LED output/function and the puzzer sound. Let me not forget about the 220 ohm resistance to set the pass-through current on the LED and the pushbutton.
TinkerCad Software
Arduino UNO with USB Cable
PIEZO "PUZZER"
Arduino IDE
PUSH BUTTON
To do this assignment it took a little online search to check out how tone/voice simulation can program to work as I hope I have, as well as a method for some of the connections I must follow in the task. Honestly, I couldn't do as much in audio programming as I would have liked but I didn't regret the research.
I started by defining the pushbuttons as analog read "INPUT" and the LED as digital write "OUTPUT" and connecting them to the analog pins on the Arduino UNO and didn't miss the resistance on each LED and pushbutton as well.
While I connected a puzzer to analog write "pin 11" to define it as output.
I took two wires of 5 V and GND from the Arduino board to the breadboard to make sure the voltage is connected to the connections I had and started laying out the blocks required to program the Arduino UNO, then I took a copy of the text code i should upload to the Arduino board using the Arduino IDE app. The last step, after duplicating the connections with a tangible Arduino and breadboard, I used a USB cable to connect the connections to the laptop and upload the code to power the circuit.
Wires and Text Code in TinkerCad software
Assignment Simulation in TinkerCad
Components Connections
TEXT CODE
Now, to perform the game idea simulation, as I mentioned in the previous paragraph, I had to start connecting the USB Cable to the laptop to upload the text code to the Arduino UNO, then start to click on the push buttons one by one like two players in Tennis Competition.
And it finally worked after many trials, yes!
Demo of the Assignment
Despite the correctness of the circuit simulation on Tinker CAD, but at some point, during the concrete simulation, I had an urgent desire to actually ask about the cause of the failure and how to get out of it, but I resorted to attempts and experiments to try to figure out the errors and how to solve them. In any case, resorting to asking for opinions from colleagues and trying to think together is always the best guide to solving problems.
Besides, I was always trying to help my stuck colleagues, sometimes when they asked for help, and sometimes it was similar to what I'm facing as well, like someone stuck in simulating the circle using real tools as he did it correctly on TinkerCad software and this is what I went through as well. What a coincidence, isn't it! I don't know if it was a good coincidence or not, but there is no doubt that sharing questions and opinions and trying to find solutions with everyone's thinking is a good and useful hand/tool for everyone as well.
I went back to GOOGLE search, Helpful Guide at All Times, that's what I call it.
I've gone through a lot of challenges frankly, like connecting the push button as well as connecting the wires to it. In addition to the omission about correcting some connections of the LEDs during the power of the circuit. But with attempts and a little research and reading about the possibility of errors and how to debug them, I can say that the result was somewhat satisfactory.
If others will make the same idea of the assignment or another, I will recommend checking the wires connections step by step to make it easier to spot errors as soon as they occur and work to solve them without the need for much effort and time.
I will be able to handle more info with Arduino UNO, blocks and text code required to program the circuit and connections of the Interactive Desk Lamp that I will be doing in my graduation project. Keep informed!
Smart Waving Hand Challenge!
Enclosure
The idea was mainly rely on building a smart hand device, when you wave at it, it waves back at you!
The components i used were:
Potentiometer
Servo Motor
Ultrasonic Sensor
Jumper Wires
5V Adapter
Large-sized Breadboard
Cardboard Sheet
Cutter or scissors
Glue Gun
Ruler
Pencil
2 Zip ties
Masking Tab
In case of automatic mood: a single servo motor (One Hand) connected at the output is controlled via signals received from an ultrasonic sensor at the input of the Arduino board.
I start with building the circuit in TinkerCad using the required components from the list tools mentioned, then set up the blocks as is shown in the simulation video to e available to be took as a text code copy to Arduino IDE for uploading it the Arduino board I have.
After i simulated the circuit in TinkerCad and checked the connections, I went to duplicate the same connections using a tangible components as it mentioned in the enclosure
Automatic Mood .. Say Hello!
CODE plus connections in case of Automatically
Automatically Simulation in Tinker Cad software
While in case of manual mood: a single servo motor (One Hand) at the output is controlled manually by a human using a potentiometer knob at the input of an Arduino board.
Hands Control Mood
Manual Control using Potentiometer
Demo of Manual Mood in TinkerCad
The WEEK of the ARDUINO
While I customized it with a distinguished name, let us now say that this week is based on a trip of 4 mainly stages plus the assignment as follow:
The first was about getting familiar with what an Arduino board is or how can I use it to have various objectives? So, I had an activity of "Hands-on, Minds-on" and what I did was use Tinker Cad software to build a circuit using a puzzer, breadboard, Arduino Uno, USB cable, 1 slide Switches, jumper wires and code (blocks + text), then simulate the circuit and guess what was the purpose behind that?
It was a kind of musical tones...yeah!
I made two of codes, so I got two of musical tones, the first was related to happy birthday music and the second one related to another tone.
It's easy to do, check the Assignment Design Files and don't miss it!
First code - First music "Happy Birthday!"
Second code - Second music "Guess the soundbite!"
Next stage was the tutorials I had to go back to make progress on the exercises I had. In fact, it was more than helpful at this time to dig a little deeper into the Arduino board and its functions or what it can do? So, after that I started working on my exercises. The first was:
Program an Arduino board to control one RGB LED so that it lights up with the following colors in order: Red, Blue, Green, Purple, Orange, and White
But how can I do that?
First of all, I had to go to Tinker Cad to try to build and simulate the circuit before I did it on a real Arduino board to make sure nothing will burnout or lose it.
I used the mentioned components above in TinkerCad and in real too.
But the main objective in this week is how to program the circuit using Arduino Uno? The answer is code, yes!
So, I wrote the code that you can see in the following pic and simulated the circuit and it worked. Have you started to visualize the color changes emitted? Keep it!
The next step was to make the same connections and circuit with the Arduino board connected via USB cable to the laptop and use the Arduino IDE to upload the code to it and then connect the Arduino via USB and enjoy watching the result of your hands!
RGB LED Simulation
RGB LED in Tinker Cad software
TEXT CODE
RGB LED lights up with the following colors in order: Red, Blue, Green, Purple, Orange, and White
segment display
Simulation in TinkerCad software
TEXT CODE
7 -segment counts down from 9 to 1
Now, it's time for a second workout...
Initially, I brought materials/gadgets such as :
7 - segment display
resistances
jumper wires
breadboard
Arduino UNO with USB Cable
TinkerCad software
Arduino IDE
I started building and simulating the circuit in TinkerCad as shown in the simulation video. The next step was to try the same connections using real components, then I took a copy of the text code from TinkerCad to the Arduino IDE to program the Arduino board with its functionality in this exercise. I finally got the countdown I needed, yeah!
I simulated the actions in the demo video, don't miss it!
Demo of 7 -segment display
RGB LED color changes at varying distances from an Ultrasonic Sensor module
This exercise takes a look at the direction of detection motion, in which the mainly objective is focusing on taking action according to the motion sensor.
In our case, I lit up a RGB LED colors based on motion detection by Ultrasonic sensor. Lets find out how I did it …
Action Mechanism
Connections with Blocks Code
Simulation Video in TinkerCad
The tools/components I used were as follows:
Jumper Wires
RGB LED
Resistances (220 ohm)
Puzzer "Piezo in TinkerCad"
Arduino UNO + USB Cable
Arduino IDE
TinkerCad software
I went to TinkerCad to set the required components I'm going to use and start connecting them together, considering connecting the trigger and echo terminals with the analog read pins "INPUT" and RGB LED to the digital write pins "OUTPUT" because the result of the RGB LED colors depends on the sensor action whether the object is far from or close to it. Of course I put the distance in centimeters and put in the code a certain distance 40 where the LED will emit a GREEN color and 20 cm for another condition in which the color output will be a YELLOW one and if the distance less than 20 cm the color will emit RED
Now, it's time to generate the code with the blocks; I did it as shown in the provided pic, then simulated the circuit to make sure the connections and code are correct to put them on a tangible Arduino UNO board and start powering the circuit after duplicating the same connections using the mentioned components.
It was a great experience, I loved the idea behind it. Try It Yourself!
BIG SHOW
The magic of Electronics …
We used to turn on and off the lights in the room with our own hands, but have we ever thought about what if we could do that without our actions?
I also imagined that this could happen, but how? …
This is what I figured out in this exercise and this is what I will work on in greater depth in my graduation project. Stay informed!
Well, in this exercise what is required is that the lamp turns on and off automatically according to the intensity of the surrounding light. I can use a LDR sensor "Photoresistor in TinkerCad software", a Red LED with a resistance of 220 ohms, an Arduino board, and a breadboard.
LDR sensor
First of all, I built the circuit and simulate it in TinkerCad after putting the code (blocks & text) to program the Arduino UNO with the needed function. I used in this stage a Photoresistor "do the same function of LDR sensor".
I connected the LED to the digital write "OUTPUT" and the photoresistor to the analog read "INPUT" because the LED depends on the behavior of the sensor I have.
I started programming the code and simulating the circuit, knowing that if there is light, the LED will turn off according to the light sensor and vice versa.
Next stage was to simulate the same connections and ON/OFF light using LDR sensor.
I took a text code copy to an Arduino IDE to upload the code to the connected Arduino UNO using USB Cable.
What I got was the simulation show i have in the next video. Enjoy watching!
Simulation Show
Connections in TinkerCad
Using Photoresistor in Tinker Cad software
TEXT CODE