Development of Multi Sensor Blind Stick ....... ........ by MUHAMMED SHARIF

It Is The Time To .... Develop The Blind Stick To .... a Magic Stick

Development of Multi Sensor Blind Stick ....... ........ ........ by MUHAMMED SHARIF

It Is The Time To .... Develop The Blind Stick To .... a Magic Stick

Development of Multi Sensor Blind Stick ....... ........ ........ ....... by MUHAMMED SHARIF

It Is The Time To .... Develop The Blind Stick To .... a Magic Stick

Development of Multi Sensor Blind Stick ....... ........ ........ ....... ...... by MUHAMMED SHARIF

It Is The Time To .... Develop The Blind Stick To .... a Magic Stick

Sunday 17 February 2013

S'2 WEEK 5 => 11 FEB - 17 FEB


ADC (Analog to Digital Converter)



Block Diagram of Partial Discharge In Data Storage




Data from the sensor will flow to analogue-digital converter (ADC). In this part, the data will convert from analogue to digital. It will separate regarding the level of the voltage or the waveform itself. If sampling rate at the waveform are low the bit after ADC is also low and sampling rate are high the bit on ADC will be high. The quality of the waveform will be determined by the variable. The ADC has to work depending on the frequency of the sensor and the voltage to make it more accurate or same as original waveform and simple to construct the circuit in the ADC with 8 bit resolution.
The data from the ADC will go to storage, but in storage there will be another circuit and program that have been done to ensure that the data will store in the storage. The circuit is to control the data to go to specified program to save in some format file and store it in the storage. The specified program is to manage the data not be separate in any ways but it have to be structured according right sequential. This will ensure that the data can be saved in one format and not to be interrupted by the other files in the storage.




  
Internal Error in Analogue to Digital Converter

In process converting analogue to digital output, a quantization error is inherent in all analogue to digital converter while sampling in amplitude axis. For example a four bit ADC which is has resolution of (1 cont/100mV) shows results for the different range for the output, for 1 count its between minus 0.5 to plus
0.5 in the range of the input. To more understanding, the figure below is illustrated;






The quantization error at amplitude


The figure show an example that all analogue voltage values from 50mV to 150mV is produce same digital output, 0001; and between 150mV to 250 is 0010. Thus it will count as one value in digital. However, in analogue input is between from 250mV to 350mV and the value in digital is 0011, converting the value again into analogue the value is shown as 300mV but the actual value is not 300mV cause the original value is between 250mV to 350mV. Thus in this case the quantization error for this digital value is ±50mV. So the internal problem in making the analogue to digital converter circuit its can only be minimize.


Analogue to digital converter in PIC

PIC is a family of Harvard architecture microcontrollers made by Microchip Technology, derived from the PIC1640 originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to "Peripheral Interface Controller”. PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide availability, large user base, extensive collection of application notes, availability of low cost or free development tools, and serial programming (and re-programming with flash memory) capability. PIC16F877A is a small piece of semiconductor integrated circuits. The package type of these integrated circuits is DIP (Dual Inline Package) package. This package is very easy to be soldered onto the strip board. However using a DIP socket is much easier so that this chip can be plugged and removed from the development board. The purpose of using PIC 16F877A is writes a program into it. It is very easy to assemble and it can be programmed and erased up to 10,000 times.






The waveform sampling in discrete time


The figure above show the analogue sample converting to discrete time.
This time sampling is the important part because its will show the quality of converting to digital. If the time sampling is not high so the quality wave form is worse.



Then the discrete-time signal is quantized to generate the digital signal




Sampling in digital signal



After converting to digital, the above figure show the line red is in digital unit of waveform. Digital waveform did not same as the original value because had quantization error. To reduce the quantization error, must put a resolution to make sure that digital output most same as the analogue input.
In PIC16F877A has built in ADC ports, which is port a is a input and port e is output. In PIC, it can be configured according to resolution will need to enhance the quality waveform in 8 bit or 10 bit resolution. The digital signal after conversion represents the digital version of the analogue signals and because it’s have 2 type of resolution, for 10 bit, the accuracy is 1 part in 1024, better than
0.1% at full scale or also 8 bit, the accuracy is 1 part in 256, about 0.5%. There are a few function of ADC ports.
• For 10 bit resolution, the conversion of an analog input signal results in a corresponding 10-bit digital number.
• The A/D module has high and low-voltage reference input that is software selectable to some combination of VDD, VSS, RA2 or RA3.
• The A/D converter has a unique feature of being able to operate while the device is in Sleep mode.
• To operate in Sleep, the A/D clock must be derived from the A/D’s internal RC
oscillator.

S'2 WEEK 4 => 4 FEB - 10 FEB











The HRLV-MaxSonar-EZ sensor line is the most cost-effective solution for applications where precision range-finding, low-voltage operation, space saving and low-cost are needed. This sensor component module allows users of other more costly precision rangefinders to lower the cost of their systems without sacrificing performance.
Additionally, this sensor line allows cost-sensitive designers to choose this precision sensor as a performance upgrade over other lower performance sensors.
The HRLV-MaxSonar-EZ sensor line provides high accuracy and high resolution ultrasonic proximity detection and ranging in air, in a package less than one cubic inch. This sensor line features 1-mm resolution, target-size and operating-voltage compensation for improved accuracy, superior rejection of outside noise sources, internal speed of-sound temperature compensation and optional external speed-of-sound temperature compensation. This ultrasonic sensor detects objects from 1-mm to 5-meters, senses range to objects from 30-cm to 5-meters, with large objects closer than 30-cm typically reported as 30-cm. The interface output formats are pulse width, analog voltage, and serial digital in either RS232 or TTL. Factory calibration is standard.


Precision Ultrasonic Range Sensing


Range-finding at a fraction of the cost of other precision rangefinders.
Reading-to-reading stability of 1-mm at 1-meter is typical.
Accuracy is factory-matched at 1-meter to 0.1% providing a typical large target accuracy of 1% or better for most voltages.
Calibrated acoustic detection zones allows users to choose the part number with the detection zone that, matches their specific application.
Compensation provided for target size variation and operating voltage range.
Internal temperature compensation is standard.
Optional external temperature compensation.

Very Low Power Requirements
Wide, low supply voltage requirements eases battery powered design.
Low current draw reduces current drain for battery operation.
Fast first reading after power-up eases battery requirements.

Easy to use Component Module
Stable and reliable range readings and excellent noise rejection make the sensor easy to use for most users.
Easy to use interface with distance provided in a variety of outputs.
Target size compensation provides greater consistency and accuracy when switching targets.
Sensor automatically handles acoustic noise.
Sensor ignores other acoustic noise sources.
Small and easy to mount.
Calibrated sensor eliminates most sensor to sensor variations.
Very low power ranger, excellent for multiple sensor or battery based systems.


Range Outputs
Pulse width, (1uS/mm).
Analog Voltage, (5mm resolution).
Serial, (RS232 or TTL, where TTL format by solderable jumper or volume orders available as no-cost factory installed jumper).


General Characteristics
Low cost ultrasonic rangefinder.
Sensor dead zone virtually gone.
Size less than 1 cubic inch with easy mounting.
Object proximity detection from 1-mm to 5-meters.
Resolution of 1-mm.
• Distance sensor from 30-cm to 5-meters.
• Excellent To Mean Time Between Failure (MTBF).
• Triggered operation yields a real-time.
• 100mS measurement cycle.
• Free run operation uses a 2Hz filter, with 100mS measurement and output cycle.
• Operating temperature range from -15°C to +65°C, provided proper frost prevention is employed.
• Operating voltage from 2.5V to 5.5V.
• Nominal current draw of 2.5mA at 3.3V, and 3.1mA at 5V.


Applications & Uses
Bin level measurement.
Proximity zone detection.
People detection.
Robots ranging sensor.
Autonomous navigation Distance measuring.
Long range object detection.
Environments with acoustic and electrical noise.
Height monitors.
Auto sizing.





HRLV-MaxSonar®-EZ™ Pin Out









Pin 1- Temperature Sensor Connection: Leave this pin unconnected if an external temperature sensor is not used.

Pin 2- Pulse Width Output: This pin outputs a pulse width representation of the distance with a scale factor of 1uS per mm. Output range is 300uS for 300-mm to 5000uS for 5000-mm. Pulse width output is up to 0.5% less accurate than the serial output.

Pin 3- Analog Voltage Output: On power-up, the voltage on this pin is set to 0V, after which, the voltage on this pin has the voltage corresponding to the latest measured distance. This pin outputs an analog voltage scaled representation of the distance with a scale factor of (Vcc/5120) per 1-mm. The distance is output with a 5-mm resolution. (This output voltage is referenced to GND, Pin 7.) The analog voltage output is typically within ±10-mm of the serial output.
Using a 10bit analog to digital convertor, one can read the analog voltage bits (i.e. 0 to 1024) directly and just multiply the number of bits in the value by 5 to yield the range in mm. For example, 60 bits corresponds to 300-mm (where 60 * 5 = 300), and 1000 bits corresponds to 5000-mm (where 1000 * 5 = 5000-mm).
A 5V power supply yields~0.977 mV per 1 mm. Output voltage range when powered with 5V is 293mV for 300-mm, and 4.885V for 5000-mm.

Pin 4- Ranging Start/Stop: This pin is internally pulled high. If this pin is left unconnected or held high, the sensor will continually measure and output the range data. If held low, the HRLV-MaxSonar-EZ will stop ranging. Bring high for 20uS or longer to command a range reading.

Real-time Range Data: When pin 4 is low and then brought high, the sensor will operate in real time and the first reading output will be the range measured from this first commanded range reading. When the sensor tracks that the RX pin is low after each range reading, and then the RX pin is brought high, unfiltered real time range information can be obtained as quickly as every 100mS.

Filtered Range Data: When pin 4 is left high, the sensor will continue to range every 100mS, but the output will pass through a 2Hz filter, where the sensor will output the range based on recent range information.

Pin 5-Serial Output: By default, the serial output is RS232 format (0 to Vcc) with a 1-mm resolution. If TTL output is desired, solder the TTL jumper pads on the back side of the PCB as shown in the photo below.



















For volume orders, the TTL option is available as no-cost factory installed jumper. The serial output is the most accurate of the range outputs. Serial data sent is 9600 baud, with 8 data bits, no parity, and one stop bit. V+ Pin 6 - Positive Power, Vcc: The sensor operates on voltages from 2.5V - 5.5V DC. For best operation, the sensor requires that the DC power be free from electrical noise. (For installations with bad electrical power, a 100uF capacitor placed at the sensor pins between V+ and GND will typically correct the electrical noise.)

GND Pin 7: Sensor ground pin: DC return, and circuit common ground.










Dead Zone

Ultrasonic sensors have a dead zone in which they cannot accurately detect the target. This is the distance between the sensing face and the minimum sensing range. If the target is too close, the tone bursts leading edge can travel to the target and strike it before the trailing edge has left the transducer. Echo information returning to the sensor is ignored, because the transducer is still transmitting and not yet receiving. The echo generated could also reflect off the face of the sensor and again travel out to the target. These multiple echoes can cause errors when the target is in the dead zone.
















  

Beam Angle

The beam cone angle values are the 3 dB points (i.e., points at which the sensor signal is attenuated by at least 3 dB). Outside this cone angle, the ultrasonic signal exists, but is rather weak. Targets may still be detected. This can be experimentally determined.














Beam Cone Diameter

The ultrasonic sensor emits ultrasound wave in a beam angle cone that eliminates side lobes. Target size versus beam spot size is important. Theoretically, the smallest detectable target is one half the wavelength of the ultrasonic signal.
Ultrasonic transducer is embedded, watertight, into the sensor housing, in polyurethane foam. The transducer transmits a packet of sonic pulses and converts the echo pulse into voltage. The integrated controller computes the distance from the echo time and the velocity of sound. The transmitted pulse duration and the decay time of the sonic transducer result in a blind zone in which the ultrasonic sensor cannot detect an object. Normally, the ultrasonic frequencies are between 65 kHz and 400 kHz, depending on the sensor type and the pulse repetition frequency is between 14 and 140 Hz.


S'2 WEEK 3 => 28 JAN - 3 FEB




The original PIC was built to be used with General Instruments' new 16-bit CPU, the CP1600. While generally a good CPU, the CP1600 had poor I/O performance, and the 8-bit PIC was developed in 1975 to improve performance of the overall system by offloading I/O tasks from the CPU. The PIC used simple microcode stored in ROM to perform its tasks, and although the term was not used at the time, it shares some common features with RISC designs.

In 1985, General Instruments spun off their microelectronics division and the new ownership cancelled almost everything — which by this time was mostly out of-date. The PIC, however, was upgraded with internal EPROM to produce a programmable channel controller and today a huge variety of PICs are available with various on-board peripherals (serial communication modules, UARTs, motor control kernels, etc.) and program memory from 256 words to 64k words and more (a "word" is one assembly language instruction, varying from 12, 14 or 16 bits depending on the specific PIC micro family).
PIC and PIC micro are registered trademarks of Microchip Technology. It is generally thought that PIC stands for Peripheral Interface Controller, although
General Instruments' original acronym for the initial PIC1640 and PIC1650 devices was "Programmable Interface Controller". The acronym was quickly replaced with “Programmable Intelligent Computer".


The PIC architecture is characterized by its multiple attributes:
ü  Separate code and data spaces (Harvard architecture) for devices other than
PIC32, which has Von Neumann architecture.
ü  A small number of fixed length instructions.
ü  Most instructions are single cycle execution (2 clock cycles, or 4 clock cycles in
8-bit models), with one delay cycle on branches and skips.
ü  All RAM locations function as registers as both source and/or destination of math.
ü  A hardware stack for storing return addresses.
ü  A fairly small amount of addressable data space (typically 256 bytes), extended through banking.
ü  Data space mapped CPU, port, and peripheral registers.
ü  The program counter is also mapped into the data space and writable (this is used to implement indirect jumps).










Microcontrollers

Microcontrollers must contain at least two primary components – random access memory (RAM), and an instruction set. RAM is a type of internal logic unit that stores information temporarily. RAM contents disappear when the power is turned off. While RAM is used to hold any kind of data, some RAM is specialized, referred to as registers. The instruction set is a list of all commands and their corresponding functions. During operation, the microcontroller will step through a program. Each valid instruction set and the matching internal hardware that differentiate one microcontroller from another.
Most microcontrollers also contain read-only memory (ROM), programmable read-only memory (PROM), or erasable programmable read-only memory (EPROM). Al1 of these memories are permanent: they retain what is programmed into them even during loss of power. They are used to store the firmware that tells the microcontroller how to operate. They are also used to store permanent lookup tables. Often these memories do not reside in the microcontroller; instead, they are contained in external ICs, and the instructions are fetched as the microcontroller runs. This enables quick and low-cost updates to the firmware by replacing the ROM.
The input/output (I/O) port pins is the way of communicating with the outside world. The number of I/O pins per controllers varies greatly, plus each I/O pin can be programmed as an input or output (or even switch during the running of a program). The load (current draw) that each pin can drive is usually low. If the output is expected to be a heavy load, then it is essential to use a driver chip or transistor buffer.
Most microcontrollers contain circuitry to generate the system clock. This square wave is the heartbeat of the microcontroller and all operations are synchronized to it. Obviously, it controls the speed at which the microcontroller functions. All that needed to complete the clock circuit would be the crystal or RC components. We can, therefore precisely select the operating speed critical to many applications.



To summarize, a microcontroller contains (in one chip) two or more of the following elements in order of importance:
i. Instruction set
ii. RAM
iii. ROM,PROM or EPROM
iv. I/O ports
v. Clock generator
vi. Reset function
vii. Watchdog timer
viii. Serial port
ix. Interrupts
x. Timers
xi. Analog-to-digital converters
xii. Digital-to-analog converters
















     Microcontroller PIC 16F877A

The microcontroller chip that has been selected for the purpose of controlling the Multi sensor blind stick and the speed of DC motor is PIC16F877A manufactured by Microchip. This chip is selected based on several reasons:
I. Its size is small and equipped with sufficient output ports without having to use a decoder or multiplexer.
ii. Its portability and low current consumption.
iii. It has PWM inside the chip itself which allow us to vary the duty cycle of DC motor drive.
iv. It is a very simple but powerful microcontroller. Users would only need to learn 35 single word instructions in order to program the chip.
v. It can be programmed and reprogrammed easily (up to 10,000,000 cycles) using the universal programmer in robotics lab.


S'2 WEEK 2 => 21 JAN - 27 JAN


Am going to show some of the websites that i just found that will help me developing my programming skills, this websites are for getting started with the MPLAB IDE.








And this is the video from youtube

S'2 WEEK 1 => 14 JAN - 20 JAN



Starting from this semester am going to show my plan in a flow chart and in shaa Allah i will keep going with this plan;