Saturday

Distance sensor

An infrared proximity sensor shines a beam of IR light from an LED, and measures the intensity of light that is bounced pack using a phototransistor. If you stare at the sensor, you can see one of the LED’s  glowing slightly red as some of the IR falls into the visible-light spectrum. A new approach was developed that not only gives object detection at a longer range than previous method but also offers range information for certain type of sensors. These new rangers all use triangulation and a small linear charge coupled device (CCD) array to compute the distance and/or presence of objects in the field of view.  The basic idea is this: a pulse of IR light is emitted by the emitter.  This light travels out in the field of view and either hits an object or just keeps on going.  In the case of no object, the light is never reflected and the reading shows no object.  If the light reflects off an object, it returns to the detector and creates a triangle between the point of reflection, the emitter, and the detector. 


The angles in this triangle vary based on the distance to the object.  The receiver portion of these new detectors is actually a precision lens that transmits the reflected light onto various portions of the enclosed linear CCD array based on the angle of the triangle described above. The CCD array can then determine what angle the reflected light came back at and therefore, it can calculate the distance to the object.

When the distance is far or increases the output voltage is decreasing gradually. But when the IR sensor is near to the obstacle the output voltage will increase. The value of output voltage is useful as a reference for the microcontroller (ATmega328). For a gas leakage detector system, if the output voltage is higher than a set point level, the DC motors will be turn off. But if the output voltage is lower than the set point the DC motors will be operated. The set point can be created in the program. This means that to one value of the output corresponds two values of distance. This problem can be avoided by noticing that the object is not too close to the sensor.





Wednesday


Gas sensor (MQ5 sensor)


MQ5 sensor is used in gas leakage detecting equipments in the industries and house. It has high sensitivity to liquefied petroleum gas (LPG) and small sensitivity to alcohol and smoke. The characteristics of this sensor are fast response, stable, long life and have simple drive circuit.

When a dangerous levels of gas vapors are detected. A detectors measure a gas concentration and the sensor responds to a calibration gas, which serves as the reference point or scale. Usually the reference point or scale is in voltage (V). The calibration of MQ5 is important in order to compare the sensitivity of MQ5 when detecting oxygen gas or liquefied petroleum gas (LPG). For an example, if the MQ5 sensor detects oxygen gas it might produce a low value of output voltage but when it detects other gases especially LPG gas it will produce a high value of output voltage. The output voltage value is between ranges 0 until 5 volts.



Based on the picture above, MQ5 have 6 pins (2 A, 2 B and 2 H). Pins for A should be attach together and then connect with the pin H for become an input connection. On the other hands, pins B will be the output connection, meanwhile the other H pin become grounded. Before the sensor connects to theATmega328 pins, it should face some calibration with lighter gas using a multi-meter to identify differences of voltage output value in normal condition (normal atmosphere) and worst condition (when detecting any presence of liquefied petroleum gas). During normal condition, the voltage output is less than 1.5 volts. When the MQ5 detected the gas produce by the lighter, the voltage output is 2 volts and above. This output values are important because it will be useful data during program writing.

Figure below shows the connection wires of gas sensor (MQ5) at the analog pins of ATmega328.




Light sensor (LDR sensor)


A light sensor generates an output signal indicating the intensity of light by measuring the radiant energy that exists in a very narrow range of frequencies basically called "light", and which ranges in frequency from "Infrared" to "Visible" up to "Ultraviolet" light spectrum. The light sensor is a passive devices that convert this "light energy" whether visible or in the infrared parts of the spectrum into an electrical signal output. Light sensors are more commonly known as "Photoelectric Devices" or "Photo Sensors" because the convert light energy (photons) into electricity (electrons).

Light dependent resistors (LDR) are very useful especially in light or dark sensor circuit. Normally the resistance of an LDR is high, sometimes as high 1000kΩ, but when they are illuminated with light resistance drops dramatically. There are just two ways of constructing the voltage divider, with the LDR at the top, or with the LDR at the bottom:


In LDR sensor operation, means light must shine into the light dependent resistance for the circuit to be activated. When the light level is low the resistance of the LDR is high. This prevents current from flowing to the base of the transistors. Consequently the lamp does not light. However, when light shines onto the LDR its resistance falls and current flows into the base of the first transistor and then the second transistor and automatically turning the lamp on. The preset resistor can be turned up or down to increase or decrease resistance, in this way it can make the circuit more or less sensitive. During troubleshooting the LDR sensor, i have tabulated all the data of an output voltage value with different resistance value produce by the LDR sensor.





Based on the figure below, the input of the LDR is only 5 volts and the value for the resistor is 10kΩ. Generally, this sensor was constructed based on voltage divider rules and the voltage output is depending on the change in resistance value of the LDR sensor. The input for IC741 has two input pins from one pin from the voltage output and another one is from the ground. Once the voltage enters the IC741, the IC741 will amplify the voltage by multiplying it gain (dB). Output for IC741 will inject to the relay and automatically switch on the lamp.



Figure above shows the circuit of light sensor (LDR circuit)