2 DACS / One Arduino Nano / Two Independent voltages - Page 1
Forum section: electronics / beginners

author: robert_south1978
author_rank: Newbie
timestamp: July 16, 2018, 06:16:03 am
content: Hi All,I want to build a voltage referance test stand. I want to generate 20 diffeferant voltages (0.0 to 3.3 vdc). I have had success with 2 MCP4725 DACs on one Arduino Nano.( I want to try 4 DACS on one NANO. ) I want to be able to connect the DAC Outputs plus to minus as if they are independent supplies ( or batteries shall we say.) As they have common ground,connecting plus to minus will cause a short. Do I Need something like a virtual ground for each DAC Output ? Using Op amps?Thanks for your help !Robert

author: Ian.M
author_rank: Super Contributor
timestamp: July 16, 2018, 07:47:19 am
content: You'd need an isolated reference supply for each DAC and you'd need to isolate their I2C interfaces, so their Vout and Vss terminals are fully floating. The alternative idea of summing the voltages using OPAMPs would degrade accuracy even if you use 0.01% precision resistors.However, as the MCP4725 only has a single address pin and you have to order different part numbers to get different high bits for the address, (MCP4725A0for 00x through to MCP4725A3for 11x), and its still somewhat more difficult to isolate an I2C bus cheaply compared to a SPI bus, it may well be preferable to switch to a SPI interface DAC, possibly with an internal reference, as a SPI bus can be cheaply optoisolated and can support large numbers of identical chips as long as you provide individual slave select signals and their SS (/CS) pin tristates their MISO pin when not asserted.

author: robert_south1978
author_rank: Newbie
timestamp: July 16, 2018, 08:04:25 am
content: a: You'd need an isolated reference supply for each DAC / I suppose I could use a cheap buck Booster Power supply for each DAC ?b: you'd need to isolate their I2C Interfaces / Again another Buck Booster PS for the NANO ( or other uP ) ?c: As far as I2C addressing, I have found differant mfg of the MCP4725 use differant adresses. So I could use two from AdaFruit, two from other mfg ( thats four* )What do you think ?Thanks for your response !!* Only Limit here is NANO Memory space

author: Ian.M
author_rank: Super Contributor
timestamp: July 16, 2018, 08:40:24 am
content: No.A: Cheap buck-boosts typically aren't isolated. You'd need regulated output isolated DC-DC converters, one per DAC, extra filtering on the output of each DC-DC converter to reduce ripple at their switching frequency, and a calibrated precision reference for each DAC.B: You'd need an individual I2C isolator chip (not a simple bus switch) for each DAC. You don't need to isolate the Nano - it doesn't even matter if it shares a ground with your PC via a USB cable as long as the DACs (and any other 'front panel' inputs and outputs on the device) are fully isolated.C: The high bits of the I2C address are encoded in the part number. It doesn't matter who you order them from: If you order a MCP4725A0it will have the same two possible addresses. Of course some suppliers may have ....A1 ....A2 or ....A3 parts in stock which use different addresses. Some suppliers may be too dumb to care and which ....Anvariant you get will be a lottery. Such dumb suppliers are best avoided.

author: robert_south1978
author_rank: Newbie
timestamp: July 16, 2018, 12:04:23 pm
content: Hello Mr. Ian M.A: Of course you are right.I have decided to use 20 NANOs each with one DAC . Each NANO/DAC powered by 12v/5v 200ma isolated DC/DC converters.( TracoPower TME 1205S DC/DC-Wandler, Print 12 V/DC 5 V/DC 200 mA 1 W Anzahl )This way I can power all 20 by one 12v DIN Rail Supply.Plus I will have no worries about I2C Signals.You are right about no Name suppliers, I have have many Problems with no Name. Never a Problem with Adafruit !P.S. we are testing fuel cells hence the 20 voltages, to be used during dummy tests.I keep you up to date if you want.Thanks for your help!!Robert

author: Ian.M
author_rank: Super Contributor
timestamp: July 16, 2018, 12:44:37 pm
content: How are you planning to control the 20 Nanos?If you just plug them in to USB they'll all share the same ground and USB is *MANY* times harder to isolate than I2C.20 Arduino Pro Mini boards with galvanically isolated RS485 transceivers on the RX and TX pins of their UART interface could work, with either a master one running a keypad and LCD or OLED to control them, or a PC with a USB RS485 interface controlling them.

author: robert_south1978
author_rank: Newbie
timestamp: July 17, 2018, 05:45:03 am
content: Since this is a test stand, it will be operated without a PC or USB connections to any NANO.Each NANO will contain the same program, once programmed, NANO will receive isolated 5vdc on the VIN pin.Each NANO/DAC will output a variable voltage with simple up / down buttons that an operator will control.I plan on putting 4 NANOs/DAC on one PCB board, wire wrap the connections, and stack 5 boards, each identical.( note in fuel cell stack all 'CELLS' are connected in series, so Cell 1(-) to Cell 2(+), Cell 2(-) to Cell 3(+), ect ... )We will verify each Voltage Channel of our fuel cell is recording the correct DAC/Voltage and we can use the DAC/Voltage to testour control software to trigger errors / shutdowns when voltage levels are out of range. ( again, during dummy testing, no real fuel cell installed )Thanks again for your comments!P.S´. Once this test stand has completed it's mission, I can disassemble it and reuse all the components.

author: HB9EVI
author_rank: Frequent Contributor
timestamp: July 17, 2018, 03:17:23 pm
content: some thoughts about that project:- there's always an issue about i2c vs spi - if we are talking about galvanic isolation, spi clearly wins; it's easy to achieve with e.g. 6N137 couplers - as DACs I'd go with the MCP4921, the dual DAC MCP4922 I used for a dual channel PSU, each channel isolated. Well, the only limit with spi of course is the chip select. I don't have in mind with AVR the Nano uses, for 4 CS it should last.- maybe no need, but as caveat: even though these DACs are r2r, they are never accurate enough to serve as, what somebody would call a 'voltage reference', they neither reach VSS down to the bottom nor VDD. of course you can calibrate it out to a certain point, but it's not comparable to a real voltage reference.

author: robert_south1978
author_rank: Newbie
timestamp: July 18, 2018, 07:08:19 am
content: Dear HB9EVIThanks for your comments.I have never tried SPI, I will play with it one of these weekends.You are correct about the percision of the DACS. But the goal of this project is to simulate 20 cell voltages of a fuel cell. To test the wiring of our FuelCell dev. system.So that voltage on DAC 1 causes voltage increase on our system channel 1, and so on.We are developing fuel cell technology and I am writing the control software for the fuel cell system. Also, by adjusting the DAC voltage over/under a control threshold for each channelwill allow me to test my control software reactions. So percision is not too much in focus.Kind Regards, Robert

author: Ian.M
author_rank: Super Contributor
timestamp: July 18, 2018, 08:56:32 am
content: 20 separate Nanos with manual controls is going to be a real PITA to use. Seriously look at including isolated comms to a PC so you can run a script on the PC to set up all the simulated cell voltages before a test run and sequence changes to cell voltages during a run repeatably.Personally, I'm with HB9EVI on this - its easiest to do the isolation between the Arduino and SPI DACs, as then the Arduino can use its standard USB UART interface for PC comms. The 20 SS (/CS) outputs is easy - simply use three 74HC138 3 to 8 line demultiplexors (+ a few inverters for some of the EN inputs) to implement a 5 to 24 line demultiplexor, with SS from the Arduino connected to /EN, then select which DAC you wish to address by outputting a binary number on five I/O pins. The 74HC138 chips could be distributed over your DAC boards - put one on each (five in total), with a 74HC86 quad XOR on each so you could set the board address with a DIP switch.