Author Topic: How to level shift voltage to my required level.  (Read 9804 times)

0 Members and 1 Guest are viewing this topic.

Offline vschingTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
How to level shift voltage to my required level.
« on: April 24, 2009, 09:44:51 AM »
Guys, i have a microcontroller with pin output 2.7v which i needed to level shift its level to 3v and above, since my rc servo require a signal of
3-5v SQUARE peak to peak. Any idea how to do it? I try using a NPN transistor with 10k resistor however somehow to signal got distorted. Any idea how to get the waveform without any distortion? And how to choose the resistor which connect to the base or collector of the transistor? Can someone please guide me? Thanks

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,208
  • Helpful? 15
  • Hardware and Firmware Designer
    • The Hellinic Robots Portal
Re: How to level shift voltage to my required level.
« Reply #1 on: April 24, 2009, 12:18:10 PM »
You need a PNP transistor of course...
You are trying to switch a positive rail!!!!!
For whom the interrupts toll...

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: How to level shift voltage to my required level.
« Reply #2 on: April 24, 2009, 07:43:25 PM »
Hi,

One of each is needed for a non-inverted positive switched signal
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline vschingTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: How to level shift voltage to my required level.
« Reply #3 on: April 25, 2009, 12:39:48 AM »
Ok, thanks, i would try with it. However, what value of the transistor i needed to take note for the value of resistor. I am currently using BC327 and BC337 atm. Thanks for the help, guys.

Oh ya, i got a bit confused with the voltage as well. The GND here refers to the GND of the microprocessor, right? How about the 0v? I am currently using a 5v regulator to output 5v required for the servo. The servo i am using is the Hitec HS311 just for your information which required 5-6 voltage source and 3-5v signal source.

The 0v is the middle point of the voltage regulator, is that right?

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: How to level shift voltage to my required level.
« Reply #4 on: April 25, 2009, 01:23:01 AM »
when you see 0V it generally is ground isn't it? the middle pin goes to common gnd of your circuit
Howdy

Offline vschingTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: How to level shift voltage to my required level.
« Reply #5 on: April 25, 2009, 02:09:38 AM »
Ok, got it. Thanks, BTW, how to choose the resistor value based on the BC327 or BC337 specs? What value should i look for? Hfe?

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,208
  • Helpful? 15
  • Hardware and Firmware Designer
    • The Hellinic Robots Portal
Re: How to level shift voltage to my required level.
« Reply #6 on: April 26, 2009, 12:39:13 PM »
Try out these ones...
Basically, BC series are almost the same expect from current sink abilities... if I remember right...
For whom the interrupts toll...

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: How to level shift voltage to my required level.
« Reply #7 on: April 26, 2009, 05:43:53 PM »
Hi,

[...] what value of the transistor i needed to take note for the value of resistor. I am currently using BC327 and BC337 atm.
No change at all, the resistor values will work with most small signal NPN/PNP BjT's.


Oh ya, i got a bit confused with the voltage as well. The GND here refers to the GND of the microprocessor, right? How about the 0v?
As you can see, they're the same plane ("wire").
When you're talking about a power source you will have +V, 0V or, 0V and -V (and sometimes +V, 0V and -V). The 0V it the point to which you refer any other voltages (by convention) and Gnd (Ground) is the natural point, sometimes also termed "Common" (usually abbreviated Com).
When talking about Gnd (which in some circuits is actually grounded), we tend to refer to a low impedance plane which at least could be grounded without detriment in any way.

In case of the schematic, it's partly because Eagle CAD won't allow the same name for two solder pads and partly to tell you that 0V and Gnd should be the same.
Had I put a controller in the drawing, I would have named the same plane as "Vss", which could be translated to -V, since digital circuitry use Vdd for positive supply and Vss for the negative (which is often used as Gnd).
The equivalent names in analog* circuitry would be Vcc and Vee respectively.

* it's not really the digital vs. analog that decides the names, but rather the technology. If FETs are used, it's Vdd and Vss (Voltage connected to drain and source respectively) and for BjTs it's Vcc and Vee (Voltage connected to collector and emitter respectively).

Don't worry though, lots of people (including some pro's I'm a bit ashamed, on their behalf, to say) are confused about this, using eg. Vcc and 0V for microcontrollers using FETs.


I am currently using a 5v regulator to output 5v required for the servo. The servo i am using is the Hitec HS311 just for your information which required 5-6 voltage source and 3-5v signal source.

The 0v is the middle point of the voltage regulator, is that right?
It can be, but it depends on which regulator you're using - the ground pin can be pin 1, 2 or 3, but if it's a 7805 in a TO220 package, it's the middle pin, V_in is the leftmost and V_out is the remaining, when you look at the text on its face, with the pins pointing down. (The 78L05 in a TO-92 package is different).
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline vschingTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: How to level shift voltage to my required level.
« Reply #8 on: April 26, 2009, 09:00:23 PM »
ok, thanks a lot, i would try it tomorrow when my school lab is opened and reply here asap.. Thanks.

Offline vschingTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: How to level shift voltage to my required level.
« Reply #9 on: April 28, 2009, 07:19:14 AM »
I am able to get my sevo to work based on your diagram. Thanks a lot. But if it is possible, can u explain the theory behind this schematics? My electronic basics is kind of weak, now trying to learn more ^^
« Last Edit: April 28, 2009, 07:24:41 AM by vsching »

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: How to level shift voltage to my required level.
« Reply #10 on: April 28, 2009, 01:12:20 PM »
Hi,

I am able to get my sevo to work based on your diagram. Thanks a lot. But if it is possible, can u explain the theory behind this schematics? My electronic basics is kind of weak, now trying to learn more ^^
When your I/O-pin goes high, it will deliver base current to (and hence open) transistor Q1 through the current limiting resistor R1. When the pin goes low, Q1 will close, helped by R2. You could leave out R2 when driven from a MOSFET output, since it sinks ample current for that.
The base of Q2 (the PNP) is pulled low (opened) when Q1 is open and R4 is limiting the current. When Q1 closes, Q2 is closed by R3 pulling its base high (to the positive supply for the servo).
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: How to level shift voltage to my required level.
« Reply #11 on: May 27, 2009, 08:15:23 PM »
Did you get it to work?

thinking outside the box, you can do it with a MOSFET as a single component, or an op-amp + 2 resistors too . . .

Offline Strikeskids

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
    • Strikeskids
Re: How to level shift voltage to my required level.
« Reply #12 on: May 28, 2009, 05:12:34 AM »
Wouldn't u just use a 5V voltage converter
Don't take life seriously
Nobody gets out alive anyway.

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: How to level shift voltage to my required level.
« Reply #13 on: May 28, 2009, 05:40:49 AM »
you would have to use a buck/boost converter and these are just worse off to use than the transistor setup.
not that you cant... just that its annoying.
Howdy

 


Get Your Ad Here

data_list