![]() ![]() It works okay on equipment that gets installed once and stays hooked up. The idea is to burn out the 10 Ohm “fuse”, if someone installs the instrument with the polarity revered. I was hoping Melanie would come to my defense about the reverse polarity diode. Something to absorb a small surge for a short time to soften the blow on the Zener. The idea of the 10 Ohm resistor was to put a “bungee cord” protection for the Zener. I feel like this is a circuit designed by a committee. A a quick google using "automotive interference suppression" or similar will probably produce some worthwhile results. There are many more "tricks" to combat the nasties found in the automotive environment. This point should have the lowest impedance path for noise/spikes. Try to use a "star" type connection where all the grounds join at one place - usually at the filter capacitor/regulator. Keep analog and digital grounds separate. The other important point is to take care when joining the ground connections together on your pcb. Adding 1nF ceramic decoupling capacitors to every i/o on your pcb can also be worthwhile. Outputs are usually buffered anyway through drivers, transistors, fets, relays etc. Doing this greatly reduces the chances of nasty spikes reaching your micro. For analog inputs I buffer the signals with RRIO op-amps powered from the +5v rail. For digital inputs, this means using opto-isolators. Try to make it and "island", if you like. ![]() I would also add some inductance before the 7805 - somewhere around 1mH works for me.įor maximum reliability, I always try and isolate or buffer the micro from the "real world" signals as much as possible. On a 12v system, an 18v Transorb should be ok. It is always a good idea to use a Transorb (instead of the zener) - they are much better at catching nasty spikes. The one you have now will burn out the 10ohm resistor if you connect it up backwards. ![]() ![]() Here is how I go about it:įirst of all, put a diode in series with the 7805 regulator for reverse polarity protection. The automotive environment can be very nasty, as someone has already said. You might add a zener diode for extra protection.Įxcellent divide by three idea (10k 10k 10k) given by Dave (mackrackit). I didn't use precision resistors, I didn't need great accuracy. Please note that the Pic itself is powered via a 7805 regulator as suggested in an earlier post, with appropriate capacitors, and a fuse just to be safe. '************************ DEFINE ADCIN PARAMATERSĭefine ADC_BITS 10 ' Set number of bits in resultĭefine ADC_CLOCK 0 ' Set clock source (Fosc/2)ĭefine ADC_SAMPLEUS 50 ' Set sampling time in uSĪDCON1 = %10001110 'Right justify, channel 0 is analog After double checking with a multimeter, I connected porta.0 of a 16f877 to the resistor node that was less than 5 volts, and used the following code to read and display the battery voltage I wired three 10K ohm resistors in series (because I had lots of 10K resistors!) to form a simple voltage divider. I'd use a 100k and a 22k-10k variable in series to set the voltage accurately, or do some other tricks in software for calibration. I have no idea where you get 58k and 41k resistors these aren't standard RETMA values. Personally, I'd use a 4:1 because the car battery can get up into the mid-14 volt range with some charging systems. He also recommended a 3:1 voltage divider for the sense. You might find that under charge the voltage could be around 13.8v, falling to 10v under load.The OA didn't say use the regulator for the sensed voltage, but for the supply voltage. If you used a 58K and 41K with a 12v supply you would get 5v, however the state of a car battery is such that it's voltage will vary under charge and drain, so you would need to make allowances for that. The simple way is to use a voltage divider made by connecting two resistors accross the 12v line and then connect the pic to the junction between the two. The regulator will simply give you a 5v supply from the 12v battery, it will never fall below 5v because the car battery would never get this low. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |