Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

mosfet

Status
Not open for further replies.

LERMACHINE

New Member
can I use a mosfet along with a zener diode to convert a +12v signal to a +5v signal? I'm basically trying to interface the output signal from a gm ecu to an aftermarket gauge cluster.
 
No. The reason a voltage regulator can be made using a bipolar transistor, is that there is a .7V drop across Vbe (Voltage from base to emitter). Mosfets do not work the same as a bipolar transistor. When the gate voltage is sufficiently above the source (n channel, below on p channel), then the device turns full on. There is a rating called Ron, or the resistance from source to drain when the device is on. This is the same no matter what the gate voltage, as long as the gate voltage is above a minimum, so the device cannot be made to regulate like the bipolar device. They are used in switching regulators, where they are full on or full off. This is why there are no "CMOS" versions of the 7805 series. You are better off using these, as they are cheap and very effective. If you need more current than they supply, you can pick a different regulator series, or use a heavier "pass" element. Remember, the heat on the pass element will be (Vin - Vout (5V)) times the current. This is why you need to heatsink regulators under heavier loads.

View attachment REG.PDF

What is the current of your ecu out to guage input? Can't you just use a resistor divider?
 
Please clarify whether you want a voltage regulator for something like a supply voltage or a level shifter for a signal.

I interpreted your post to mean the latter. That is, you just need to change the signal level. IC's are available for that, and mosfets can be used for it too. In some instances, a simple resistor divider can work. There is a wealth of information on level shifting, but before going too far in what may be the wrong direction, please clarify what you need to do.

John
 
Last edited:
Halt, I want a level shifter to convert a twelve volt pulse from an engine computer to a 5v pulse to work with an aftermarket digital dash. So yes I do not need a constant supply regulator. I saw a simple circuit on. Motorcycle forum that utilized two resistors, a small cap, a Zener diode, and a MOSFET. And from the looks of it, it had a twelve volt signal and ground and then a single output, which is what I need. But I wasn't certain it would work the way I wanted it to because they used a 12v Zener and they were using ignition cool pulse for a tach. My application is needed for the speedometer which I know work very similar but my input is different. Thank you for your help! Let me know if you need any more info.
 
they probably had the zener on the input to the circuit to keep voltage spikes out of the circuit.

why would an aftermarket speedometer only be 5V?
 
The term you want to look for is "level shifter."

Since the new cluster is 5V, you will have a 5-V source available. I don't see the need for a zener, unless you also need to power the new cluster. You also need to know the current draw for the new cluster's signal. Presumably, it is very small. If that is the case, a simple resistor voltage divider can be used to drop the 12V to 5V.

If you don't want to use the divider you could use a mosfet. A simple approach may be to use a N-channel version with its gate connected to the incoming signal (0 to +12V). Connect its drain to +5V and its source to a resistor, such as 1K to 10K, and to the input to your new cluster. The other end of the resistor goes to ground. Since Vs cannot exceed 5 V; whereas, the gate will reach 12V, many mosfets will turn on sufficiently to give you a 5-V low current signal when the input signal goes high.

Can you post the original circuit you mention in your first post?

John
 
Last edited:
In that case IMO a simple voltage-divider (as mentioned above) should suffice. It's extremely cheap :D. Try it and see. If that doesn't work then something more elaborate could be considered.
 
image.jpg
This is the circuit I found on the other website. The gauge cluster has a 5v supply for the Hall effect sensor a ground and then the signal wire. The ecu only has a single 12v output. The rep from the digidash manufacturer told me the signal reads a 5v to 0v pulse. Hope this helps.
 
There is something funny with that circuit. Some connections are apparently not shown. The zener is there to suppress spikes, as noted earlier.

1) Both devices must have a common ground. Thus, the circle above the input needs to be ground too.
2) There is no supply to the output. That is, where does the 5V come from? A pull-up resistor will do that, which isn't shown, but may be part of the new cluster. The output will be inverted compared to the input, but that may not make a difference, particularly if it is reading frequency rather than pulse width, which I assume.
3) That is a large capacitor (relatively speaking) from gate to source. The on/off transitions of the mosfet will be quite slow. That also may not make a difference, depending on how the new cluster works and the frequency of the signal. In other words, the RC time constant is roughly 1 mS, which may be insignificant if the max signal frequency is 100 Hz, but if it is >1 KHz, then it will make a difference. It probably needs a turn-off resistor, unless the signal source is low resistance. If it is very high resistance (probably unlikely), the gate could stay turned on a long time.

In other words, given the noisy automotive electrical environment, that design might well work, with the caveats mentioned.
John
 
Last edited:
so i drew this out on a piece of paper... the drain is open circuit, and this is not a buffer, but an inverter (or it would be if the drain of the transistor actually had a load and power source)...
 
image.jpg

As you suggested, I looked into level shifting circuits and found this. What do you guys think? You all have no idea how much I appreciate all of your help!
 
That will do it too; although, you may want to put a small resistor just before the gate to reduce "ringing" if that is a problem. It is basically what I suggested in post #6.

You have a circuit that apparently works well with your new cluster. I and others have mentioned a few concerns, such as the "open drain," but I suspect those issues are taken care of in the source and new cluster. The solutions are simply not shown in the design you presented. The advantage of that design is that it includes considerable filtering and apparently has been tested. So, why not use it? This new design may be more susceptible to noise in the electrical system.

John
 
What do you mean by open drain? I plan on testing this on a breadboard so I can see what amperage and what not are generated. I wish I had an o-scope so I could really tell what's going on. :/
 
"open drain" and "open collector" are ways to describe the condition I mentioned above when the mosfet drain (or bjt collector) is not connected to any obvious power. Your device, in this case the new cluster, provides the power. It is a configuration that is often used for sensors. I described that above, but didn't actually use the term. Unclejed (post #11) sort of used it.

Without an o'scope, I think going with the known circuit would be the best and quickest option. Simply eliminating the zener may be something to consider. However, if you want to experiment and no harm done, then consider these changes to the circuit you show:

untitled.JPG

The resistor you have added to turn off the gate might work, but you could also reduce its value. Based on values used in the original circuit, I think 10K would work and give a faster turn-off.* I also added the gate resistor that I mentioned above. Its minimal value to stop gate ringing is hard to predict, but since this is not a fast circuit, I would try 1K.

Let me emphasize that this circuit may be susceptible to electrical noise. However, the new cluster may have adequate filtering built in, so that may not matter.

John

*You may not even need the gate turn-off resistor.
 
Awesome. Ill try out the circuit this weekend and let you know how it works out. Thank you everyone and John especially for all of your help and expertise! I hope you all have a safe and happy new year!
 
So I have everything connected and I'm using an analog voltmeter to check for pulses. I have a wheel on a drill to excited the induction sensor from the transmission. I also have a obd2 scanner to show me what the ecu is doing. With the drill I can get the ecu to read 10mph. So it is working and also the speed output is a twelve volt pulse which is what I'm using for my input signal. I also checked and the circuit output is also pulsing. Problem is now the digidash is not reading any input. I know it's supposed to read a square wave. Is my circuit generating a square wave?
 
Given that the frequency is relatively low (for example, 3500 rpm = 58 Hz), the output should be a square wave, if the input is a square wave.

I am a little surprised that you are reading only 10 mph with an electric drill driving the sensor. Approximately how fast is your drill turning.

John
 
The drill turns roughly 1700rpm and I have four holes spaced about one inch from the center of the wheel. So 6800 pulses per minute? And now that is just the triggering for the sensor, I'm not sure yet how the ecu translates that. Is it possible the resistor between ground and the signal wire is too large? I also used the circuit you posted except I used a 1.5k for the gate. I also used 10k for the turn off resistor like ou suggested.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top