Remote Patient Monitoring and Alert System using Arduino and Raspberry Pi
This project is a remote patient monitoring and alert system designed to help a carer monitor patient room activities using sensors and dashboard in raspberry Pi. The system using Arduino Nano 33 IoT to collect sensor data such as motion, light level, and emergency button alert. A Raspberry Pi server/dashboard receives the data, allowing the caregiver to monitor the patient's condition and act immediately if assistance is required. Because it promotes safer care settings and demonstrates how embedded systems may link sensors, microcontrollers, and software interfaces, I created this project.
Components Used· Arduino Nano 33 IoT
· Raspberry Pi 4
· PIR motion sensor
· BH1750 light sensor
· Push button
· LED
· Buzzer
· Jumper wires
· Breadboard
· USB cables / power supply
Software Used· Arduino IDE
· Python
· Flask server
· Tkinter dashboard (using Tkinter library)
· Raspberry Pi OS
· Wi-Fi communication
· Browser or terminal for testing
The Arduino is used to gather data from sensors. The push button is an input for emergency or help request. The BH1750 sensor is for light measurement, and the PIR sensor is for motion detection. Arduino sends this data to Raspberry Pi server through Wi-Fi. The Raspberry Pi then displays the data on a dashboard for the caregiver to view the health of the patient.
Block DiagramPIR sensor:
VCC - 5V or 3.3V
GND - GND
OUT - Arduino digital pin
BH1750:
VCC - 3.3V or 5V
GND - GND
SDA - SDA
SCL - SCL
ADD - GND or not connected
Button:
One side - GND
On the other side - Arduino digital pin using INPUT_PULLUP
LED/Buzzer:
Positive side - Arduino digital pin
Negative side - GND
Step 2: Read Sensor Data on ArduinoI first tested each sensor separately using libraries and sample codes. I recommend you do the same. So, if there is a problem with a sensor, you can easily catch it.
Step 3: Send Data to the ServerI transferred the sensor values to the Raspberry Pi server after verifying the sensors and connecting the Arduino to Wi-Fi. This avoided the need for USB serial connectivity and enabled the Raspberry Pi to get real-time data from the Arduino.
Step 4: Create the Raspberry Pi ServerNext thing you must do is create a flask server using python and run that flask server on the Raspberry Pi. The server maintains the most recent sensor values after receiving data from the Arduino. To make sure the data was being received correctly, I tested the server using a browser and terminal commands.
Step 5: Create the DashboardI created a dashboard using Tkinter to show the patient status. The dashboard displays motion detection, light level, button alert status, and connection status. This makes it easier for the caregiver to comprehend what's going on in the patient's room.
Step 6: Test the Full SystemLastly, I covered the light sensor, activated the motion sensor, pressed the button, and verified that the dashboard updated properly to test the entire system. In order to confirm that the server was receiving data, I also checked the Arduino and Raspberry Pi connection.
Code Snippets to includeSensor reading snippetmotionState = digitalRead(PIR_PIN);
buttonState = digitalRead(BUTTON_PIN);
lightLevel = lightMeter.readLightLevel();
As you can see this part reads the motion sensor button, and light sensor values.
Wi-Fi/server sending snippetclient.connect(server, 5000);
client.print(data);
This part connects the Arduino to the Raspberry Pi server and sends the latest sensor values.
Flask route snippet@app.route('/latest')
def latest():
return jsonify(latest_data)
This route allows the dashboard or browser to request the latest sensor data from the server.
I gradually tried the system. I first tested each sensor one at a time with the Arduino Serial Monitor. So, I sent some simple data to the Raspberry Pi server to test the Arduino Wi-Fi connection. I then tested the Flask server using browser and terminal commands. Finally, I stood in front of the PIR sensor and pushed the button and dimmed the lights to test the whole system. The dashboard updated correctly, showing that the Arduino, server and dashboard could interoperate.
This assignment was useful to my learning because it taught me how to write embedded systems, not just create them, clearly. During work on the project, I learned how sensors, microcontrollers, Wi-Fi connection, a Raspberry Pi server and a dashboard can all work as one, cohesive system. Also, writing the teaching case forced me to think about the project from the perspective of another student because I had to explain in detail about the goal, hardware, software, wiring, code, and testing procedures. Overall, this project has increased my confidence in designing and presenting embedded systems.
**This article was created as part of an assignment submitted to Deakin University, School of IT, Unit SIT210/730 - Embedded Systems Development.**

















Comments