![]() This is similar to a series of "if" statements in Basic language. This reading is then compared with a series of values to determine the range of the voltage. Once the set-up is complete, a reading will be taken at port RA2, the input for the A/D convertor. 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. RB7, pin 13, drives a switching transistor for the piezo buzzer.įor the software, the design follows the basic template for a PIC microcontroller. 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. ![]() This brings the voltage down to within the 0-5V range for the A/D input of the PIC16F819. The battery voltage is sensed via a voltage divider using 33kΩ and 100kΩ resistors. The incoming supply is connected via diode D1 which provides protection against reverse polarity while zener diode ZD1 provides protection from spike voltages.Ī standard 7805 3-terminal regulator is then used to provide a stable 5V to the microcontroller. This little battery monitor could easily prevent a very inconvenient failure to start! So let's describe the rest of the circuit. ![]() So don't think that a modern car will always start reliably. 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. After all, most cars will start with no troubles, even though the battery voltage might be a touch below 12V, won't they? Well, no. ![]() 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. LED6 covers from 11.5V to 12V while LED7 comes on for voltages below 11.5V. LED4 covers 12.5V to 13V while LED5 covers 12V to 12.5V. LED2 indicates for voltages between 13.5V and 14V while LED3 indicates between 13V and 13.5V. The topmost LED, LED1, comes on for voltages above 14V which will occur when the battery is fully charged. There are seven LEDs in all, giving a good range of voltage indication. 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. 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. What was really needed was a display and a buzzer, to get my attention should the voltage fall outside a specified range. 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.Īfter the initial shock wore off, I put on my thinking cap to come up with a PIC-based solution to the problem. 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. 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. A large semi-trailer loomed in the rear-vision mirror as I pushed the clutch in and tried to restart. Just as I was going up a hill, the lights began to dim and the engine coughed. It was around 8pm at night and everything was very dark no street lights or house lights anywhere. ![]() I was traveling through an area that is full of open-cut coal mines and large heavily loaded semi-trailers constantly pound the roads, traveling at quite high speeds. It wasn't 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 traveling the closest petrol station may be 80km away. I had been enjoying a pleasant week of traveling around the countryside at a leisurely pace and taking in the beautiful scenery each day. A close call on the road can really focus your mind on the importance of having a battery monitor in a car. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |