901
1 INTRODUCTION
This paper is an analysis of the possibilities of using a
Raspberry Pi microcomputer on board a ship. The
main purpose of this paper is to find the possibility of
using this device to displace current traditional
measuring devices. The measurement data are to be
as close as possible to the values obtained by such
devices. The goal is also the development of ship
technology and finding a solution that allows it to be
used in all possible situations, such as power failures.
[1]
The first part of the work presents an analysis of
the use of computer systems on operational ships,
attention will be paid to the use of traditional
measuring devices in the aspect of meteorological
measurements. Measuring devices and their
operating ranges will be presented. An aspect of the
use of this data by officers and mechanics during the
operation of merchant ships will be presented.
The next part will present the Raspberry Pi
microcomputer, its technical data and operating
systems on which the device works. In addition, the
Python programming language will be presented.
This language will be needed to create a code that
will read data from meteorological station sensors
and display ready values of temperatures,
atmospheric pressure and humidity.
The last part of the work is a project to build a
meteorological station on a merchant ship. First, the
sensors used, their dimensions and methods of
connecting to the microcomputer will be presented.
Then, by using ready-made scripts for individual
sensors, the first measurements will be presented.
Scripts should be programmed to display both sensor
values simultaneously. The values will be presented
by calling the code to minimize the use of
microcomputer resourses.
The Single-board Computer As a Toll to Measure the
Weather Parameters in the Marine Areas
T. Neumann
Gdynia Maritime University, Gdynia, Poland
ABSTRACT: This paper is an analysis of the possibilities of using a Raspberry Pi microcomputer on a ship. The
paper is an introduction characterizing the project goal and its main assumptions. It includes a brief history of
shipping development and the current use of computer systems on board merchant ships. Also meteorological
devices have been characterized that can be used on the ship to obtain weather data. The paper also includes
description of the Raspberry Pi microcomputer, its specification and operating systems on which the device
works. The project of a station is designed to measure the value of air and water temperature, humidity and
atmospheric pressure.
http://www.transnav.eu
the International Journal
on Marine Navigation
and Safety of Sea Transportation
Volume 14
Number 4
December 2020
DOI: 10.12716/1001.14.04.14
902
2 METEOROLOGY AT SEA
Meteorology is the science that deals with the study
of physical phenomena and processes occurring in
the atmosphere, in particular in its lowest layer - the
troposphere. These processes affect how the weather
and climate in a given area are shaped.
Meteorological conditions play an important role in
maritime transport, where not only sailing time
matters, but also the safety of crew and ship. The
officer must take into account factors such as the state
of the sea, visibility, tide level, temperature, currents
and even the presence of ice cream in a given area,
both when planning the ship's route and conducting
the watch. Constant observation of these factors on
the bridge is therefore crucial if we want to carry out
a ship from one port to another without problems,
especially if the journey is counted in weeks. [2]
The main source of valuable information about the
weather on the ship are primarily visual observations
conducted by an officer or a watchman. Skillful
assessment of the state of the sea, wave height and
visibility allows a sufficient level to determine the
prevailing weather and often how it will shape over
the next few hours.
A hygrometer, i.e. an instrument constructed of a
dry and wet thermometer, is increasingly used to
measure the temperature on a ship. This instrument
is often placed on both wings of the sternum. Based
on the temperature differences indicated by both
thermometers, we can read the value of relative
humidity from special tables or psychometric charts.
In order to determine the wind speed and its
direction, a sailor may suggest the state of the sea and
its surface, in addition most ships are equipped with
a device called an anemometer, which measures the
speed of air, gas and liquid flow. The most common
solution is a portable anemometer, although wind
gauges are being installed more and more often on
ships, sending information about wind speed and
direction remotely to devices on the bridge.
The device for measuring atmospheric pressure is
a barometer. Depending on the principle of
operation, we distinguish a liquid and spring
barometer, the so-called aneroid, which is most often
placed on the ship's bridge. Rapid changes in
pressure often correlate with occurring weather
changes. Low pressure is often associated with
adverse weather phenomena such as typhoons and
hurricanes. High, in turn, is usually high-
temperature, sunny weather. At sea level, the average
atmospheric pressure is 1013 hPa. [3]
Observation of the cloud cover is not the most
difficult tasks when the sky is clear or completely
covered with clouds. However, the ability to identify
clouds in the sky is useful when it is partly cloudy.
Knowing the characteristics of the precipitation of a
given cloud, we are able to determine whether, for
example, planned painting work on board can be
interrupted by the coming rain and make the right
decision. [4,5]
3 USE OF IT SYSTEMS ON THE SHIP
The history of merchant ships goes back to ancient
centuries. Ancient Greeks and Romans aboard their
ships carried out trade expeditions throughout the
Mediterranean, as well as nearby waters accessible to
their ships. They were built of wood, and used their
sails or the strength of human muscles for their
motive power. The operation of ships consisted
mainly of sailing with a given commodity to a
specific port where it was sold and new buyers were
gained. Navigation was mainly based on sailing on
known seas and routes. There were no maps, so the
position of the ship could not be determined. Over
the years, the appearance, characteristics and
capabilities of ships have changed. Crossing oceans
and discovering the world began. Discoverers such as
Christopher Columbus and Ferdinand Magellan have
reached new previously unknown lands. In 1110,
magnetic compasses appeared, which began to
determine directions, and one hundred and sixty
years later in 1270, the first maps appeared. [6] At the
end of the nineteenth century, units made of concrete
and then of steel began to arise. The first units
received steam engines, and transatlantic journeys
became commonplace. However, it has only been in
the last few decades that ships have received
something that officers and mechanics owe to easier,
safer and more effective work. They are computing,
monitoring and alarming systems based on computer
networks.[7]
Such networks allow a deeper understanding of
the processes occurring in individual devices. On the
hull, in ballast and fuel tanks, in the main engine and
many other locations there are sensors constantly
monitoring parameters, which are transmitted to the
main unit, which thanks to computer systems
connected to the ship's network transmits current
data.
4 RASPBERRY PI MICROCOMPUTER’S
SPECIFICATION
Technological progress has developed significantly
over the last several years. The equipment available
on the market now, compared to that of the early 90s
of the last century, is huge. Not only in terms of
materials and the availability of such devices, but
primarily due to the computational capabilities and
their sizes. The first computer created during the war
called ENIAC (Electronic Numerical Integrator And
Computer) had an area of 140 square meters, i.e. a
medium-sized single-family house. His
computational abilities allowed for basic calculations
related to military subjects. The computer was mainly
used for ballistic and nuclear weapons calculations.
[8]
Over time, computers have become smaller and
more accessible to ordinary users. Home and
personal computers were created, followed by
notebooks. However, a very important date in the
history of personal computers was February 29, 2012.
That day, the smallest computer, the Raspberry Pi
microcomputer, went on sale (see Fig. 1). It was
designed by the Raspberry Pi foundation, located at
903
the University of Cambridge. Its main chairman is
Eden Upton, who is still trying to improve this
microcomputer so that he can accommodate the most
efficient components in its small dimensions. [9]
Figure 1. Raspberry Pi 3 B
The technical specification of the device based on
materials obtained from the microcomputer manual
and the website of the Polish distributor will be
presented below. The presented model is one of the
basic manufacturer, and the data may vary
depending on the version selected.
Table 1. Specifications of Raspberry Pi 3 B device
_______________________________________________
Raspberry Pi 3 model B
Processor Broadcom BCM2837 64-bit
Core Quad-Core ARM Cortex A53
Operating system Linux Raspbian
CPU clock speed 1,2 GHz
Architecture ARMv8-A
RAM 1GB LPDDR2 @ 900 MHz
Memory microSD card
GPIO Socket Connector 40-pin (2x20) raster 2,54mm
Power 5 V / 2 A microUSB input
Dimensions 85x56x17 mm
USB interface 4x USB2.0 gniazdo typ A
Network interface Port Ethernet 10/100 Mbps
WiFi interface 802.11 b/g/n 150 Mbps
Bluetooth BLE 4.1
_______________________________________________
As you can see in the table above, despite the
small dimensions, the components contained in the
device allowed to create a microcomputer with very
interesting parameters. It is worth adding that the
computer has an additional WiFi and Bluetooth
interface.
Figure 2. Outputs and inputs in Raspberry Pi 3 B
Inputs and outputs available on the Raspberry Pi 3
B microcomputer (see Fig. 2): [10]
A. USB port - 4 USB 2.0 ports allowing you to
connect external entities such as an external disk,
pendrive, ROM etc. However, due to the low
power consumption, by the microcomputer itself,
USB sockets offer lower power than standard
sockets in personal computers
B. Ethernet port - standard input for local
networks, so-called cable connection with RJ45
plug. It allows you to connect the microcomputer
to a wider computer network.
C. Video Composite RCA output - analog video
signal output. The signal is sent in NTSC or PAL
formats. The quality of the transmitted image is a
maximum of 480i or SD (Standard-Definition).
D. HDMI output - interface for sending video and
audio in a digital form. The sent image can be in
UHD (Ultra High Definition) format, i.e. 4K. It can
be used when using a microcomputer as, among
others multimedia platform.
E. Power socket - microUSB input, identical to
mobile phones, 5 V / 2 A.
F. DSI 15-pin socket - the last available video
output on the board, commonly used for
connecting LCD monitors.
G. GPIO port - 40 pins for connecting peripheral
devices to the microcomputer. They can be both
input and output devices.
There is also one slot on the other side of the main
board under the DSI socket (see point F) and is used
to support microSD cards. This is an important socket
due to the characteristics of the device, which, having
a very small internal memory, does not have an
operating system installed. Therefore, it is important
for the device to have a microSD card with the
operating system installed before it is turned on. It
will also allow you to operate easily between
different operating systems, only by changing the
microSD card.
Due to the use of GPIO sockets in the rest of the
work, it is important to provide their specifications
(see Fig. 3).
Figure 3. Specification of GPIO sockets
Due to the adaptation of the device primarily to
programming, the operating system, which used in
the microcomputer must allow it to delve into its
source code. Unfortunately, the most popular
Windows or macOS available on the market are
closed-source systems. This means that it is kept
secret and no one except the creators knows what is
inside it. Free and open source is the English term for
free systems that provide users with the ability to
view and modify such code. [11]
904
5 USE OF RASPBERRY PI
In the previous chapter, the Raspberry Pi
microcomputer was presented, which was used to
create a weather station that is the goal of this thesis.
The weather station aims to measure basic weather
parameters that are needed to control the weather
situation and create entries in the ship's logbook. The
values are to be presented on one screen, refreshing
the displayed values every minute. This will allow
you to collect current information. [12]
Parameters presented by the weather station:
Air temperature
Water temperature
Atmospheric pressure
Air humidity
Wind strength and direction will not be
represented by the weather station. These parameters
are needed for safe navigation, their value must be
very accurate, and also be presented on several
devices at the same time. In addition, wind gusts
should be presented on an ongoing basis, which is
difficult to present based on basic sensors available to
a wide range of users, and additionally available for
connection to a microcomputer. It would also be
necessary to connect a gyro-compass / magnetic
compass and a log to determine the actual wind from
the apparent wind value represented by the
anemometer. The weather station I created is
designed to present weather information on one
small screen located at the table with the ship's
logbook. [13]
The station was created by connecting to a
Raspberry Pi microcomputer by more specifically to
GPIO sockets BME280 and DS18B20 sensors. The first
is a sensor for air temperature, atmospheric pressure
and humidity. The second is a waterproof probe for
measuring water temperature. The specifications of
both sensors are provided in the table below.
Table 2. Specification of weather station sensors
_______________________________________________
Parameter BME280 DS18B20
Interface SPI/ I2C 1 wire (GPIO)
Temperature range - 40C - 85C -55C - 125C
Pressure range 300 hPa - 1100 hPa ---
Humidity range 0%RH - 100%RH ---
Temperature accuracy +/- 1 +/- 0,5
Pressure accuracy +/- 1 hPa --
Humidity accuracy +/- 3%RH --
Power 3,3V 3,0V
Dimensions 27 x 20 mm 6 x 51 mm
Cable length: 1 m
_______________________________________________
As you can see in the table above, these sensors
are very small in size, which allows them to be
installed anywhere outside the ship, as well as their
voltage consumption allows you to connect them and
the microcomputer to a standard power outlet. The
sensor ranges are very wide and sufficient for secure
weather forecasting. Regarding accuracy, the values
presented by the DS18B20 are small and the
maximum discrepancy is +/- 0.5 . The BME280
sensor is a little less accurate, but they still show
sufficient values for the weather station being built.
Both sensors are basic devices widely available on the
market, therefore their accuracy difference is not
minimal. If the idea was used in maritime economy,
the sensors could become very accurate, additionally
supervised by meteorological institutions.
The first sensor to be connected is BME280. It
operates on the I2C interface, so it is important to
properly connect the wires from the sensor to the
GPIO sockets in the microcomputer. The photo below
shows how to connect the sensor to the
microcomputer.
Figure 4. BME280 sensor connected to the microcomputer
After connecting the sensor to the microcomputer,
the next step was to connect the Raspberry Pi to the
power supply and the screen on which the
measurement results could be displayed. Connecting
the sensor itself will not display the measurement
results on the screen, which is why a ready-made
script prepared by the creator of the Waveshare
BME280 sensor was used. The code fragment is
presented below, it is forcing the presentation of
temperature, pressure and humidity values.
Figure 5. Used Python Code Fragments
The code is assumed to display values on one line
with a refresh period of microseconds. It is quite
frequent to receive measurement results, but the user
905
can control the functioning of the sensor, thanks to
which we can check whether the impact of external
objects can affect the result. For example, placing a
heat source on the sensor should increase the
temperature or placing the sensor near a water source
will change the humidity value.
Figure 6. BME280 sensor measurement ready
The next step was connecting the second sensor,
i.e. the DS18B20 probe, thanks to which the water
temperature values were obtained. A contact plate
was needed to connect the sensor to the
microcomputer (as in Fig. 7). The probe, unlike the
BME280 sensor, uses a GPIO interface, thanks to
which we can connect both sensors to the device at
the same time.
Figure 7. DS18B20 sensor connected to the contact plate
The code had to be programmed to get the results
of the water temperature measurement. Here, simple
code based on the previously presented Python
programming language was used. It is much simpler
than the sensor presented earlier, but the obtained
result is displayed only once after entering the
command.
Figure 8. Code for DS18B20 sensor
Therefore, it is necessary to develop and combine
both scripts to create one unified code, thanks to
which all measurements can be displayed on one
screen. In addition, the values displayed by both
sensors should be named accordingly, which is why
in the next stage I used the following words for the
parameters:
Air temperature - air temperature
Sea temperature - water temperature
Pressure - atmospheric pressure
Relative humidity
The values presented by the sensors on the final
display will be rounded to one decimal place and
will be displayed after calling the commands. The
values displayed continuously by the BME280 sensor
will slow down the microcomputer's operation by
limiting its RAM memory for a longer time. If the
sensors are to provide data to the microcomputer, it
is important that they are current and shown
immediately after calling the command under the
button on the display. Any slowdown or stopping the
system can cause imaging of unreal measurement
results. It is therefore important to create a code and a
way to visualize the results so simple that it does not
affect the negative operation of the microcomputer.
The first part necessary to create the report is to
determine how the code reads the data from the
sensor. In the BME280 manual you can find the code
snippet responsible for this task. The code loading
such data based on the sensor instruction was used.
Data are taken from the sensor address in the system.
6 PROPOSED DESIGN IMPROVEMENT AND
OTHER POSSIBLE USES OF THE RASPBERRY PI
MICROCOMPUTER
The project has many options for improvement. One
option is to create a barograph on the microcomputer
display. It could be based on creating a small
database with weather data. The system would
download the data in the background and save it to
the database at a 15-minute interval. The data would
operate in the database for 24 hours and then be
deleted to minimize the size of the database. The
system would use the collected data to create an
atmospheric pressure graph over a three-, six- and
twelve-hour range. The electronic barometer
indicated above has a similar application, however,
assuming this thesis, all sensors and meteorological
data will be displayed on one screen, therefore it
would be necessary to develop such a database and
create a program displaying the graph. [13]
In addition to the meteorological station, the
microcomputer could be found on a ship in many
906
other solutions. The first is to create a training station
for officers and crew. XBMC software could do this.
A computer connected to a monitor or TV would
play training materials during weekly / monthly
exercise alerts that are mandatory in accordance with
SOLAS convention and flag State regulations.
Raspberry Pi could also be used to create a
navigation station for lifeboats. Its small size, low
power consumption and the ability to connect a USB
device to it allows you to create a geographical
position display of the ship. For construction it
would be necessary to use a small LCD display and a
GPS receiver connected via a USB port (see Fig. 9.).
This solution would allow the unit's position to be
determined and to navigate safely to the mainland.
Figure 9. GPS receiver with USB plug
Another possibility of using such a
microcomputer is to create from it a spare computer
with a library of materials, instructions, procedures
and important ship documents, which could be used
during emergency situations, such as power loss. As
it was presented earlier, the power consumption of
this device is minimal, so that the batteries available
on the ship could last much longer than when
operating on desktop computers. In addition, its size
and the ability to connect a portable screen allows it
to move with it across different parts of the ship.
There are many ideas for using a microcomputer.
Currently, you can find many publications, both
online and book, presenting the possible uses of the
Raspberry Pi microcomputer. Some of them could
also be used on merchant ships.
7 CONCLUSION
The meteorological station project created in this
work can find its application on merchant ships. As
shown in the paper, sensors available to each user can
present measurement data with values comparable to
those obtained by certified equipment intended for
commercial ships.
This is not the only possible use of a
microcomputer, Raspberry Pi is constantly being
improved. In the future, its computing power may
increase, and the amount and current consumption
may decrease. Therefore, finding even better options
for using such microcomputers is a matter of time.
Possible development of the device in the next
phase will allow the creation of further measuring
devices such as, among others, a barograph. Thanks
to the current design, the most important devices will
be located in one place and their values will be
displayed on one screen located in one or many
places on the ship. This will allow you to control the
weather not only from the navigation rooms, but also
from the office rooms and even crew cabins, which
will be able to check the current weather conditions
every day.
REFERENCES
[1] Corral-García, J.; González-Sánchez, J.-L.; Pérez-
Toledano, M.-Á. Evaluation of Strategies for the
Development of Efficient Code for Raspberry Pi
Devices. Sensors 2018, 18, 4066, doi:10.3390/s18114066.
[2] Morón, C.; Diaz, J.; Ferrández, D.; Saiz, P. Design,
Development and Implementation of a Weather Station
Prototype for Renewable Energy Systems. Energies
2018, 11, 2234, doi:10.3390/en11092234.
[3] Davies, H.; Bevan, S. A Consultative Approach to
Charter Party Agreements Based on Virtual On Time
Arrival. TransNav, the International Journal on Marine
Navigation and Safety of Sea Transportation 2017, 11,
303308, doi:10.12716/1001.11.02.13.
[4] Capraro, F.; Tosetti, S.; Rossomando, F.; Mut, V.; Vita
Serman, F. Web-Based System for the Remote
Monitoring and Management of Precision Irrigation: A
Case Study in an Arid Region of Argentina. Sensors
2018, 18, 3847, doi:10.3390/s18113847.
[5] Chang, S.J.; Huang, C.H.; Chang, S.M. AIS-Assisted
Service Provision and Crowdsourcing of Marine
Meteorological Information. TransNav, the
International Journal on Marine Navigation and Safety
of Sea Transportation 2019, 13, 6367,
doi:10.12716/1001.13.01.05.
[6] Jurdziński, M. Nawigacja morska; Akademia Morska:
Gdynia, Polska, 2014; ISBN 978-83-7421-217-5.
[7] Neumann, T. Telematic Support in Improving Safety of
Maritime Transport. TransNav, the International
Journal on Marine Navigation and Safety of Sea
Transportation 2018, 12, 231235,
doi:10.12716/1001.12.02.02.
[8] Carloni, A.; Baronti, F.; Di Rienzo, R.; Roncella, R.;
Saletti, R. Open and Flexible Li-ion Battery Tester Based
on Python Language and Raspberry Pi. Electronics
2018, 7, 454, doi:10.3390/electronics7120454.
[9] Halfarcree, G. The official Raspberry Pi Beginner’s
Guide; Raspberry Pi Press: Cambridge, 2018;
[10] Upton, E.; Halfacree, G. Raspberry Pi User Guide; John
Wiley & Sons Ltd: Chichester, 2012;
[11] Suehle, R.; Callaway, T. Raspberry Pi Hacks; O’Reilly
Media Inc.: Sebastopol, California, 2014;
[12] Fernández-Cerero, D.; Fernández-Rodríguez, J.Y.;
Álvarez-García, J.A.; Soria-Morillo, L.M.; Fernández-
Montes, A. Single-Board-Computer Clusters for
Cloudlet Computing in Internet of Things. Sensors
2019, 19, 3026, doi:10.3390/s19133026.
[13] Stępień, B. Analysis and the possibility of using the
Raspberry Pi microcomputer on the ship, engineering
thesis, Gdynia Maritime University, Gdynia 2019
[13] Neumann, T. Automotive and Telematics
Transportation Systems. In Proceedings of the 2017
International Siberian Conference on Control and
Communications (SIBCON); IEEE: Astana, Kazakhstan,
2017; pp. 14.