Wednesday, November 18, 2015

HOW TO MAKE A ROBOTIC SPIDER BY USING ARDUINO NANO

 Arduino Nano

The Idea:

To build a programmable robotic spider based on Hexbug Scarab, equipped with the following sensor suite:

Ultrasonic distance sensor
v Laser pointer (just for fun)
The robot should be able to perform various activity. From them:
v Move backward,forward, and rotate.
v Flash LEDs, point the direction with a laser beam.
v Detect and avoid obstacles
v Maintain direction
v Detect being upside-down or on the side
 Scarab is on board Arduino Nano , the logo programming language equivalent to executing the steps in the program , serving as a physical platform for a variety of functions including program can be performed

The decision of two sensors for obstacle detection sensor that comes from the fact that each has its limitations

1.    The soft objects cant be detected by ultrasound sensor.
2.    The black object cant be detected by IR sensor
(A black teddy-bear is still somewhat a challenge for this Scarab...)
Scarab detects an obstacle , it's a " dance " performed.
Scarab a sequence of movements of a dance around a barrier to help decide how to do that . Just some of the dance moves are fun and show off .
Currently every obstacle in front of scarab he randomly chooses 3 different dance , performance
 
.
1.   Randomly 90 degrees right or left turn and go in that direction for 5 seconds . Then try to move in the original direction
2.      Barrier at 30 degrees to the right and to the left at 30 degrees 2. Stop and measure distances. Then the distance barrier with the attempt to go in the direction of measurement
.
3.      Back off a little , so the dance # 1 ( random ) execute - it 's just a little more than # 1 dance is engaged
.
Scarab is powered up , it is necessary to calibrate the gyro . It is completely still , and on a horizontal surface . Scarab gyro is calibrating , a yellow light is blinking . Scarab during calibration moved or shaken , then the red light starts blinking , and the calibration process restarts
.
Scarab is turned upside down , then it stops and the calibration process begins again . It is also trying to maintain the direction Scarab resets
.
Scarab, either because of some severe obstruction or low battery can not move , then a slight relative delay , all three lights ( running light ) will blink with .

Step 1: Parts and Tools
While creating Scarab Unfortunately I did not take pictures of every step . This directive should be a very literal , and will only directional means
.
With a soldering electronic components need to be very familiar with , and electric drill , fret saw , various small Phillips screwdrivers, etc. works with such devices ,
.
PARTS:
To build a Scarab, one will need:
v Hexbug Scarab XL radio controlled toy: 
v Arduino Nano microcontroller boardArduino Compatible Uno v3.0
v ROBOMARTS Infrared IR Sensor Obstacle Avoidance Sensor: Infrared IR Sensor
v SunFounder Ultrasonic Module HC-SR04 Distance Sensor
v Robomart Multi purpose PCB
v 5mW Red Laser module: Laser Pointer
v Robomart Dual H-Bridge Motor Driver for DC orSteppers - 600mA - L293D: L293D
v Micro power switch
v 2 x Black Plastic Battery Case Holder Wire 2 x 1.5V AAA: AAA Battery Case Holder
v Black Plastic Battery Case Holder for 9V Batteries: Battery Case Holder
v Light Emitting Diode LED 5mm 3mm Red Green Yellow: LEDs
v Lots of wires, like these: Wires
v Micro power switch
v Double-sided adhesive tape

TOOLS:
1.    Soldering iron and supplies
2.    Glue gun and supplies
3.    Glue 
4.    Drill and drill bits
5.    screwdrivers
6.    Sharp knife
7.    Scissors
Step 2: Preparing Hexbug







1. Removing the control board
4 Phillips screws from the bottom by removing Open hexbug . Spider should come from the top and you should have access to the internal electronic board .
Unscrew the two Phillips screws holding the board in place , cut the wires leading from the power supply , and motors ( as close as possible to the board cut - we wiring reuse ) and remove the board - we it will not be used for this project .
2. Power supply
I tested the Scarab using internal 4.5V power supply an found it too weak (Scarab is a bit slow). So I removed the power supply cover, cut off the plastic border and attached two separate power supplies:
1.      Scarab connected serially on each side of the lower body  2 x double AAA battery holders , I used to motors to 6V power supply
2.      Attached to the bottom holder  1 x 9V battery ( partially built battery space , Arduino board itself provides for the capture 9V 
 
AAA electrical wires you have to go through both sides of the lower part of Scarab 3 mm will need to drill a couple of holes . Between inside and away from the gear , which take a position , and not to waste too carefully drill mechanism .
9 V cables , you at the back of the scarab can re-use existing wires routes .
Step 3: Ultrasonic Sensor

 Ultrasonic sensor

 Ultrasonic Sensor




I ( microchips out too many layers ) using double-sided tape on the front of Scarab chose to install ultrasonic sensors .
To free up space for modules two front " teeth " need to snap off . Wires ( used " teeth" to be where ) scarab go in the right and left top cover .
Step 4: Infrared Sensor


I use double-sided tape on the left side of the lower part of the body's lower Scarab kept the IR sensor.
IR sensors have a range of 15 to 20 cm, so I IR obstacle detection distance to allow maximum sound level sensors installed around the protruding.
On the right side you Scarab "blind" as being just a drop left, two IR sensors might want to use. I had a lot to me.
To achieve maximum on-board potentiometer using the Tune IR sensor.
Step 5: Arduino, Gyro/Accelerometer and Laser


Gyroscope/Acceleromoter
I would like to achieve the maximum horizontal position using double-sided tape to the inside of the top cover Gyro / Accelerometer tape . Scarab Gyro board facing toward the front of the connection hole is placed upside down
.
Laser
The laser pointer is optional and it is growing just a visual way to indicate the direction of the scarab . The laser pointer is low energy and can be connected directly to the Arduino pin . I just left from a glue gun to cover the actual Arduino board laser sticking up
.
Arduino Board
Scarab there is no place for the Arduino board , so I decided to mount on top.
1. I cut Arduino pins (using wire cutters, carefully once on a pin)
2. Scarab 3 mm holes in the top two rows of the series Drilled
3. The second cutting with a sharp knife holes "Connected"
4. The resulting hole with a file Smoothed
5. glued on top of an Arduino board with double-sided tape
Step 6: LEDs


The three colour LED is used to determine the scarab’s status:
1. Red ( fast blinking ) - some sort of error , or not realizable
2. Green ( solid ) - Everything is good - moving
3. Yellow ( blinking ) - gyro or obstacle avoidance equipment is in progress
LEDs installed on the right side of the I Scarab 3 x 3 mm hole drilled and glued inside the cover to the LEDs
.
NOTE: The LEDs should be connected to Arduino via 200ohm resistor.
Step 7: Motor Control Board


The internal control toy motor control circuit board for the measurments cut the Vero board, is built on. I have exactly the same locations as the original control board has two holes in the mounting hardware to be able to use again drilled.
L293D H-bridge chip on the wiring diagram for the Internet there are plenty of. I am referring to Adafruit.com published on the website.
Here are assigned to pin on my L293D
:

v connect to +5V pin from Arduino
v connect to digital pin #6 from Arduino
v connect to pin #1 of motor #1
v connect to ground
v connect to ground
v connect to pin #2 of motor #1
v connect to digital pin #9 from Arduino
v connect to "+" of the motor power supply (the 6V double pack of 2xAAA)
v connect to +5V pin from Arduino
v connect to digital pin #3 from Arduino
v connect to pin #2 of motor #2
v connect to ground
v connect to ground
v connect to pin #1 or motor #2
v connect to digital pin #5 from Arduino
v connect to +5V pin from Arduino
v Scarab both motors already " full capacitor cure ' , you just L293D pin 3 , 6 , 11 and 14 of the motors on the respective resistors need to solder wires 

Step 8: Arduino Pin Allocation




Below is the Arduino Nano pin allocation
Vin - connect to +9V of the 9V power supply (via power switch)
Gnd - connect to -9V, ground wires of the LEDs, Ultrasound and IR sensors, Gyro/Accelerometer, Laser, LED cathodes and L293D
Reset - not connected
5v - connect to VCCs pins of L293D, Ultrasound and IR sensors, Gyro/Accelerometer
A7 - not connected
A6 - not connected
A5 - connect to SCL pin of Gyro/Accelerometer
A4 - connect to SDA pin of Gyro/Accelerometer
A3 - connect to VCC of the laser pointer
A2 - not connected
A1 - not connected
A0 - not connected
REF - not connected
3.3V - not connected
D13 - not connected
D12 - connect to DATA pin of the IR sensor
D11 - connect to TRIGGER pin of the Ultrasound sensor
D10 - connect to ECHO pin of the Ultrasound sensor
D9 - connect to pin #2 of motor #1
D8 - connect to Red LED anode (via resistor)
D7 - connect to Green LED anode(via resistor)
D6 - connect to pin #1 of motor #1
D5 - connect to pin #1 of motor #2
D4 - connect to Yellow LED anode (via resistor)
D3 - connect to pin #2 of motor #2
D2 - connect to INT pin of Gyro/Accelerometer (not currently used by the sketch)
the rest of the pins are not used
Step 9: Assembly


The assembling of the hexbug should be  in the following order:
v Mark all external power supply state of affairs and wire hole drill
v Mark the position of the IR sensor and drill holes for the wires
v 2cases in sequence to get 6V AAA connecting cables , power supply issues , engage and pull the wires inside Scarab
v IR sensor is attached inside the Scarab pulling your strings
v Keep your wiring inside the sensor is attached and scarab Ultasonic
v Vero board , solder wires to solder all pins L293D
v ( Via 3- way switch - see step # 23 ) L239D motor power pin solder to + 6V
v L293D for the ground wire solder -6V
v -9V Including electric wire is a " common " ground wire and making it all the sensors / Arduino give ground wires
v Vero board with Phillips screws attaching the control board in place
v L293D motor pin solder pin suitable for motor control
v Arduino and LEDs for proper hole in the top cover Scarab
v Scarab with double-sided adhesive tape to the inside of the cover Gyro / Accelerometer attached
v Glue the LEDs to respoective holes

v Solder resistors to LED anodes

v Solder resistor cathodes to a "common ground"

v Solder wires of different colors to the LED resistors
v Scarab to go to the Arduino and the top cover "Arduino" hole through the parties that they should pull all strings mark

v Pull all the wires through respective sides

v Attach Arduino Nano to the outside of top cover with double sided adhesive tape

v Close Scarab cover and slightly tighten 2 screws diagonally to keep it in place
v Solder all Arduino-bound wires to respective Arduino pins

v Use three way switch from hexbug remote as a power switch for both Arduino board and motors: route 9V and 6V positive wires to the switch and then back to VIN pin of Arduino and Vmotor+ pin of L293D respectively

v Glue the switch to the Scarab cover with a glue gun

v Pull the excess wires down under the top cover

v Tighten all 4 Phillips screws


No comments:

Post a Comment