|Discovering Computer Science||Obstacle »
Troubleshooting and FAQ
Problem: Wheels not turning even without the motor shield.
Solution: Connect the positive lead coming out of the motor to positive wire of the battery. Do the same with the negative lead. If the motor spins, the hardware is fine. If it does not spin, connect the leads from the battery directly to metal hooks on the motor. If they spin now, it probably means that there were soldering issues with the wires and the metal hook in the first case, and the wires need to be re-soldered. If the wheels still do not spin even while connecting the wires to the metal hook, try replacing the batteries and redoing the above process. If it still does not spin, there might be a hardware issue with the motor.
Problem: Now if the wheels spin normally but not with the motor shield on:
Solution: Check if the wires going into the motor shield are connected properly i.e the 4 wires from the motor firmly fit into their sockets and the positive and negative leads are in the right place i.e positive from battery goes into positive of motor shield and negative from battery goes into negative of motor shield. If this works, make sure the motor shield is the PWRIN mode and the VIN mode. Be sure to remember to power both the Arduino Board and the motor shield separately, unless the digital ports for VIN and GND are being used to power both at once. Then connect the arduino board to the adapter and see if the wheels turn. If they do, the batteries have probably died out. If they still do not, there is probably something wrong with the hardware.
Problem: Sensors not working correctly (robot does not react as it should)
Solution: The sensor(s) can be irregular i.e. one value can jump from time to time, therefore it is necessary to do an average of 5 values to make sure that the distance between the sensor(s) and the object is correct. If everything is working fine and then suddenly a sensor starts to show signs of irregularity, the first thing to do is look if the cables are correctly connected to the Arduino or breadboard. If this is not the problem, a simple way to find out if the sensor is still working is by uploading the “Simple sensor” code available on the Arduino Instructional webpage to the Arduino. This way, you should be able to read the distance values directly from the serial monitor.
|Page last modified on January 25, 2014, visited times|