There were some changes in our robot. The changes were stated bellow:
1. L293D for motor driver was changed into L293NE.
2. Pins that control enable/disable of motor driver were changed into pin 16 and 17 of the
3. Additional of 1 rechargeable AAA battery and removal of 9V battery.
4. Additional of 2 Module IR sensors to detect no wall path.
5. Some changes in the circuit and circuit diagram due to all of the changes stated above.
The reason why we change the motor driver was because we found that the L293D can cause some short circuit that lighted up the other indicator LED that should not on. L293NE driver can work exactly the same as L293D without causing any of the stated problems; therefore we decide to change the motor driver. We also find out that the PWM could only be used in pin 16 and 17; therefore we change the connection of enable form the motor driver into these two pins. We also find out that 9V battery cannot be use for a long time moreover; currents of 5 AAA batteries could not drive the motor. Therefore we decide to remove the 9 V batteries can add the AAA batteries. The previous design of the robot was also used for the competition purpose; therefore we were not bothered about the no-wall case condition. The addition of 2 module IR sensors should be enough to solve the simple no-wall tract. With all of the changes, the circuit and circuit diagram of robot were also changed.
The new circuit and circuit diagram was shown bellow:
With all of the changes made, the hardware and body of the robot are complete. The last thing to do is the programming. Programming of the robot is not an easy task since we cannot know whether the program is correct or not. The only way to know is to program it one by one and test it to the robot. Finding the correct threshold is also not an easy task. With all the hard work, we finally manage to fine the best threshold voltage.
For the programming, we are trying our best to simplify the code. The left wall following algorithm is used as our first code. This algorithm set the priority to left. Whenever left is opened, the robot will turn to left. The flow chart of the main program is given bellow: