Hi guys,
I'm planning on building a battery voltage monitoring module (using a PIC16F88) for some testing we are doing at work. Here are the requirements:
A specific load is applied to a battery. The purpose of the module is to continuously sample the battery's voltage as it is gradually discharged, then remove the load via a relay once a pre-defined voltage threshold is reached. Voltage output is displayed on a 4x7segment display.
I think I have most of the circuit and programming worked out. Just seeing if anyone could provide some advice on the following?
THRESHOLD ADJUSTMENT
I'd like to be able to set the voltage threshold before the load is applied. Threshold can be adjusted between 7.3v and 25.5v. I was thinking of using the PIC's ADC for this, in conjunction with a pot/resistor circuit as per PDF attached. (NOTE - the switch is just there for another input so I could save on pin usage).
If I set the ADC high and low voltage references to Vss and Vdd, do I need a resistor before the Micro's input pin to limit current? Or can I put voltages (between 0 and 5v) straight into the input pin when using ADC?
What are the consequences of drifting outside 0 and 5V at the input pin? Should I use a 5V Zener to limit input voltage at the pin?
RELAY CONTROL
I'm planning on driving the Relay using an NPN BC547, switching from the Micro via a 1K resistor at the base. Relay is 12V, so current would be around 100mA. I'll admit I'm not great with transistor calculations - Would the transistor be able to handle the current?
Any feedback or questions, let me know. Thanks in advance.
-Tom
I'm planning on building a battery voltage monitoring module (using a PIC16F88) for some testing we are doing at work. Here are the requirements:
A specific load is applied to a battery. The purpose of the module is to continuously sample the battery's voltage as it is gradually discharged, then remove the load via a relay once a pre-defined voltage threshold is reached. Voltage output is displayed on a 4x7segment display.
I think I have most of the circuit and programming worked out. Just seeing if anyone could provide some advice on the following?
THRESHOLD ADJUSTMENT
I'd like to be able to set the voltage threshold before the load is applied. Threshold can be adjusted between 7.3v and 25.5v. I was thinking of using the PIC's ADC for this, in conjunction with a pot/resistor circuit as per PDF attached. (NOTE - the switch is just there for another input so I could save on pin usage).
If I set the ADC high and low voltage references to Vss and Vdd, do I need a resistor before the Micro's input pin to limit current? Or can I put voltages (between 0 and 5v) straight into the input pin when using ADC?
What are the consequences of drifting outside 0 and 5V at the input pin? Should I use a 5V Zener to limit input voltage at the pin?
RELAY CONTROL
I'm planning on driving the Relay using an NPN BC547, switching from the Micro via a 1K resistor at the base. Relay is 12V, so current would be around 100mA. I'll admit I'm not great with transistor calculations - Would the transistor be able to handle the current?
Any feedback or questions, let me know. Thanks in advance.
-Tom