Showing posts with label car. Show all posts
Showing posts with label car. Show all posts

Monday, September 23, 2013

A Car Battery Monitor

A close call on the road can really focus your mind on the importance of having a battery monitor in a car. I had been enjoying a pleasant week of travelling around the countryside at a leisurely pace and taking in the beautiful scenery each day. It wasnt until the final day, with the big rush to return home, that I had to drive at night.My home is deep in the country and on the road I was travelling the closest petrol station may be 80km away. I was travelling through an area that is full of open-cut coal mines and large heavily loaded semi-trailers constantly pound the roads, travelling at quite high speeds. It was around 8pm at night and everything was very dark no street lights or house lights anywhere.

Just as I was going up a hill, the lights began to dim and the engine coughed. A large semi-trailer loomed in the rear-vision mirror as I pushed the clutch in and tried to restart. My speed was falling rapidly and my lights were blacked out - I was like a sitting duck in the middle of the road, as the semi-trailer came rapidly bearing down on me. I just managed to pull the car off the road, as the semi-trailer came screaming past, missing me by inches! After calling for assistance from the NRMA, the problem was found to be a fault in the alternator, which was failing to charge the battery. The battery voltage had been falling under the heavy load of the lights and at the worst possible time, there was not sufficient power for the lights or the motor.

After the initial shock wore off, I put on my thinking cap to come up with a PIC-based solution to the problem. What was really needed was a display and a buzzer, to get my attention should the voltage fall outside a specified range. So my design criteria was set, a series of LEDs could indicate the voltage and a buzzer would also be used to warn of problems.
Main Features:
  • Visual indication of battery voltage
  • Audible warning when voltage becomes low
  • Screw terminals for easy connection
  • Simple and easy to build
Circuit details:

The circuit is based on PIC16F819 18-pin microcontroller which has an analog-to-digital (A/D) input to monitor the battery voltage and outputs capable of driving LEDs directly, to keep the component count down. There are seven LEDs in all, giving a good range of voltage indication. The topmost LED, LED1, comes on for voltages above 14V which will occur when the battery is fully charged. LED2 indicates for voltages between 13.5V and 14V while LED3 indicates between 13V and 13.5V. Normally, one of these LEDs will be on. LED4 covers 12.5V to 13V while LED5 covers 12V to 12.5V. LED6 covers from 11.5V to 12V while LED7 comes on for voltages below 11.5V. These two LEDs are backed up by the piezo chime which beeps for voltages between 11.5V and 12V and becomes more insistent for voltages below 11.5V.

That might seem fairly conservative. After all, most cars will start with no troubles, even though the battery voltage might be a touch below 12V, wont they? Well, no. Some modern cars will happily crank the motor at voltages below 11V but their engine management will not let the motor start unless the voltage is above 11V. So dont think that a modern car will always start reliably. This little battery monitor could easily prevent a very inconvenient failure to start! So lets describe the rest of the circuit. The incoming supply is connected via diode D1 which provides protection against reverse polarity while zener diode ZD1 provides protection from spike voltages.

A standard 7805 3-terminal regulator is then used to provide a stable 5V to the microcontroller. The battery voltage is sensed via a voltage divider using 33kΩ and 100kΩ resistors. This brings the voltage down to within the 0-5V range for the A/D input of the PIC16F819. Port B (RB0 to RB7) of the microcontroller is then used to drive the various LEDs, with current limiting provided via the 330Ω resistor network. RB7, pin 13, drives a switching transistor for the piezo buzzer.

Software:

For the software, the design follows the basic template for a PIC microcontroller. Port A and its ADC (analog-to-digital converter) function are set up while port B functions as the output for the LEDs and buzzer. Once the set-up is complete, a reading will be taken at port RA2, the input for the A/D convertor. This reading is then compared with a series of values to determine the range of the voltage. This is similar to a series of "if" statements in Basic language. If the voltage is found to be within a certain range, the relevant port B pin will be turned on. If the voltage is below 12V, the buzzer will be turned on for a brief period, to signal a low battery condition. As the voltage falls below 11.5V, the frequency of the beeps will increase, to signal increased urgency.

Building it:

All the parts are mounted on a small PC board measuring 46 x 46mm (available from Futurlec). The starting point should be the IC socket for the PIC16F819, as this is easiest to mount while the board is bare. The next item can be the PC terminal block. The resistors and capacitors can then follow. Make sure the electrolytics are inserted with correct polarity.

Make sure that you do not confuse the zener (ZD1) with the diode when you are installing them; the diode is the larger package of the two.

Even more important, dont get the 78L05 3-terminal regulator and the 2N3906 transistor mixed up; they come in identical packages. The 78L05 will be labelled as such while the 2N3906 will be labelled "3906". And make sure you insert them the correct way around. The buzzer must also be installed with the correct polarity. The 330Ω current limiting resistors are all in a 10-pin in-line package. There are four green LEDs, two yellow and one red. They need to be installed in line and with the correct orientation.

Testing:

Before you insert the PIC16F819 microcontroller, do a voltage check. Connect a 12V source and check for the presence of 5V between pins 14 & 5 OF IC1. If 5V is not present, check the polarity of regulator REG1 and the polarity of the diode D1. If these tests are OK, insert the IC and test the unit over a range of voltage between 9V and 15V. Make sure that all LEDs come on in sequence and the piezo buzzer beeps for voltages below 12V.

Now it is matter of installing the unit in your car. It is preferable to install the unit in a visible position for the driver. However, it should not obscure any other instruments. The unit should be connected to the cars 12V supply after the ignition switch. This will turn the unit off with the other instruments and prevent battery drain while the motor is not running.

Author :Alan Bonnard Copyright : Silicon Chip Publications Pty Ltd

ReadMore....

Tuesday, April 30, 2013

Car Interior Lights Delay

Most cars do not have delayed interior lights. The circuit presented can put this right. It switches the interior lights of a car on and off gradually. This makes it a lot easier, for instance, to find the ignition keyhole when the lights have gone off after the car door has been closed. Since the circuit must be operated by the door switch, a slight intervention in the wiring of this switch is unavoidable. When the car door is opened, the door switch closes the lights circuit to earth. When the door is closed (and the switch is open), transistor T1, whose base is linked to the switch, cuts off T2, so that the interior light remains off. When the switch closes (when the door is opened), the base of T1 is at earth level and the transistor is off.

Circuit diagram:

Capacitor C1 is charged fairly rapidly via R3 and D1, whereupon T2 comes on so that the interior light is switched on. When the door is closed again, T1 conducts and stops the charging of C1. However, the capacitor is discharged fairly slowly via R5, so that T2 is not turned off immediately. This ensures that the interior light remains on for a little while and then goes out slowly. The time delays may be varied quite substantially by altering the values of R3, R5, and C1. Circuit IC2 may be one of many types of n-channel power MOSFET, but it should be able to handle drain-source voltages greater than 50 V. In the proto-type, a BUZ74 is used which can handle D-S voltages of up to 500 V.
ReadMore....

Friday, April 5, 2013

Car Boot Light Warning

On many cars, the boot light will not go out until the lid is properly closed. It is all too easy when unloading the car, to leave the lid ajar. If you are unlucky and the car remains unused for some time, the next time you try to start it, the lamp will have drained the battery and you will no doubt utter a few appropriate words. The circuit described here will give a warning of just such a situation.

A mercury tilt switch is mounted in the boot so that as the lid is closed, its contacts close before the lid is completely shut. The supply for the circuit comes from the switched 12 V to the boot lamp and through the mercury switch. When the lid is properly closed, the boot lamp will go out and the supply to the circuit will go to zero. If however the lid is left ajar, the lamp will be on and the mercury switch will close the circuit.

Car Boot  Light  Warning Circuit diagram :


After 5 seconds, the alarm will start to sound, and unless the lid is shut, it will continue for 1 minute to remind you to close the boot properly. The 1-minute operating period will ensure that the alarm does not sound continuously if you are, for example, transporting bulky items and the boot will not fully close. The circuit consists of a dual CMOS timer type 7556 (the bipolar 556 version is unsuitable for this application). When power is applied to the circuit (i.e. the boot lid is ajar) tantalum capacitors C1 and C2 will ensure that the outputs of the timers are high. After approximately 5 seconds, when the voltage across C2 rises to 2/3 of the supply voltage, timer IC1b will be triggered and its output will go low thereby causing the alarm to sound.

Meanwhile the voltage across C1 is rising much more slowly and after approximately 1 minute, it will have reached 2/3 of the supply voltage. IC1a will now trigger and this will reset IC1b. The alarm will be turned off. IC1a will remain in this state until the boot lid is either closed or opened wider at which point C1 and C2 will be discharged through R6 and the circuit will be ready to start again. To calculate the period of the timers use the formula: t = 1.1RC Please note that the capacitor type used in the circuit should be tantalum or electrolytic with a solid electrolyte. The buzzer must be a type suitable for use at D.C. (i.e. one with a built in driver).

Source : www.ecircuitslab.com/2011/.../car-boot-lamp-warning-icm7556.html


ReadMore....