Arduino Forum

Products => Arduino Due => Topic started by: David_ZI on Nov 06, 2017, 02:39 pm

Title: DAC's output voltage managment on Arduino Due
Post by: David_ZI on Nov 06, 2017, 02:39 pm
Hi everyone,


Currently setting up Arduino Due for a Lab project, and would like to get an advice. I need both DAC's on Due to be able to output a voltage from 0- max 4 Volts. Is there a chance that the Due will do it without any additional /and or support circuitry= ?, and second question, is the Due capable of using both onboard DAC'S simultaneously=?  :smiley-confuse:


David
Title: Re: DAC's output voltage managment on Arduino Due
Post by: ard_newbie on Nov 06, 2017, 03:13 pm

I need both DAC's on Due to be able to output a voltage from 0- max 4 Volts. Is there a chance that the Due will do it without any additional /and or support circuitry= David
No, see this tutorial:

http://ardupiclab.blogspot.fr/2015/07/how-to-modify-analog-output-range-of.html (http://ardupiclab.blogspot.fr/2015/07/how-to-modify-analog-output-range-of.html)

is the Due capable of using both onboard DAC'S simultaneously=?  
Yes, select both channels and Word transfer in DACC_MR with the appropriate channel setting (bits 12 and 28).
Title: Re: DAC's output voltage managment on Arduino Due
Post by: David_ZI on Nov 07, 2017, 02:21 am
Hi, thanks for the article. I just want to use the Analog to Digital Chain on Arduino Due, that said, to read multiple analog signals and then output suitable response signal via the 2DACs. Let's say similar to PID controller. You think the board itself is capable of doing that, having restrictions on Hardware level?

Title: Re: DAC's output voltage managment on Arduino Due
Post by: ard_newbie on Nov 07, 2017, 03:26 am

Of course yes.
Title: Re: DAC's output voltage managment on Arduino Due
Post by: David_ZI on Nov 07, 2017, 06:03 am
so one has even several options to output voltage via AnalogWrite(), which means PWM, and of course the DACs, come into play, so i can easyily use both lets, say pwm and DAC;s in parralell? :smiley-surprise:
Title: Re: DAC's output voltage managment on Arduino Due
Post by: ard_newbie on Nov 07, 2017, 06:29 am
You can use the PWM controller in parrallel with de DACs.

Note that the DACs output is a true analog voltage which is not the case of a PWM output. You will have to low-pass filter your PWM output to transform it into an analog voltage:

https://www.allaboutcircuits.com/technical-articles/low-pass-filter-a-pwm-signal-into-an-analog-voltage/ (https://www.allaboutcircuits.com/technical-articles/low-pass-filter-a-pwm-signal-into-an-analog-voltage/)
Title: Re: DAC's output voltage managment on Arduino Due
Post by: David_ZI on Nov 08, 2017, 05:32 am

what is really not clear to me, how one can achieve make ADC sense smaller amounts of milivolts?? say if my ADC range is 0-4 Volts, then the minimum voltage it can sense is 4/4095=0.97miliVolts. I need to make this value something 0.5-0.3 miliVotls.

any ideas what could make that come ture= ? :smiley-confuse:

Title: Re: DAC's output voltage managment on Arduino Due
Post by: ard_newbie on Nov 08, 2017, 07:36 am
You would need to transform the 12-bit DUE ADC to a virtual 13-bit ADC. The answer to this is oversampling, inputing white noise (dithering) and averaging.

http://www.atmel.com/images/doc8003.pdf (http://www.atmel.com/images/doc8003.pdf)

https://www.silabs.com/documents/public/application-notes/an118.pdf (https://www.silabs.com/documents/public/application-notes/an118.pdf)

Note that the DUE TRNG controller is able to produce a gaussian noise (white noise).

And be careful, the DUE is 3.3V compliant only.

Title: Re: DAC's output voltage managment on Arduino Due
Post by: David_ZI on Nov 08, 2017, 12:04 pm
great article newbie ! thank you so much... will try to do that...
Title: Re: DAC's output voltage managment on Arduino Due
Post by: David_ZI on Nov 09, 2017, 05:49 am
Hi newbie, currently trying to interface the thermocouple directly to analog pins, and just want to make sure i understand it right, the thermocouple plus + and minus- terminals should be connected to analog pins like one for Plus + and one for Minus- ? but in this case we do not short circuit the pins=?


 :smiley-confuse:
Title: Re: DAC's output voltage managment on Arduino Due
Post by: weird_dave on Nov 09, 2017, 09:46 am
What thermocouple are you using and what temperature range are you interested in? I suspect you are going to need to amplify the signal before you sample it, in reality you will do that anyway, incorporating some common mode noise rejection.
Title: Re: DAC's output voltage managment on Arduino Due
Post by: David_ZI on Nov 10, 2017, 03:03 am
its N-P type thermopile. What i am very curious about, in most simple case, lets say where no OP amps or Instrumental amps or any other circuitry or IC is involved. Just we have plus and minus wires coming directly from thermopile. Is it technically correct to connect thermopile + to an analog pin, and thermopile - to another analog pin on controller?.
Title: Re: DAC's output voltage managment on Arduino Due
Post by: weird_dave on Nov 10, 2017, 10:57 am
Have you got a link to your sensor?

If I've read this correctly, you're suggesting connecting the +ve and -ve to 2 separate analogue reading pins, this is not technically correct, no. The -ve would connect to gnd on a Due. I don't know the specifics of your sensor, but I suspect it will require amplification to give you a reading (P-N thermopile doesn't mean much to me or google, hence the request for a link).
Title: Re: DAC's output voltage managment on Arduino Due
Post by: David_ZI on Nov 13, 2017, 03:13 am
Hi wierd_dave, 

http://www.xensor.nl/pdffiles/sheets/nanogas3939.pdf

the one I'm using is XI-395/390. So al the circuitry is directly doped on the silicon membrane. I was thinking to get one of the MAX-31856 IC to lock it in between thermopile and Due. But beforehand, was curious if the Due itself will read out some data directly.


Title: Re: DAC's output voltage managment on Arduino Due
Post by: weird_dave on Nov 13, 2017, 12:12 pm
Interesting device!

Using something like the Maxim part is a good idea as it has compensation and does the digital conversion for you. The AD595 may also be worth a look if you really want to use the Due ADCs.

Purely for initial testing purposes, you should be able to connect a digital multimeter and get a reading and then compare that to a reading using a Due, there may be some discrepancy as the Due's input impedance may be low enough to skew it noticeably (I haven't quite had time to understand that part of the SAM3X datasheet). The result is never going to be fantastic going straight to the Due inputs.

What temperature range are you looking at?
Title: Re: DAC's output voltage managment on Arduino Due
Post by: David_ZI on Nov 14, 2017, 02:46 am
experiment No1, I connected the thermopile V+ and V- to Agilent RMS multimeter respectively. The Resistors(aka heaters) of the sensor connected to Due digital Pins. When giving small amounts of voltage to    heaters the multimeters measured feedback from thermopile. I measured several 0,01 -1,3 mvolts depending on the heater voltage.

experiment No2. I connected the Thermopile V+ to a Due analog pin and V-to Due GND. Using analog Read in function i tried to read the same reading as multimeter did. Guess what? while giving same amount of voltage to heaters the Thermopile feedback was still 0.0000, till the point where i have increased the heaters voltage with some 2%. Then I saw that data in serial, but it was too unstable, like 5.000 , then it gets 0.0000, then again , 3.000, unstable readings. Anyway, I decided to convert those ranalog readings to milivolts, to compare them with multimeter readings, so I did the following:

Tp(V)= analog reading * (3.3/4095); to get Tp in Volts??? but the reading does not coinside with multimeter value, its to low. Am i doing something wrong here?

at the moment i have ambient temperature, c.a.25°C, but for future its gonna be something -30 up to +300°C range


Title: Re: DAC's output voltage managment on Arduino Due
Post by: weird_dave on Nov 14, 2017, 10:14 am
It looks like Maxim will allow free samples of the part you suggested ;)
I'm not really surprised the Due failed to give a good result, you're probably just reading noise, a reading of 5 equates to 4mV, which is higher than you got with the meter, I wouldn't expect that to be the case unless it was noise.
What were the figures you got using the Tp(V) maths?

I'd probably go for the Maxim part at this point, it looks like you can set the device to 'custom' and read the raw data out which you can then convert to temperature.
Title: Re: DAC's output voltage managment on Arduino Due
Post by: David_ZI on Nov 16, 2017, 10:00 am
Hi wierd_dave

so I've attached the Tp(V) maths figures as reqeusted. Also one figure is the actual raw data from (adc). One can see the noise level. The Graph represents the both measurements on same scale (Volts), the Agilent multimeter, and the Due SAM MCU. I have also atached the PWM voltage curve measured directly on pin, just to have an idea how much analogWrite() argument represents in voltage. The data calculation took a while coz I did a lot of calculations ot make sure the data is resonable. By the way, i used the analogReadresolution(12)-(16) to increase the default-10 :o  , but it looks like the Due did not change the resolution, even tho i added this in my code, it kept reading from 0-1023. Any ideas on that=? :smiley-confuse:

Title: Re: DAC's output voltage managment on Arduino Due
Post by: weird_dave on Nov 17, 2017, 12:21 pm
I had written a long reply, hit post button only to find it had logged me out and I lost the post :(
Suffice to say, I think you're going to need an interface IC of some sort if you want repeatable and reliable results.
Have you changed the maths? if the raw values are only going up to 1023, only 0.82 volts are possible (1023*3.3/4095).