How to enable Analog output 4-20 mA?

I connect positive lead of multimeter to Ch1 of analog output through the 100 Ohm resistor. Common of multimeter connected directly to the ground of analog output. Controller powerd by 24 v power supply. Ch1 programmed as 4-20 mA raw. Multimeter reads 2.5 mA and stays constant no matter I am trying to write.

Am i missing something?

Heres the sketch I am using (standart example one)

#include <Indio.h>

#include <Wire.h>

void setup()
{
  Serial.begin(9600);

  Indio.analogWriteMode(1, mA_raw); // Set Analog-Out CH2 to mA mode and take raw DAC value (0-4096 -> 0-20mA). 

 }

void loop()
{

Indio.analogWrite(1, 2048, false); //Set CH1 DAC to integer value 2048 (approx 10.5mA).

do { } while (1);  //Do nothing, program finished. Keep waiting.

}

 

Daniil Gorbachev
Daniil Gorbachev
14
| 0 0 0
Asked on 3/21/19, 8:02 PM
0
vote
67 Views

Hi, are you using the latest version of the Indio library? i'm not sure as i see a 'Serial.begin(9600)' in your code, and the current D21G based version should have 'SerialUSB.begin(9600)' see https://github.com/Industruino/Indio

I have just run a test with your code and it works for me, so i suspect it is a library version issue. Also, you don't need the 100 ohm resistor, you can put your DMM between OUT CH1 and 4-20mA GND. If your resistor value is too high (above 1k) it won't work, as the DAC's output voltage is limited.

 

 

Tom
Tom
5375
| 0 0 1
Answered on 3/22/19, 12:18 AM
1
vote

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

55 follower(s)

Stats

Asked: 3/21/19, 8:02 PM
Seen: 67 times
Last updated: 3/22/19, 12:18 AM