Embedded Systems
Assignment 3
Nursing Bed Alarm
Required equipment
- Arduino
- Open Smart - Rich Shield
- Laptop PC
Introduction
In this assignment you’ll use your laptop to send commands to the Arduino and receive results back. You will write an application on the laptop in C# and you will write an application on the Arduino in C.
A company specialising in products for home care for the elderly has an idea for a product. The new product im-proves safety and comfort of people confined to their beds by giving them controls to change the position of the bed as well as providing an alarm button in case of emergencies and monitoring the room temperature.
The system consists of three subsystems.
Subsystem 1: An Arduino system mounted onto the bed. This system is what the patient interacts with.
Subsystem 2: A small laptop under the bed. This systems interfaces with the Arduino and may forward alarms to the alarm center.
Subsystem 3: A remote server is the alarm center. This server receives an alarm and sends it to the personnel to take action. We will not build this system.
You will build subsystem 1 and subsystem 2.
Functional description
User interaction with Arduino
Display mode: Button 1 switches between three display modes.
Mode 1: The display shows the current time. The time is retrieved from the laptop pc.
Mode 2: The display shows the current temperature. The temperature is calculated from the on-board NTC or DHT11.
Mode 3: The display shows the angle of the headrest. Valid values are between 0-30 degrees.
Alarm button: Button 2 activates an alarm and must work at all times. When the alarm button is pushed the red LED switches on. An alarm is sent to the laptop PC and is shown in the laptop application. The alarm can only be reset from the laptop. When an alarm is reset, the red LED switches off.
Headrest: The knob increases or decreases the inclination of the headrest of the bed. The angle of the headrest can only be adjusted between 0-30 degrees. When adjusting the headrest the display mode switches automatical-ly to mode 3. You must use the full scale of the knob.
Other functionality.
Temperature monitoring: The system monitors the temperature at regular intervals. When the temperature drops below 16°C or rises above 27°C the system also triggers an alarm. It can be the same urgent alarm as with button 2 or a different less urgent alarm. The temperature is sent to the laptop application at regular intervals.
Laptop application
You will create an application in C# on your laptop. The laptop application shows: - The current status of the alarm,
- a button to reset the alarm,
- a history of all alarms,
- and the current room temperature.
The laptop application allows the user to reset an active alarm. When the alarm is reset the red LED on the Ar-duino also switches off.
The laptop application will send the time to the Arduino when requested. You can get time as a string in C# as follows:
String time = DateTime.Now.ToString("HHmm");
The application could like something like this: