transistor base input

Hi all

I have an old analog alarm system. I am hooking up the bell output to a microcontroller. Although the output voltage for the bell fluctuates around 6 to 9 volts. I need either a steady 0 or 5v for the input of the controller. I made a circuit with 2 2n222 transistor, acting as an inverting gate. The problem is that the spec sheet of these and most transistor have a Veb of 5 volt. my Ve is at ground therefor my Veb exceeds this. any ideas on how to get pass this issue. Thought about a voltage divider at the output of th bell , but I am scared that if voltage drops a bit below 6v, the inverter will not pick it up as positive voltage. thanks k

Reply to
lerameur
Loading thread data ...

The Veb spec is a limit on how much reverse voltage that junction can stand, not any normal operating voltage. If the emitter is at zero volts, the transistor will switch on when the base voltage is about 0.7 volts more positive than ground, and the base-emitter junction becomes forward biased enough for the base current to rise to about 1/20th of the collector load current.

However, using a transistor as a switch will do nothing to regulate the voltage of the collector load.

It would help us help you if we could see a schematic of your circuit. Either you could post a link to your circuit, draw one with text characters (and a fixed width font, (like Courier) and post it here (this is made easy with a little chunk of software:

formatting link
) or post a normal graphic file representation on the alt.binaries.schematics.electronic group, where attachments are allowed.

--
Regards,

John Popelish
Reply to
John Popelish

ok good thanks for the link. below is my circuit . I have a 7805 that regulates the 5v. The ground is common to all. The source is anywhere between 6 to 9 volts. The source as mentionned in the circuit is the output of the analog alarm system going to the siren. I will hooking up the 5v regulator most probably on the batteries (12v) actin g as backup and being recharge by the analog circuit. Hope that helps you help me.

VCC 5V + VCC 5v | + | | .-. | | | .-. | | | | '-' | | | ___ '-' -------|___|-- to microcontroller | | | ___ |/ |----|___|--| | |>

___ |/ | Source--|___|- --------| | |> | | | GND | GND

Reply to
lerameur

Is the voltage swing labeled as "source, below also limited to swing between +5 volts and ground? I guess I don't understand why you need this circuit, at all. What prevents you from connecting the "source" directly to the microprocessor?

Once I understand exactly what the purpose of this circuit is, I might have more suggestions.

--
Regards,

John Popelish
Reply to
John Popelish

Well section 13.9 of the pic16F88 datasheet is copied below: From what I can read, if I supply 5v to the chip, my input to the microcontroller has to be between 4.4v and 5.6v. So the circuit is there to have a steady output of 5v into the microcontroller for any voltage between 6 to 9 v off alarm system (source)

A simplified circuit for an analog input is shown in Figure 13-4. Since the analog pins are connected to a digital output, they have reverse biased diodes to VDD and VSS. The analog input, therefore, must be between VSS and VDD. If the input voltage deviates from this range by more than 0.6V in either direction, one of the diodes is forward biased and a latch-up condition may occur. A maximum source impedance of 10 k? is rec- ommended for the analog sources. Any external com- ponent connected to an analog input pin, such as a capacitor or a Zener diode, should have very little leakage current.

Reply to
lerameur

(snip)

I assume this is a PIC input configured as a digital input, based on your two transistor interface circuit.

Why would you use the input configured as an analog input, instead of digital? Your circuit will output only two states-- high and low.

Yes.

Yes.

Only if you need the full analog to digital converter resolution over the full temperature range. What, exactly do you want the microprocessor to know about the input signal?

Of else, what?

--
Regards,

John Popelish
Reply to
John Popelish

(snip)

(snip)

formatting link

--
Regards,

John Popelish
Reply to
John Popelish

Because the input is from the analog alarm system, which varies between 6 to 9 volts. I cannot use that as an input.

Just high or low, alarm on or off...

k
Reply to
lerameur

So you need to distinguish between an output of 9 volts and an output of 6 volts, with some decision voltage between those?

I suggest you use a two resistor divider to lower the input range to about 1/3rd (3 to 2 volts) and do a one bit analog to digital conversion of this range with one of the inputs configured as a comparator. The comparators include an internal reference voltage derived from the PIC supply voltage, or can use a second input as the reference voltage input (the decision voltage) so you could use an external pot to set the detection point.

See section 13.0 for comparator setup and Tables 18.1 and

18.2 for the comparator DC specs. Note that the comparator input voltage range is 0 to Vcc-1.5 volts. Note, also that only the decision voltage must be within this range, since the measured input will still give the correct result if it goes more positive than this limit. So you may get by with a 1/2 input voltage division (4.5 to 3 volts), or some ration between 1/3rd and 1/2, as long as the decision voltage is below 3.5 volts.

If the microprocessor might not be powered when the input is active, you might want to add a Schottky diode from the comparator input to Vcc to limit the input voltage to about Vcc+0.3 volts.

--
Regards,

John Popelish
Reply to
John Popelish

no

just as 5 volt.

When the voltage from my source is between 6v and 9 volts, my chip reads high (or 5v) otherwise the chip reads low or zero. like I said, the source is the voltage going to the siren, so it is almost always ZERO. When siren goes off, the voltage jumps anywhere between 6 to 9 volts. Then the chip should read high

ken

Reply to
lerameur
[snip]

Just use your micro as a digital input; no analog required.

6-9vdc in --10K-----+------ micro | /\\ 5v zener diode | Gnd

HTH

Reply to
Randy Day

Man, it took you enough posts to make that simple explanation of what you want. All you need is a series resistor to limit the current from the source and a means to clamp the input voltage to no more than Vcc +0.3 volts. You could do that with a 10k to 100k series resistor and a 5.1 volt zener or a Schottky diode to Vcc. Set the PIC pin as a digital input. If you want the low state to be more noise immune, use a 2:1 voltage divider for the input, since the decision voltage is between 0.8 volts and 2.0 volts (see

18.4, DC characteristics.)
--
Regards,

John Popelish
Reply to
John Popelish

I think we have it now, thats sounds pretty good. Sorry for the bad explanation, I thought I had it good enough.

k
Reply to
lerameur

If it makes sense to you, then that's fine. If not, we'll hit it some more.

As to "good enough", I probably have a lot more possibilities floating around in my imagination than you have, so you don't understand what I have to eliminate to get to your case.

--
Regards,

John Popelish
Reply to
John Popelish

I think we have it now, thats sounds pretty good. Sorry for the bad explanation, I thought I had it good enough.

k
Reply to
lerameur

Another thought - perhaps the 6 to 9 volts going to the siren is actually AC or pulsed DC, rather than plain DC. In that case, you would want a diode in series with the 10K resistor in the above circuit, cathode towards the Zener, and a capacitor (0.1 uF or so, perhaps) and a 100K resistor, both in parallel with the zener. This would give a steady DC voltage to the microcontroller input while the siren is operating.

(The "jumps anywhere between 6 to 9 volts" bit makes me think that the siren drive is not DC.)

--
Peter Bennett, VE7CEI  
peterbb4 (at) interchange.ubc.ca  
 Click to see the full signature
Reply to
Peter Bennett

Good point.

Reply to
Randy Day

You should rethink the 10k resistor. You chose to make your input signal the max specified impedance for the chip -- without even allowing for the additional impedance of the source signal, or just plain old wiggle room; which you can easily afford. You should also consider zener current. A smaller resistor is in order, maybe by an order of magnitude.

Reply to
gearhead

Why? The lower the resistor, the more the source will be loaded.

--
Regards,

John Popelish
Reply to
John Popelish

Well, it's a bell output from an alarm. I guess I was operating on the assumption that it has the power to drive a physical bell, so it will hardly be able to tell the difference between 200uA or 2mA; either way you'd draw magnitudes less than the alarm's potential output, so it hardly matters. But if he feeds a maximum specified impedance to the micro input, he risks having the circuit not work. But the OP knows more about his alarm than I do. Let him work it out.

Reply to
gearhead

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.