# Voltage reduction question

Discussion in 'General Electronics Discussion' started by C0st, Feb 11, 2018.

1. ### C0st

Joined:
Feb 11, 2018
Messages:
3
0
I have an old alarm system I would like to connect to a raspberry pi,
the alarm system uses a voltage of 4.5v for digital 0 and 9v for digital 1
I need somehow to reduce 4.5v to close to 0 volts and 9v to 3.3v for digital 1 of the raspberry pi.
Voltage divider circuit with a zener is the best I could do but it doesn't achieve the close to 0
Any help would be appreciated.

C0st, Feb 11, 2018

2. ### Harald KappModeratorModerator

Joined:
Nov 17, 2011
Messages:
8,385
1,592
Location:
Germany-Europe-Earth-Sol System-Milky Way-Laniakea
Welcome to EP.

The quality solution is a comparator with 5 V output. Divide the input voltage down by e.g. a factor 4 (1.125 V low, 2.25 V high), set the treshold to ~1.7 V and you're set.

The cheap solution is a 5.6 V zener diode, transistor and a few resistors:

Note that this circuit inverts the signal 4.5 V in -> 5 V out, 9 V in -> 0 V out but that can easily be handled on the raspbery in software.

Harald Kapp, Feb 11, 2018

3. ### C0st

Joined:
Feb 11, 2018
Messages:
3
0
Thank you very very much, gonna try it soon. Won't the 5v fry the Rpi gpio?

C0st, Feb 12, 2018
4. ### Harald KappModeratorModerator

Joined:
Nov 17, 2011
Messages:
8,385
1,592
Location:
Germany-Europe-Earth-Sol System-Milky Way-Laniakea
Right, I came up with this rather quickly. Of course, it the raspberrie's I/O is 3.3 V use Vcc=3.3 V.

Harald Kapp, Feb 12, 2018
5. ### C0st

Joined:
Feb 11, 2018
Messages:
3
0
Thank you so so much!

C0st, Feb 13, 2018
6. ### AnalogKid

Joined:
Jun 10, 2015
Messages:
2,172
615
Location:
Ohio - GMT-5
100K from the base to the emitter?

ak

AnalogKid, Feb 13, 2018

Joined:
Nov 17, 2011
Messages:
8,385