Level shifting - 5v to 12 - 30v

Thread Starter

mrgecook

Joined Sep 17, 2018
7
Hi all
Please treat me carefully. I have some basic knowledge but am getting confused.

I have two small issues which I need to address.

This is for a keyboard instrument. The hall effect sensors will be used to detect movement of the key.

1) I am going to be reading a hall effect sensor using something like an attiny85. The output from the tiny is going to be digital 0 or 1.
This is at 5volts but I need to bring this signal up to control another control system at 15v. In my industry these control systems could be from 12 to 30vdc. Most of them are solid state and have opto isolators on the inputs.
I have been thinking of a transistor on the output of the tiny. I know the norm is to have a signal out between a resistor load and transistor. My concern is would this trigger the input of another control system? I was assuming a better way would be to have the signal out on the emitter followed by the load (Commom Collector)
What is your advice and what transistors and resistors would you recommend for the base and load?

2) I need to design a simple input board. The signal is 15v again it could be anything from 12 to 30vdc. I want to run this through optocouplers and into shift registers. What is the best way to handle this variable voltage? would a zener with resistors be the best idea?

Im just getting a little confused by it all.

Thanks in advance

Gary
 

crutschow

Joined Mar 14, 2008
38,503
1) So you just need to generate the 12V-30V signal at a low current to drive the control system inputs?

2) Do the shift-registers need a 5V signal input from the 12-30V signals?
 

Thread Starter

mrgecook

Joined Sep 17, 2018
7
1) So you just need to generate the 12V-30V signal at a low current to drive the control system inputs?

2) Do the shift-registers need a 5V signal input from the 12-30V signals?
Thank you for your help and for getting back to me so quickly.

1) I need the logic from the tiny (0 / 1) (0 or 5v) to be translated to a +Positive output 0 (Off) to 12 - 30 volts. The 12 to 30 volts is provided by a main switchmode power supply. e.g. the base would be connected to the tiny and the collector connected to the power supply (12 - 30).

2) I believe so. I was looking at using the 74hc165 which I believe needs a 5v input.
 

Thread Starter

mrgecook

Joined Sep 17, 2018
7
hi mrg,
Try a #3, #2 is the wrong around.;)
You want to go from 5v to[12v to 30v] .?? Please confirm

E
I am sorry, I have confused things.
1) goes from 5 to [12v to 30v]. I am taking a digital output from an arduino / attiny to drive a control system of 12v to 30. (Picture number 1)

2) goes from 12v to 30v to logic level over an opto. (Picture number 2)

Two different applications. Sorry for any confusion.
 

Alec_t

Joined Sep 17, 2013
15,117
I would use an opto-isolator driven by the micro (via a current-limiting resistor; something you haven't included in your second circuit), plus your 12-30V supply, to provide the control system input.
 

Thread Starter

mrgecook

Joined Sep 17, 2018
7
Here is the LTspice simulation of two typical opto-isolator circuits that should do what you want:

View attachment 160070
Thanks for this.
A few questions mainly about the variable voltage side of things. The upper circuit, will R1 be the same if the voltage is 12v or 30v?
In the lower circuit will R3 need to change depending on the voltage? or will the circuits handle the differences in voltage?
 

crutschow

Joined Mar 14, 2008
38,503
Both circuits have sufficient design margin that they should work fine over the expected voltage range with no resistor changes required.
 
Top