Source Code on GitHub
Autonomous Crane | Hexapod Walker
System Architecture | Software Design | Electrical Design | Mechanical Design
The microcontroller in the crane is entirely autonomous, using the ultrasonic sensor to determine the distance of the trolley along the boom and the contact switch as the trigger to grab a block.
The microcontroller is connected to the switch using a simple GPIO pin. The pin is low when the switch is pressed and high when the switch is released. The microcontroller is connected to the ultrasonic sensor using a pair of GPIO pins. The trigger pin is pulsed to tell the sensor to "ping", while the echo pin is connected to a hardware timer to determine how long the pin is held high - which corresponds to the echo time and thus to the distance of the trolley from the sensor. Finally the microcontroller is connected to the servos using a serial bus.