DAC is being self powered by input pins - Page 1
Forum section: electronics / projects

author: leonhart88
author_rank: Regular Contributor
timestamp: March 23, 2015, 05:45:53 pm
content: Hey All,I'm working on a custom shield for an Arduino and was running into some strange issues that I was hoping someone here could help explain. I've attached a hand drawing of part of the circuit.Basically, I have a 24VDC power supply going into a 9V DC DC converter. The 9V then goes into the Arduino through the "Vin" pin (with a reverse bias protection diode) and also to a 5V voltage reference which then powers an ADC and a DAC.What I've noticed is that when I plug the Arduino into a USB port without the 24V supply on, the DAC is actually generating a voltage onto the 5V reference rails due to the SPI data pins from the Arduino, which is now powered by USB. I noticed this because the input LED was dimly lit, which indicates the voltage generated on the 5V rail is making its way back through the voltage reference and the DC DC converter. I thought this was strange behaviour. I managed to isolate it down to the DAC which was generating ~3V on the 5V reference rails. Apparently this is caused by internal clamp diodes in the chip (http://electronics.stackexchange.com/questions/91716/why-my-dac-works-without-gnd-and-vcc).It's interesting that my ADC did not have this problem but only the DAC does. Does anyone have any further experience with this situation? There can be situations where the Arduino is plugged into USB first and then the 24V supply turned on. My circuit works as expected when the 24VDC supply is on, but I want to make sure the circuit is safe even when only USB power is applied. I'm not sure if I should worry about the 3V being applied to the rail due to the SPI data pins.Any advice would be greatly appreciated! Thanks!

author: leonhart88
author_rank: Regular Contributor
timestamp: March 23, 2015, 05:49:48 pm
content: Specifically, I guess I'm concerned about the following:Is it OK to have voltage at the SPI pins without the DAC actually being powered by the 5V reference?Do I need reverse bias protection before/after the 5V reference due to the voltage generated by the DAC when only USB power is plugged in?I had to add D1 because when the Arduino is USB powered, Vin has 5V across it. This was reverse biasing the DC DC converter and causing issues (it wouldn't output 9V if USB was plugged in and then 24V turned on, but it would work if I turned 24V on first and then plugged in the USB). I am using an Arduino Uno.

author: ajb
author_rank: Super Contributor
timestamp: March 23, 2015, 06:09:45 pm
content: Is your DACpoweredby the ADR02?The rail clamp diodes are really there for ESD/transient clamping, not for continuous operation. Whether this will actually cause any problems is harder to say. The datasheet may or may not specify. A reasonable solution would be to have the arduino detect the 24V supply and tristate the SPI pins when it's not present. And/or you could add some series resistors to the SPI lines to limit the amount of current that can be driven through the rail clamps. Alternatively, there are buffers with inputs specifically designed to tolerate >Vcc inputs for just this sort of situation (also makes them handy as 5V->3V3 level translators)--many 74LVC series parts, for example--that could go between the Arduino and the DAC inputs. But I would probably stick tristating the SPI.

author: leonhart88
author_rank: Regular Contributor
timestamp: March 23, 2015, 06:24:33 pm
content: Hey ajb,Yes, both the DAC and ADC are meant to be powered by the ADR02 which can supply 10mA current output. This is plenty for the ADC/DAC, which are the only things connected to the reference output.I had no intention of continuously operating the chips from the clamp diodes, I was actually very surprised (and stumped for a good amount of time) at this observation.Detecting the 24V supply and tristating the SPI pins seems like a reasonable solution that won't require adding several series resistors to the board. I suppose I could also just move the supply for the ADC/DAC to the 5V output from the Arduino, but I'm sure the output from that 5V regulator is not as accurate as a dedicated voltage reference.

author: dom0
author_rank: Super Contributor
timestamp: March 23, 2015, 07:33:55 pm
content: Quote from: leonhart88 on March 23, 2015, 05:49:48 pmThis is specified in the data sheet, in the "absolute maximum ratings" section. There itprobablysays something like "Voltage on any pin: min -0.6 V max Vcc + 0.6 V". Now, if it is powered down, Vcc is 0 V. What voltage is allowed on any pin then?

author: dom0
author_rank: Super Contributor
timestamp: March 23, 2015, 07:35:09 pm
content: Quote from: ajb on March 23, 2015, 06:09:45 pmThat's often just fine. The reference makes for a good low noise supply for most DACs.

author: leonhart88
author_rank: Regular Contributor
timestamp: March 23, 2015, 07:48:53 pm
content: Hey dom0,Ah yes, my bad, I forgot to check that. The ADC says -0.3 to 6.5V for any digital pin, so I'm OK there. However, the DAC says -0.3 to (Vdd + 0.3), so that's a problem. Vcc is actually not 0V, as I was measuring ~3V since the rails were being powered by the internal clamping diodes. However, the digital I/O is at 5V, so that still exceeds the maximum ratings.I think my best bet is to put a simple voltage divider on the DC DC converter output and connect that up to a digital I/O pin on the Arduino to sense if 24VDC is on. I'll set the SPI pins to tri-state until 24V is detected.This has been an extremely (although time consuming) educational lesson for me. Typically, I've dealt with circuits that only have one supply and I haven't had to worry about issues like this before. But in this case, because things can be powered by USB before the 24V supply is on, there's clearly other things I need to think about.Thanks for everyone's help. I will try to tackle this tonight.

author: leonhart88
author_rank: Regular Contributor
timestamp: March 23, 2015, 07:53:07 pm
content: As an aside, it's interesting that even with what I'm seeing the circuit seems to work fine once I turn the 24V supply on. However, it may just be working for now and I suppose the chips could eventually be damaged in the long run.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: March 23, 2015, 08:04:58 pm
content: Quote from: leonhart88 on March 23, 2015, 07:48:53 pmI bet if you measured those digital I/O pins, they wouldn't be at 5v, they'd be one diode drop above 3v.Regardless, as mentioned you shouldn't use the clamping diodes on purpose, tri-stating the SPI lines until the 24v supply is detected is a good idea.

author: dom0
author_rank: Super Contributor
timestamp: March 23, 2015, 08:07:40 pm
content: You could also keep the Arduino in reset while the 24 V supply isn't there, or power it from the 24 V, too.

author: ajb
author_rank: Super Contributor
timestamp: March 23, 2015, 08:29:17 pm
content: Quote from: leonhart88 on March 23, 2015, 07:48:53 pmThe thing to watch out for is the current through the diodes. The specified voltages just tell you at what point the diodes start to conduct, you won't damage the diodes until the current gets to an appreciable level. In your case, the current through the diodes will be determined by the load on the rails they're supplying and the current source capabilities of the Arduino's SPI drivers. On a related note, I just ran across an Atmel app note that uses a 1M series resistor into a GPIO to detect mains zero crossing, relying on the clamping diodes to limit the voltage at the IO pin. It's all about limiting the current. Not many datasheets specify a maximum forward current for the diodes, though (IIRC, Atmel's datasheets usually do), so best to not push your luck.Aside from damaging the diodes, some devices may experience latchup or other problems when the inputs approach or exceed the supply rails, but that's more common in analog parts than digital. I'd be a bit more concerned about the ADR02 in this respect, since you're using it to power the DAC you're driving it's output when the 24V supply is disconnect. The Arduino probably can't source enough current to cause a problem there (or the ADR02 might not have any problem being driven that way, I haven;t looked at the datasheet), but best to avoid it if you can.Any time you have multiple sources and/or multiple rails it's worth taking a look at what happens if the supplies come up in the wrong order, or one rail fails to start entirely, etc. Usually in such cases the system will just fail to work, but in some cases you can wind up with very different voltages than you intended appearing at different parts of the circuit, potentially causing sudden magic smoke release.

author: dom0
author_rank: Super Contributor
timestamp: March 23, 2015, 08:42:43 pm
content: While Analog doesn't supply an equivalent schematic for the ADRxx it's probably the usual thing of bandgap reference + trimmed divider + error amplifier + series pass element. Assuming a bipolar process, so reverse voltage there isn't an issue if smaller than about 6 V.Atmel doesn't specify permissible current through the ESD diodes, but in the app note you brought up I think they say something like "well, uh, we don't specify this, but if you limit the current to less than a milli-amp it's okay to use them for clamping".But of course: none of this is specified. In fact, Analog doesn't say a single word about external voltages applied to Vout while Vin is down. So it's hopefully clear that one should not rely on any of this :-)

author: Richard Crowley
author_rank: Super Contributor
timestamp: March 23, 2015, 08:46:30 pm
content: ADR02 is a REFERENCE supply, not a voltage regulator to power downstream circuits.POWERING ADC and DAC circuits from the ADR02 just seems bizzare.Google never heard of: "ADC1215021"

author: leonhart88
author_rank: Regular Contributor
timestamp: March 23, 2015, 09:05:41 pm
content: Quote from: suicidaleggroll on March 23, 2015, 08:04:58 pmI recall measuring these pins last night and they were 5V. I'll check again tonight.Quote from: dom0 on March 23, 2015, 08:07:40 pmI will also consider the reset, that way I won't have to add more firmware scenarios. Also, I need to have the USB plugged in for serial communication, so regardless of how I look at it, there will always be a scenario where the user can plug the USB in first before turning on the 24V supply, thus powering up the Arduino via the USB.Quote from: ajb on March 23, 2015, 08:29:17 pmThanks for the in depth explanation, makes sense. I also worried about driving the output of the ADR02, although I couldn't find any information in the datasheet that specified whether this was OK or not (if someone finds something in there, please let me know, I may have missed it).Yes, having to consider the order of the supplies is something I totally overlooked when initially designing this. I'll know better next time!Quote from: dom0 on March 23, 2015, 08:42:43 pmYes, I'll just stay on the safe side =)Quote from: Richard Crowley on March 23, 2015, 08:46:30 pmSorry if my writing wasn't clear enough, the part # is "ADC121S021"If you look at the datasheet for the DAC I chose, it actually suggests using the voltage reference I've picked as a supply:http://www.farnell.com/datasheets/1780742.pdf. I also made sure that the current output of the reference was able to supply current to both the ADC/DAC based on their consumption.

author: leonhart88
author_rank: Regular Contributor
timestamp: March 23, 2015, 09:20:58 pm
content: Thanks again for everyone's contributions to this topic, it's been a real help to get some feedback on this from people with more experience than me.

author: dom0
author_rank: Super Contributor
timestamp: March 23, 2015, 09:27:00 pm
content: Quote from: Richard Crowley on March 23, 2015, 08:46:30 pmIt's not bizzare. Not at all.

author: leonhart88
author_rank: Regular Contributor
timestamp: March 23, 2015, 11:12:56 pm
content: So I managed to scrounge up some LM311 comparators in my electronics box. I'll throw this together with the DC DC converter output and the 5V from the Arduino and tie the output to the reset pin.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: March 24, 2015, 03:18:32 am
content: Quote from: Richard Crowley on March 23, 2015, 08:46:30 pmIt's quite common. Many references and ADC/DACs suggest doing it as long as you don't exceed the current limit.

author: leonhart88
author_rank: Regular Contributor
timestamp: March 24, 2015, 05:11:53 pm
content: Just to update this thread, I threw on a LM311 comparator and tied the output to the Arduino reset pin and it's working perfectly! When the DC DC converter output is not on, the mcu is held in a reset state. When the DC DC converter output is on, the mcu operates.This is perfect, as it avoids applying voltages to my ADC/DAC before they are being powered and it also means the microcontroller doesn't run at all unless the 24V power is on.Thanks again for the help everyone! Cheers.