Skip to Content
All case studies

Case study · Weather station · GPRS PLC

Wind data from places with no network. One PLC sends it over GPRS.

A wind study in Panama, on one Arduino based PLC with GPRS.

6parameters on the list of the case, from the wind to the forecast
3sensor connections named: analog, I2C and SPI
3rainfall totals: per day, per month and per year
1PLC with GPRS sends all the data to the cloud

Panama gets strong storms, and even tornadoes. To predict them, you first need a record of the weather.

So the sensors go where the weather is, not where the network is.

This case describes a weather station for a wind study in Panama, with an M-Duino 42+ PLC that sends its data over GPRS. Industrial Shields won the project. The case does not name the client. The parameters, the sensor connections, the GPRS link and the cloud platform come from the case. The values in the panels are examples, not data from the station.

The challenge

Record the weather far from any network.

The aim of the project is to manage a weather station built on open source technology, and to monitor it through a cloud platform. The goal is a record of the climate in Panama: the data of today and the data of the past, to make good forecasts of storms and other weather phenomena.

01

Six things to record

Wind speed and direction. Temperature and humidity, inside and outside. Current and accumulated rainfall, per day, month and year. Rainfall intensity. Atmospheric pressure. And the weather forecast.

02

Each sensor has its own connection

Each sensor model uses its own connection: analog, I2C, SPI or another one. The method depends on the model, the data type and the update time. One PLC must read all of them.

03

No Ethernet, no Wi-Fi

The sensors must be where the weather can be measured well. In most of those areas, the only communication available is GPRS.

04

Past data counts too

A forecast needs history. The platform needs a database, so that the data of the past is as useful as the data of now.

Why it matters

Storms and tornadoes can be very dangerous. The case says it is important to study them, to predict them and to avoid their consequences. A station that keeps sending data from the right place is the first step.

How it works

Three jobs: read every sensor, add up the rain, send it over GPRS.

Each panel shows one job. Press the buttons. The panels are illustrative simulations: the parameters, the sensor connections and the GPRS link are the ones of the case, but the values, the rates and the sensor assignments are examples, not data from the station.

Job 1 · Read every sensor

Many sensors, many connections, one PLC.

The PLC reads each sensor on the connection its model uses. In the case: analog, I2C, SPI or another one, chosen by the model, the data type and the update time. Then a program on the PLC processes all the values. Change the wind and watch the reads.

  • Wind speed and direction for the wind study
  • Temperature, humidity and pressure around it
  • Each sensor read on its own connection
NSEWWind vaneanalogAnemometerpulsesTemp. and RHI2CPressureSPI
Wind speed0
Wind direction0
Outside temperature0
Pressure0
ANALOGPULSESI2CSPI

Sensor reads (example)

    Illustrative simulation. Example values, not data from the station. The case names analog, I2C and SPI connections and does not publish which sensor uses which. In this example: the wind vane on an analog input, the anemometer as pulses on a digital input, temperature and humidity on I2C, pressure on SPI.

    Job 2 · Add up the rain

    Now, today, this month, this year.

    The case asks for more than one rain value: the current rainfall, the totals per day, per month and per year, and the intensity. The PLC can keep these totals itself, with its real-time clock to close each day. Make it rain and go to midnight.

    • Current rainfall and intensity
    • Totals per day, month and year
    • The clock of the PLC closes each day
    TodayThis monthThis year
    Intensity0
    Today0
    This month0
    This year0
    DRYRAINHEAVY RAIN

    Rain gauge (example)

      Illustrative simulation. Example values, not data from the station. The case asks for current and accumulated rainfall, per day, month and year, and for the rainfall intensity. It does not publish the gauge or the logic. In this example: a tipping bucket gauge with 0.2 mm per tip, the intensity from the tips of the last 10 minutes, heavy rain from 20 mm/h, and the day closed at midnight by the real-time clock of the PLC.

      Job 3 · Send it over GPRS

      From the station to the cloud, with no cable.

      The PLC sends the data to the cloud through its GPRS module and antenna, with HTTP or another protocol. There, a platform with an API and a database keeps the record and shows it on computers, tablets, HMI displays or a Panel PC. Cut the coverage and bring it back.

      • GPRS: the only link in most places
      • HTTP or another protocol to the cloud
      • A database keeps the past for the forecast
      PLC×databasePanel PC
      Records sent0
      Waiting on the PLC0
      Last send0
      Rows in the database0
      GPRS OKNO COVERAGESENDING BACKLOG

      GPRS link (example)

        Illustrative simulation. Example values, not data from the station. The case sends the data over GPRS, with HTTP or another protocol, to a cloud platform with a database. It does not publish a send interval or a local buffer. Keeping the records on the PLC while there is no coverage, and sending them later, is a typical way to do it (store and forward). The 10 minute interval is an example.

        System architecture

        How do you send weather data from a site with no network?

        Connect each sensor to the PLC on the connection its model uses: analog, I2C, SPI or another one. A program on the PLC reads and processes all the data. Through its GPRS module and antenna, the PLC sends the data to the cloud with HTTP or another protocol. In the cloud, a platform with an API and a database keeps the record and shows it. Computers, tablets, HMI displays or an Industrial Shields Panel PC read it, if they use a protocol compatible with the cloud. In this case the PLC is an M-Duino 42+ with GPRS and GSM.

        Weather stationfar from any networkWindspeed and directionTemp. and humidityinside and outsideRain gaugenow, day, month, yearPressurecurrent valueAnalog / I2C / SPIM-Duino 42+ GPRSreads and processesGPRSHTTP or otherCloud platformAPI and databaseComputers, tabletsany screenHMI displaysprotocol of the cloudPanel PCIndustrial ShieldsLayout from the case. Today the M-Duino 42+ in its GPRS/GSM version fits the PLC role; the ESP32 PLC 21 FLEX is the 4G option.Windspeed and directionTemp. and humidityinside and outsideRain gaugenow, day, month, yearPressurecurrent valueAnalog / I2C / SPIM-Duino 42+ GPRSreads and processesGPRS · HTTP or otherCloud platformAPI and databaseprotocol of the cloudPanel PCComputers, tabletsLayout from the case. Today the M-Duino 42+in its GPRS/GSM version fits the PLC role;the ESP32 PLC 21 FLEX is the 4G option.
        Sensor connections: analog, I2C, SPIPLC with GPRSGPRS to the cloudScreens that read the cloud
        Signals and data
        SignalBetweenTypePurpose
        Wind speed and directionBetweenWind sensors → PLCTypeBy sensor modelPurposeThe main data of the wind study
        Temperature and humidityBetweenInside and outside sensors → PLCTypeBy sensor modelPurposeTwo places: inside and outside
        RainfallBetweenRain gauge → PLCTypeBy sensor modelPurposeCurrent rainfall, totals per day, month and year, and intensity
        Atmospheric pressureBetweenPressure sensor → PLCTypeBy sensor modelPurposeCurrent value
        Sensor connectionsBetweenSensors → PLCTypeAnalog, I2C, SPI or otherPurposeChosen by the model, the data type and the update time
        Data outBetweenPLC → cloudTypeGPRS, with HTTP or another protocolPurposeGPRS is the only link in most places where the sensors must be
        RecordBetweenCloud platform → databaseTypeAPI and databasePurposeKeeps the past data as useful as the current data
        MonitoringBetweenCloud → computers, tablets, HMI, Panel PCTypeA protocol compatible with the cloudPurposeReal-time view and tracking of the weather
        Weather forecastBetweenPlatform → usersTypeSoftwarePurposeOn the list of the case; it comes from the record, not from one sensor

        Why it works

        One PLC for the sensors, one link for the site, one record for the forecast.

        One PLC for every connection

        Analog inputs, I2C and SPI are on the same PLC. A new sensor model needs a new connection and new code, not a new controller.

        GPRS where nothing else reaches

        The case chose GPRS because it is the only communication available in most of the places where the sensors must be. The station can stand where the weather is measured well.

        Split the job into parts

        Sensors, PLC, GPRS link, cloud and platform. The case says it plainly: the project can look complex, but the key is to separate each part and keep a common goal.

        A record that lasts

        The database keeps every record with its time. The current data and the past data both feed the forecast.

        Any screen

        The data in the cloud reaches computers, tablets, HMI displays or an Industrial Shields Panel PC, such as the TouchBerry Pi Panel PC 10.1" FLEX.

        Open and modular

        There are no licence fees. The project can be extended in the future if the client requires it.

        From the original case

        The scheme of the case.

        Scheme of a weather station: meteorological sensors connected by analog, I2C or SPI to a PLC that sends data over GPRS to cloud storage and a Panel PC
        The data path of the case: weather sensors, analog, I2C or SPI, the PLC, GPRS, cloud storage and a Panel PC (image from the original case)
        M-DUINO ETHERNET PLC ARDUINO 42, Arduino based PLC for DIN rail
        The M-Duino 42+ as it is sold today, Ethernet version (product image)

        The case does not publish photos of the installation.

        Hardware

        The PLC of the case, today. And a 4G option.

        M-DUINO ETHERNET PLC ARDUINO 42, Arduino based PLC for DIN rail

        Current base model M-DUINO ETHERNET PLC ARDUINO 42

        The M-Duino 42+ of the case, as it is sold today. It has the analog inputs, I2C and SPI that the sensors of the case use. Its GPRS/GSM version adds the mobile link.

        Role in this design
        Reads all the weather sensors, processes the data and sends it to the cloud
        Controller
        Arduino Mega 2560, programmed with the Arduino IDE
        Inputs
        26: 12 analog/digital (0-10 V, 10-bit) and 14 digital optoisolated, 5 to 24 Vdc, 4 with interrupt
        Outputs
        16: 6 analog/digital/PWM and 10 digital optoisolated
        Buses and ports
        I2C, SPI, RS-485, RS-232, TTL serial, Ethernet (W5500)
        Built in
        Real-time clock, microSD slot
        Power and mounting
        12 to 24 Vdc, DIN rail TS35, IP20, 0 to 60 °C

        The case used the M-Duino 42+ with GPRS and GSM. That product is no longer in the shop under its old name. This page links the current M-Duino 42+, and its GPRS/GSM version is described in the M-Duino GPRS family datasheet. Ask our team for the cellular version.

        ESP32 PLC 21 FLEX, ESP32 based PLC for DIN rail

        Option on 4G ESP32 PLC 21 FLEX

        For a site where you want 4G instead of GPRS. The FLEX version takes one 4G LTE-M/NB-IoT board, and it is also programmed with the Arduino IDE.

        Role in this design
        The same job, with a 4G LTE-M/NB-IoT link
        Inputs
        13: 6 analog/digital (0-10 V, 11-bit) and 7 digital optoisolated, 2 with interrupt
        Outputs
        8: 3 analog/digital/PWM and 5 digital optoisolated
        Buses and ports
        I2C, SPI, RS-485, RS-232, Ethernet, Wi-Fi, Bluetooth LE
        Expansion
        One board: 4G LTE-M/NB-IoT (u-blox SARA-R412M), LoRa or CAN
        Power and mounting
        12 to 24 Vdc, real-time clock, DIN rail TS35, IP20

        Not part of the original case. GPRS uses 2G mobile networks, and some operators have switched 2G off. Check the coverage at the site before you choose the link.

        Questions about this case

        Which parameters does a weather station for a wind study record?

        In this case: wind speed and direction; temperature and humidity, inside and outside; current and accumulated rainfall, per day, month and year; rainfall intensity; current atmospheric pressure; and the weather forecast. The wind data is the main data of the study. The other values describe the conditions around it.

        Analog, I2C or SPI: which connection does each weather sensor use?

        It depends on the sensor model. In this case the sensors use analog, I2C, SPI or other connections, chosen by the model, the data type and the update time. The M-Duino 42+ has 0-10 V analog inputs, I2C and SPI, and digital inputs with interrupt for pulse sensors. Check the output of each sensor before you choose. For a full list of sensors on one M-Duino 42, see the irrigation district station.

        Why use GPRS for a remote weather station?

        In this case GPRS was the only communication available in most of the places where the sensors had to be. Ethernet and Wi-Fi need a network close by; GPRS needs mobile coverage. GPRS uses 2G networks, and some operators have switched 2G off, so check the coverage at the site. Where only 4G is left, use a PLC with a 4G LTE-M/NB-IoT board, such as the ESP32 PLC 21 FLEX.

        How does the PLC add up rainfall per day, month and year?

        The case asks for these totals and does not publish the logic. A typical way: a tipping bucket gauge gives one pulse for a fixed amount of rain. The PLC counts the pulses on an interrupt input, adds them to the totals of the day, the month and the year, and uses its real-time clock to close the day at midnight. The intensity is the rain of the last minutes, scaled to one hour. Try it in the second panel.

        Why does a weather platform need a database?

        For the forecast. The case says the current information must be as useful as the previous one. A database keeps every record with its time, so the platform can show trends, compare seasons and feed the forecast. The PLC sends the data; the platform and the database are on the cloud side.

        Can I show the data on an Industrial Shields Panel PC?

        Yes. In this case the data in the cloud can be read by computers, tablets, HMI displays or Industrial Shields Panel PCs, if they use a protocol compatible with the cloud. The case notes that the Panel PCs also have many communications and extra I/O. One option is the TouchBerry Pi Panel PC 10.1" FLEX.

        Download the case study

        4-page PDF with the challenge, the logic, the architecture and the hardware. No form required.

        Measuring the weather at a remote site?

        Tell us about your station. An engineer will answer.

        Tell us what you want to measure, which sensors you have, where the station is and how the data must leave it. We will propose the PLC, the link and the software.

        • You get an answer from our technical team
        • Sensors, PLC and mobile link for your site
        • Arduino, ESP32 or Raspberry Pi based PLCs