ADC

From Wiren Board
Jump to navigation Jump to search
This page is a translated version of the page ADC and the translation is 100% complete.
Other languages:
English • ‎русский

How to get voltage from ADC

  1. Select the terminal to which your source can be connected based on the maximum allowable voltage (see table below).
  2. Most ADC terminals have two functions: ADC and low-voltage load control. Before measuring the voltage on the ADC, turn off the appropriate low-voltage load control output. For example, if you are connecting to terminal A1, turn off A1_OUT in the web interface (the Relays & FETs section).
    For details, see Multiplexing ports
  3. Connect your source to the terminal. The voltage value will immediately appear in the веб-интерфейсе in the ADCs device. The value is also translated to the MQTT message systemMQTT.


Using values from external programs

A special WB-homa-adc driver translates the value to the MQTT system and can be obtained there.

Also, the value can be obtained in manual mode:Low-level work with ADC.


Resistance measurement

Wiren Board 5.8 controllers and below were able to measure the resistance of resistors connected to the R1 and R2 inputs.

TODO: you should write here how to configure resistive inputs through the web interface.

See ADC: resistance measurement - technical details


Input voltage

The wb-homa-adc daemon translates the value to the MQQT message queue in the /devices/wb-adc/controls/Vin topic. Therefore, the value is displayed in the web interface as the Vin channel of the ADCs device


Battery voltage

The wb-homa-adc daemon translates the value to the MQTT message queue in the topic /devices/wb-adc/controls/BAT. Therefore, the value is displayed in the web interface as the BAT channel of the ADCs device


Manual mode: see low-Level ADC operation.



Technical details on the implementation of the ADC

Wiren Board сontrollers versions 2.3 and 4 have 8 ADC channels that are multiplexed into one processor channel (LRADC1). Multiplexing channels are shown in the table Wiren Board 4:Список GPIO.

The Wiren Board 5 uses 8 different ADC channels that are connected to separate processor channels. The 4V line is connected to the BAT channel (LRADC7), in addition to measuring the voltage at the 2 resistive inputs, 4 universal inputs A1-A4 and the input voltage (see table below).

The ADC channels serving the R1 and R2 inputs have a built-in independent current source that is used to measure the resistance connected to the channel. Current source accuracy: 5%. See Calibration of analog inputs.

In Wiren Board 6, the ADC channels of the processor are connected to terminals A1-A4. Also, the ADC has input voltage (after the input diodes) and voltage at the terminal 5Vout.


The main channels

A part of the ADC channels is output to the terminals in parallel with the low-voltage load control transistors. Make sure you have closed the corresponding FET using GPIO before using the ADC. For details, see Multiplexing ports


A list of ADC for different devices

Wiren Board 6

See Wiren Board 6.2: Peripherals#Каналы АЦП


Wiren Board 5

terminal block ADC Channel (LRADCxx) Divider Final formula (without divider) V max. measured comments
A1 1 88k7/12k V = N * 3.80 mV 31V
A2 2
A3 3
A4 4
R1 6 1 V = N * 0.4518 mV 3.1V r2 = 3150 Ohm,

r1 = 1000 kOhm

R2 0
4В/li_pol 7 V = N * 1.807 mV - on the 4 В line
Vin 5 88k7/12k V = N * 3.80 mV 31V inpit voltage


WB4

Terminal block || Divider || Formula to recalculate || Final formula (without divider) || V max. measured (with divider) || comments

A1-A3 100k/90.9k N / 4095 * 1.85V * 2.100 V = N * 0.949 mV 7.4V
A4-A5 100k/11.86k N / 4095 * 1.85V * 9.43 V = N * 4.26 mV 34.4V
R1-R2 3k15/1M N / 4095 * 1.85V * 1.003 V = N * 0.426 mV 3.7V
li_pol 100k/90.9k N / 4095 * 1.85V * 2.100 V = N * 0.949 mV - battery
Vin 33k/4k51 N / 4095 * 1.85V * 8.32 V = N * 3.76 mV 30.6V input voltage, iio channel 0


WB3.5

Terminal block Divider Formula to recalculate Final formula V max comments
A1-A4 220k/22k V = N / 4095 * 1.85V * 11 V = N * 4.97 mV
R1-R4 - V = N / 4095 * 1.85V V = N * 0.452 mV
Vin 33k/4k53 N / 4095 * 1.85V * 8.28 V = N * 3.74 mV 30V input voltage, iio channel: 0



WB NETMON-1

Terminal block Divider Formula to recalculate Final formula (without divider) V max. measured (with divider) comments
A1-A8 31k/4.68k N / 4095 * 1.85V * 7.627 V = N * 3.446 mV 20V
Vin 12k/1k N / 4095 * 1.85V * 13 V = N * 5.873 mV input voltage


WB2.8

Terminal block Divider Formula to recalculate Final formula comments
A1-A7 12K/33K V = N / 4095 * 1.85V * 1.364 V = N * 0.616 mV