
|
|
|
|
| INFRARRED | MECHANICS | MAGNETICS | ULTRASOUND |
| IS471F | Bumper | Basico | |
| CNY70 | |||
| GP2D | |||
| Light | Temperature | Humidity | |
| LDR | LM35 | SHT11 |
To endow from sensibility to the robot, with the world that surrounds it , is needed to endow to this, of sensors for detect obstacles and thus to be able to act to avoid them or to do the necessary movements according to the programming that be done.
|
The use of light to InfraRed modulated considers object to do al relatively immune sensor to the interferences caused by the normal light of a lightbulb or the light of the sun.
The the following plan we see the easy necessary circuit to cause to function al sensor.
Not yet and it tested nothing and this so alone are ideas but if someone tests him and he wants to share his experiences, we would be thanked him all. |
|||||||||||||||||||||||||||
|
The the following figure we see the internal disposition of the CNY70 looking at the encapsulado from above, thus therefore we have the diode transmitter of infrared to the left and the fototransistor to the right.
The sensibility of the circuit is adjustable by means of the variable resistance of 10k (I advise to put a trimmer multiturn). To verify and to visualize the sign at the outset is possible to mount a diode led in the exit with its resistance of polarization to mass, if thus we cause we will see it that when the sensor detects a white surface or reflexive, the led is illuminated since the exit of the LM 358 passes to high level and therefore feeds al led that has its anode connected directly. The exit of the LM358 various of 0V for logical level 0 to some 3,3V for logical level 1, with what can be carried directly to a disparador trigger schmitt (p.ej. 74LS14 ) to conform pulses of levels TTL from 0 to 5V if were necessary.
|
|||||||||||||||||||||||||||
In the following photography we see the disposition of pines in the connector at the outset of the GP2D02 1.-GND 2.-Vin 3.-Vcc 4.-Vout
The device is fed putting to + 5V the pin VCC and GND to 0V(masa). The pin Vout is the exit of data in series with positive logic and levels TTL. Vin it is the entrance with the one that will command the operation of the sensor, one must have very in account a characteristic of this pin and the fact is that the exit is to drenador open and this prohibited to put this entrance to an exit TTL or CMOS since this would cause the destruction of the entrance, alone accepts low levels and therefore to adapt it on the way out of a microcontrolador is necessary putting a diode (p.ej. : 1N4148) just as is shown subsequently:
Once we have connected the sensor remains us to send him to do a capture and to read the result , to obtain this one must continue some simple steps:
It can accelerate the measure verifying when passes to high level the sign Vout while is maintained to level low Vin in the measurement start 70mS although I recommend to expect the 70mS.
It notes: As can be seen in the plan not this position the circuit oscillator of 4 MHz necessary so that function the assembly, not to be forgot to put it! (crystal of 4MHz and capacitors of 27pF) It programs in assembler for meter Gp2d02: The program uses a board of conversion calibrated to use with a white pasteboard as distant object for the measurement and sample in the LCD the distance in centimeters continuously, for other objects of different color the board can be modified easily.
|
|||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||
|
MAGNETICS |
|
The circuit is comprised of a divisor of tension formed by the LDR, a resistance and a disparador trigger schmitt model investor74LS14. As the LDR various in function of the light, the sign at the outset of the divisor will also do it and when pair the threshold of shot of the trigger schmitt this Changed the state of its exit as correspond. The thresholds of shot for the 74LS14 are of 0,9 and 1,7 volts, this means that when the sign in the entrance of the disparador surpass the 1,7 volts was taken like a 1 logical in the entrance and the exit al to be inverse took the logical level low or 0 volts, if the voltaje of low entrance under 0,9 volts was taken as a 0 logical in entrance with what the exit took a level logical 1. The problem that was commented in the explanation of the CNY70 situates in the distance in volts between the threshold of high shot and low, that is of 0,8 volts then we imagine that if the light received in the sensor goes increasing until arriving at the 1,7 volts and to brim them this will be the point of activation but itself not al was defused to pass again by this point, since the exit circuit was not defused until descend not under the threshold of 0,9 volts, this one must have it very in account since for some cases where the levels to detect be very distant as for example to detect levels of all or nothing or light and darkness can give equal but if what is wanted is to activate some circuit in a determined level of light and to defuse it When that level no longer exist, then the circuit no longer is been worth and will be better to use the circuit based on operational amplifier in way comparator of tensions. It notes : The integrated circuit 74LS14 arranges in its intern of 6 doors trigger schmitt negates, so one must have special care in leave not any entrance done not use al air, this is without any connection since the door began to oscillate and would be able to cause the destruction of said door, so that this happen not one must connect all the entrances to a stable logical level, normally to GND. the Exits were left like is logical al air since they will have the inverse logical level that in their entrance.
|
|
|
|
|
| Temperature | |
|
Description : The LM35 is a sensor of temperature with a precision calibrated of 1ºC and a rank that covers since -55º to +150ºC. The sensor is presented in different encapsulados but the but common is the to-92 of equal form that a typical transistor with 3 legs, two of them to feed it and the third a value of proportional tension to the temperature measured by the device delivers us. With the LM35 on the table the sideburns toward us and the letters of the encapsulado up we have that of left to right the pines are: VCC - Vout - GND. The exit is lineal and equals to 10mV/ºC therefore:
We can connect it to an Analog/Digital converter and to treat the measure digitally, to store it or to process it with a µController or similar
Using a PIC16F876 and a LCD to show the data although the program can be modified easily for obtain the data of temperature and to calculate with them what were necessary. For a real measure with the converter of the Analog/Digital one a model adjustable reference tension generator has been arrangedLM336 external al pic, with which the measure of temperature will be simple and reliable. The rank of measures that bears this assembly is alone of positive temperatures and covers since 0º to +150ºC. In the LCD the 4 channels are shown T1=RA0, T2=RA1, T3=RA2, T4=RA5.
It notes: As can be seen in the plan not this position the circuit oscillator of 4 MHz necessary so that function the assembly, not to be forgot to put it! (Crystal of 4MHz and condensers of 27pF). Forget neither to put condensers of desacoplo of 100nF among the sideburns of diet of each integrated it but close possible of these to avoid interferences by the line of diet that are very you criticize using the converter TO/D of the pic.
Adjust : There is an only adjustment that is necessary to do correctly and is referring to the tension of reference for the converter TO/D, we will cause we removing it the µController PIC of its base and measuring among the pin number 5 pertaining to "RA3 + Vref" and GND, then we will adjust through the variable resistance multivuelta (I recommend multivuelta and not normal by precision of adjustment) so that in the polímetro mark us exactly 2,56 V with which is obtained that with a TO/D conversion precision of 8 bits each 10mV dams you an increment in the byte at the outset of the converter and therefore we can represent it in a simple way without doing complex calculations. It programs in assembler for thermometer 4 channels:
|
|
|
|
|
| HUMIDITY | |||||||||||||||||||||||||||||
|
As it can be seen in the datasheet of the SHT11, the chip has 10 pins although alone they are used 4 of them and the others they should be welded in pads al air, simply for the subjection of the integrated. The pin DATES corresponds on the way out data entry to command and to read the sensor and is a pin triestate for which needs a resistance of polarization to Vcc (push-up). SCK is utilized to synchronize the broadcast and does not have most minimum frequency.
Transmission Start : to be communicated with the SHT11 the first thing that one must cause is to send a Broadcast Start sequence "Transmission Start". This it consists of putting to logical zero the line of data while SCK this to one, follow a pulse is generated low in SCK while the line DATA continues to zero and to finalize is put to 1 DATA while SCK this to 1, follow itself drop to zero also SCK and finalizes the sequence leaving the line of data and Clock in the logical states by defect, DATA in state High and SCK in state low.
The following thing will be to send a command of the following that accepts:
The commands broadcast protocol this based on a complete byte or what is the same thing 8 bits , like the commands are of 5 bits so alone the remainder of bits to the left always they will be 0. For which they were sent first the 3 zeros followed by the command to complete the byte. The SHT11 will indicate a reception validates with a pulse of ACK in the line of data that is bi-directional (do not we forget it) and will do it in the following pulse of CLK after to have completed the 8 bits of the command, therefore immediately afterwards after sending the command one must configure as entrance the port of the microcontrolador connected to DATES from the SHT11 and to generate a sign CLOCK so that the sensor send us its answer ACK and will cause putting it the line to level low since as told but up the line of data this polarized to VCC therefore always there is a 1 logical in her and what does the SHT11 is to force to 0 logical with its exit to open collector. Sequence of measure: Supposing that already we know to send a command and for example we have sending a command "00000101" corresponding to "Measure of Humidity", once received the ACK since the sensor one must expect to that this complete the acquisition and its measure deliver us, this is used to delaying some 55mS for a resolution at the outset of 12bits or well, some 11mS for a resolution of 8 bits. As this time of acquisition is not very exact and can vary depending on the diet of the sensor, and therefore of its internal oscillator. To avoid you expect unnecessary the sensor generates a pulse low in the line of data and thus is known that the following thing already will be data been worth , this causes verifying the line of data each x time until this pair to level low. If it is high level even not to finished and when we receive a level low will be the indication of acquisition completed and we will pass to read the measure of the sensor. Now 8 pulses of clock in the line are generated CLK and the state of each bit is kept that the sensor returned us. The plot that returns the sensor is composed of 3 bytes, the first one corresponds to MSB the second to LSB and the third is the CRC-8 Checksum to verify that the data to arrived correct, but we can ignore it generating NACK after the arrival of the second byte (LSB). As it can be observed the data of the measure is composed of 2 bytes although as a lot the data been worth will be of 12 bits of resolution, but although we configure the sensor for a Resolution of 8 bits.. always we will read 2 bytes ignoring the MSB in this case. Despues of each 8 bits they received the microcontroller to to generate an ACK so that the sensor know that already to received the data. This causes generating a side of ascent in CLK while DATES this to level low. After this itself continuous with the reading of another byte. To finish the plot is generated since the microcontrolador a NACK (NoACK) this is the same thing that the ACK but instead of maintain the linea DATES to level under it we will have to put to 1 generating while this passes a side of ascent in CLK the same as before. The sensor admits some two acquisitions or measures by second for which itself not the reading with refreshments should force over this, and neither that to say that a measure of this type does not need a so high soft drink.. serious the normal thing a measure each 5 or 10 seconds or but even.
Circuit of test : The following assembly is a meter of relative humidity (without compensation of temperature) which utilizes a sensor integrated SHT11, a pic16F876 and a LCD microcontrolado. The measure is shown by screen representing a percentage of relative humidity and is brought up to date each 2 seconds. The plan for the assembly is the following:
It notes: itself Not the printed circuit due to the simplicity of the assembly has been carried out, that can be done in protoboard without problems.
|
|||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
Robotica & µControladores Pic
![]()
Esta obra está bajo una licencia de Creative Commons.
Daniel C. Martin "ionitron" ··· Barcelona (Spain) ··· 2001-2006