Pages

WEEK 3 FYP2

 

Software Development

In week 3, I am doing my coding for my motor driver. motor driver are use to control the dc motor movement at the prototype. To move this automatic whiteboard cleaner, motor driver L298N are use with the DC motor. The motor driver are connected with the Arduino Nano in this project.



    Figure show the motor driver are connected to the arduino board. The first two line is to define port at arduino board for motor 1 and the other two line is to define pins for motor 2.



    From figure above, the motor was define as the output because for this automatic whiteboard cleaner the motor was declared as the output so that it can easily move around the whiteboard.

0

WEEK 2 FYP2

 

Software development

    On week 2, I am doing my coding for ultrasonic sensor. This automatic whiteboard cleaner are using ultrasonic sensor as the obstacle avoiding system on the whiteboard. The whiteboard will be mount with an obstacle at the border of the whiteboard that act as the obstacle for the system.


    The ‘int’ in this program are used to declare multiple variables at once in c language. In this project, it is used to declare the trigger pin and the echo pin of the ultrasonic sensor. The trigger pin at the ultrasonic sensor act as input and echo pin are use as the output pin. The program used ‘int’ because it takes less space than the others.

     


‘long’ are used in this program because it can store up to 64-bit signed integer. The long in this program are used to calculate the duration and distance for the ultrasonic sensor. The distance are calculate by using this formula; Distance = Speed x Time.

    


    Based on figure above, it shown the loop program for the ultrasonic sensor. Loop program are important to make sure it keep moving until the user stop the program by the switch. When the ultrasonic sensor did not detect any obstacle in front of it the input will remain at the low state. When the sensor detect the obstacle the input will be high and it will send the input to the controller and the output will also be high state. The distance will be calculate before the output become high.




Figure show how to control the program by using the if and else condition. In this figure it is show that if the distance of the ultrasonic sensor is more than 19, it will keep moving forward until it met any obstacle in front of the sensor. it shows the condition and the decision if the distance of the ultrasonic sensor is less than 18. When the distance is less than 18, that’s mean the input of the sensor is high. The sensor are detecting the obstacle in front of it and make decision to move backward and move to another side of the whiteboard.

0

WEEK 1 FYP2

 

Software designation in Arduino for each components

       Before starting doing the coding, I need to explore the Arduino IDE software because i never use the software before. I learn how to include components library into the software and realize that it is easy to use the software. 

        The language that will be use in the software is C-language. It make me learn more faster since i have the knowledge about the language that will be use.

    During week 1, I am researching about how to write code for each of my components. the components is ultrasonic sensor, colour sensor and motor driver. I need to calibrate each of the components and make sure the components are in good condition. 

    

0

copyright © . all rights reserved. designed by Color and Code

grid layout coding by helpblogger.com