Analog Output 0-10V or 4-20mA

Description

This feature is present on OI-Mixed module (x2).

With these outputs, you can generate any voltage or current within the specified range. These outputs are especially suitable for applications with actuator controlled by voltage or current.

It’s feasible to integrate both types of generator, accommodating both current and voltage output, on the same board.

Characteristics

Voltage mode

Voltage output specifications

Requirements

Value

Remark

Resolution

14 bits

Minimum output voltage

-10.25V

Maximum output voltage

10.25V

Precision

± 60mV

worst case

Step

1.28mV

Minimum load

1kΩ

Output impedance

7mΩ

Output is protected against short-circuit.

Current mode

Current output specifications

Requirements

Value

Remark

Resolution

14 bits

Minimum output current

0mA

Maximum output current

24mA

Precision

±20µA

worst case

Step

1.46µA

Maximum load

500Ω

Output impedance

100MΩ

Output is protected against open-circuit.

Code examples

The example code above demonstrates how to set a current on output AOUT_1 and AOUT_2.

#include "OpenIndus.h"
#include "Arduino.h"

OIMixed mixed;

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

    /* Init AOUT */
    mixed.analogOutputMode(AOUT_1, AOUT_MODE_0mA_20mA);
    mixed.analogOutputMode(AOUT_2, AOUT_MODE_0mA_20mA);
}

//Output values which will be changed with this variable
float counter = 1;

void loop(void) 
{
    //mixed.analogWrite(CHANNEL, OUTPUT_VOLTAGE_VALUE);
    mixed.analogWrite(AOUT_1, counter);
    mixed.analogWrite(AOUT_2, counter);

    Serial.println("All channels set at "+String(counter)+"V");
    
    counter = counter + 0.1;
    //Maximum output value is 20mA
    if (counter >= 20.0)
    {
        counter = 0;
        //Additional 100 ms delay introduced to manage 20mA -> 0V fall time of 150 ms
        delay(100);
    }
    delay(100);
}

The example code above demonstrates how to set a voltage on output AOUT_1 and AOUT_2.

#include "OpenIndus.h"
#include "Arduino.h"

OIMixed mixed;

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

    /* Init AOUT */
    mixed.analogOutputMode(AOUT_1, AOUT_MODE_M10V5_10V5);
    mixed.analogOutputMode(AOUT_2, AOUT_MODE_M10V5_10V5);
}

//Output values which will be changed with this variable
float counter = 1;

void loop(void) 
{
    //mixed.analogWrite(CHANNEL, OUTPUT_VOLTAGE_VALUE);
    mixed.analogWrite(AOUT_1, counter);
    mixed.analogWrite(AOUT_2, counter);

    Serial.println("All channels set at "+String(counter)+"V");
    
    counter = counter + 0.1;
    //Maximum output value is 10.4V
    if (counter >= 10.5)
    {
        counter = 0;
        //Additional 100 ms delay introduced to manage 10.5V -> 0V fall time of 150 ms
        delay(100);
    }
    delay(100);
}

Software API

class AnalogOutputs

Public Static Functions

static int init(uint8_t nb, ad5413_config_t *configs)

Initialize Analog Outputs.

Parameters:
  • nb – Number of Analog Outputs

  • configs – Analog Outputs configurations

Returns:

0 if success, -1 if error

static int start()

start the devices to enable Outputs

Returns:

0 if success, -1 if error

static int analogOutputMode(AnalogOutput_Num_t num, AnalogOutput_Mode_t mode)

Set the mode of the specified Analog Output.

Parameters:
  • num – Analog Output number

  • mode – Analog Output mode

Returns:

0 if success, -1 if error

static int analogWrite(AnalogOutput_Num_t num, float value)

Set the specified Analog Output to desired voltage value.

Parameters:
  • num – Analog Output number

  • value – Desired voltage

Returns:

0 if success, -1 if error