Port expander with high side switch ground dilemma - Page 1
Forum section: electronics / beginners

author: JAGADISH K
author_rank: Newbie
timestamp: May 31, 2022, 10:26:59 am
content: I have a design wherein the basic idea is to control individual LED strings and dim (analog dimming) them using Pi Pico via an I2C interface.This board is the LED driver which will be connected to the LED array board where the strings of LED are populated.The LED driver is a constant current one, one is Recom and another one is from Diodes Inc.More detailed info can be found in the attached schematic.Parts Datasheet Links -RCD-24-0.35/VREF - Constant Current LED DriverTBD62786AFWG, EL, Application note - High Side Load SwitchAD5142AWBCPZ10-RL7 - Digital potentiometerPCAL6408APWJ - I2C ExpanderRecom's datasheet says "Don't connect the V- output to Gnd"I had assigned a separate net to it (provided jumpers for flexibility of using two different drivers.)I have connected the high side switch according to the datasheet and app note, but to control the load switch the gate or input pin of the load switch is being controlled by the I2C expander.Where should I connect the I2C expander GND: GNDD or GND?If I want to control the load switch I must connect the IO expander's ground to the GNDD net but that would mean for I2C it won't use the GND of Pi Pico.Am I missing something here or is my schematic wrong? Please advise.I found the following post [https://electronics.stackexchange.com/questions/104337/constant-current-led-drivers-shared-ground]useful.If there's any shortcoming in the post understandability please let me know.P.S, I have posted this question on stack exchange but I need more clarity and a solution to this problem. Please consider visiting the link so that you may get better context about the problem and what others think of this problem.Link -https://electronics.stackexchange.com/questions/620703/port-expander-with-high-side-switch-ground-dilemma

author: Ian.M
author_rank: Super Contributor
timestamp: May 31, 2022, 12:22:01 pm
content: I2C needs a common ground (and cant tolerate much noise on it or ground offset) for communication. Due to its bidirectional nature its a PITA to optoisolate.Your high side switch requires control logic signals referenced to its positive supply - pull an input low to turn an output on or pull it high to turn off. Your I2C I/O expander is rated for max 5.5V Vcc or on its outputs, so the two are not compatible for direct connection.You *NEED* a level shifter in-between for each high side switch input. Back before the industry apocalypse, you could buy a suitable level shifter IC easily 'off the shelf'. If you are lucky you may still find one in stock somewhere, but with the current component shortages, the best option may well be eight 'jellybean' NPN BJTs (with an adequate Vceo rating) in common base, bases strapped to your 5V rail, eight resistors between their emitters and the I/O expander outputs to set the level shifter drive current, and eight pullup resistors to the high side switch supply to set the desired voltage swing at the high side inputs.

author: JAGADISH K
author_rank: Newbie
timestamp: May 31, 2022, 01:09:27 pm
content: "Due to its bidirectional nature its a PITA to optoisolate."I'm not following can you elaborate.Also, does the following part makes sensehttps://www.mouser.in/datasheet/2/408/TLP240A_datasheet_en_20200217-1102581.pdf

author: Ian.M
author_rank: Super Contributor
timestamp: May 31, 2022, 01:55:59 pm
content: Both I2C signals are (or can be) bidirectional - SDA is obviously so, but SCL can be held low by slaves that do clock stretching. Optocouplers are unidirectional. To optoisolate I2C, you have to use one optocoupler for each direction of each signal, and keep track of which side is driving the signal low and add logic to break the feedback loop that would otherwise latch both sides low. Its tricky, but can be done if you can sense the bus pullup current on both sides of the isolator. Therefore you could optoisolate the I/O expander so it could directly drive the high side switch. However you'd still have to provide an isolated 5v supply for the I/O expander 'hanging off' the high side supply. I doubt you could do all that as cheaply or in as little board area as 8x simple common base BJT level shifters.

author: Terry Bites
author_rank: Super Contributor
timestamp: May 31, 2022, 02:29:12 pm
content: The driver is meant to drive an isolated string of LEDs so you can't ground the cathodes. A MAX16809 allows addressing of individual LED string outputs and a single resistor to set the current. This may simplify your design and reduce your costs.

author: JAGADISH K
author_rank: Newbie
timestamp: June 01, 2022, 05:08:42 am
content: This Driver isn't my first choice, I like my design very elegant, So I Chose LT3966 which has four channels with analog as well as PWM Dimming, I2C, and other cool features, Designed and manufactured the PCB but the IC went out of stock, not available until next year.Recom driver was a requirement for team a member, I didn't have a choice since most of these appropriate drivers are out of stock.One more thing to consider is these are high-power LEDs that can handle 1W easily So Maxim IC won't cut it.

author: JAGADISH K
author_rank: Newbie
timestamp: June 01, 2022, 05:10:12 am
content: I was thinking of Isolating the Expanders IO and Load switch inputs, Do the I2C buses also require Isolation?

author: SmokedComponent
author_rank: Regular Contributor
timestamp: June 01, 2022, 11:16:36 am
content: If you do choose to isolate I2C, you could use ADuM1250 I2C isolator IC or similar of-the-shelf solutions. Unfortunately, many ADuM isolators are unobtanium right now.

author: Terry Bites
author_rank: Super Contributor
timestamp: June 01, 2022, 01:09:00 pm
content: I imagine there is a current sense resistor in the V- and shorting it to gnd will kill the ccs function. The desire for elegance is forcing you into extra complexity.

author: free_electron
author_rank: Super Contributor
timestamp: June 01, 2022, 01:26:34 pm
content: none of this will work. the reason being that the -LED pin of the recom module is not a power "output". it is a power return. the led current comes from +led , goes through the leds and goes into -LED. there is a current regulating system -LED to -VIN.another note in the datasheet says you cannot leave the output open. so ,if you were to turn "off" all leds' you risk damaging the module. The reason being that this thing has a boost converter on board that can make up to 35 volts. Leave that output open and that booster will keep pumping all the way to 35 volts. if you connect the led's suddenly you have get the full 35 volts while the current regulator is wide open. this can potentially destroy the led's. The system has a soft-start but only if you control it from the power side. if you apply power there the module will start pumping slowly and regulate. if you disconnect the chain of leds while the module is working the soft start does not work.

author: tooki
author_rank: Super Contributor
timestamp: June 01, 2022, 03:14:29 pm
content: That’s exactly what I was thinking when I started reading the original post: a CC driver followed by switching is unlikely to work. (For starters, that the current through a given strand changes asotherstrands are turned on and off.)For what it’s worth, I’m working on two projects right now using the NXP PCA9634 and ’24 I2C LED drivers. (They’re identical except that the PCA9624 has 40V/100mA MOSFETs built in, while the ’34 is only 5V/25mA, but can be configured to drive external switching transistors properly.) They use PWM, but at 97kHz, which is absolutely flicker-free without a slow-motion camera. They’re both in stock at Mouser and Farnell.

author: JAGADISH K
author_rank: Newbie
timestamp: June 02, 2022, 07:13:11 am
content: Quote from: Terry Bites on June 01, 2022, 01:09:00 pmYes there is low side current sense going on with the Recom Driver, which I have also linked and discussed in my stack exchange post(https://electronics.stackexchange.com/questions/104337/constant-current-led-drivers-shared-ground), I had discussed these aspects in the comments too. The elegance I was referring to was the design I created using LT3966(IC is out of the stock, Couldn't populate the PCB) which solves all of the problems, this design is nothing but elegant.

author: JAGADISH K
author_rank: Newbie
timestamp: June 02, 2022, 07:33:17 am
content: Quote from: free_electron on June 01, 2022, 01:26:34 pmYes there is low side current sense going on with the Recom Driver, I have also linked another post that describes it in my stack exchange post(https://electronics.stackexchange.com/questions/104337/constant-current-led-drivers-shared-ground), I had discussed these aspects in the comments too.The connecting or disconnecting of the load while the converter is ON, is not advised, it's clearly mentioned in the datasheet and one Individual also raised a similar concern in the stack exchange post(https://electronics.stackexchange.com/questions/620703/port-expander-with-high-side-switch-ground-dilemma).The datasheet mentions thatAll LED Drivers may not be used without a load. They must be switched on the primary side only.Noncompliance may damage the LED or reduce its lifetime..You either turn off the power supply to the converter and then do your secondary side switching and turn ON the primary side, or the analog dim pin of the Recom module when pulled up to more than 2.5V the LED output current goes to zero which can be seen in one of the graphs in the datasheet. So I am assuming the converter is off( Not 100% sure, mailed Recom but they never replied about it. Discussed these in the stack exchange answer comments too).So to make this work you can use Isolated load switches(Not in stock again), a Load switch and Optocoupler or Digital Isolator combo, or the one I have decided to use, Mosfet Relay(https://electronics.stackexchange.com/questions/621865/mosfet-relay-gate-drive)

author: JAGADISH K
author_rank: Newbie
timestamp: June 02, 2022, 07:41:46 am
content: Quote from: tooki on June 01, 2022, 03:14:29 pmLike I said in my other replies, this design isn't my first choice and the LEDs in use are 1Watt high power LEDs from Luxeon. LT3966(attached Bare PCB) was the first choice that simplifies everything, but the IC went out of stock while PCB was being manufactured.That being said there are ways to make this design work but it ain't simple.Also if you had seen the schematic attached in the stack exchange post (https://electronics.stackexchange.com/questions/620703/port-expander-with-high-side-switch-ground-dilemma) there is one more IC from diodes Inc which is a Linear CC driver.Recom design was like a Design Quest that I took to see what it takes to make this work and I also have them in stock with me now.

author: free_electron
author_rank: Super Contributor
timestamp: June 02, 2022, 01:58:49 pm
content: so i took a look at the datasheet of that high side driver. simply connect the GND pin of that part directly to your normal GND ( disconnect it from GNDD )but .. there is a problem. if you read the datasheet attentively you will see that all the application diagrams use negative voltages.... the driver turns on with an input voltage that is 2.8 volts BELOW VS ( in your case VS is +35 something volts made by the recom module)So to turn the output OFF you must put something between 32 to 35 volts on the input.... your i2c device cannot do that. it clamps to 5 volts. so the drivers will all be on.you will need to put open collector drivers between the i2c expander and the toshiba chip. (uln2803 may do the trick)these drivers are made for split rail applications ( most likely for VFD displays used in whitegoods or browngoods) they connect VS to the cpu main power and then float the "negative" rail below ground.