new-home

= =

= Programming the world: =

In this Wiki will guide you to program the word, by reading physical variables (such as temperature, amount of light, rotation position, switch and many others) and by acting to actuator (such as motors, led, light, position servos, buzzer and many others)

The program is coded in S4A (a revision of Scratch able to interact with external elements) and sensors and actuators are in the Arduino shield "scartch-io"



=//__** Mercury thermometer **__//= Today we are programming a simple but quite didactic exercise. Using the temperature sensor in scratch-io shield (LM35) we can display a mercury thermometer in the screen. See below the sprites scripts. A theory pill: LM35 give a voltage proportional to temperature of the package. 0 º centigrade equals to 0mvol, 1º centigrade equals to 10mvol. Knowing that Arduino ADC convert 0to5vol into 1to1024 data... K=2,048 data/º here you have the script for S4A:





Here below, the Arduino script and the mercury 'line' script. See the complete code in the link above for details. .



=//__** Robotic Arm **__//=

You can find detailed guide ans .STL file in these webpages:
 * thingivers
 * instructables



Base on this wonderful design of [|Carlo Franciscone,]S4A and Sratch-io shield we create a interesting programming practice where students learn how to build and manage robotic arms. As any robot we have structure, electronic and progrmaing.

a./ Structure follow this link

b.-/ electronic

We use an Arduino UNO and Scratch-io shield (and the extra pluging we have to add)

As we know S4A version 1.6 only handles three servos but we need four of them to move the arm, so a simple multiplexer plug on shield converts a servo line into two servo lines.

Here you have the schematic of the additional board. we plug this board on top of IO-shield and we connect the four servos of the Arm into the shield as we show in the picture below.



S4A code has a separate process executed each one second, this procress updates the position of every servo with the value stored in the four variables: waist, shoulder, elbow and hand

structure 
 * 1

Step 1:


Connect two link arms (003) to the Triangular link (006). Keep the M4 round heads screws to the inner side like shown on image and selflocking nuts to the outer side. IMPORTANT I design all the holes of joints quite exact to allow to make them more precise using a drill bit The nuts are to be tightened till the locking of the joint, then consequently you must loose them until you obtain a smooth movement with the lower clearance between components. This rule is valid and is to be applied also for the following joint that involve use of self locking nuts.



Step 2:


Connect link (003) to the rear joint of the horizontal arm (005). The lower part of the link (003) is to be connected with the vertical drive arm (002) as shown. Between the two links interpose three M4 washer, this to better align them with the vertical arm Keep the M4 round heads screws to the inner side and self locking nuts outside 

Step 3:


Connect now the two preassembled links to the forward drive arm (004). Punt in position horizontal arm (005) and triangular link (006) aligned with the upper connection of the forward drive arm (004). Insert the Ø4 mm brass pipe crossing all the parts and fix it with the M3x30 screw, locked by the nut on the other side. Verify the freedom of movement and If everything is ok, proceed to the next step. 

Step 4: Base assembly


Part list: · n° 1 EBA_01.00.001_base.stl · n° 1 EBA_01.00.011_round plate.stl · n° 1 EBA_01.00.010_basement.stl · n° 1 TowerPro metal gear MG90S servo with double arm horn · n° 1 servo horn fixing screw · n° 2 M3 x 15 screw (VTCEI) · n° 3 M3 nuts 

Step 5:




Be sure that the servo is in the neutral position than install the double arm horn on the splined shaft keeping the arms parallel to the servo body Insert the horn inside the housing below the round plate and fix the servo to the plate using one of the two long screw supplied with the servo (the small one in too short due to the thickness of round plate) 

Step 6:




Put in position the base between the two shoulder on the plate and attach together using the two M3 screws and nuts. There two hexagonal housing below, so nuts will be kept in position during tightening 

Step 7:




Align the servo and introduce the wiring in the central part of the basement. Gently pull the wire to make it straight while continue to push in it housing the servo The wire is then kept in position making it pass through a frontal hole 

Step 8: Gripper assembly


Part list: · n° 1 TowerPro metal gear MG90S servo with single arm horn · n° 1 servo horn fixing screw · n° 1 EBA_01.00.012_claw support.stl · n° 1 EBA_01.00.015_drive gear.stl · n° 1 EBA_01.00.014_left finger.stl · n° 1 EBA_01.00.016_driven gear.stl · n° 1 EBA_01.00.013_right finger.stl · n° 2 M3 x 20 screw (TCEI) · n° 3 M3 selflocking nuts 

Step 9:


Attach the servo to the claw support using the two fixing screws supplied

with the servo Keep the output shaft forward 

Step 10:




Insert the horn in the driven gear then attach the horn at the servo shaft using the supplied screw

The horn has to be aligned forward with the servo in neutral position. Cut the exceeding part of the horn from gear using a cutter



Step 11:


Insert an M3 screw in the central hole connect it to the claw support then tight the self locking nut checking the freedom of movement <span style="background-color: #ffffff; color: #333333; display: block; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">

Step 12:
<span style="background-color: #f6f6f6; color: #e86c00; display: block; text-align: center; text-decoration: none; vertical-align: top;">



Insert the two pin of the driven gear into the dedicated holes on the left finger The driven gear has also a shoulder that has to be aligned with the lateral side of the finger. If you find difficulties coupling them, reduce interference using a file. Once coupled insert an M3 screw in the central hole and attach the finger to the claw support Now the gripper is ready to be installed on the horizontal arm of the EEzybot Verify freedom of movement of the gripper manually or using a servo tester <span style="background-color: #ffffff; color: #333333; display: block; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">

Step 13: Final assembly


Now we have the three main sub assembly ready to be connected each other. Next step we will join the base with the main arms <span style="background-color: #ffffff; color: #333333; display: block; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">

Step 14:
<span style="background-color: #f6f6f6; color: #e86c00; display: block; text-align: center; text-decoration: none; vertical-align: top;">



To join the base with the main arms align the axis of the parts and insert from one side the brass pipe 24mm long. Also the short arm of the servo that drive the vertical movement has to be supported by the brass pipe as shown on the pictures. Check the freedom of movement <span style="background-color: #ffffff; color: #333333; display: block; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">

Step 15:
<span style="background-color: #f6f6f6; color: #e86c00; display: block; text-align: center; text-decoration: none; vertical-align: top;">



Is time now to install the servo that drive the vertical movement of the arm. Put in the dedicate receptacles two M3x10 hex screw. The servo has to be in the neutral position with the horn at 90 degrees on the right side with the press plate (009) installed (Make the wiring pass through the dedicated enlargment). Introduce the servo angled in the square seat on the base plate and slide the horn in the shaped housing of the arm that drives the vertical movement. Fixt the press plate against the servo using two M3 nuts <span style="background-color: #ffffff; color: #333333; display: block; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">

Step 16: Fwd/bckw drive servo
<span style="background-color: #f6f6f6; color: #e86c00; display: block; text-align: center; text-decoration: none; vertical-align: top;">



Sequence for the forward&backward driving servo is similar to the previous. In this case the servo horn has to be installed with the servo in neutral condition aligned vertically. <span style="background-color: #ffffff; color: #333333; display: block; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">

Step 17: Last link


attach the latest link to the fixed arm on the rear side of the base using a M4x20 a washer and a selflocking nut <span style="background-color: #ffffff; color: #333333; display: block; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">

Step 18: Attaching the gripper


The last assembly step is to join the gripper to the horizontal arm as shown on the picture.