Hi,
Upon power up, your PIC I/O is an input high-impedance (tri-state)
and then with your code you make it an output. Without R2 the
base of the transistor will be left "floating" when the I/O is
in high-impedance state.
* * *
Battery operated devices
Hypothetical scenario:
Only the PIC is switched off with a switch and the
emitter of the transistor is directly connected to the battery.
When the PIC is powered down what is the voltage on its I/O?
In this conditions, do you have still some current flow in R1?
If the transitor "switch" is not completely turned off, will the
sound module slowly discharge the battery?
* * *
How to measure the current in R1:
To do this measurement you will need a high-impedance voltmeter.
(Digital multimeters with LCD display are OK).
With the Digital multimeter set for "DC volt" measurements,
measure the voltage dropp across R1.
Example, your Digital Voltmeter measures 1V across R1:
(1 V is dropped across R1 and your R1 is 10000 ohm).
I = V/R
To calculate the current flow through R1:
1V / 10000 Ohm = 0.0001 A (0.1 mA)
Best regards,
Luciano





Bookmarks