Introduction: Fleet Management System for Sea Food
Fleet management system for seafood transportation uses an Arduino Nano 33 IoT and a Raspberry Pi 4 as the main microcontrollers. The system provides real-time data monitoring through MQTT, with a NEO-6M GPS module for location tracking and a DHT22 sensor to monitor temperature and humidity, ensuring the seafood stays in optimal conditions. Data is transmitted through MQTT, and a web-based GUI enables easy access and visualization.
Supplies
Hardware Components
- Arduino Nano 33 IoT
- Raspberry Pi 4
- NEO-6M GPS Module
- DHT22 Temperature and Humidity Sensor
- Breadboard
- Jumper wires
Software & Libraries
- Arduino IDE
- MQTT Broker (e.g., Hive MQTT)
- Python (for Raspberry Pi programming)
- MQTT Library for Arduino (PubSub Client)
- DHT Sensor Library
- TinyGPS++
Step 1: Connect DHT 22 With Arduino Nano 33 IoT
Connecting DHT 22 sensor with Arduino nano 33 IoT is an easy thing. Lets get into it real quick:
First of all lets take a look at the wiring:
VCC-5V
GND-GND
OUT-D4
After making these connections a library is to be downloaded in Arduino IDE
which is Adafruit Unified Sensor Library.
Step 2: Connecting GPS Sensor With Arduino Nano 33 IoT
For proceeding further you might want to take out your gps module. First lets take a look at the wiring of this sensor with the arduino nano 33 iot
Wiring:
GPS VCC – Connect to the 3.3V pin on the Arduino Nano 33 IoT.
GPS GND – Connect to GND on the Arduino Nano 33 IoT.
GPS RX (Receive) – Connect to D9 on the Arduino Nano 33 IoT.
GPS TX (Transmit) – Connect to D10 on the Arduino Nano 33 IoT.
For this we have to download TinyGPSPlus library.
For starting the gps module firstly, dont connect the RX with the sensor as it takes a time to be available and to catch a satellite's signal when the signal will be available the red light will blink rapidly and once its connected to the satellite the blinking of the light will become slow. It is preferred to use the GPS module outside as it is easier to catch a satellite's signal when its outside.
Step 3: Connecting MQTT
Create an Account on HiveMQ Cloud:
- Visit HiveMQ Cloud and create an account.
Create a New MQTT Broker:
- After logging into the HiveMQ Cloud dashboard, click on Create New MQTT Broker.
- Once the broker is created, you'll be provided with details, including:
- Broker URL (e.g., broker.hivemq.com)
- Port (usually 1883)
- Client ID (can be any unique name for your device)
Install Required Libraries in Arduino IDE
- WiFiNINA Library (for Arduino Nano 33 IoT Wi-Fi functionality)
- ArduinoMqttClient Library (for MQTT functionality)
- DHT22 and TinyGPS++ Libraries (for sensor data reading)
Attachments
Step 4: Set Up Raspberry Pi
Step 1: Install Paho MQTT Client on Raspberry Pi
Install Paho MQTT Python Client:
pip install paho-mqtt
Step 2: Create a new python script by :
nano mqtt_subscribe.py
Then put your python code in the file and run it by:
python3 mqtt_subscribe.py
Step 5: Add GUI
I've added simple yet explanatory GUI in my code and the updated code is provided below l
step 1: Install Tkinter
sudo apt install python3-tk
Add gui logics to the previous file and then run it.
It will give you the real time data monitoring and the values read by the sensors
********This assignment is submitted to the Deakin University, School of IT, Unit SIT210 - Embedded Systems Development.*********