Shop OBEX P1 Docs P2 Docs Learn Events
Switching 3.3v logic level with a 12v source / Higher Amperage Voltage Regulati — Parallax Forums

Switching 3.3v logic level with a 12v source / Higher Amperage Voltage Regulati

CharlieIICharlieII Posts: 70
edited 2008-12-08 16:17 in General Discussion
I have been using a voltage divider circuit to pull the voltage on the output wires from a shifter down to 3.3volts so they could be used as inputs to the propeller.· However, I am now at the point of applying my breadboard circuit to a PCB and would like to do away with all the resistors and extra traces they require by hopefully using some kind of mosfet.

I only have 4 of these 12v inputs to cope with.· So if there is possibly some form of quad driver that can switch 3.3v outputs with 3.3v VDD while taking a 12v input I could really clean things up on my circuit layout, and also fully isolate things such that voltage fluctuations on the input device side wouldn't carry over to the propeller.

I have never had an issue of trying to switch a lower voltage with a higher.· And as such the transistors I have been using are not going to work out according to what I've read from their data sheets.

Any help would be greatly appreciated.

Thanks guys,

Charlie

Post Edited (CharlieII) : 12/4/2008 2:06:31 PM GMT
«1

Comments

  • T ChapT Chap Posts: 4,223
    edited 2008-11-18 02:21
    I would search for a quad opto isolator, use 3v3 on the output side, one resister per opto, say 470 using 12 volts. That is 5 components, rather tidy.

    Another option is a quad 3v3 zener IC, and 4 resistors. The opto is a safer bet for high voltage buffering though.
  • CharlieIICharlieII Posts: 70
    edited 2008-11-18 02:45
    It's funny you mention optocouplers.· I was just searching Newark and was looking at them until I just checked back.

    This is rather frustrating to be honest.· I need the equivelent of a 10 dollar autoparts store relay.· Even the cycle time of a relay is fine.· And it doesn't need to be solid state even.

    Is there no semiconductor equivelent to the lowly autoparts store, normally open·relay?

    Even it can switch 3.3v with a 12volt signal.

    confused.gif

    Maybe I'll have 4 wires running outside the case to 4 relays with 4 return wires coming back in with 3.3 volts on them.

    tongue.gif

    But seriously.· Is there not a nice 4 channel·device in a nice dip package·that can switch a 3.3v output with a 12 volt input?

    The amperage is basically·non-existent here.··The only amperage will be two rather large pull down resistors.· One for each prop pin and one for each output pin from the 12volt·device.

    And again, thanks for any·help here.

    I don't mean to sound rude, I honestly just think it·borderline absurd that·such an IC does not exist in mass.· I guess voltage divider resistance circuits are not so bad afterall.·
  • CharlieIICharlieII Posts: 70
    edited 2008-11-18 03:01
    I think I may have answered my own question.

    In the fact that I still need the pulldown resistors... I can't get away from the resistors.· And in that case, I'm merely looking to swap 4 resistors for one IC with likely just as many or more pins.

    I"ll just stick to the voltage divider.

    (smacks forehead)
  • T ChapT Chap Posts: 4,223
    edited 2008-11-18 03:25
    Somebody said...
    Is there not a nice 4 channel device in a nice dip package that can switch a 3.3v output with a 12 volt input?

    Yes, a qaud opto in 16 pin dip. Use pull downs on the output, feed the LED's with 12 and use a 330-470 ish resistor to get the LED hot enough to turn on the transistor fully. 1 IC, 4 pull down resisters, 4 current limiting resisters on the input to the LED's.

    The voltage divider is OK, but does not offer any protection in case there is an over voltage spike, or if one side of the divider to GND gets lifted accidentally, your chip is dead.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-18 05:33
    Take a look at the CD4050BC. The inputs can tolerate up to 15V, even when run from 3.3V. Better still, they're cheap.

    -Phil
  • T ChapT Chap Posts: 4,223
    edited 2008-11-18 05:51
    Good call, I forgot about the 4050.

    May still need pull up/down on the inputs of the 4050 depending on the source.
  • CharlieIICharlieII Posts: 70
    edited 2008-11-18 20:32
    Sweet!



    I was hoping such an integrated circuit existed.· I"ll try it for sure.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-11-19 05:57
    I don't know what's wrong with just using two resnets to do the voltage dropping but if you really really want to do the same job with a chip then the logical solution would be to use a QUAD RS-232 receiver chip like the hardy and venerable MC1489.

    *Peter*
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-19 06:41
    Peter,

    Hmm, not a bad idea. The MC1489 is certainly more rugged than a '4050 and includes input hystersis, but it requires a 5V Vdd. This is an easily surmountable difficulty, given a 5V supply and some current limiting resistors on its outputs.

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-11-19 08:39
    5V is only nominal as that's what they used to be used on but the spec is open on that. They are just transistors on a common substrate and there is nothing to stop it being used on 3V or 9V.


    *Peter*
  • CharlieIICharlieII Posts: 70
    edited 2008-11-19 13:33
    When you say "resnet" is that resistor network?·

    If so, the benefit of using an IC would be isolation.· If some stray voltage hits anything on the 12v side and spikes the voltage the resistors won't account for it and the voltage hitting the prop pins will also rise.· Depending on how much they jump, it could hurt the prop.

    I'll look up that one you posted.· Although I'm starting to think about just using a zener on each input to the prop for protection.· To do that would I just choose a Zener with an "avalanch" voltage roughly equivelent to the voltage maximum I want to let the pins see?

    While I've got you guys thinking in terms of power and such, where can I find voltage regulators capable of more than the common 1A output current?

    I need to drive a fairly strong servo and I would like more than a 1A rated regulator to power it.· It needs to be a 6v output reg with preferably a 12v input.· Same goes for the 12v reg, I would like one capable of more than 1A as the 6 volt reg will be getting power from it.

    Thanks for any suggestions.·
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-11-19 14:21
    Charliell,
    Yes, resnet is jargon for "resistor network". Really, resistors are all that you need for +12V inputs. In fact I usually don't even worry about resistor dividers but simply rely on the intrinsic clamp diodes that are part of the silicon substrate. As long as you limit the current using a suitable value resistor then there isn't a problem. Take 10K for instance, if you apply +12V through a 10K resistor straight to a Propeller pin without any other resistors or diodes then the input on the Propeller will be clamped to around 3.6V and the current would be limited to (12V-3.6V)/10K = 840ua. In theory you could apply 120V to that same input (don't do it) and everything would be fine. (Problems might arise during reset and other times when the Propeller doesn't draw much current from the 3.3V supply and that "clamp current" can end up pushing up the 3.3V supply which could affect operation although a clamp diode on the supply is all you really need)

    In regards to the servo, I'm not really sure what kind etc but usually with motors it is very easy to drive them in pulse-width modulation fashion to control the speed from a higher voltage. If the servo was connected to +12V but driven from a 50% on 50% off repetitive signal then the "average voltage" would be 6V. In this case the motor is happy as it probably ends up with more torque (+12V peak pulses) and you are happy because you didn't need to supply the 6 volts. You can use a suitable NPN or N-channel MOSFET driven directly from the Prop to control even very heavy motors.

    *Peter*
  • CharlieIICharlieII Posts: 70
    edited 2008-11-19 14:51
    Interesting.

    So there is a diode built into each input pin on the prop that clamps the input voltage?· And then I just have to ensure that the amperage is controlled with ample resistance.

    I didn't realize there was a "clamp" on the input pins that would yank excess voltage to ground (assuming amperage doesn't burn this little guy up).


    And as for the servo, I can drive it directly, as there is little to no amperage on the "control" or signal wire.· My issue is with the actual power output wires.· I need to literally drive the servo from my PCB as well.· I had though that I would need a voltage regulator capable of dropping the voltage to 6v that was also capable of handling the current as well.

    But are you suggesting that aside from the signal wire to the servo, that I use the PWM of a transistor to produce an average voltage to the servo and let it be my regulator?· If so, I wonder what an acceptable frequency would be to avoid any noise and to keep the servo from "seeing" the switching.

    Interesting.· Along those lines, what would be a good transistor to use for switching a 12v source with the prop?· Or should I be switching the ground side and just letting the prop pull the gate to ground?

    I am as "green" as it comes here, so keep my inexperience in mind when reading my responses and questions tongue.gif

    I'm still waaaaay low on the learning curve with electronics.

    Thanks.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-11-19 22:52
    Whoa, hold up there, it's good you are thinking but you are making some huge assumptions as well. You cannot drive a +12V servo directly from a port pin but that is why we use a transistor to take a low voltage, low current signal and switch a higher voltage, higher current. Without going into a long didactic explanation I suggest you read some books on electronics or google up specific subjects and have a look at some simple circuits (like this one below) and try to understand how and why so that you can make adjustments yourself.

    As regards to the "clamp" diode, it's not really designed into the circuit but it's intrinsic (part of it's nature) to the whole process used to produce CMOS ICs. Being intrinsic they are not designed as clamp diodes but we can use this characteristic of CMOS if we are mindful of the limitations. So certainly I wouldn't be asking the "clamp diode" to handle more than a few milliamps but usually less than a milliamp. For low-speed signals it wouldn't hurt if you used even higher value resistors of around 100K for your inputs.

    With PWM and motors it is usual to run the frequency at around a few KHz but it is easy to experiment yourself.

    We are all green in some subject until we learn and gain experience and knowledge and understanding (then we are just another shade of green with some really green patches too). Just make sure you do your own research rather than asking too many questions or jumping to hasty conclusions. Test out your knowledge and gain experience and understanding, if you need a lead or you are stumped or curious then please ask.

    Here is a suggested workable circuit based on what we are talking about.

    *Peter*

    BTW, the excess clamp current flows into the VDD supply not ground. Also, you may need a diode across the motor.

    Post Edited (Peter Jakacki) : 11/19/2008 10:59:49 PM GMT
    1269 x 544 - 31K
  • CharlieIICharlieII Posts: 70
    edited 2008-11-21 15:00
    Sorry, I hadn't checked back in a while.· Thanks for the detailed response.

    I should mention, when I said drive it directly, I meant the control wire.· The servo control wire has little to no amperage on it.· I have a 1k resistor between it and the prop for good measure, but the amperage is miniscule.

    The only meaningful amperage is in the positive and negative wires to the actual motor of the servo.

    I'll look over the schematic you posted before I ask anymore questions.

    Thanks a lot.

    Charlie


    Oh, and the servo is 6v.


    Okay, I checked out the schematic.· That appears to be a diagram for controlling the speed of a standard 12v electric motor by switching·a transistor with varied duty cycle on a PWM signal to a transistor.· Make's sense.· And I notice it's switching the low side.· I'm guessing this is easier to do?· Because of the gate voltage needing to be high in order to switch the high side?

    Thanks.


    Also, is the prop pin sinking the voltage to the transistor?

    Post Edited (CharlieII) : 11/21/2008 3:37:19 PM GMT
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-11-22 01:20
    I haven't checked back in a while either. It makes sense to switch the low side for a variety of reasons but in this case it means that the Propeller can drive it directly through a current limit resistor. High-side drive would require more components without any advantage in this instance. The transistor is controlled by current flow (not voltage) from the base to the grounded emitter (conventional flow). The transistor amplifies this current by around 100 to 200 times through the collector to emitter but of course there is a maximum current that the device can handle plus we run the transistor as a on/off switch by saturating the base with more than enough current to completely turn the transistor on a bit like a switch. If you don't have enough current in the base to completely turn the transistor on then it will act more like an imperfect switch with resistance and probably get rather hot. That's the idea of using a low value resistor like 220R as the current into the base would be around (3.3Vdd - 0.6Vbe)/220R = 12ma. With this current transistor's gain of around 200 we could theoretically switch 2.4A but we overdrive it to make sure it will handle a 1A load in varying conditions etc.

    So the prop is "sourcing" current into the transistor through the base to ground. In other words you need a positive voltage through the resistor to develop a limited current flow. Think water flowing through the pipes, the pressure is analogous to voltage or the potential while the current is actually work or flow. Bigger pipes, less resistance. More pressure, more current. Too much current for the reservoir (power source) and the pressure (voltage) drops. Short out a little 9V battery and the terminal voltage drops to near zero while the current flow is at maximum.

    Whew, it's easier to say all this than it is to type it.

    *Peter*
  • CharlieIICharlieII Posts: 70
    edited 2008-11-24 13:41
    Okay.· I never thought of a transistor like a current amplifier.· I'm guessing the relative "gain" of any specific transistor is specified in the datasheet?· I'll look.

    And based on this number, I can always choose the correct combination of voltage/resistance·to apply toward the·base·that will produce current·through the·emitter to ground proportionate to the current I plan to switch, plus some safety factor.· And as you stated, hopefully plus a rather large safety factor, such as 2, as to avoid overheating and loss of transistor efficiency.

    If my conception thus far is correct, I have a much better view of transistor function now.

    So this leaves me with a Good part number to accomplish most all the switching I will need to do.


    So for this circuit, the only thing I'm still somewhat puzzled with, is how to get a solid 6v power source from my 12v (13 - 14v in reality) DC source that has enough amperage capacity for a 330+oz servo.· All I can find are 1A regulators.· Maybe that is plenty?

    I will check the maximum servo current draw when I bind it up and it attempt to right itself.· That should give me an idea of what I'm up against in terms of amperage to shoot for.

    Thanks again.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-11-25 00:29
    You don't need to convert to 6V DC with a regulator as you can run the 6V motor directly from +12V while using PWM to regulate the power. This has been mentioned before, you are talking about 6V for the motor or am I missing something?

    *Peter*
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-25 00:51
    Peter,

    I think his motor is a large hobby-type RC servo that has a logic-level input and requires a constant supply voltage of 6V. In this case, PWMing the supply line is not a good idea, since it also supplies the internal logic circuitry.

    CharlieII,

    For your current requirements, a switching regulator is probably your best bet. Here is one rated for 1.5A, but I'm not sure that will be enough for such a large motor. You will have to find the specs for your motor first, before you set about finding a regulator for it.

    -Phil
  • CharlieIICharlieII Posts: 70
    edited 2008-11-25 12:39
    Yes, it is an Rc servo. And it is a rather strong one. I believe it is in excess of 330in/oz of torque at the listed 6v max.

    I will grab my DVOM before I leave this morning so I can physically check it's amperage draw when at full load. Then we will have a good ballpark of where I should be looking in terms of current requirements.

    And yes, the servo has three wires, positive, negative and signal. The signal is now connected to a prop pin through a 1kohm resistor. The power wires are run directly to my 5v reg that came with the propeller dip kit. Maybe the amperage is actually rather low. I will find out.

    One other thing. If it did turn out that I needed more than 1A of current, or close to it at full load, could I simply parallel regulators, such that by using two 1A regs in parallel I could apply up to a 2A load?

    Thanks.
  • CharlieIICharlieII Posts: 70
    edited 2008-12-03 00:29
    Sorry, I haven't responded in a bit.· I guess I got caught up in the holiday.

    Anyway, I finally checked out the amperage required to drive the little servo.· I bound it so that it could not move, and then commanded a position far from where I bound it.· With my DVOM connected in series with ground it showed just a shade over 2.3 amps right before the little 5v reg I was using started smelling a bit hot, lol.· (it was fried).



    So what should I do now?· This goes on a vehicle, so I have a "12v" system, but in reality it's between 13 and 14.5 volts.· So even for the 12v controller I would still need a regulator.· And assuming I pull my 6v servo power from this same regulated 12v source on my board, then it too will have to endure a worst case scenario amperage of 2.3.

    So how do I go about getting 12v and 6v regulators capable of 3A current draw?

    Thanks.



    BTW, I think that little sucker tried to break my finger.· [noparse]:)[/noparse]
  • Mike GreenMike Green Posts: 23,101
    edited 2008-12-03 01:09
    The LM350 can handle 3A with a TO-5 package and is adjustable using two resistors so you can easily get 6V output if that's what you need. Download the datasheet from National Semiconductor. It includes typical circuits.

    With the amount of voltage to be dropped (turned into heat) and the current, you might consider a switching regulator (http://www.national.com/pf/LM/LM2676.html).· With a voltage drop of 8V at 3A, your LM350 would have to dissipate 24W of power.· You'll need a big heatsink.

    Post Edited (Mike Green) : 12/3/2008 1:18:41 AM GMT
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-12-03 03:46
    Your regulator only has to worry about normal loads and take into account the duty cycle. If you operate the servo for 1 second every 10 seconds for instance and the servo draws 1A then a simple linear regulator will start to get rather hot but then it has a chance to cool down (average 0.6W). If the servo is stalled then no amount of regulation is going to help and the standard linear regulators will go into thermal shutdown which is fine. You can even monitor the +6V line through a resistor divider to monitor fault conditions. This is assuming that the 6V is only required for the servos and nothing else.

    As Mike pointed out you could use a switching regulator which is really the only option for higher input/output differentials and higher current. There is also the venerable LT1074 in a 5-pin TO220 that is bullet proof and easily handles 5A from 10V to 40V input. Haven't used them in a while but I can swear by them. Take your pick but I'd factor in such things as normal operating current and duty cycle to come up with a simple and practical solution.

    BTW, this thread is more about running 6V servos from 12V rather than switching 3.3V logic. If you think this thread will go on for a bit it might be an idea to start a new thread for the benefit of the rest of the group who might be unaware about this aspect of the thread.

    *Peter*
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-03 05:17
    ... or just edit the title to include the new content, since we're already on a roll here.

    -Phil
  • CharlieIICharlieII Posts: 70
    edited 2008-12-04 13:56
    I ran across something last night called a "Power Mosfet" which seemed to be capable of relatively high voltage and insanely high amperage.·

    Although when I look this morning on Google, I must be using different wording as I was finding datasheets galore last night, and can't find a thing now.

    Anyway, I remember finding a few capable of up to 40 amps in a TO 262?, package.· Assuming I can use something similar (although not necessarily with that kind of amperage capacity) could I have the prop run a high frequency PWM to it, and then just read the output voltage with an ADC channel and write something that will alter the duty cycle vs output voltage and hold 6v on the output?

    Or is it the case that for a given duty cycle the output voltage will remain constant and only amperage will fluctuate with load?

    If this is the case, I can just use the transistor that Peter already showed me and just do a PWM "regulator" for the servo power and leave the rest of the board powered from Standard regulators like came with the Prop Dip Kit as there is very little amperage on any of that being that it's all logic level.

    Also, I have to make the circuit capable of withstand a sustained situation where the servo is "bound".· Since it will be physically cycling the valvebody on the transmission itself, I can forsee a situation where the Parking Paw could become bound on a hill and be reluctant to come out.· In that case, if the servo torque isn't sufficient it will sit in full load until the shifter is moved back to park, it comes out of Park..... or it lets the smoke out of the wires.· jumpin.gif·· lol



    I would just test this stuff, but I don't have a transistor capable of it at the moment.· I will order a few of the ones Peter suggested earlier that can handle a 3A load and can be switched from the 3.3v prop.··But I still don't know if you leave the duty cycle constant, and vary the load on the line, does the voltage drop?··I would think so?· In this case, do you have to integrate closed loop control like I mentioned above?

    Thanks.





    Also, I don't see a place to modify the title.

    Post Edited (CharlieII) : 12/4/2008 2:01:29 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-12-04 14:33
    Charlie -

    I don't know if this is what you found with Google, but International Rectifier has a line of Power MOSFETs called HEXFETs. Here is the link to their web site on the Power MOSFET page: http://www.irf.com/product-info/hexfet/

    I hope that's what you were seeking.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When all else fails, try inserting a new battery.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-12-04 22:33
    "I am not liking" the sound I hear of you implementing your own regulator with a transistor, bipolar or mosfet.

    One thing you need to learn is when you are working on a new design is to concentrate on the core objectives instead of being sidetracked or taking shortcuts that could jeopardize the whole project.

    Please take the extra effort and use a switching regulator that is guaranteed to work, you probably have more than enough variables to deal with without introducing extra magic smoke.

    *Peter*
    760 x 812 - 105K
  • CharlieIICharlieII Posts: 70
    edited 2008-12-05 00:00
    Well shoot, lol.

    I thought the switching transistor to control the motor voltage was your idea.· tongue.gif



    I just want 6v on the dang servo any way I can get it.· And I haven't found a regulator capable of handling the 3A load I need it to.· I have done some looking (granted I'm fishing in the dark given my lack of experience) and can't find too many rated over 1A, and even fewer rated to 2A.· The servo will pull a minimum of 2.3A at full load (which will happen anytime I move the shifter and·the servo·gets hung).

    So even 3A seems a bit marginal.· Combine this with the fact that the only high amperage voltage source I have is the automobile electrical system running between 10 and 14.5 or so volts and 6v regulator options seem to dwindle.

    I'm sitting here trying to lay out the PCB now and not knowing how I'm controlling the servo power is making it a bit hard.

    If a good Reg for this has already been suggested then I'll use it.· I'll look back to see.·



    I wondered once before, and still now, can you simply parallel the regulators for more amperage?· I just don't know how to do what I need here.· I've got the input voltage mentioned, and I need 6v to power the servo and it will draw 2.3A when bound.· Whatever ways exist to meet that need I'm all ears.

    Thanks.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-12-05 01:35
    Yes it was my idea before I got a "smack in the head" NCIS style because of I was thinking of a motor not a servo which has it's own electronics.

    But there is a difference between PWM regulation for a motor and regulation for servos which required a stabilized and smooth DC supply. That is why we have been talking about switch-mode regulators such as the lm2676 that Mike mentioned and the LT1074. There are many many others besides.

    Yes, you can parallel regulators but your biggest single problem with linear regulators is the amount of power that they have to dissipate as they are brute force devices. 14V-6V = 8V times 3A = 24W and that is a lot of heat indeed.

    Most switch-mode regulator datasheets or their appnotes also contain some info on pcb layout.

    *Peter*

    P.S. Your system shouldn't have to cope with overload currents continually if you monitor a fault and continually pulse the servo on briefly to see if the jam is cleared.

    Post Edited (Peter Jakacki) : 12/5/2008 1:40:59 AM GMT
  • CharlieIICharlieII Posts: 70
    edited 2008-12-05 01:56
    So is a "Switching Regulator" very different than a "Linear Regulator" ?

    Can I search Newark, Digikey or the like and expect results·for Switching Regulator?· If you have a part number in mind to do it I will check it out.· I just have no idea what a switching regulator is.· Although it sure sounds like a transistor with a feedback loop to control voltage.

    I'll try and find specs on them right now.

    Thanks.
Sign In or Register to comment.