Good way to power a logic level shifter - Page 1
Forum section: electronics / beginners

author: mys_721tx
author_rank: Contributor
timestamp: July 08, 2021, 04:31:29 am
content: Hello all,Our lab has a LED control box that accepts 5V trigger signal. We also have a high speed camera that generates and accepts 3.3V trigger signal. W The documentation of the camera does not indicate it is 5V tolerant. To make them talk to each other, a logic level shifter is probably needed.I have looked at several logic level shifter on DigiKey. They all require V_CCA and V_CCB voltage inputs. Therefore, I need to supply the shifter with 5V and 3.3V. So far I can think of two ways to do it:The first is to power the shifter with +5V from USB, then have a 3.3V buck regulator. A USB wall plug is easy to come by and it is unlikely that I would need more than 500mA. If I ended up needing 2A then that requires fiddling with the two data pins.The second is to power a 5V and a 3.3V buck regulator with 12V. The upside is that I do not need to negotiate with the charger if I ended up needing more power. The downside is that there are two regulators and they might require considerations regarding heat dissipation.Is either solution better than the other? Are there any other good ways to power the logic level shifter?

author: ledtester
author_rank: Super Contributor
timestamp: July 08, 2021, 05:01:37 am
content: The level translation shouldn't require much power -- just milliwatts -- so if you don't need the 3.3V rail for anything else in your application I would just use a linear regulator to derive the 3.3V rail from your 5V rail -- however you decide to get 5V into your system, whether by down-converting from 12V or by using a USB source.

author: Zero999
author_rank: Super Contributor
timestamp: July 08, 2021, 10:02:24 am
content: Why not power the level shifter from the 5V signal?A simple potential divider will probably do, but for more speed, an emitter follower can be added, to reduce the output impedance.

author: fcb
author_rank: Super Contributor
timestamp: July 08, 2021, 10:15:44 am
content: I'd start by doing some testing and finding out what the minium voltage your lab trigger will accept. Work out if you really have a problem first.Also, the camera trigger will undoubtedly have some sort of ESD protection and probably more besides. So you could just use say a 2K7 resistor in-line with the input ((5-3.3)/2700=0.6mA, which is at least 20x less than the ESD structures on an 3V3 IC are designed to take).

author: Ian.M
author_rank: Super Contributor
timestamp: July 08, 2021, 10:19:27 am
content: @Zero999,Hmm. A BAT54S dual (series) Schottky in place of D1 would significantly improve the logic '0' margin when pulling down against a load with a pullup. The other half of the diode can be used to clamp the output to stop it going significantly negative on falling edges. See sim.However this type of circuit isn't going to help much with the need for upwards translation for 3.3V => 5V logic with CMOS thresholds.

author: Zero999
author_rank: Super Contributor
timestamp: July 08, 2021, 11:24:50 am
content: Quote from: Ian.M on July 08, 2021, 10:19:27 amI agree that the BAT45 is better, but question how much the lower diode does. Adding a 10pF capacitor achieves a similar result, don't forget there's likely to be some parasitic capcitance in the PCB track/cable, in real life, so our simulations are not 100% representative, although the dual diode is cheap, so it makse sense to use it.QuoteI didn't realise there is a need to go from 3.3V to 5V too. The original post is confusing. A block diagam would clarify things.

author: Ian.M
author_rank: Super Contributor
timestamp: July 08, 2021, 11:45:48 am
content: Quote from: Zero999 on July 08, 2021, 11:24:50 am^ s/BAT45/BAT54/ ^BAT45is a wire-ended glass DO-35 diode. Its just a little difficult to get a series pair in that package . . .Yes, and once you upgrade to a Schottky, the second diode in the BAT54S is essentially free, so *IF* the negative overshoot would have been problematic, you save a capacitor.Quote from: Zero999 on July 08, 2021, 11:24:50 amHilights mine:Quote from: mys_721tx on July 08, 2021, 04:31:29 amI read that as: bidirectional comms are required, but I agree its ambiguous and it would be nice to have a block diagram with interconnects fully detailed.

author: Zero999
author_rank: Super Contributor
timestamp: July 08, 2021, 12:53:30 pm
content: The 5V input might work fine, with a 3.3V signal. Failing that, just use the 74HC2G17 and get the 5V from the USB, assuming it's not possible to get it from elsewhere.

author: exe
author_rank: Unknown
timestamp: July 08, 2021, 01:26:09 pm
content: Just in case, there are cheap four-channel bidirectional level shifters from China. They use mosfets and each channel is like this:https://www.hobbytronics.co.uk/mosfet-voltage-level-converter.Here is an example of such board:https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/all.However, if there is a possibility to just use one 3.3V rail for both sides, then it's also a good option because on level shifters required.In general, I'd just do whatever requires less wiring/soldering.

author: mys_721tx
author_rank: Contributor
timestamp: July 08, 2021, 06:20:30 pm
content: Thanks every for the suggestions. Sorry about the confusion, the block diagram of the system is as follows. Bi-directional translation is a must.

author: Ian.M
author_rank: Super Contributor
timestamp: July 08, 2021, 06:51:31 pm
content: Well that makes it easy. The Arduino Uno has enough 5V and 3.3V power available to power proper level translating buffers. I suggest any brand of74LVC1T45for single signals, and74LVC2T45where you've got two going in the same direction. For either chip, tie DIR to GND to make it unidirectional (B in => A out). Don't forget decoupling capacitors on both VCCA and VCCB - min. 10nF ceramic on each shared by two ICs, with both as close as possible to the capacitor, but one capacitor for each supply on each individual IC is usually preferable, and its common to use 100nF rather than 10nF.If you don't want to make a PCB you could make a nice neat job of it using the 'dead-bug' method of construction, or you could use breakout boards. In either case you'd be well advised to build it up on an Arduino Prototype Shield, just to get reliable connections to the Arduino, and to let you use robust latching connectors for the camera and LED board connections.

author: mys_721tx
author_rank: Contributor
timestamp: July 09, 2021, 12:33:24 am
content: Based on my experience with Arduino shields, the real estate is somewhat limited. I can manage a maximum of six BNC connectors on a Uno size shield and little spaces for anything else. I hesitate to use right angle BNC/SMA connectors on a shield owning to the clearance issue with Arduino's pin headers.A standalone board might be better. I would not need to worry a heavy board hanging off an Arduino or whacky board to board connection cables. It seems that all our 5V devices use BNC and all 3.3V devices uses SMA. This is advantageous since different logic levels are physically incompatible with either other.I would base a PCB with the design ofthis SparkFun breakout board, with a bucking converter instead of a boosting converter.

author: Miti
author_rank: Super Contributor
timestamp: July 09, 2021, 01:03:18 am
content: I found this to be a very good bidirectional level shifter:https://www.nxp.com/docs/en/application-note/AN10441.pdf

author: Ian.M
author_rank: Super Contributor
timestamp: July 09, 2021, 02:11:41 am
content: TXB0104 '4-bit bi-directional voltage-level translator with automatic direction sensing' is a snare and a delusion. It works reasonably well if everything is on one PCB and you can carefully control the loading either side of it but if you attempt to drive long(ish) cables with it, the capacitive loading and reflections will cause it to go ape-sh!t!If you really don't think you can fit the necessary chips + latching 0.1" pitch pin header connectors*on a proto shield, then you'll need to make a PCB. You could use an Arduino Nano which software wise is indistinguishable from a Uno, mounted on soldered in headers direct to the PCB.* Transition to/from SMA or BNC using chassis mount connectors as the signals leave/enter the case.

author: Zero999
author_rank: Super Contributor
timestamp: July 09, 2021, 08:40:10 am
content: How many channels do you need?For just low to high translation, any 74HCT device, run off 5V will do, such as the 74HCT32 will do. If you don't mind it inverting, there's the 74HCT14, which has Schmitt trigger inputs.https://www.diodes.com/assets/Datasheets/74HCT32.pdfhttps://www.diodes.com/assets/Datasheets/74HCT14.pdfFor high to low translation, there are specific ICs with high voltage tolerant inputs, such as thr 74HC4050.https://www.nxp.com/docs/en/data-sheet/74HC4050.pdfIf the inputs don't need much current, a buffer with open drain outputs can be used. The 74LV07 has 6 channels and its inputs and outputs can take 5V, even when powered from 3V, so a single IC can be used to both level shift up and down.https://www.mouser.co.uk/datasheet/2/115/74LV07A-271638.pdf

author: Peabody
author_rank: Super Contributor
timestamp: July 09, 2021, 02:25:18 pm
content: From the diagram it's still not clear to me what's needed. What shifting is required between the computer and the camera? If the only 3.3V-to-5V shift that's needed is from the camera to the Arduino, then you should see if the Arduino will simply accept 3.3V from your camera as High. The MISO line coming in from a 3.3V SD card module works fine in my experience with no shifting.

author: mys_721tx
author_rank: Contributor
timestamp: July 11, 2021, 05:10:19 am
content: Based on our current equipments, at least one 3.3V to 5V channels (three outputs from the camera) and one 5V to 3.3V channel (one input to the camera) are needed.The cable won't be longer than 1m. The capacitance of a typical RG-58 is 82pf/m. I can see the problem with a long cable.My thinking for the number of channels is that since I need to make a PCB anyway, I might as well to make some extra channels just in case.Since I need to work within the constraint of MicroMananger's Arduino firmware, which requires TX/RX needed for serial communication with the computer, I won't be able to use the ethernet shield.For ATmega328P, the VIH is about 2.7V when VCC is 5V. In this case I would not need to 5V to 3.3V conversion.