Nowadays, elderly people require more attention and care. They are more vulnerable to adverse drug reactions (ADR), whereas some forget to take their medications at the right time. Drug overdose is a serious problem and the victim could be either a child or an adult. Both adverse drug reaction and drug overdose can be detected by heart rate and body temperature measurements. I am going to solve this problem by providing an effective way to detect and prevent these three problems - ADR, Drug overdose and pill reminder. The app will also monitor and display real time health measurements such as heart rate and body temperature in Celsius and Fahrenheit. This app can be shared with the user's doctor and close contacts.
This project is an alternative and improved version of one of my previous projects: COVID-19 Remote Health monitoring system ( IoT )
Aim/ Objective of this projectI am going to build a real-time remote monitoring app using AppSheet platform which will also perform as a pill reminder and medication tracker. It is different from existing solutions because it has two-in-one purpose. You usually have a separate health monitoring app and a medication tracker app, but my solution will be an app which combines both. This is useful because it could help prevent serious effects of adverse drug reaction and drug overdose. These conditions can be detected beforehand and my app can automatically notify the subject's personal doctor or relative and even contact an emergency medical helpline if no one is available at that moment.
How does this work?This system could be made into a medical device and used to record the health measurements of people, especially the elderly. My IOT health companion app will display real-time health measurements and will also serve as a medicine tracker. The user should log their daily dosages and if they forget it, an alert will be sent to the person as well as his/ her close contact. The user is also able to record his/her health measurements and the date and time will also be automatically recorded. Before taking their health measurements, the user must practice hand hygiene - wash hands for at least 20 seconds - to prevent contamination. The user could touch his/ her face after using the device and it the device is contaminated, there is a risk of infection. A touchless faucet (https://www.hackster.io/RUCKSIKAA/automatic-faucet-touchless-using-arduino-for-covid-19-369b18) could be used for this purpose. For beginners, he/ she should be guided by someone.
After the person washes his/ her hands, the push-button allocated for the body temperature measurements must be pressed. The non-contact temperature sensor module will be used to take body temperature measurements of the person. After the measurement is taken, press the push-button again to record it. If the temperature is above 37°C, the person will receive an emergency alert on his/her mobile phone and the personal doctor's mobile phone via my app. The notification will also be sent to the closest contact of this person if preferred.
If the temperature is not above the critical value (37°C), he/ she can proceed to measure the heart rate. Before measuring the heart rate, the second push-button must be pressed. Measuring heart rate would require the person to place his/ her finger on the sensor as the measurements are taken by reflective method. If the heartbeat is detected, the normal LED will light up. While the heart rate measurements are being taken, the two-colour LED module will be green in colour. The LED will turn red while the body temperature is recorded. As I have already mentioned, the push-button should be pressed again to record the measurements.
After the health measurements are taken, the person should hover his/ her finger over the IR tracking sensor. The measurements will be logged in the Google sheets via the AVR-IoT WG development board's encrypted communication. If the temperature exceeds 37°C, the cell will turn red - due to conditional formatting. This will also happen if the heart rate is above the average heart rate. If the person has heart conditions, his/ her heart rate will be compared to previous measurements. The measurements will be logged in the IOT health companion app as real-time data. This app can be shared with preferred people: the user's personal doctor or close contacts like the person's family members. Sharing this app will make it easier for the shared contacts to monitor the person's vital measurements and they will also be notified if any abnormal measurements are made or if the person has forgotten to take his/ her medicine dosage.
AVR-IoT WG Development BoardI will be using the AVR-IoT WG development board for this project. I won the hardware after submitting my idea for the free hardware application. AVR-IoT WG microcontroller needs a UPDI/ FTDI programmer to be compatible with Arduino IDE, therefore I have decided to use my Arduino Nano as a UPDI programmer in this case.
The AVR-IOT WG uses the ATmega4808 in a 32 pin package. 32 pin standard is the correct pinout for this board. Note that UART2 is connected to the nEDBG chip (often referred to as the debug serial port). This means you'll have to use Serial2.begin(baud)
to print to the serial monitor. You'll also have to choose Atmel nEDBG (ATSAMD21E18) as your programmer to upload code. For more information about this board please refer to the user guide and its schematic. [source]
I followed this guide to connect my AVR-IoT WG Development board with Google sheets: https://www.hackster.io/abouhatab/avr-iot-wg-directly-in-google-sheets-783b6b#schematics
Arduino NanoAs I didn't have a FTDI programmer, I will be using my Arduino Nano as a UPDI programmer and for this purpose I will be using the jtag2updi library, which enables an Atmega 328p AVR microcontroller to perform as a UPDI programmer and helps us to program other microcontrollers.
AppSheetI have used the AppSheet platform to create apps. AppSheet is a no-code platform and it enables us to create apps using the data from Google sheets, Excel, Smart Sheets, SQL and more. In this case, we will be using the data stored in Google Sheets. As I have already mentioned, I will be creating an app to display real-time data recorded by the heartbeat sensor and the temperature sensor. The app will also serve as a medicine tracker in which users can track their daily medicine dosages and this will be helpful if they forget to take their medicines. If the daily dosage is not logged, an alert notification will be sent to the user's phone and to that of the closest contact. This can also help to prevent over dosage if the user takes another dosage because of his/ her forgetfulness. This app will also have a calendar with it.
I followed the guide in this page to create my app: https://solutions.appsheet.com/how-to-create-an-app
This is my app: https://www.appsheet.com/start/cd674038-08f0-42f1-9e9e-5b296abe4b9f
The app function can be modified by adding the doctor's and the closest contact's email addresses so that alerts can be sent to them if critical values or over dosage is recorded.
01.Prepare your data [Source]
The AppSheet platform allows you to start from an array of data sources like Google Sheets, Excel, SmartSheet, SQL, and more. For spreadsheets and databases, make sure that your top row is your header row so that AppSheet understands your data. In my project, we will be using the Google sheets to prepare our data.
02. Connect your data to Appsheet to create an app [Source]
You always keep control of your data with AppSheet. Connect your cloud drive to AppSheet and select the file you want to use to create an app. If you decide to delete the app, don't worry. The data will remain in your cloud drive.
03. Refine how your app uses your data. [Source]
Your app will automatically generate. AppSheet uses the data in your column header as fields (i.e. the first row of your spreadsheet). These fields determine how the app captures or displays data.
Navigate to data section of the editor. Select the Column tab to edit the properties of each column. Click the Slices tab to create smaller data sets from your main data source.
04. Refine how your app presents your data. [Source]
Before you build your app interface, you will want to specify how your data is being used in the Data tab.
Add additional tables to your app by going to Data>Tables and click on “New Table”
In Data>Columns, you’ll see a list of each column you have in your table listed in a field. The column structure of your connected data will determine what features you're able to add to your app. For example, if you want to capture and display images in your app, there must be a column in your data set as 'Image'.
By either clicking on the pencil to the left of each field, you can adjust settings for how the app will interact with your data. Here’s two examples of the settings you can adjust here:
- Check Show if you want this data to be displayed in your app (some data you may want to keep hidden)
- Type lets you specify what type of data is in that column. For example, if you have an “Address” column in your data, you need to make sure that column type is set to Address.
The Data section can initially feel a little overwhelming, as there are a lot of powerful features available in it, but don’t worry--as you create your views, you’ll be able to go back and adjust it as needed. Plus, we provide a lot of resources to help you know what to do.
Learn more about setting up data interactions here.
05. Add actions, workflows, and reports to your app. [Source]
AppSheet makes it easy to create and customize views by providing ready-to-use view templates that you can customize. To create a view, go to the UX tab (UX stands for user experience, or how people interact with your app), click on the Views section and select “New View”. From here, you can:
- Update the View Name
- Select which data the view should use
- Choose which view type you want. Options include Calendar, Map, Form, Chart, and Card, to name a few. Play around with each view to see which one works best.
- Choose how the view can be accessed by setting its Position. Your view can either be accessible along the main menu at the bottom of your app or via the reference menu in the top left corner of your app
- Specify which row of data goes where, in the View Options area
- Choose the Display Name and Icon for your view in the Display area
To customize your app’s look and feel, go to UX>Brand and UX>Format Rules, where you can specify your theme, colors, logos, and more!
Learn more about views and UX here.
06. Define your app’s security settings. [Source]
The Behavior tab in the AppSheet editor lets you set up custom buttons and actions that can be used in a wide range of ways. These can be set by going to Behavior>Actions>New Action. From there you can set the Action Name, specify the type of action to occur, and, if you want that action to be triggered by a button, you can specify the button’s Look and Feel.
Workflows and Reports let you set up automations, such as emails or texts being sent, data being added or updated, or new calendar events being added. Workflows and Reports are very similar, with one key difference: Workflows are automations that are triggered when certain actions occur, while Reports are automations that are triggered based on periodic schedules.
Finally, if you want to be able to use your app when its not connected to the internet, you can enable offline use in the Offline/Sync section
Learn more about actions, workflows, and reports here.
07. Test your app with real users. [Source]
Whenever you’re ready, you can easily share your app with others to test it. Go to the Users tab, and in the Users section type the email addresses for the people you want to to share your app with. Once you verify you’re human, you can customize the email message they will receive from AppSheet, inviting them to use your app. From there, they can either download the AppSheet app on their device, or open your app in a web browser.
Finally, once you’ve finished making changes to you app, you can officially deploy it, which will activate all the services in your app. Go to Manage>Deploy>Deployment Check and click “Run Deployment Check.” AppSheet will analyze your app to make sure it’s working properly and give you a full report. If you’re ready for it to be deployed, select “Move app to deployed state.” Your app is now live!
Learn more about managing users here.
08. Deploy and share your app. [Source]
Congratulations on creating your first app! From here, you can continue improving your app or start on your next idea! AppSheet provides numerous resources you can use to learn how you can leverage the platform to build your own tailored apps.
Libraries required for this projectYou will be needing the following libraries for this project (the first three will not be needed if you use the Non-contact temperature sensor module and MAX30100/02 high sensitivity pulse oximeter):
- PulseSensorPlayground library - https://github.com/WorldFamousElectronics/PulseSensorPlayground
- OneWire library - https://github.com/PaulStoffregen/OneWire
- DallasTemperature library - https://github.com/milesburton/Arduino-Temperature-Control-Library
- Arduino ECCX08 for Cryptoauthentication - https://github.com/arduino-libraries/ArduinoECCX08
- WiFi101 - https://github.com/arduino-libraries/WiFi101
- MCP9808 Temp sensor (if you are using this instead of the non contact sensor) - https://github.com/adafruit/Adafruit_MCP9808_Library/blob/master/Adafruit_MCP9808.h
- Wire library (Built-in library)
- jtag2updi library - https://github.com/ElTangas/jtag2updi
The heartbeat sensor which I have used in this project is quite tricky to work with. You should not place your finger on it too lightly or too hard because your blood flow would be interrupted and the measurements will be less accurate and the precision of the results will be affected.
The heartbeat sensor module used in this project uses the reflective method. The IR LED in the heartbeat sensor module emits Infrared wave, and the photodiode measures the amount of light reflected. The intensity of the light reflected depends on the blood flow in your finger. This is how a heartbeat sensor work.
Future workIn future, I will upgrade this device by adding more sensors so that it could record all vital measurements and be more accurate.
I used the AppSheet platform as my FireBase account required me to pay to have access to the Google cloud. In future, I will use the Firebase platform and create an app using Android studio to improve this project.
Comments