Saturday, September 3, 2011

Post Four: Oxygen Sensor Display Unit

My task for the past one and a half weeks was to build an oxygen sensor display unit. This display unit consisted of three LED's, each one a different color. This unit when attached to your oxygen sensor (O2 sensor) on your car, can tel you whether your car is running rich or lean. The LED's were used to indicate this.

A O2 sensor is located in your exhaust (just after the exhaust manifold), and as the name states it is senses the amount of oxygen in your exhaust gases. When a engine is running it draws in a mixture of air and fuel combined. this mixture is then compressed and then ignited by the spark plug. This ignition causes a mini explosion inside your combustion chamber which then pushes down on the piston forcing it to go down, giving you your power. When a car runs rich (more fuel being used) the oxygen levels in the exhaust gasses will decrease as now the more fuel particles will cause a bigger explosion, burning off most of the air. As a result the oxygen level goes down. When a car runs lean (more air) the fuel particles are more spread apart and therefore the explosion that takes place isn't very effective in burning up all the mixture. As a result of this the oxygen levels increase. These readings are given out by the O2 sensor in the form of voltages. The O2 sensor works on a voltage scale of 0 - 1V. These readings are sent to the ECU (Electronic Control Unit) which then alters the air/fuel ratio. It the voltage received by the ECU was 0.2V, this would indicate a lean mixture (more air, less fuel). The ECU will then inject more fuel into the next intake stroke to try and make the air/fuel ratio perfect. The same applies when the ECU gets a high voltage reading of 0.9V. This means that the car is running rich (more fuel, less air). The ECU will then lower the fuel content for the next intake stroke, trying to perfect the air/fuel ratio.  

Component List
A few components were used for making this display unit. I used seven resistors, each with a different value. Two 0.1uF capacitors, one 9v1 zener diode, three 1N4001 diodes, three LED's (one green, one yellow and one red) and a LM324IC operational amplifier (Op amp).

Calculations

Before we could make the circuit we were to calculate the resistors that needed to be used. We were given the value for one of the resistors; R6 = 10K. Before i started calculating the resistance i needed to know the available voltage for the circuit. I noticed that straight after the 12V power supply there was a diode. As we know a diode requires 0.6V to let the current through so therefore the current available to the circuit was 11.4V (12V - 0.6V). To calculate R5 i needed to know two things voltage drop (over R5) and current. Current was given to us, it was 0.0056A. Now the zener diode is rated at 9v1, which means it requires 9.1V to push the current through. So 11.4V minus 9.1V equals the voltage drop over R5. 11.4V - 9.1V = 2.3V. To find R5 i used the formula R = V/I. Therefore  2.3V divided by 0.0056A equals 410.71Ohms. R5 is 410Ohms. Now to find R8 and R7 we needed to know the current flow through that circuit, as we were already given the voltage readings at different point of the circuit. Firstly i found out the voltage drop over R6. The available voltage before R6 was 9.1v and after R6 was 0.63V. Therefore  9.1V minus 0.63V equals the voltage drop over R6, which is 8.47V. 8.47v divided by 10000ohms equals the current flowing through the circuit, which was 0.000847A. To find R8 i needed to know how much voltage it uses. the voltage available before the resistor is 0.63V and after the resistor is 0.23V. Therefore 0.63V minus 0.23V equals voltage drop over R8 which was 0.4V. So R8 equals 0.4V divided by 0.000847A which is 472.26Ohms. R7 was easy to calculate as the available voltage after it is 0V and before it is 0.23V. So R7 equals 0.23V divided by 0.000847A which is 271.55Ohms. The formula I am using is R = V/I.

Resistors 2, 3 and 4 are on a different circuit. They are placed after the LED's. Now as we know LED stands for light emitting diode and as all diodes it requires a voltage to let the current through. This voltage value is stated at 1.8V. This means that now we have to minus 1.8V from 11.4V to get the available voltage and the voltage drop over resistors 2, 3 and 4. 11.4v minus 1.8v equals 9.6V. Now the current required to turn the LED's on is 0.0095A. So to find resistor 2 and four i used the rule R = V/I. So 9.6V divided by 0.0095A equals 1010.53Ohms. So therefore resistor 2 and 4 are  1010.53Ohms. There is a diode in the circuit of resistor 3. This means that we have to subtract an additional 0.6V from 9.6V. This leaves us with 9V. So R3 equaled 9V divided by 0.0095A which was 947.37Ohms.

Now I had all the values for my resistors.

The Circuit   


This circuit looks complicated but in fact it is actually very simple. The triangles you see represents the op amps. All these four op amps were in a chip we got. The numbers on the ends of the op amps represents the leg number on the chip. As we know current requires a positive terminal and an earth terminal to flow through a circuit. Without this the current wont flow and the components on that circuit wont work. The same rule applies with this circuit. The LED's get their positive end from the battery terminal, and it requires the op amp to supply it with earth for it to turn on.

The red LED represents the car running rich. As we can see pin five which is the positive of the op amp, gets a constant voltage of 0.63V. Pin six which is the negative of this op amp is connected to the sensor input.         When the car is running lean or at perfect air/fuel ratio the sensor input wont deliver a voltage that it higher than 0.63V. As a result of this the op amp wont provide ground and the red LED will remain off. When the car does start to run rich, the sensor input will start to reach over 0.63V. This is when the op amp will supply ground for the red LED circuit and the red LED will turn on, indicating a rich air/fuel mixture.

The green LED works in a very similar way to the red LED, except this time the negative pin of the op amp receives a constant voltage of 0.23V (pin 13). The positive pin of this op amp (pin 12) is connected to the sensor input. When ever the sensor input is higher than 0.23V the green LED circuit wont have ground and therefore it will not light up. When the car starts to run lean and the O2 sensor is sensing high levels of oxygen in the exhaust gases. The sensor input will go below 0.23V. This is when the op amp will provide ground for the green LED circuit and the green LED will turn on, indicating a lean air/fuel mixture. 

The yellow LED circuit is a bit tricky as it requires the output from two op amps. It needs pin one and pin eight to output ground. This will only happen it the sensor input is between 0.23V and 0.63V. If the sensor output goes lower than 0.23V then pin eight wont output ground and therefore the yellow LED wont turn on. If the sensor output goes above 0.63V pin one wont output ground. It will output a positive voltage. This will mean that yellow LED will positive voltage coming to it from both sides. This will also cause the yellow LED to not turn on. When the yellow LED turns on it indicates that the car is running at perfect or very close to perfect air/fuel mixture.

The capacitor circuits on the two sides at the top were there to make the current flow smoother.    

Breadboard 
Before we can build this circuit on a proper board we first had to build it on a breadboard. This was done to see if the resistors we chose were right for the job. This was a very tricky task. But to overcome this i followed each individual circuit on the wiring diagram and built it circuit by circuit. Following the individual circuits made it a lot easier to understand what goes on in this circuit, and also helped me understand on how it works. This is where i encountered my first problem. I had not given my LED's the 11.4v power supply. This was then easily fixed as i used jumper wires to deliver the 11.4V after diode one. My second problem i faced while building this circuit was that i had placed my LED's the wrong way around. I had the negative leg going towards the 11.4V power source and not the positive leg. I noticed this when i wired up my circuit to test it. The warning light came on so i quickly turned it off. I checked all my wires and connections but couldn't notice anything wrong. But then as I was following how the current would travel i noticed that the positive leg of the LED has to be facing the 11.4V power source. I then checked my LED's and swapped the legs around. This mistake was made by me because i overlooked the position of the LED's in the wiring diagram. I quickly learned my mistake and checked all my components and wiring before reconnecting it. When I reconnected my circuit to the power sources, it worked!

This is the circuit that I made on the breadboard.

Fault Finding
After our O2 sensor display unit was completed, we were to create a fault on it and let a friend assist it. I assisted Richard's one. he had cut off on of the legs of resistor five. This meant that now resister six, eight and seven didn't receive any voltage at all. After i found the cause i connected the faulty display unit to the power source to see what was happening. No mater what the sensor input changed to only the red LED was on. And it stayed on. I then took down the voltage readings from each of the pins of the LM324IC op amp chip. I wrote these figures down on a spare wiring diagram and then followed the current flow to see what was going on and why the red LED was permanently on. Since resistor six, eight and seven weren't receiving any voltage the pin seven would always output ground as it was very close to zero 0.0022V. I also noticed that the lowest the sensor input voltage went was 0.0086V. This is why the red LED was always on as it always had ground. But what about the other two LED's. Since the lowest the sensor input went was 0.0086V it meant that pins 14 and 1 would always put out positive voltage. Pin 14 is required to put out ground for the green LED to turn on and since it couldn't, the green LED stayed off. Pin 8 did supply ground to the yellow LED but since pin 1 was supplying the yellow LED with positive voltage, it didn't turn on. As we know the yellow LED requires both pin 1 and 8 to be supplying ground to work. Since pin one was supplying positive voltage; the yellow LED got no ground but only positive voltage from both sides; hence it didn't turn on either.  After the fault was found and diagnosed the resistor leg was soldered back on and the display unit worked again.

This Picture shows my findings.

These were the voltage drop readings taken from each pin of the LM324IC operational amplifier.

This picture shows the current flow in the faulty circuit. The arrows represent positive current flow. As you can see from the picture that only the red LED circuit had a positive and a negative.

Reflection
One thing I learnt from this task was to never overlook any aspect of the wiring diagram. As this can cause in the circuit to not work and can also cause damage to the components of that circuit. Always look carefully for the current flow and follow it as you are making your circuit. I also improved on my soldering. I learnt that you are meant to heat up the component leg as well and not just the area around it. Although you have to be care full not to over heat the leg otherwise you can damage the component you are trying to solder. If i was to do this task again a second time the one thing i would make a change on would be the fault finding exercise. I would want a more challenging fault to diagnose.