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.

Serial Data Voltage Clamping

Status
Not open for further replies.

microkid

New Member
I need to interface to two different devices using a single wire bi directional serial interface.

As far as the communication goes both of these devices utilise the same protocol so they respond to the same commands in the same way - obviously when addressed!

However one device signals at 0 and 5V whilst the other signals at 0 and 12V. Whilst in practice this does work it only does so intermittently.

I should point out that both these devices are designed to work on a bus with up to 128 similar devices, and that the 12V device will see anything over about 2V as a mark so it does not need a 12V input signal!

When no communications are in place these devices pull the serial line up so one device will pull it up to 12V and the other to 5V. The 12V device is able to pull the line low when required however the 5V device struggle to pull the line low as it is being held up at 12V.

So what I need to do is somehow clamp the serial line to the 12V device so it only pulls the bus up to 5volts but whilst still allowing the other devices to pull it down and also allowing the signal the other side of the clamp to be pulled down by the host controller.

Any ideas muchly appreciated.
 
hi,
From your description I would suggest you look at using a 5V1 zener diode, fed by suitable resistor to clamp the 12Vout to 5Vout. It would still allow the 5V sender to pull it down to <2V.

OK.?:)
 
Use an N channel MOSFET to separate the 5v devices from the 12v devices. Tie the gate and source to the 5v bus, and the drain to the 12v bus. Then a pullup resistor on both sides.

When a 5v device drives high, Vgs = 0, and the pullup pulls the 12v device all the way to 12v. When a 5v device drives low, the MOSFET turns on, and pulls the 12v bus to ground.

When a 12v device drives high, nothing happens. The MOSFET is off, and the 5v pullup keeps the 5v side high. When a 12v device drives to ground, the internal source,drain diode of the MOSFET becomes forward biased, and the 5v side gets pulled down to ground.

This is a simple bidirectional bus translator you'll find in all the literature. Just do a google search on MOSFET bidirectional level shifter. It's an easy solution for just a few cents.
 
Unless you are planning on running your serial bus at 100 MHz pretty much anything you have sitting around will work at the voltages you are talking about. 2N7000's are really cheap. Lots of people use a BSS138 and are happy with the result.

Unless you have a special requirement you haven't mentioned, it's hard to imagine anything you use won't do the job. Good luck.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top