Sei sulla pagina 1di 10

Notice that the L293D supports two DC motors.

Pin 16 is the +5 voltage for the chip, while pin 8 is the voltage for the motors. The first motor gets hooked directly to pins 3 and 6. The motor is turned on by sending a high signal to both the enable (pin 1) and one of the two direction pins, lets say pin 2, while keeping pin 7 low. To go the other direction keep the enable pin and pin 7 high while pin 2 goes low. To stop enable pin is high while both 2 and 7 are low.motor drivers are the simplest modules in the sense that all they do is provide power amplification for low-level control signals (e.g. PWM and direction) supplied by the user; on the other hand, that means that the master device to which the motor driver is connected must take care of the low-level, resource-consuming signal generation.

The MAX232 IC is used to convert the TTL/CMOS logic levels to RS232 logic levels during serial communication of microcontrollers with PC. The controller operates at TTL logic level (0-5V) whereas the serial communication in PC works on RS232 standards (-25 V to + 25V). This makes it difficult to establish a direct link between them to communicate with each other.

The intermediate link is provided through MAX232. It is a dual driver/receiver that includes a capacitive voltage generator to supply RS232 voltage levels from a single 5V supply. Each receiver converts RS232 inputs to 5V TTL/CMOS levels. These receivers (R1 & R2) can accept 30V inputs. The drivers (T1 & T2), also called transmitters, convert the TTL/CMOS input level into RS232 level. The transmitters take input from controllers serial transmission pin and send the output to RS232s receiver. The receivers, on the other hand, take input from transmission pin of RS232 serial port and give serial output to microcontrollers receiver pin. MAX232 needs four external capacitors whose value ranges from 1F to 22F.

Microcontroller Tx Rx T1/2 In R1/2 Out

MAX232 T1/2 Out R1/2 In

RS232 Rx Tx

Magnetic compass
The magnetic compass consists of a magnetized pointer (usually marked on the North end) free to align itself with Earth's magnetic field. A compass is any magnetically sensitive device capable of indicating the direction of the magnetic north of a planet's magnetosphere. The face of the compass generally highlights the cardinal points of north, south, east and west. Often, compasses are built as a stand alone sealed instrument with a magnetized bar or needle turning freely upon a pivot, or moving in a fluid, thus able to point in a northerly and southerly direction.The compass greatly improved the safety and efficiency of travel, especially ocean travel. A compass can be used to calculate heading, used with a sextant to calculate latitude, and with a marine chronometer to calculate longitude. It thus provides a much improved navigational capability that has only been recently supplanted by modern devices such as the Global Positioning System (GPS).The compass was invented during the Chinese Han Dynasty between the 2nd century BC and 1st century AD.[1] The dry compass was invented in medieval Europe around 1300.[3] This was supplanted in the early 20th century by the liquid-filled magnetic compass.[4]Other, more accurate devices have been invented for determining north that do not depend on the Earth's magnetic field for operation (known in such cases as true north, as opposed to magnetic north). A gyrocompass or astrocompass can be used to find true north, while being unaffected by stray magnetic fields, nearby electrical power circuits or nearby masses of ferrous metals. A recent development is the electronic compass, either a magnetometer or a fibre optic gyrocompass, which detects the magnetic directions without potentially fallible moving parts. A magnetometer frequently appears as an optional subsystem built into hand-held GPS receivers. However, magnetic compasses remain popular, especially in remote areas, as they are relatively inexpensive, durable, and require no power supply.[6]edit How a magnetic compass worksA compass functions as a pointer to "magnetic north" because the magnetized needle at its heart aligns itself with the lines of the Earth's magnetic field. The magnetic field exerts a torque on the needle, pulling one end or pole of the needle toward the Earth's North magnetic pole, and the other toward the South magnetic pole. The needle is mounted on a low-friction pivot point, in better compasses a jewel bearing, so it can turn easily. When the compass is held level, the needle turns until, after a few seconds to allow oscillations to die out, one end points toward the North magnetic pole.A magnet or compass needle's "north" pole is defined as the one which is attracted to the North magnetic pole of the Earth, in northern Canada. Since opposite poles attract ("north" to "south") the North magnetic pole of the Earth is actually the south pole of the Earth's magnetic field.[7][8][9] The compass needle's north pole is always marked in some way: with a distinctive color, luminous paint, or an arrowhead.Instead of a needle, professional compasses usually have bar magnets glued to the underside of a disk pivoted in the center so it can turn, called a "compass card", with the cardinal points and degrees marked on it. Better compasses are "liquid-filled"; the chamber containing the needle or disk is filled with a liquid whose purpose is to damp the oscillations of the needle so it will settle down to point to North more quickly, and also to protect the needle or disk from shock.In navigation, directions on maps are expressed with reference to geographical or true north, the direction toward the Geographical North Pole, the rotation axis of the Earth. Since the Earth's magnetic poles are near, but are not at the same locations as its geographic poles, a compass does not point to true north. The direction a compass points is called magnetic north, the direction of the North magnetic pole, located in northeastern Canada. Depending on where the compass is located on the surface of the Earth the angle between true north and magnetic north, called magnetic declination can vary widely, increasing the farther one is from the prime meridian of the Earth's magnetic field. The local magnetic declination is given on most maps, to allow the map to be oriented with a compass parallel to true north.In geographic regions near the magnetic poles, in northeastern Canada and Antarctica, variations in the Earth's magnetic field cause magnetic compasses to have such large errors that they are useless, so other instruments must be used for navigation.

Description:This is the very popular 2.4GHz XBee XBP24-ACI-001 module from Digi (formally Maxstream). The Pro series have the same pinout and command set of the basic series with an increase output power of 60mW! These modules take the 802.15.4 stack (the basis for Zigbee) and wrap it into a simple to use serial command set. These modules allow a very reliable and simple communication between microcontrollers, computers, systems, really anything with a serial port! Point to point and multi-point networks are supported.</DESCRIPTION:<> <DESCRIPTION:< span="">Features:</DESCRIPTION:<>

3.3V @ 215mA 250kbps Max data rate 60mW output (+18dBm) 1 mile (1500m) range Built-in antenna Fully FCC certified 6 10-bit ADC input pins 8 digital IO pins 128-bit encryption Local or over-air configuration AT or API command set

Detecting Obstacle with IR (Infrared) Sensor The basic concept of IR(infrared) obstacle detection is to transmit the IR signal(radiation) in a direction and a signal is received at the IR receiver when the IR radiation bounces back from a surface of the object.

Here in the figure the object can be any thing which has certain shape and size, the IR LED transmits the IR signal on to the object and the signal is reflected back from the surface of the object. The reflected signals is received by an IR receiver. The IR receiver can be a photodiode / phototransistor or a ready made module which decodes the signal. In order to implement the IR obstacle detection, we need to understand the following We need to understand how to transmit IR signal using commercially available electronic components. same way we also need to understand the IR receiver. My main focus in this document is to explain the implementation of IR based obstacle detection in detail. IR Transmitter In general, the basic building block of any IR transmitter is modulation of the information signal with carrier signal, because the receiver modules which are available off-the-shelf are made for a particular carrier frequency. So it is clear that when you chose a particular IR receiver module, you also need to transmit the the modulated wave with the same carrier frequency of that of a IR receiver module. Modulating a 38 Khz carrier signal

ON state = 10ms OFF state = 90ms The figure above explains the modulation process, this is similar to OOK(ON-OFF Keying) modulation, where the carrier signal is ON for certain period of time. When transmitting a signal for obstacle detection, it is necessary that the carrier signal is transmitted for a short while and remains OFF for longer period of time. If the transmission of the carrier signal is prolonged, in other words, instead of having a short transmission period(10 milliseconds in our case, as explained in the figure) of carrier signal, if we have it for a long period of time then the receiver module will treat it as a noise and ignores receiving the transmitted signal. The implementation of IR transmitter can be done in various way, in this document we will discuss two ways Using 7555(compatible with 555) timer IC to generate a 38 kHz carrier signal Using Micro controller(Atmel atmega8535) inbuilt wave generation module Now let us have a look at the IR transmitter using 7555 timer IC

Here in the figure 5k ohms pot is used instead of 1200 ohms resister, so that it can be adjusted for 38 kHz frequency. This adjustment is required because of the tolerance value of the components used in the circuit. The best way to over come this is to connect the circuit to the oscilloscope and trim the pot to get 38 kHz. In case you done have access to oscilloscope, still you can check it with IR receiver circuit. Secondly you can trim the 500 ohms pot depending on the distance you intend to operate the sensor. Its observed that, by adjusting the 500 ohms pot to 200 ohms, it is possible to detect obstacles with in 50 cms of range from the sensor. Circuit using Micro controller(Atmel atm

ega8535) inbuilt wave generation module

This approach needs additional software and this software is referred as firmware / embedded software because this software will be flashed / downloaded in to the microcontroller.

The source code is provided in the Software Section of this web site. The steps required to use the firmware are provided along with the source code. IR Receiver It is quite simple to construct a IR receiver with readily available off-the-shelf modules. These modules are nothing but the IC packages, referred as TSOP(Thin small-outline package). In this document, the receiver is designed for 38 kHz carrier signal, hence the IC selected should work for the same frequency. The IC TSOP4838 will serve as a receiver module, which is compatible with both TTL and CMOS logic. This means that we can directly get digital signal from the receiver module and then connect it to the microcontroller. The Implementation of IR receiver is explained using an LED as an indicator.

Here in the circuit the LED blinks when ever the TSOP4838 module receives a signal from the transmitter. The same circuit can be altered to work with microcontroller, the circuit below has both IR transmitter and IR receiver modules integrated with the microcontroller. Circuit for IR based obstacle detection using atmega8535 microcontroller & TSOP4838

Code for IR based obstacle detection is provided in the software section, please go through the link --> Code to detect obstacle using IR(Infrared) sensor Once the transmitter and receiver is complete, both should be placed at a certain angle, so that the obstacle detection happens in a proper way. This angle is nothing but the directivity of the sensor, which is generally +/- 45 degrees. Also remember, that a thick enclosure is necessary for both IR transmitter and IR receiver, because the IR radiation may bounce back from the surrounding objects which may not help when you want to detect obstacle in one direction. Some times, if you dont have a thick enclosure then the signal may directly reach the receiver even without having an obstacle. The enclosure can be made out of plastic or even metal materiel which is painted black in color.