For this week of Arduino programming. We are tasked to complete 4 different tasks that are separated into input and output namely:
- Interface a Potentiometer Analog Input to maker UNO board and measure its signal in serial monitor Arduino IDE
- Interface an LDR to maker UNO board and measure its signal in the serial monitor
- Interface 3 LEDs (Red, Yellow, Green) to maker UNO board and program it to perform something
- Interface the DC motor to maker UNO board and program it to on and off using a push button on the board
Before I use the Arduino board to complete the tasks, I will use Tinker CAD to make the codes and the placement of the board. I will put the interactive tinker codes below to show how to make it.
Potentiometer
Using the video for the potentiometer using analog input, I used tinkercad to design the board and searched up the code to measure the signal.
From the codes, I understand that turning the potentiometer clockwise or anticlockwise will result in a change that will be shown in the LED. So to sum it briefly, turning the potentiometer to the right there will be more resistance hence increasing the blinking of the LED while turning the potentiometer to the left will decrease the resistance so the LED will blink less.
LDR
From what I can understand from the codes is that the LDR which is Light Dependent Resistor will increase or decrease the resistance through the light intensity that is exposed to it. So the higher the light intensity exposed to the LDR, the less resistance of the LDR. So like a daylight sensor where the LDR will detect that in the morning to afternoon where there is still light in the sky. The LED will not be switched on since the resistance is at its highest. At night time when it is dark, the LDR will detect that there is less/no light in the sky and decrease its resistance allowing the LED to shine its brightest.
3 LED
For this task, what I have learnt was how I can make 3 different coloured LEDs turn on in sequence. Just by making 3 of the same codes 3 times where the LED will have both switches on high and low after a second delay.
DC Motor
This task was quite challenging as there were more unique components to be used like a button and a motor. There is a difference between a separate button with tinkercad and the actual board. Honestly, this task was quite rewarding as it was also the one that took the most time, so knowing that I completed the task made me quite happy.
This week of tasks is one of the more challenging ones as there was a lot of stuff to do and post it up. However, it was also one of the more fun ones as there were many new things to experiment with after learning and understanding the Arduino board. I think these tasks were great in limit testing myself in the knowledge I have learned and how I can apply it in completing the 4 tasks. Using other resources to help supplement the missing information I need like Youtube videos, searching on Google. I hope that I can apply what I learn here in the future.