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.
}
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.
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!
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
Stats
Asked: 3/21/19, 8:02 PM |
Seen: 2046 times |
Last updated: 3/22/19, 12:18 AM |