WIP adding modbus registers to datasheet
This commit is contained in:
parent
b60498f1ff
commit
6571095fd3
@ -7,6 +7,7 @@
|
||||
\usepackage{multicol}
|
||||
\usepackage{capt-of}
|
||||
\usepackage[table]{xcolor}
|
||||
\usepackage{hyperref} % for internal section links
|
||||
|
||||
% ONLY FOR TEMPLATE
|
||||
\usepackage{blindtext}
|
||||
@ -14,7 +15,7 @@
|
||||
%
|
||||
% Sensor name definition
|
||||
%
|
||||
\newcommand{\sensor}{SM-IAQSW-01}
|
||||
\newcommand{\sensor}{IAQSW-01}
|
||||
|
||||
\pagestyle{fancy}
|
||||
\fancyhf{}
|
||||
@ -36,7 +37,7 @@
|
||||
\begin{itemize}
|
||||
\setlength\itemsep{0cm}
|
||||
\item Measures all important indoor air quality values: $\mathrm{CO_2}$, T, RH, VOC
|
||||
\item Communicates via MODBUS RTU (RS-485)
|
||||
\item Communicates via Modbus RTU (RS-485)
|
||||
\item Wide input voltage range 5 - 30V
|
||||
\item Indicates $\mathrm{CO_2}$ (carbon dioxide) level using LED for quick air quality assesment
|
||||
\item Easy to setup using Raspberry Pi and open-source Veles Sensors python library
|
||||
@ -44,20 +45,23 @@
|
||||
\item Temperature range -40 - 125 °C
|
||||
\item Relative humidity range 0 - 100 \%
|
||||
\item VOC (volatile organic compounds) index range 1 - 500 VOC index points
|
||||
\item Fully opensource
|
||||
\end{itemize}
|
||||
\section*{Description}
|
||||
\sensor{} is a wired indoor air quality sensor measuring temperature, relative humidity, carbon dioxide and volatile organic compounds. Communication over RS-485 using MODBUS RTU protocol makes it easy to interface with the sensor using PLC or any PC with RS-485 to USB converter. Open-source Python libraries are available to ease sensor configuration and readout using PC and embedded computers (e.g. Raspberry Pi).
|
||||
\sensor{} is a wired indoor air quality sensor measuring temperature, relative humidity, carbon dioxide and volatile organic compounds. Communication over RS-485 using Modbus RTU protocol makes it easy to interface with the sensor using PLC or any PC with RS-485 to USB converter. Open-source Python libraries are available to ease sensor configuration and readout using PC and embedded computers (e.g. Raspberry Pi).
|
||||
|
||||
On-board RGB LED enables user to quickly assess air quality with single glance. Two quality-to-color schemes are available: continuous color change and tri-state (semaphore) mode.
|
||||
On-board RGB LED enables user to quickly assess air quality with single glance. Two quality-to-color schemes are available: continuous color change and tri-state (semaphore) mode. Thresholds for color change are user-configurable.
|
||||
|
||||
Wide input voltage range makes it possible to integrate sensor to many different systems, ranging from house-wide 12V bus to 5V USB connected to local computer.
|
||||
|
||||
Extended version of this sensor \sensor{}-PM adds particulate matter (dust) measurement option.
|
||||
|
||||
Fully open-source ecosystem: sensor hardware, case, firmware and connected Python libraries are open-sourced under permissive licence.
|
||||
|
||||
\section*{Application}
|
||||
\begin{itemize}
|
||||
\setlength\itemsep{0cm}
|
||||
\item IAQ measurement for home and office spaces
|
||||
\item Ventilation control (manual or automated)
|
||||
\item IAQ measurement for home and office spaces, ventilation control
|
||||
\end{itemize}
|
||||
\end{multicols*}
|
||||
\pagebreak
|
||||
@ -115,7 +119,7 @@ RH measurement repeatability & \multicolumn{1}{c|}{-} & $\
|
||||
\begin{tabular}{|p{3.75cm}|p{9cm}|}
|
||||
\hline
|
||||
\rowcolor{lightgray}\textbf{Parameter} & \textbf{Value} \\ \hline
|
||||
Used Protocol & MODBUS RTU \\ \hline
|
||||
Used Protocol & Modbus RTU \\ \hline
|
||||
Default Baudrate & 19200 Baud \\ \hline
|
||||
Usable Baudrates & 4800, 9600, 14400, 19200, 28800, 38400, 57600, 76800, 119200 Baud \\ \hline
|
||||
Data Bytes & 8 \\ \hline
|
||||
@ -166,16 +170,114 @@ Stop Bits & 1 \\ \hli
|
||||
2 & GND & Ground \\ \hline
|
||||
3 & SWDIO & SWD Data \\ \hline
|
||||
4 & SWCLK & SWD Clock \\ \hline
|
||||
4 & NRST & MCU Reset \\ \hline
|
||||
5 & NRST & MCU Reset \\ \hline
|
||||
\end{tabular}
|
||||
\caption{Programming Connector Pinout}
|
||||
\label{tab:swd_connector_pinout}
|
||||
\end{table}
|
||||
|
||||
\section{Communication Specification}
|
||||
|
||||
For physical layer RS-485 is used. This enables communication to be robust and resistant to EMI (electro-magnetic interference). As a data link layer, Modbus RTU is used. This protocol is widely supported by number of PLCs and other devices. To interface with PC (or any computer with USB port) USB to RS485 converter may be used in comjunction with Veles Sensors python library.
|
||||
|
||||
\subsection{Physical Layer - RS485}
|
||||
\subsection{Link Layer - MODBUS RTU}
|
||||
\subsubsection{Registers Description}
|
||||
|
||||
RS-485 is a full-duplex serial bus ideally suited for low-speed, noise-resistant communication over long distances (up to 1200 m, more if repeaters are used). Linear bus topology is preferable over star or ring configurations. To prevent signal reflections, each sensor is equipped with 120 $\Omega$ termination resistor, therefore optimal cable for connecting sensors to each other and to master node is twisted pair cable with 120 $\Omega$ characteristic impedance.
|
||||
|
||||
\subsection{Data Link Layer - Modbus RTU}
|
||||
|
||||
Modbus is well-tested, openly-published and royalty free data communications protocol. Developed for industrial applications, it aims to be simple and robust. It is a client/server (master/slave) type protocol. Maximum number of client nodes on a Modbus bus is 247.
|
||||
|
||||
Limitation of Modbus-based buses is that there is no arbitration in case of address conflict. This means that nodes should be either added one by one or node addresses should be configured beforehand.
|
||||
|
||||
(TODO note: random address assignment command?)
|
||||
|
||||
\subsubsection{Modbus register space}
|
||||
|
||||
Modbus supports four types of registers:
|
||||
|
||||
\begin{table}[h]
|
||||
\scriptsize
|
||||
\centering
|
||||
\begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|p{3cm}|}
|
||||
\hline
|
||||
\rowcolor{lightgray} \textbf{Object type} & \textbf{Access} & \textbf{Size} & \textbf{Address space} \\ \hline
|
||||
Coil & read / write & 1 bit & 00001 - 09999 \\ \hline
|
||||
Discrete input & read & 1 bit & 10001 - 19999 \\ \hline
|
||||
Input register & read & 16 bits & 30001 - 39999 \\ \hline
|
||||
Holding register & read / write & 16-bits & 40001 - 49999 \\ \hline
|
||||
\end{tabular}
|
||||
\caption{Modbus register space}
|
||||
\label{tab:modbus_register_space}
|
||||
\end{table}
|
||||
|
||||
\subsection{\sensor{} Modbus registers}
|
||||
|
||||
\subsubsection{Input registers}
|
||||
|
||||
Input registers contain measured values. They are read-only and 16-bit in size.
|
||||
|
||||
\begin{table}[h]
|
||||
\scriptsize
|
||||
\centering
|
||||
\begin{tabular}{|p{4cm}|p{2.5cm}|p{2cm}|p{3.6cm}|}
|
||||
\hline
|
||||
\rowcolor{lightgray} \textbf{Register name} & \textbf{Register address} & \textbf{Dimension} & \textbf{Note} \\ \hline
|
||||
Temperature & 30010 & °C & \\ \hline
|
||||
Temperature & 30011 & °F & \\ \hline
|
||||
Relative humidity & 30012 & \% & \\ \hline
|
||||
$\mathrm{CO_2}$ concentration & 30013 & ppm & \\ \hline
|
||||
VOC index & 30014 & VOC index & see Note 1 \\ \hline
|
||||
VOC ticks & 30015 & raw VOC ticks & Raw value from VOC sensor \\ \hline
|
||||
Temperature from $\mathrm{CO_2}$ sensor & 30028 & °C & \\ \hline
|
||||
Temperature from $\mathrm{CO_2}$ sensor & 30029 & °F & \\ \hline
|
||||
RH from $\mathrm{CO_2}$ sensor & 30030 & \% & \\ \hline
|
||||
\end{tabular}
|
||||
\caption{Modbus register space}
|
||||
\label{tab:modbus_register_space}
|
||||
\end{table}
|
||||
|
||||
\paragraph{Note 1}
|
||||
|
||||
VOC index has range 1-500 with 100 being the average. After sensor start-up VOC index is 0 until sufficient amount of data has been measured.
|
||||
|
||||
\subsubsection{Holding registers}
|
||||
|
||||
Holding registers can be written to by master node. Sensor \sensor{} offers following configuration registers:
|
||||
|
||||
\begin{table}[h]
|
||||
\scriptsize
|
||||
\centering
|
||||
\begin{tabular}{|p{4cm}|p{2cm}|p{4cm}|}
|
||||
\hline
|
||||
\rowcolor{lightgray} \textbf{Register name} & \textbf{Register address} & \textbf{Note} \\ \hline
|
||||
LED on & 40001 & set to 0 to turn off LED; set to 1 to turn LED on \\ \hline
|
||||
LED brightness & 40002 & range from 0 (off) to 100 (full intensity) \\ \hline
|
||||
LED smooth & 40003 & see \hyperref[holdingReg:note1]{Note 1} \\ \hline
|
||||
$\mathrm{CO_2}$ alert limit 1 & 40004 & see \hyperref[holdingReg:note2]{Note 2} \\ \hline
|
||||
$\mathrm{CO_2}$ alert limit 2 & 40005 & see \hyperref[holdingReg:note2]{Note 2} \\ \hline
|
||||
SCD4x temperature offset & 40006 & see \hyperref[holdingReg:note2]{Note 3} \\ \hline
|
||||
Device Modbus address & 40007 & see \hyperref[holdingReg:note2]{Note 4} \\ \hline
|
||||
Modbus baudrate & 40008 & see \hyperref[holdingReg:note2]{Note 5} \\ \hline
|
||||
Reset device & 40100 & see \hyperref[holdingReg:note2]{Note 6} \\ \hline
|
||||
\end{tabular}
|
||||
\caption{Modbus register space}
|
||||
\label{tab:modbus_register_space}
|
||||
\end{table}
|
||||
|
||||
\paragraph{Note 1}
|
||||
\label{holdingReg:note1}
|
||||
Setting LED smooth register to 1 will turn on LED color interpolation, meaning LED will have color in continuous spectrum from green to red according to $\mathrm{CO_2}$ level. Setting this register to 0 will turn off interpolation and set LED to semaphore (tri-state) mode. Depending on $\mathrm{CO_2}$ level LED color will than be either green, yellow or red.
|
||||
|
||||
\paragraph{Note 2}
|
||||
\label{holdingReg:note2}
|
||||
Registers $\mathrm{CO_2}$ alert limit 1 and 2 set threshold for LED color change (see \ref[holdingReg:note1]{Note 1}). Limit 1 is threshold between green and yellow color, limit 2 is threshold betweek yellow and red color.
|
||||
|
||||
\paragraph{Note 3}
|
||||
\label{holdingReg:note3}
|
||||
SCD4x is $\mathrm{CO_2}$ sensor
|
||||
|
||||
|
||||
|
||||
\section{Mechanical Dimesions}
|
||||
\end{document}
|
Loading…
Reference in New Issue
Block a user