RPI DCV8: Difference between revisions

From lechacal
Jump to navigation Jump to search
No edit summary
 
(46 intermediate revisions by the same user not shown)
Line 1: Line 1:


RPI_DCV8 is a 8 channels acquisition board for Raspberrypi. Any of AC current & voltage or DC current & voltage can be setup at assembly/purchase time on each channel.
[http://lechacalshop.com/gb/internetofthing/72-rpidcv8.html Link to the shop.]


* 8 Channels (both AC or DC).
RPI_DCV8 is a 8 channels acquisition board for Raspberrypi. Any of AC current & voltage or DC current & voltage can be setup at assembly/purchase time.
 
* 8 Channels.
* Instrumentation amplifiers.
* Measure RMS or Average signal.
* Measure RMS or Average signal.
* Fit on Raspberrypi 4 holes mounting pattern.
* Fit on Raspberrypi 4 holes mounting pattern.
* AtMega328 Mcu (Arduino UNO)
* Atmega328p Mcu (Arduino UNO)
* MCP3208 ADC
* MCP3208 ADC (12bits)
* Screw Terminal connectors.
 
[[File:IMG_2062_small.png | 300px]][[File:IMG_2063_small.png | 300px]][[File:IMG_2064_small.png | 300px]]
 
 
=Hardware Channel Setup=
 
The idea of the RPI_DCV8 brings a customisable base to setup each channel as per your requirement. We will setup the channel type and range at purchase time.
Currently supported type of channels are:
* AC Current (using both Voltage and Current CT).
* AC Voltage.
* DC Current.
* Dc Voltage.
* Thermocouple.
 
==DC Current==
[[File:N22837947A_1.jpg | 240px| right]]
DC current can be read using a Clamp meter suitable for DC.
 
===BT-605A===
With the BT-605A currents up to 600A can be measured.<br>
The amplification stage can be adapted on the RPI_DCV8 to adjust for desired range.
 
 
[[File:IMG_2080_small.png | 300px]]
 
==AC Current==
[[File:269.jpg | 240px | right]]
For measuring AC current current a Current Transformer (CT) must be used.
 
RPI_DCV8 can host the burden resistor for current output CT.
<br><br><br><br><br><br><br><br>
 
==AC Voltage==
 
===AC/AC Transformers===
Recommended models are
* UK: 77DB-06-09
* EU: 77DE-06-09
* US: 77DA-10-09
 
===ZMPT101B Module===
 
=Arduino Firmware=
 
The RPI_DCV8 operate with an Atmel microcontroller programmable with Arduino.
 
A default sketch (firmware) is provided to read AC and DC readings.
 
==Raspberrypi Communication==
 
The RPI_DCV8 interface with the Raspberrypi using the serial uart. Data can be simply read by reading the serial port.
You will find more details about the raspberrypi setup in the following link.
[[Howto setup Raspbian for serial read]]
 
==RPI_DCV8 configuration==
 
The RPI_DCV8 has many configuration parameters. Some of them are
* Polling interval.
* Order of Channel to ouput.
* RealPower, ApparentPower, Power factor if in AC reading.
* Frequency.
* Irms.
* Average value for DC reading.
* Length of applied average.
* and more...
 
A web interface to help configuring the board will be out soon.


An example of the configuration file below.




[[File:IMG_2062_small.png]]
[main]
format = 3
nodeid = 11
polling = 1000
N_cvpair = 1
kcal = 30.00 83.33 83.33 83.33 83.33 83.33 83.33 83.33
phasecal = 0
vest = 240.0
xpFREQ = 50
Ncycle = 20
HWSCT = 0 6 5 4 3 2 1 0
HWVOL = 127 127 127 127 127 127 127 127
N_node_average = 8
N_samp_average = 100
K_SENSITIVITY = 1000 1000 1000 1000 1000 1000 1000 1000
K_OFFSET = 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
HW_ave = 7 6 5 4 3 2 1 0
Nchan = 9
CHTYPE = 9 9 9 9 9 9 9 9 5 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
CHID = 0 1 2 3 4 5 6 7 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255  255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
debug = 0


All parameters are explained below.


[[File:IMG_2063_small.png]]
{| class="wikitable"
|+Table 0: Parameters
|-
!Parameter
!Description
!Data type
!Expected Range
!Default Value
|-
| '''format'''
| format output to be used by the serial port.
| uint8_t
| 0 - CSV<br>1 - deprecated<br>2 - deprecated<br>3 - Emonhub<br>4 - Binary
| 3
|-
| '''nodeid'''
| Device identification number. Well used with emonhub format.
| uint8_t
| Any number between 0 and 255.
| 11
|-
|'''polling'''
| Number of milliseconds between each data to be sent over serial.
| uint16_t
| Any non null number up to 65535.
| 5000
|-
|'''N_cvpair'''
|Number of Current/Voltage pair to compute AC signals.
|uint8_t[28]
|An integer between 0 and 255
|Depends on board type.
|-
|'''kcal'''
|Current or Voltage calibration coefficient. Formerly Ical or Vcal. Must contain 5 times 8 values.
The first 8 values are for slave1. The second 8 values are for slave2 etc. The last 8 values are for the master board.
Each values inside a block of 8 must be in the same order as in Table 1 below. The example above shows for a rpict7v1 vcal=560 then all ical=83.33.
|float[5][8]
|Any floating point number.
|Depends on board type.
|-
|'''phasecal'''
|Phase Calibration value. Adjust phase delay between Voltage and Current. 0 is usually the best option unless tests prove otherwise.
|int8_t
|An integer between -9 and +9.
|0
|-
|'''vest'''
|Voltage to compute estimated power. Usually 240V 220V or 110V. Only applies for channel type number 5 (estimated power). Must be set even if not used. Set vest=1 to obtain output as ampere instead of watts. Set vest=1000 to get milliampere.  <small>Former sketches were computing real power only if this parameter was set to 0. This is no longer the case here.</small>
|float
|Any floating point number.
|240.0
|-
|'''xpFREQ'''
| Expected Frequency. The expected frequency to be measured should be set here. Typically 50 or 60Hz. This does not have to be highly accurate. A nominal value usually suffice.
|uint8_t
|An integer between 1 and 255
|50
|-
|'''Ncycle'''
| Set the number of cycle to measure. This directly set the sampling window. Minimum would be 1. Maximum 255. The lower the number the faster and more responsive are the data but more prone to anomalies. The higher the number the slower the reading but more averaged over time. Values of 10 or 20 are usually good.
|uint8_t
|An integer between 1 and 255
|20
|-
|'''HWSCT'''
|Pin configuration of a AC current input. Only first N_cvpair are relevant.
|uint8_t[28]
|An integer between 0 and 255
|Depends on board type.
|-
|'''HWVOL'''
|Pin configuration of a AC voltage input. Only first N_cvpair are relevant.
|uint8_t[28]
|An integer between 0 and 255
|Depends on board type.
|-
|'''N_node_average'''
|Number of computation node for DC signals.
|uint8_t
|An integer between 0 and 255
|Depends on board type.
|-
|'''N_samp_average'''
|Number of samples to use to compute the averaged DC.
|uint16_t
|An integer between 0 and 65536.
|100
|-
|'''K_SENSITIVITY'''
|Calibration value for DC signal. Multiplier component.
|float
|Any floating point number.
|1000.0
|-
|'''K_OFFSET'''
|Calibration value for DC signal. Offset component.
|float
|Any floating point number.
|0.0
|-
|'''HW_ave'''
|Pin configuration of a DC voltage input. Only first N_node_average are relevant.
|uint8_t
|An integer between 0 and 255.
|Depends on hardware setup.
|-
|'''Nchan'''
|Number of channels (or fields) to output.
|uint8_t
|An integer between 0 and 255
|Depends on board type.
|-
|'''CHTYPE'''
|Type of channel to output. See table below.
|uint8_t[64]
|An integer between 0 and 255
|Depends on board type.
|-
|'''CHID'''
|Identified from which combination node defined with HWSCT the channel should be output. 0 being the first node.
|uint8_t[64]
|An integer between 0 and 255
|Depends on board type.
|-
|'''debug'''
|Turn debug on/off
|uint8_t
|0 - OFF<br>1 - ON
|0
|-
|}


=Files=


[[File:IMG_2064_small.png]]
==Sketch==
Version 1.0.0 to come up soon.

Latest revision as of 17:27, 21 November 2020

Link to the shop.

RPI_DCV8 is a 8 channels acquisition board for Raspberrypi. Any of AC current & voltage or DC current & voltage can be setup at assembly/purchase time.

  • 8 Channels.
  • Instrumentation amplifiers.
  • Measure RMS or Average signal.
  • Fit on Raspberrypi 4 holes mounting pattern.
  • Atmega328p Mcu (Arduino UNO)
  • MCP3208 ADC (12bits)
  • Screw Terminal connectors.


Hardware Channel Setup

The idea of the RPI_DCV8 brings a customisable base to setup each channel as per your requirement. We will setup the channel type and range at purchase time. Currently supported type of channels are:

  • AC Current (using both Voltage and Current CT).
  • AC Voltage.
  • DC Current.
  • Dc Voltage.
  • Thermocouple.

DC Current

DC current can be read using a Clamp meter suitable for DC.

BT-605A

With the BT-605A currents up to 600A can be measured.
The amplification stage can be adapted on the RPI_DCV8 to adjust for desired range.


AC Current

For measuring AC current current a Current Transformer (CT) must be used.

RPI_DCV8 can host the burden resistor for current output CT.







AC Voltage

AC/AC Transformers

Recommended models are

  • UK: 77DB-06-09
  • EU: 77DE-06-09
  • US: 77DA-10-09

ZMPT101B Module

Arduino Firmware

The RPI_DCV8 operate with an Atmel microcontroller programmable with Arduino.

A default sketch (firmware) is provided to read AC and DC readings.

Raspberrypi Communication

The RPI_DCV8 interface with the Raspberrypi using the serial uart. Data can be simply read by reading the serial port. You will find more details about the raspberrypi setup in the following link. Howto setup Raspbian for serial read

RPI_DCV8 configuration

The RPI_DCV8 has many configuration parameters. Some of them are

  • Polling interval.
  • Order of Channel to ouput.
  • RealPower, ApparentPower, Power factor if in AC reading.
  • Frequency.
  • Irms.
  • Average value for DC reading.
  • Length of applied average.
  • and more...

A web interface to help configuring the board will be out soon.

An example of the configuration file below.


[main]
format = 3
nodeid = 11
polling = 1000
N_cvpair = 1
kcal = 30.00 83.33 83.33 83.33 83.33 83.33 83.33 83.33
phasecal = 0
vest = 240.0
xpFREQ = 50
Ncycle = 20
HWSCT = 0 6 5 4 3 2 1 0
HWVOL = 127 127 127 127 127 127 127 127
N_node_average = 8
N_samp_average = 100
K_SENSITIVITY = 1000 1000 1000 1000 1000 1000 1000 1000
K_OFFSET = 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
HW_ave = 7 6 5 4 3 2 1 0
Nchan = 9
CHTYPE = 9 9 9 9 9 9 9 9 5 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
CHID = 0 1 2 3 4 5 6 7 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
debug = 0

All parameters are explained below.

Table 0: Parameters
Parameter Description Data type Expected Range Default Value
format format output to be used by the serial port. uint8_t 0 - CSV
1 - deprecated
2 - deprecated
3 - Emonhub
4 - Binary
3
nodeid Device identification number. Well used with emonhub format. uint8_t Any number between 0 and 255. 11
polling Number of milliseconds between each data to be sent over serial. uint16_t Any non null number up to 65535. 5000
N_cvpair Number of Current/Voltage pair to compute AC signals. uint8_t[28] An integer between 0 and 255 Depends on board type.
kcal Current or Voltage calibration coefficient. Formerly Ical or Vcal. Must contain 5 times 8 values.

The first 8 values are for slave1. The second 8 values are for slave2 etc. The last 8 values are for the master board. Each values inside a block of 8 must be in the same order as in Table 1 below. The example above shows for a rpict7v1 vcal=560 then all ical=83.33.

float[5][8] Any floating point number. Depends on board type.
phasecal Phase Calibration value. Adjust phase delay between Voltage and Current. 0 is usually the best option unless tests prove otherwise. int8_t An integer between -9 and +9. 0
vest Voltage to compute estimated power. Usually 240V 220V or 110V. Only applies for channel type number 5 (estimated power). Must be set even if not used. Set vest=1 to obtain output as ampere instead of watts. Set vest=1000 to get milliampere. Former sketches were computing real power only if this parameter was set to 0. This is no longer the case here. float Any floating point number. 240.0
xpFREQ Expected Frequency. The expected frequency to be measured should be set here. Typically 50 or 60Hz. This does not have to be highly accurate. A nominal value usually suffice. uint8_t An integer between 1 and 255 50
Ncycle Set the number of cycle to measure. This directly set the sampling window. Minimum would be 1. Maximum 255. The lower the number the faster and more responsive are the data but more prone to anomalies. The higher the number the slower the reading but more averaged over time. Values of 10 or 20 are usually good. uint8_t An integer between 1 and 255 20
HWSCT Pin configuration of a AC current input. Only first N_cvpair are relevant. uint8_t[28] An integer between 0 and 255 Depends on board type.
HWVOL Pin configuration of a AC voltage input. Only first N_cvpair are relevant. uint8_t[28] An integer between 0 and 255 Depends on board type.
N_node_average Number of computation node for DC signals. uint8_t An integer between 0 and 255 Depends on board type.
N_samp_average Number of samples to use to compute the averaged DC. uint16_t An integer between 0 and 65536. 100
K_SENSITIVITY Calibration value for DC signal. Multiplier component. float Any floating point number. 1000.0
K_OFFSET Calibration value for DC signal. Offset component. float Any floating point number. 0.0
HW_ave Pin configuration of a DC voltage input. Only first N_node_average are relevant. uint8_t An integer between 0 and 255. Depends on hardware setup.
Nchan Number of channels (or fields) to output. uint8_t An integer between 0 and 255 Depends on board type.
CHTYPE Type of channel to output. See table below. uint8_t[64] An integer between 0 and 255 Depends on board type.
CHID Identified from which combination node defined with HWSCT the channel should be output. 0 being the first node. uint8_t[64] An integer between 0 and 255 Depends on board type.
debug Turn debug on/off uint8_t 0 - OFF
1 - ON
0

Files

Sketch

Version 1.0.0 to come up soon.