Sunday, March 2, 2014

Hardware and Software Design

Hardware system

  • Micro-controller (2 Arduino Uno Boards)

Arduino is a single-board microcontroller to make the use of electronics in multidisciplinary projects more accessible. The hardware consists of an open-source hardware board designed around an 8-bit Atmel AVR microcontroller, or a 32-bit Atmel AVR. The software consists of a standard programing language compiler and a boot loader that executes on the microcontroller.
Figure 1: Arduino Uno Board

Figure 2: Arduino Uno pins

  • 2 Ultrasonic sensors (SRF05)

The SRF05 is an evolutionary step from the SRF04, and has been designed to increase flexibility, increase range, and to reduce costs still further. As such, the SRF05 is fully compatible with the SRF04. Range is increased from 3 meters to 4 meters. A new operating mode (tying the mode pin to ground) allows the SRF05 to use a single pin for both trigger and echo, thereby saving valuable pins on your controller. When the mode pin is left unconnected, the SRF05 operates with separate trigger and echo pins, like the SRF04. The SRF05 includes a small delay before the echo pulse to give slower controllers such as the Basic Stamp and Picaxe time to execute their pulse in commands.
Figure 3: Ultrasonic sensor SRF05

Mode 1 - SRF04 compatible - Separate Trigger and Echo:
This mode uses separate trigger and echo pins, and is the simplest mode to use. All code examples for the SRF04 will work for the SRF05 in this mode. To use this mode, just leave the mode pin unconnected – the SRF05 has an internal pull up resistor on this pin.
Figure 4: Ultrasonic sensor SRF05 Mode 1

Mode 2 - Single pin for both Trigger and Echo:
This mode uses a single pin for both Trigger and Echo signals, and is designed to save valuable pins on embedded controllers. To use this mode, connect the mode pin to the 0v Ground pin. The echo signal will appear on the same pin as the trigger signal. The SRF05 will not raise the echo line until 700uS after the end of the trigger signal. It has that long to turn the trigger pin around and make it an input and to have the pulse measuring code ready. The PULSIN command found on many popular controllers does this automatically.

Figure 4: Ultrasonic sensor SRF05 Mode 2

Calculating the distance:
The SRF05 Timing diagrams are shown above for each mode. It only needs to supply a short 10uS pulse to the trigger input to start the ranging. The SRF05 will send out an 8 cycle burst of ultrasound at 40khz and raise its echo line high (or trigger line in mode 2). It then listens for an echo, and as soon as it detects one it lowers the echo line again. The echo line is therefore a pulse whose width is proportional to the distance to the object. By timing the pulse it is possible to calculate the range in inches/centimeters or anything else. If nothing is detected then the SRF05 will lower its echo line anyway after about 30mS. The SRF04 provides an echo pulse proportional to distance. If the width of the pulse is measured in uS, then dividing by 58 will give you the distance in cm, or dividing by 148 will give the distance in inches. uS/58=cm or uS/148=inches. The SRF05 can be triggered as fast as every 50mS, or 20 times each second. It should be waited 50ms before the next trigger, even if the SRF05 detects a close object and the echo pulse is shorter. This is to ensure the ultrasonic "beep" has faded away and will not cause a false echo on the next ranging.
Connection with Arduino Uno Board:
Figure 5: SRF05 connect with Arduino Board

The position of two SRF05 sensors on the robot:

Figure 6: Position of sensors SRF05 on chassis

Two sensors SRF05 were placed in front of the FCR for avoiding obstacles purpose. It is shown in the Figure 6 by the Solidworks program.

  • Digital Compass (HMC5883l)
The Honeywell HMC5883L is a surface-mount, multi-chip module designed for low-field magnetic sensing with a digital interface for applications such as low-cost compassing and magnetometry. The HMC5883L includes our state-of-the-art, high-resolution HMC118X series magneto-resistive sensors plus an ASIC containing amplification, automatic degaussing strap drivers, offset cancellation, and a 12-bit ADC that enables 1° to 2° compass heading accuracy. The I2C serial bus allows for easy interface. The HMC5883L is a 3.0x3.0x0.9mm surface mount 16-pin leadless chip carrier (LCC). Applications for the HMC5883L include Mobile Phones, Netbooks, Consumer Electronics, Auto Navigation Systems, and Personal Navigation Devices. 

The HMC5883L utilizes Honeywell’s Anisotropic Magneto resistive (AMR) technology that provides advantages over other magnetic sensor technologies. These anisotropic, directional sensors feature precision in-axis sensitivity and linearity. These sensors’ solid-state construction with very low cross-axis sensitivity is designed to measure both the direction and the magnitude of Earth’s magnetic fields, from milli-gauss to 8 gauss. Honeywell’s Magnetic Sensors are among the most sensitive and reliable low-field sensors in the industry. 

Figure 7: HMC5883L

Arrow indicates direction of magnetic field that generates a positive output reading in Normal Measurement configuration.

Mode of operations

Continuous-Measurement Mode:
During continuous-measurement mode, the device continuously makes measurements, at user selectable rate, and places measured data in data output registers. Data can be re-read from the data output registers if necessary; however, if the master does not ensure that the data register is accessed before the completion of the next measurement, the data output registers are updated with the new measurement. To conserve current between measurements, the device is placed in a state similar to idle mode, but the Mode Register is not changed to Idle Mode. That is, MD[n] bits are unchanged. Settings in the Configuration Register A affect the data output rate (bits DO[n]), the measurement configuration (bits MS[n]), when in continuous-measurement mode. All registers maintain values while in continuous-measurement mode. The I2C bus is enabled for use by other devices on the network in while continuous-measurement mode.

Single-Measurement Mode:
This is the default power-up mode. During single-measurement mode, the device makes a single measurement and places the measured data in data output registers. After the measurement is complete and output data registers are updated, the device is placed in idle mode, and the Mode Register is changed to idle mode by setting MD[n] bits. Settings in the configuration register affect the measurement configuration (bits MS[n])when in single-measurement mode. All registers maintain values while in single-measurement mode. The I2C bus is enabled for use by other devices on the network while in single-measurement mode.

Idle Mode:     
During this mode the device is accessible through the I2C bus, but major sources of power consumption are disabled, such as, but not limited to, the ADC, the amplifier, and the sensor bias current. All registers maintain values while in idle mode. The I2C bus is enabled for use by other devices on the network while in idle mode.



No comments:

Post a Comment