ARDUINO Programming
Arduino Documentation Blog Entry
There are 4 tasks that will be explained in this page:
Input devices:
Interface a potentiometer analog input to maker UNO board and measure/show its signal in serial monitor Arduino IDE.
Interface a LDR to maker UNO board and measure/show its signal in serial monitor Arduino IDE
Output devices:
Interface 3 LEDs (Red, Yellow, Green) to maker UNO board and program it to perform something (fade or flash etc)
Include the pushbutton on the MakerUno board to start/stop part 2.a. above
For each of the tasks, I will describe:
The program/code that I have used and explanation of the code. The code is in writable format (not an image).
The sources/references that I used to write the code/program.
The problems I encountered and how I fixed them.
The evidence that the code/program worked in the form of video of the executed program/code.
Finally, I will describe:
My Learning reflection on the overall Arduino programming activities.
Input devices: Interface a potentiometer analog input to maker UNO board and measure/show its signal in serial monitor Arduino IDE.
Below are the code/program I have used and the explanation of the code.
Below are the hyperlink to the sources/references that I used to write the code/program.
To help do part 1, I searched online and came across a video by Autodesk Tinkercad. Video Link : https://www.youtube.com/watch?v=-EDYMQ9lczA
This video taught me how to write the code in Thinkercad, before I transfer it to the Arduino Software. and uploaded it to the Arduino Uno board.
Below are the problems I have encountered and how I fixed them.
The LED light was not lighting up even after we were sure that the code on Arduino was correct. It took a while but we realised that the pair next to us had a similar problem and they solved it by switching the sides of the LED diodes. It turns out we had the same problem as them and so we solved it by switching the cathode and anode of our LED on the breadboard.
Below is the short video as the evidence that the code/program work.
Input devices: Interface a LDR to maker UNO board and measure/show its signal in serial monitor Arduino IDE:
Below are the code/program I have used and the explanation of the code.
Below are the hyperlink to the sources/references that I used to write the code/program.
We found a video by MERT Arduino & Tech.
Video link: https://www.youtube.com/watch?v=4fN1aJMH9mM
The video uses a breadboard that is longer than ours but it’s ok because we manage to make some slight adjustments.
The same source also provided us with the Arduino code.
Link here: https://create.arduino.cc/editor/mertarduinotech/40f2d22f-7853-4882-b2a9-1b6d43ac81b0/preview
Below are the problems I have encountered and how I fixed them.
For the first try, my pair forgot to include the LED light. Without it, it wasn’t really possible for us to see physically whether the LDR was working or not. Well on the Ardino software we could see that it was working because the serial monitor was picking up a reading but physically there was no change.
It wasn’t until our teacher pointed it out to us that we realised we had forgotten to add the LED light. We add it in, in the end.
Below is the short video as the evidence that the code/program work.
Output devices: Interface 3 LEDs (Red, Yellow, Green) to maker UNO board and program it to perform something (fade or flash etc)
Below are the code/program I have used and the explanation of the code.
Below are the hyperlink to the sources/references that I used to write the code/program.
We use the video made by Drone How to help us for 2a.
Video link: https://www.youtube.com/watch?v=e1FVSpkw6q4
The programming code by the same person can be found here: https://www.dropbox.com/s/bivwdnehp7ln1iq/Sequential_blinking.ino?dl=0
Below are the problems I have encountered and how I fixed them.
When the code was first uploaded, we noticed that the 3 LED started blinking just like how we programmed it to be. Just 1 problem, we realised that compared to the red and yellow LED, the green LED was considerably dimmer compared to the both of them.
After checking it again, I realised that the resistor used for the green LED was different from the other 2 light bulbs and that it has a higher resistance. I think it was because of the higher resistance, which means lesser current which cause the green LED to be dimmer.
We managed to solve this problem by simply switching out that resistor to be the same as the other 2 LEDs.
Below is the short video as the evidence that the code/program work.
Output devices: Include pushbutton to start/stop the previous task
Below are the code/program I have used and the explanation of the code.
Below are the hyperlink to the sources/references that I used to write the code/program.
I actually got help for the coding from a pdf file posted in my school e-learning site. But the good news is that I found that pdf online also. The link to download is here: https://download.kamami.pl/p576422-Maker_Uno_Edu_Kit_Module.pdf
Refer to pages 51 to 52.
We did not use the exact coding in those pages as our part 2a was a bit different in that ours only uses 3 LEDs while theirs uses 5. Since 2b is a continuation of 2a we didn't want to redo our board from 2a to match the one in the pdf. Hence, we simply choose to pick out the parts with the push button and try to see if we can slot it in our code from 2a. Thus resulting in the code u see on top.🥳
Below are the problems I have encountered and how I fixed them.
As we were manually typing the code into the Arduino programme, there were times where we made the mistake in spelling out and the format of the words. This resulted in Arduino not understanding the commands that we were making.
Below is some of the mistakes:
The way of solving it is quite easy. We simply just went back and double check the code to correct the spelling mistake and format mistake we made.
Below are the short videos as evidence that the code/program work.
Below is my Learning Reflection on the overall Arduino Programming activities.
To be honest, never would i have thought that i would come into contact with arduino programming, circuits board etc …🤣 in chemical engineering. But here i am🤩. I suppose it is a good skill to have.
Each group was given 2 maker uno kit to work with. Inside consist of many things: breadboard, circuit board, resistors, LED light bulb… to name a few. There were only 2 kit so in a group of 4 we split up into pairs to use 1. From there, we first look at the e learning package provided to us. There are many activities there that help to introduce us to the function of the kit. Such as making music sound and making LED bulbs light up.
Then we began with the 4 activities that are in the blog. Beside the problem mentioned on top, overall it was still manageable. There was a small problem for me because the breadboard has so many holes to plug the terminal in and the holes are quite dense. There were times where I kept plugging the end of the components in the wrong place, same with the circuit board. But it wasn't a big problem and so the whole process ran quite smoothly.
Although there were some frustrations at first (mainly due to the code we use being wrong or the board was constructed wrongly), buttttt i felt quite happy after we completed those activities. There was a sense of achievement and while i guess this is just the basic of basic for coding i am still quite proud of myself 🤩🥳
Comments
Post a Comment