summaryrefslogtreecommitdiff
path: root/text/demohw.tex
diff options
context:
space:
mode:
authorMichal Hanus <mikehanus@protonmail.com>2025-06-02 05:28:49 +0200
committerMichal Hanus <mikehanus@protonmail.com>2025-06-02 05:28:49 +0200
commit2634e6fdfd5ef87311deeff3709eaa76610888f8 (patch)
treefb8737c32c1eefd9b6447d15a6f07e55e1203019 /text/demohw.tex
parentbde23520eedae819e5e14c39b47e4611fdab11a9 (diff)
bez diskuze a zaveru
Diffstat (limited to 'text/demohw.tex')
-rw-r--r--text/demohw.tex41
1 files changed, 18 insertions, 23 deletions
diff --git a/text/demohw.tex b/text/demohw.tex
index a457d03..1674037 100644
--- a/text/demohw.tex
+++ b/text/demohw.tex
@@ -1,34 +1,35 @@
%\chapter{Demonstration tracker}
\chapter{Practical demonstration - tracker with meteo sensor}
+\label{chap:demo}
For practical demonstration of an IoT device with 4G/5G connectivity, a development kit Connexio Pro with nRF9161 was selected.
-Practical demonstration of an IoT device with LTE-M or NB-IoT connectivity was made on an example of an GPS tracker with meteo sensor, transferring data to a remote cloud server via MQTT protocol, simulating a data transfer to a central panel.
+Practical demonstration of an IoT device with LTE-M or NB-IoT connectivity was made on an example of an GPS tracker with meteo sensor, transferring data to a remote cloud server via MQTT protocol, simulating a data transfer to a central panel. For mobile field testing the GNSS was disabled due to long time needed to get fixed location and that get connection to LTE network. Both of these action will reset the state to the other so the behavior is very similar to cold start.
\section{Hardware}
-nRF9161 DK development kit was adapted with an add-on board made from a universal line \ac{PCB} with headers fitting to Connexio Pro headers. The add-on PCB contained connections Li-ion accumulator and meteo sensor BME680.
+Connexio Pro development kit was adapted with an add-on board made from a universal line \ac{PCB} with headers fitting to its headers. The add-on PCB contains connections for Li-ion accumulator and meteo sensor BME680.
-Electronic and PCB schemes with 3D render of PCB can be found in appendix \ref{chap:demoapp}.
+Electronic and PCB schemes with 3D render of PCB can be found in appendix \ref{appendix:demoapp}.
\begin{figure}[!h]
\begin{center}
\includegraphics[width=0.5\textwidth]{obrazky/32_PCB3.JPG}
\end{center}
- \caption[Overview of security and fire alarm]{Overview of security and fire alarm board}
- \label{fig:pcb1}
+ \caption[PCB of demonstrator tracker]{PCB of demonstrator tracker}
+ \label{fig:pcb2}
\end{figure}
+
\begin{figure}[!h]
\begin{center}
- \includegraphics[width=0.5\textwidth]{obrazky/32_PCB3.JPG}
+ \includegraphics[width=0.5\textwidth]{obrazky/33_in_case1.JPG}
\end{center}
- \caption[Overview of security and fire alarm]{Overview of security and fire alarm board}
- \label{fig:pcb2}
+ \caption[Demonstrator tracker in 3D printed case]{Demonstrator tracker in 3D printed case}
+ \label{fig:pcb1}
\end{figure}
-
\section{Firmware tools}
nRF Connect SDK was used as a software platform for the demo application. nRF Connect SDK is a unified software development kit for building products based on all Nordic nRF Series wireless devices. It integrates the Zephyr RTOS and wide range of samples, application protocols, protocol stacks, libraries and hardware drivers \cite{zephyrpp}.
@@ -37,7 +38,7 @@ It offers a single code base for all Nordic devices and software components. It
\ac{MQTT} is a lightweight, publish-subscribe protocol that enables efficient and reliable communication between devices in the IoT domain. \ac{MQTT} is based on a broker-client architecture, where a broker is a server that receives and routes messages from multiple clients, and a client is any device that can publish or subscribe to a topic. A topic is a hierarchical identifier that defines the content and scope of a message\cite{mqtt}.
-This firmware is based on nRF Connect SDK example named Simple \ac{MQTT}\cite{nrfmqtt}.
+This firmware is based on nRF Connect SDK example named Simple \ac{MQTT}\cite{nrfmqtt} and GNSS example.
\section{Firmware outline}
@@ -47,18 +48,6 @@ First task for the demo firmware is an establishment of a connection to LTE netw
\texttt{lte\_lc\_init\_and\_connect()} takes all modem settings from text config files transferred to macros by Kconfig. This ilustrates a possibility of cross-platform or regionally independent application, where only the config files for given platform or region are needed to be changed.
-\subsection{ADC configuration}
-When connection with LTE network is successfully established, ADC is configured. Two analog input channels are used in this demo - AIN4 on P0.17 pin connected to LM35 temperature sensor and AIN5 on P0.18 connected to MQ-2 combustible gas sensor. For both channels, \texttt{adc\_channel\_cfg} structs are initialized and channels are set to 10bit resolution, internal 0.6 V reference voltage and 1/2 divider using \texttt{adc\_channel\_cfg()}, setting channels voltage range to 1.2 V. Both channels (if they are enabled by the button configuration) are then sampled in set interval using a custom fuction \texttt{adc\_sample()} and printed to USB serial.
-
-\subsection{Digital inputs and outputs}
-For ease of implementation, digital sensors on GPIO pins P0.16 (DRV5033) and P0.19 (PIR) were added to the device tree as additional development kit buttons. This avoided the need for their own separate initialization and reading codes.
-
-These digital input sensors are then processed as buttons using callback handler \texttt{button\_handler()}. This function is called with bitmasks \texttt{button\_states} and \texttt{has\_changed}, making it ease to figure state change for these two sensors.
-
-Two buttons and two switchers are used for optionally disabling the corresponding sensors. This is executed in \texttt{button\_handler()}.
-
-Four on-board LEDs are used for local signalization of status of PIR sensor (LED1) and Hall effect sensor (LED2), as well as over-threshold values of temperature (LED3) and combustible gas (LED4) sensors.
-
\subsection{MQTT}
Communication with MQTT server is done by zephyr/net/mqtt.h library. Connection with the server is attempted after LTE and sensors setup with function \texttt{mqtt\_connect()}.
@@ -66,8 +55,14 @@ Publishing of message is achieved by function \texttt{mqtt\_publish()} upon a di
\begin{figure}[!h]
\begin{center}
- \includegraphics[width=0.2\textwidth]{obrazky/mqttcom.png}
+ \includegraphics[width=0.4\textwidth]{obrazky/mqttcom2.png}
\end{center}
\caption[Demo MQTT communication]{Sample of resulting MQTT communication}
\label{fig:mqttcom}
\end{figure}
+
+\subsection{Application loop}
+
+The program after establishing LTE connection enters main loop which main where it disables LTE, enable GNSS and waits for modem to get from GNSS fixed location. After that it disables GNSS, enables LTE, waits for LTE connection to be established.
+
+With fresh location data it loads data over I2C from BME680 meteo sensor and gets from modem values about radio connection with \ac{BTS}. All these data are than transmitted using MQTT to remote server. After this program waits for specified time and than runs the loop again. \ No newline at end of file