I am starting a project that involves applying a voltage from 0V to -13V to a device. Applying this voltage to a single 'part' alone is easy and we have a function generator that can do that, but now I would like to apply this voltage to 32 different parts (on a single device), it doesn't make sense to have 32 function generators. I figured using a microcontroller would make the most sense, but I am unsure how to proceed.
Will Arduino be the solution that I am looking for? I'd like to interface with LabView, and develop a UI to control the voltage that each part recieves. From my fairly high level investigation, I figure I may need to have an additional transistor / op-amp for each part in addition to the arduino. (Or I could use 2 Arduinos).
Yes, this can be done, but it's quite a complex setup.
The arduino alone cannot generate the kind of voltages you are after. It can generate analogue voltages 0-5V in the form of PWM which you can low-pass filter, but it can only generate a few of them at once.
My suggestion would be to use external SPI DAC chips, like the MCP4822 - each one can generate 2 stable precision voltages at 12-bit resolution between 0V and 4.095V. Those you could then feed into inverting op-amps with a fully split-rail supply (+/-15V) and use the gain of those to increase the voltage to the right levels for you.
You would need to use a Mega rather than an UNO, because the UNO doesn't have enough IO lines to select 16 chips as well as do the rest of the things you need (well, it could use a multiplexer, but that adds extra complexity). Also the Mega has multiple SPI channels, so you can spread the load on the SPI busses around a bit and not have 16 chips all hanging off (and applying load to) one bus.
Thanks for the response it helped a lot. I'll detail my plan.
I'll get an Arduino Mega 2560. It has the SPI that I need, and the Digital I/O that I need as well.
I'll get 16x MCP4822's DAC's, which are powered by 5V and output 2 voltages from 0V to ~4.1V. These connect to the SCK (via SCK pin) and MOSI (via SDI pin) pins on the Arduino, and each individually connects to a Digital I/O pin (via CS pin). the LDAC pin on these I will hold low (how?). The two outputs will each connect to an OP-AMP.
I'll get 16x OPA2277 OpAmps, which will be powered with +/- 15V. These will connect to the DAC's output, each will amplify with a gain of 3.3 (3.3k and 1k in inverting configuration), leading to total voltage control of 0V to -13.5. These have 2 op-amps in them, so each DAC DIP will have an OPAMP DIP, with the two DAC outputs connecting to the two OpAmp inputs. The OpAmp outputs will be able to connect right to my device.
Then I just need to figure the coding out. That part shouldn't be too hard right?
Also I wonder if it would be prudent to add some protection, my device breaks if a positive voltage is applied to it, so maybe I should put a diode in there...
Abyss:
the LDAC pin on these I will hold low (how?).
Connect it to GND.
Then I just need to figure the coding out. That part shouldn't be too hard right?
Most of what you want is available as a library. I know I wrote one a bit back to handle those chips, but it's pretty darn simple to do it manually anyway.
Also I wonder if it would be prudent to add some protection, my device breaks if a positive voltage is applied to it, so maybe I should put a diode in there...
You could do the opposite of the normal clamping diode arrangements that you see all over the place. Normally it's 2 diodes, one connected between signal (A) and Vcc (K) - reverse biased under normal operation, and one between signal (K) and GND (A) - reverse biased under normal operation. Of course, you'd have to reverse them and connect to V- instead of Vcc...
Use the microchip DAC and a 1 of 16 demux as the chip select interface http://www.digikey.com/product-detail/en/CD74HC154E/296-9180-5-ND/376804
Set up the 4 address/select lines, bring SS to one of the E/ pins (with the other held low) to make one output go low out to the DAC chips.
Then you can still use an Uno.
5 pins for demux (SS and 4 address lines)
3 pins for SPI (SCK, MOSI, MISO committed but not used)
2 pins for serial
10 IO pins free for other stuff