It is a small robot able to walk on four legs thanks to two servo motors which, glued together, constitute the body of the insect. Feet, linked to the engines, two by two, are obtained by shaping the wire of a coat hanger. Arduino drives the motors one at a time so moving the legs and allows the robot to move forward. A battery, attached to the body together with Arduino, guarantees the supply of the whole. The robot uses an ultrasonic sensor to detect objects in front of him and, in the case of the presence of an obstacle, can move back, turn around and go in another direction.
The project is based on work published by Kimmo Karvinen and Tero Karvinen.
The project is based on work published by Kimmo Karvinen and Tero Karvinen.
Main components
- Arduino Uno
- Two large servo motors
- Ultrasonic sensor
- 9V battery
- Sketch for the actuation of the motors and the use of ultrasound
How do you
Components and tools used
(In order of appearance):
Photo Description Quantity 1 Pliers 2 2 Wire Ø ca. 2 mm 28cm and 25cm 3 Shrink tubing 7cm × 2 4 Lighter 1 5 Hitec HS-325HB Servo Motor (40 × 20 × 37 mm) 2 6 Thin metal wire 7 cm × 6 7 Electric glue gun 1 8 Mini drill 1 9 Velcro h 2 cm 7 cm 10 2 × 10 screw and nut 2 11 Screwdriver 1 12 Plastic base 70 × 70 mm 1 13 Arduino Uno 1 14 Plastic screw 2 × 25; nut; washer; spacer 4; 4; 4; 4 15 Mechanical switch 11 × 5 mm 1 16 Electric screwdriver 1 17 Adhesive Pads 2 18 Ponticelli (AKA colleghini): blacks; red; Yellow 2; 3; 2 19 Welder 1 20 Pond - 21 Clamps - 22 Clip for 9V battery 1 23 9V battery 1 24 Terminals 90 and cable with 5-pin 1 25 Ultrasonic sensor Devantech SRF05 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Let the legs
Cut two pieces of wire of the type used for coat hangers, one 25 cm for the front legs and one of 28 cm for the hind legs. With the help of two pliers, bend legs in the form shown in the picture.
To improve the adhesion of the legs clothe them with heat-shrink tubing: I cut two pieces 7 cm long, insert the ends of the hind legs and they heat it with a lighter to make them adhere to the wire.
To further improve the grip of the front legs, we cover with the eraser. We used Oogoo, the recipe on Instructables . |
Now we can attach the legs to the motors. We use the accessory in the shape of a cross as a base to attach the legs to the motor shaft. Fix the legs to the arms of the cross with wire serving us small holes along the arms.
Pass the wire ends from the outer side of the cross and shake well, then we twist the two ends a few times and eliminate any excess. To make legs more stable, we fix the points of union to the arms with hot glue.
We assemble the body
The insect body is formed by two servo motors glued together: order to join them we must first remove the plastic flap near the hub from the front engine and the flap furthest away from the hub from the engine rear. For this we use a mini drill with a cutting disc.
Check that the surface where the cut is smooth before applying hot glue. Apply glue to the rear engine ...
... And we press the two engines each other to make them adhere well. The hub of the front engine should be facing forward and be at the bottom, the plastic flap of the engine remained tip top and bottom wires, while the hub of the rear engine should face down and be at the back, the 'plastic flap of the engine remained and the wires point back. Let's make sure that the tops of the engines are well aligned.
In case of prolonged activity, the heat generated by the motors can soften the glue and cause a dramatic detachment of the components. |
We combine a battery holder
The robot is powered by a 9V battery. We carry a battery door with a strip of Velcro: unite the two sides of the strip at one end so you can then quit ring. We practice two holes where the two sides overlap checking the position with the cavity fin rear engine and fix the strip lug with two bolts.
We apply a support for Arduino
Arduino to place on the back of the insect use a plastic base. We check the position of the holes on the Arduino and practice of the holes at the base.
In order to handle the power of the robot we use a switch. We practice three holes on the base to set the switch.
To attach the base to the motors at this stage we will use adhesive pads in order to remove the base to carry out any other assistance and reposition it.
We assemble the structure
Arduino we tighten the base with plastic screws, spacers, washers and nuts. With the help of a gripper we eliminate the excess part of the screws.
Attach the legs to the motors do not tighten the screws yet.
We connect with each other all the ground wires (blacks) engine with a jumper, then use another bridge to connect one of the motors to a GND pin of Arduino.
We connect with each other the power wires (red) engine with a jumper, then use another bridge to connect one of the engines to power pin 5V Arduino.
We connect the control wire (yellow) of the motor back to pin 2 of the Arduino with a bridge, then the same way we connect the front engine to pin 3.
We weld the center pin of the switch to the positive (red) clip to the battery and an external pin to a red jumper. We set the switch to the stand with the glue.
To get more stable connections and prevent the wire from becoming detached, we welded the ends of the bridges to connect the wires and coupled with the thinner ends with some terminals. |
We set the legs
Now we can center the engines : using code twoServosCenter.pde (from the site "Make: Arduino Bots and Gadgets") we can hit both engines at the same time.
Once the hubs are centrally located, check that the legs are well centered and avvitiamole
definitely. We assemble the battery and also settle the legs so that the robot is properly balanced.
Once the hubs are centrally located, check that the legs are well centered and avvitiamole
definitely. We assemble the battery and also settle the legs so that the robot is properly balanced.
We use the sensor
To avoid obstacles equip the insect of an ultrasonic sensor. Arduino is able to use the sensor data to calculate the distance between the sensor and the objects lying in front. Examples provided by the development environment integrated sketching Table serves to measure distances with an ultrasonic sensor and use it in our code. But in the sketch using a different sensor model than what we have chosen, so we must first prepare the connection so you can have the same type of sensor behavior example
We connect the sensor
Let's start by inserting the strip at 90 ° in the sensor and weld.
We observe the correspondence of the cable wires to the pins of the sensor.
Prepare the cable and connect the wires to the terminals: in our case, the green wire is connected to the power pin 5V Arduino, the yellow wire is not connected, the orange cable must be connected to pin 4, the red and brown wires are connected together with a pin GND.
Let the proper functioning of the sensor by connecting with Arduino sketch Ping after changing the sensor pins in 4 (in the sketch of the example is used 7), then we proceed to attach the cable connector to the front of the engine. We can also permanently fix the basic engines. We mount the sensor on the connector.
We complete the code
We compose codes of movement that we have seen individually in a single code and its completion with the code to use the sensor. In the loop we use distance detected by the sensor to decide whether to proceed forward or backward and change direction.
We use as a reference the code walkerForwardComplete.pde with some modifications: modify the values of the variables for the movement of the motors to the left, in the detection of sensor data we eliminate any reference to the distance in inches, that does not interest us (since we use only one in centimeters), we eliminate the
We use as a reference the code walkerForwardComplete.pde with some modifications: modify the values of the variables for the movement of the motors to the left, in the detection of sensor data we eliminate any reference to the distance in inches, that does not interest us (since we use only one in centimeters), we eliminate the
void center ()
(not used in the loop
), replace the void moveForward ()
and void moveTurnLeft ( )
with those of the example that we have compiled and eliminate thedelay
in the loop
for gait forward (file theWalk.ino ).
To improve the behavior of the robot in the phase of the change direction and prevent it from moving blindly for too many steps, we insert the obstacle detection even in the moment in which advances towards the left and, if so, we do still retracted (file theWalk1.ino ).
We have also added a cycle
for
the insect to advance more slowly (file theWalk2.ino ).
To improve recognition of the obstacles during the progress, we have included additional controls within the sketch (file theWalk3.ino ).
We complete body
Now that we have completed all the steps related to the mechanics and electronics, we can devote ourselves to the outward appearance of the insect. We have chosen to use simple and easily available to create a sort of exoskeleton that recalls the appearance of a beetle.
As basic piece we chose a bottle of green plastic.
We will use only the tapered part of the bottle, then the first operation cut the bottom of the bottle using a cutter or a pair of scissors.
Also cut the top of the neck being a particularly tough, we use the minitrapano.
Use scissors to cut the neck of the bottle from the base to the apex. Screws Remove the rear legs of the insect's body and insert into the bottle holding the cut centered at the top. We turn the insect and draw with a marker area of the bottle at the hub of the rear engine.
Cut the sides of the bottle without getting to the base of the neck to make the wings and eliminate even the circle that we have drawn on the belly.
In order to keep closed the exoskeleton, use a strip cut from the body of the bottle (the part that we do not use the insect's body) and practice two small cuts on the wings, near the head of the insect, so that you can then insert the strip and retain the two wings in the gathered position on the body of the robot. Also we round the tips of the wings with scissors.
To avoid that the edges of the wings are sharp, we pass them over the flame of a cigarette lighter so that the plastic rests slightly and the cut part showing chamfered.Also screws Remove the front legs and paws and decorate the exoskeleton: we used a spray paint metallic black for the legs and belly of the insect, and metallic yellow for wings. We colored the inside of the exoskeleton to exploit the green transparent plastic.
Before replacing the legs, we upload the sketch to align the engines so be sure to screw them in the right position. We tighten the front legs, the insect nell'esoscheletro settle and we tighten the hind legs by releasing the hub of the hole in the belly. Insert the clip into place to maintain the wings and load the final sketch.
Post a Comment