Autonomous Robot Part 3: Ghosty
Ghosty is an autonomous little robot who is adventurous and loves to explore his surroundings. However, unlike a normal ghost, he doesn’t like to scare people. Instead they actually scare him! In our most current version of Ghosty, his vision line is based on the data of two proximity sensor data reads. The difference between the data of the two proximity sensors determine whether the motors that control the wheels of Ghosty will go forward or backward and what acceleration (bigger difference equals greater speed).
Ghost was set up according to the above circuit diagram. There were two proximity sensors, both powered by the 5 volt pin on the arduino board. These sent readings to the arduino, which checked the difference between the values and turned the robot left or right if there was a significant difference between them. The difference between the proximity sensors caused a certain combination of high and low values to be sent to the motor pins, controlled through an integrated circuit that was able to operate two motors simultaneously.
The above circuit diagram is a modified version of the circuit diagram seen below:
Upon reaching out to Dr.Ali from prior iteration (Ghosty II), It was decided the DRV 8833 Motor Controller (source: http://www.pololu.com/file/0J534/drv8833.pdf ) would be best to control the motors for Ghosty. After working with Dr.Ali, a program that works with the DRV 8833 Motor controller was made. The Arduino was able to send data to the Motors was using the DRV 8833, which has the ability to drive two motors simultaneously and send signals from the arduino and relay them to the motor.
The way the motor driver works is it reads two different data forms, by sending LOW/HIGH to the pin labeled BIN2, the motor driver would tell whichever motor connected to that pin to move at a slow decay if it is set to HIGH, and fast decay if it is set to LOW. Then it would move at a forward motion at a rate determined by the difference between the data read by the two proximity sensors. If sent data to BIN1 LOW/HIGH, the motor connected to the pin will also move at a slow decay if sent to HIGH and fast decay if it is set to LOW, however it will now move in reverse motion based on the difference between the data recorded from the two proximity sensors. The same conditions also apply to pins AIN1 and AIN2. BIN1 or BIN2 (as well as if AIN1, AIN2) is fed a positive value (determined by if the proximity sensor connected to A1 on the arduino reads that an object is further away from it than it is the proximity sensor connected to A0) and a negative value if A0 reads an object is further away from it than it is the proximity sensor connected to A1. If fed a negative value then the motor will move in a reverse motion and if positive, will move in a forward motion. The combination of the motors determines which direction Ghosty will go. The motors themselves (from prior iterations in Ghosty II), Solarbotics GM9 Gear Motor (http://www.pololu.com/product/188/resources ) required around 9V of power each to show any noticeable change, which, in the current iteration was supplied by battery (Code from prior iteration (Ghosty II) Shown Below): ArduinoDistance
Originally in prior iterations (Ghosty 2) it was decided that the arduino would be controlled by pins 9/10 from the Arduino, such that if a proximity sensor read that an object is close, Ghosty will move its arms (servos) in an upward motion, however it was decided it would be more efficient to use these pins for motors instead. The servos were originally powered by A 5V Step Up Regulator. Code shown below: ArduinoDistanceWithServo
Research was done in regards to integrate puredata in the 3rd edition of Ghosty using sensors & arduino, however, under given time constraints, it was decided not to. http://forum.pdpatchrepo.info/search/arduino-sensors.
For more detail: Autonomous Robot Part 3: Ghosty
EasyEDA: Ideas for Circuit Design, Innovation for Electronics Access
Free Circuit Design: Schematic – Simulation – PCB Layout – Gerber Viewer
Cheapest PCB Prototype: Only $2 for 10pcs 10×10cm PCBs, 24 hours Quick Turn, DHL Delivery in 3 Days
This Post / Project can also be found using search terms:
- arduino stepper motor projecten