ORIGINALDUSTCOVER - HOMEMADE EXPERIMENTS

PHYSICS EXPERIMENTS
EXPERIMENTS OF MATHEMATICAL
CHEMISTRY EXPERIMENTS
BIOLOGY EXPERIMENTS
EXPERIMENTS OF SOLAR ENERGY
PLANES OF EXPERIMENTS
ROBOTS AND ROBOTICS
IT BUYS THIS EXPERIMENT
ROBOTICS






Book: Beam robotics GREAT SUPPLY Book: Beam robotics - Construction of Robots Insect with Materials Recyclings.

BOOK WITH THE ROBOTS OF THIS PAGE AND TENS OF OTHER ROBOTS. IT COUNTS ON PRINTED CIRCUITS!



SIMPLE ROBOTS


HANDLED WITH THE PORT OF THE PRINTER

Previous Windows 98 or versions only works with

The port of the printer of a PC can be ignited and be extinguished using one of the following lines of QBASIC
OUT 888,0
OUT 632,0

The number ‘0’ is altered according to which cables are desired to extinguish or to ignite. No of this line is a program is necessary to make them run so that they work

Although the port of the printer only has 25 conecciones 8 are usable exits. Here we showed 4 of them to control a simple robot.

In order to change of dull (in off) to ignition (on) a binary number is used. For example binary number 0101 (of which the equivalent decimal is the 5) will cause that the motor goes ahead.


It tries forward edge of QBASIC with this number
OUT 888,5
and fix to you if something happens. If it does not happen nothing tries with:
OUT 632,5
Usually first he is the one that better works.

The simple robot that it above sees consists of two motors stuck by the center with epóxico glue, a paper clip to avoid that it goes away of backs and two assured rubber small balls in the axes. The reason by that it does not have wheels is that the port of the printer only has sufficient current since to make work motor of high impedance (motor of walkman or Mabuchi) in quite slow form, if some type of gear is placed, this it will not turn. Using the axis with small balls as wheels reduction of gears without gears is obtained. When placing a rubber small ball in the axis is obtained major friction.
Usually the port of the printer is used to make work transistors that will as well make work to the motors, but this is a little more complicated.

Assuming that forward edge of QBASIC has worked the other that will be needed are:
OUT 888,6
(first motor in reverse, second motor advanced - ‘6’ are the decimal of binary the 0110)
OUT 888,9
(first motor in reverse, second motor advanced - ‘9’ are the decimal of binary the 1001)
and finally
OUT 888,10
(both motors in reverse - ‘10’ are the decimal of binary the 1010)
OUT 888.0 extinguishes both motors.
Binary numbers above of 11111111 (decimal 255) could be used to make work the eight exits.
A form easy to create a time delay (delay tricks out of) is with “loop? for-next, for example:
FOR n=0 TO 10000: NEXT
It will create a short one but perceivable delay of time, its precise duration depends on the speed of the processor of the computer. So that delay is longer is used a greater number:
FOR n=0 TO 70000: NEXT
A smaller number will give a smaller time interval us.
This program will ignite both motors for a moment, soon will cause that one of them goes in reverse:
OUT 888,5
FOR n=0 TO 9000: NEXT
OUT 888,9

The animation of down shows as the binary numbers are used to control the exits:

Another use is the one to ignite Leds, here two are connected Leds to the first exits and wing earth of the port of the printer by means of a resistor of 10 ohms. The resistor is to limit the current and perhaps it is not necessary.

If the LEDs ignite and extinguish using the following program and the rule in which they are placed is made go quickly of a side to the other, one will be able to be noticed carita in the air produced by the Leds.
w=10
WHILE INKEY$<>CHR$ (27)
OUT 632,2
FOR n= 0 TO w: NEXT
OUT 632,1
FOR n= 0 5 TO * w: NEXT
OUT 632,2
FOR n= 0 TO w: NEXT
OUT 632,0
FOR n= 0 15 TO * w: NEXT
WEND
The variable w defines the width of the image; multiplier 5 defines the width of the mouth; 15 define the space between the faces. The program antiene fuincionando “loop? WHILE-WEND until escape is pressed (escapes is 27 in code ASCII).
If the program becomes more sophisticated, etc. can be caused that the face yaws the eye, Using more Leds (they are possible to be used more than 8) we will obtain more interesting images. One better form to do this is to use a disc of
Nipkov.

Using the Entrances


If it is made run the following program:
PRINT INP (889)
a number in the screen will aparaecerá, for example 120.
If we connected with a cablecito the Earth of the port of the printer with one of the pins

and it is made run the program, the number would have to change. The new number could be 56 for example.
If one is that the port of the printer responded to number 632 then the program would be:
PRINT INP (633)
There are 5 pins of entrance. When connecting to earth the other pins are due to produce other numbers. For example 248,88,104,112. You do not try to understand the meaning of these numbers. The same pin always will produce the same number. Connecting to earth different combinations from the pins they will produce different numbers.
Down a program a little improved to show this:
WHILE INKEY$<>CHR$ (27)
PRINT INP (889)
WEND
This means ‘mantente going in loop until the key is not pressed escapes’; continuously it shows the number that corresponds to the Earth or of the pins of entrance.

We say that one has settled down that numbers 120 and 56 indicate if the conección to earth is touching the pin of the first entrance, I could be made a switch of collision for the robot.

The program is:
OUT 888,5
WHILE INKEY$<>CHR$ (27)
PRINT INP (889)
WEND
It is as the last program but has an extra line that causes that the robot ignites.
OUT 888,5
WHILE INKEY$<>CHR$ (27)
IF INP (889) =56 THEN PRINT “there you have been to collision?
WEND
OUT 888,0
Very similar other but extinguishes the robot when the key is pressed ‘escapes’. What it is really desired is a program that if says ‘reverse you beat against something’
OUT 888,5
IF INP (889) =56 THEN OUT 888,10
The bad thing is that it works only for a collision (a shock), would be better if it were shelp ‘if you beat against something when going ahead sees backwards or the other way around, of another way sees ahead (because estbas assumes that going forwards).
This is a good illustration of the difficulty to translate the use of the common sense to logical language. We already developed the common sense naturally (clearly, not all) and we do not realize its complexity.
d=5
WHILE INKEY$<>CHR$ (27)
IF INP (889) =56 THEN IF d=5 THEN d=10 ELSE d=5
OUT 888, d
WEND
OUT 888,0
The program of above introduces a variable,
d (it is possible to be called as is) that is used to describe the direction of the robot.
Actually it does not work very well because the computer goes to loop thousands of times per second and when the robot hits against something I could not take a desición. This can be fixed introducing a “Time delay?: ‘If you have struck against something backs down a little before asking to you if you have struck against something again’, we see:
d=5
WHILE INKEY$<>CHR$ (27)
IF INP (889) =56 THEN IF d=5 THEN d=10 ELSE d=5
OUT 888, d
IF INP (889) =56 THEN FOR n=0 TO 1000: NEXT
WEND
OUT 888,0
Still so simple equipment is quite complex. He is better to use I devise mechanic to fix to these defects and other that could be presented.


MAS ENTERED
In the example, the second entrance gives number us 248 when it is connected to earth. If the first entrance is connected to earth at the same time, is number 184.
It is possible to isolate the entrances by means of ‘binary sum’ (And). If one or both entrances are connected to earth, the following one will isolate to first:
PRINT INP (889) AND 248
This will give 56 us even though both have been connected to earth; in the same way:
PRINT INP (889) AND 56
it will isolate the second entrance.

This it is all the knowledge of programming that is needed to read
PWM (Width M Beatsodulation - modulation of pulse width); there are many sophisticated but cheap sensors in the market that use exit PWM, for example:
ultrasonic eyes
electronic compass
accelerometer
detector of colors

assuming that is connected one exit PWM of these dipositivos to the first entrance (the earth are due to connect), siguiemete program will give to a number qie us will indicate acceleration, color, etc.
WHILE INKEY$<>CHR$ (27)
n=0
WHILE INP (889) =56
n=n+1
WEND
PRINT n
WEND

SIMPLE INTERFACE


This is a very simple interface and a little experimental:

This interface uses four common transistors, since they have been placed symmetrically in a cardboard strip, is topographically simple. We notice that the earth are connected. It is little probable that the components are damaged just by a battery, on the other hand we obtain a constant current, is very adapted to use it with   robot that writes.
The interface will respond to binary numbers 00.01 and (10 decimal of 0.1 and 2) then the program:
OUT 888,2
it will cause that the motor goes in a direction
OUT 888,1
it will cause that it goes in the opposite direction. By the way, the equivalent commando in language C is:
outportb (888,1);
the entrance commando is very similar:
inportb (889);
“dos.h? is due to include. I feel more comfortable using QBASIC. Apparently Java can even be used.


DETECTING VOLTAGE


Sometimes it is desired to measure a determined voltage, instead of detecting if he is dull or ignition (On - In off) this can be obtained measuring the time that takes a capacitor in loading itself using loop for-next

It arrives we can see a simple circuit, the transistor is controlled by the cable of the second exit (first it is used as voltage source and always is ignited); when the second exit is in on the transistor leads and empty the capacitor (first loop for-next loop in the program does this). As soon as one goes out the capacitor begins to load itself by means of the potentiometer. The time that taking is depended on whatever is driving the LDR or Dependent Resistor of the Light.
WHILE INKEY$<>CHR$ (27)
OUT 888,3
FOR n=0 TO 1000: NEXT
n=0
OUT 888,1
WHILE INP (889) =56
n=n+1
WEND
PRINT n
WEND
The value of n grows until is sufficient voltage to ignite the entrance (1,3 volts) and soon it is in the screen.
The more correinte pass by the LDR, the more high will be the number in the screen. In the drawings the LDR directed to a card of gradient and illuminated by a LED of high brightness can be seen. It works as a transducer to linear without friction. Down the card is seen.

Also a revolving transducer can be used.



WARNING HERE








Book: Alternative energies GREAT SUPPLY Book: Introduction to the Enerías Alternative with EXPERIMENTS!
EXPERIMENTS FOR FAIRS OF SCIENCES GREAT SUPPLY Book: EXPERIMENTS FOR FAIRS OF SCIENCES!