Robot Arm.
The inspiration this time came from the hackathon that we did on Saturday the 10th of September. That was a robot arm with servo motors. I got inspired by the movement of servo angles according to buttons and wanted to visualize them using an RGB led.
1- I got inspired by the hackathon .
2- I prepared the components (an arduino uno, servo motor, RGB led light, resistors, adaptor 5V and Bluetooth Module).
3- I used Arduino IDE to write the code.
4- I connected the mobile app (Arduino Bluetooth Control) to the Bluetooth module.
Circuit Components
The Process
I started to make the wiring diagram to connect the components.
Firstly, I wired the RGB LED and the servo motor to Arduino as they are the output components.
Then I Uploaded the code to Arduino itself.
Then I wired the Bluetooth module as shown in the wiring diagram.
Code
Wiring Diagram.
Code Explanation
I started the code by including the Servo library.
Then I defined all the variables I have.
Inside the Void Setup, I defined the pin modes of the components.
Then, it's time to the Void Loop. I begin with the while function that enables the code to only work when there is a serial input.
I want the servo to rotate and the led goes green when I press 1 on the mobile app. Therefore, It was translated into if condition with the and function.
In order to make sure how the Arduino connects with the buttons on the application. We check the settings of these buttons. how they are translated into characters. From settings, command buttons configuration. Then, use them in the code.
Then, the other option is for the servo to rotate in the opposite direction and the led goes blue when I press 2 on the mobile app.
otherwise, The led goes red.
I simulated The Circuit on a real breadboard and Bluetooth module. and This is how it is ended.
The Real Wiring
I had a challenge uploading the code into Arduino. Then, I remembered what Amany and Ibrahim told us that we should disconnect the Bluetooth module before we upload it.
I had a problem connecting the Bluetooth module on the mobile app. It was taking too much time to connect to the module. I solved it by disconnecting the module from the circuit and then connecting it again.
Title of Media
Title of Media
Title of Media