Martin Bradley
Published © Apache-2.0

COVID-19 Compliance Tracking SIMPLIFIED

Build COVID-19 compliance tools to help ANY enterprise protect their employees and patrons to help SAVE LIVES and help business OPEN SAFELY.

AdvancedShowcase (no instructions)8 hours18
COVID-19 Compliance Tracking SIMPLIFIED

Things used in this project

Hardware components

Android device
Android device
Used to communicate with BLE Thermometer.
×1
nRF52840 Multi-Protocol SoC
Nordic Semiconductor nRF52840 Multi-Protocol SoC
Used nrf52840 Dev. Kit and nRF52840 Dongle for prototyping BLE Thermometer.
×1
Texas Instruments LMT70 - ±0.1°C ultra-small, high-precision, low-power CMOS analog temperature sensor
Used ±0.1°C ultra-small, high-precision, low-power CMOS analog temperature sensor.
×1
LMT70 board
Small Board for building prototypes
×1

Story

Read more

Schematics

nRF52840 Dongle Prototype

Simple connection diagram LMT70

Test Setup

Nordic boards with with LMT70 mountedon small test boards.

Code

React-Native questionnaire application GraphQL schemas

JavaScript
The schema can be used to build a Fullstack application using AWS Amplify
//Using AWS it is simple to create and deploy a fullstack React-Native application

//NOTE - The AWS documentation to build a fullstack project is excellent.
//You should be able to follow the AWS documentation to build the questionnaire application. 

//without authentication
//https://docs.amplify.aws/start/getting-started/setup/q/integration/react-native
//Set up fullstack project
//Use the following schema in the demo for the questionnaire

type Todo @model 
{
 	id: ID!
  owner: String
  fever: Boolean
  temperatureC: Boolean
  temperature: Float  
  smell: Boolean
  muscle: Boolean
  throat: Boolean
  cough: Boolean
  breath: Boolean
  chills: Boolean
  headache: Boolean
  diarrhea: Boolean
  hadc19contact: Boolean
  asktoselfisolate: Boolean
}


//Using AWS Amplify it is simple to create an application with authentication.
//https://docs.amplify.aws/lib/auth/getting-started/q/platform/js
//Use the following schema in the demo for the questionnaire

type Todo @model @auth(rules: [{allow: owner}])
{
 	id: ID!
  owner: String
  fever: Boolean
  temperatureC: Boolean
  temperature: Float  
  smell: Boolean
  muscle: Boolean
  throat: Boolean
  cough: Boolean
  breath: Boolean
  chills: Boolean
  headache: Boolean
  diarrhea: Boolean
  hadc19contact: Boolean
  asktoselfisolate: Boolean
}

//don't forget to destroy your AWS resources that were created during this process so you don't get billed.

Nordic HTS example - temperature reading handler

C/C++
This explains how to read the 12 bit Analog input to be able to have 0.1 degree C accuracy.
//Health Thermometer Application running on nRF52 dev kit. 

//The Nordic sample application can be found here:
// https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fble_sdk_app_hts.html

//After you download the nRF5SDK16 you can find the sample application in the following directory:
//nRF5SDK160098a08e2\examples\ble_peripheral\ble_app_hts

//I strongly recommend that you run this application in debug mode in SEGGER Embedded Studio ( Nordic version provided free for nRF52 ). 
//The example application runs a function for populating simulated health thermometer measurement.
//static void hts_sim_measurement(ble_hts_meas_t * p_meas)
//After deploying the .hex file to your device you can use the Nordic nRF Connect, on your mobile device, to view the simulated data over a BLE connection.
//https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile

//After you are comfortable with the simulator you can add a handler for getting the temperature from a sensor.
//The example code is ~900 lines long. Instead of putting it here I'm going to just describe adding the handler.



//Create a recurring timer to read the 12 bit analog input every 1 second.
APP_TIMER_DEF(m_our_char_timer_id);
#define OUR_CHAR_TIMER_INTERVAL APP_TIMER_TICKS(1000) // 1000 ms intervals

// Create timers.
err_code = app_timer_create(&m_our_char_timer_id, APP_TIMER_MODE_REPEATED, timer_timeout_handler); 
APP_ERROR_CHECK(err_code);

//Start the timer
static void application_timers_start(void)
{
  ret_code_t err_code;

  // Start application timers.
  err_code = app_timer_start(m_our_char_timer_id, OUR_CHAR_TIMER_INTERVAL, NULL); 
  APP_ERROR_CHECK(err_code);
}

//Have handler call function to measure temperature and report reading to BLE client
void timer_timeout_handler() {
  temperature_measurement_send();
}

//rem simulated function call, read analog in and convert and then send BLE message ever 1 second
static void temperature_measurement_send(void)
{
  ble_hts_meas_t simulated_meas;
  ret_code_t   err_code;

  if (!m_hts_meas_ind_conf_pending)
  {
    //hts_sim_measurement(&simulated_meas);

    READ YOUR TEMPERATURE SENSOR HERE

    err_code = ble_hts_measurement_send(&m_hts, &simulated_meas);
etc..

TODO - I've run out of time, I wanted to add more detail. Will add in the future.

Credits

Martin Bradley

Martin Bradley

0 projects • 0 followers
I'm an engineer interested in using microcontrollers to improve efficiency.

Comments

Add projectSign up / Login