Coding Partner for Very Small/Easy DIY Medical Equipment Retention Dongle

I have had to move into an assisted living facility. We wear emergency transmitter dongles that post directly to pagers that the nurses carry. The nurses often forget to leave their pagers for the next shift and take them home. This makes for a lack of coverage and that is dangerous for the residents.

I would like to help, by building key fob style dongles that attach to the pagers and monitor stations that would be placed at each of the two doors. When a pager gets too close to the door, alarms would sound and blink.

I think the project is as simple as tiny MCUs talking to each other over Bluetooth. The key fobs would constantly transmit their identity code. The monitors would constantly listen for the codes.

IIUC, this Seeed ESP32C3 might have all of the MCU power and BLE functionality that is needed for both the monitor and the key fob. And, they are cheap enough...
Amazon.com: Seeed Studio XIAO ESP32C3(Support Arduino) - Tiny MCU Board for IoT Controlling Scenarios, Wi-Fi, BLE, Battery Charge, and Rich Interface for Tiny Machine Learning : Electronics

This project could be used for all sorts of purposes... Keeping infants, dementia patients, or pets inside... Retaining expensive company tools... Anything that you need to keep track of.

I have considered RF anti-shoplifting tag systems. The tags are cheap. The monitors are very expensive!

I am thinking of using Bluetooth, because the monitor stations only need a range of maybe 3 to 6 feet. WiFi would have too much range.

So, I purpose to build the hardware (KiCad to PCB to working units,) if you will write the code. (I do not code and I am too old to learn. But, I know how the two interface.) Then, we will distribute it as open source. I will finance the hardware costs. Or, if someone knows of this project as fully developed, I would appreciate the link.

I look forward to working with you.

If your medical staff are "forgetting" anything, the solution is not more equipment, but medical and legal authorities.

That's quite a far-fetched story for having someone do your homework.

I choose to be part of the solution.

Please do not muddy the water.
From the guidelines...
Welcome to Arduino Forum — thanks for contributing!

  • Be kind to your fellow community members.
  • Does your reply improve the conversation?
  • Constructive criticism is welcome, but criticize ideas, not people.

For more, see our community guidelines. This panel will only appear for your first 5 posts.

Here is my extremely feeble attempt at the code for the monitor station. As I don't code, this is an exercise in the thought process (sort of using the comments as a flow chart to discover hardware needs/etc,) as opposed to trying to learn the particulars of syntax. It is also intended to show that there should not be many lines of code needed to accomplish the project. Yes, it is a silly mess, but it is helpful, for my stated purposes. Accordingly, there is no need to make comments as to the ineptness of the code, or how to correct it.

/*
Date: 8/24/24
Author: [t1d;] All Rights Reserved
Version: Monitor_0.1-First Draft

Monitor Code


Project Statements
The purpose of the project is to create a Monitoring and Alert System to prevent
vital equipment from being accidentally removed from the facility in which
it is employed.

The means will be 1) to attach a "key fob" type broadcasting unit to the equipment
and 2) to place monitoring stations at each doorway. When the equipment comes within
a short distance of the doorway, an audible alert tone will sound to remind the 
employee to leave the equipment in the facility.

It is proposed to use an ESP32C3 MCU as both Master Monitor and Slave [More politically correct terms, please?], as this MCU includes both Bluetooth and WiFi capabilities. Bluetooth methods will be attempted, firstly, as to make use of Bluetooth's limited broadcast and listening distances.

Considerations
- It is likely that the Master Monitor will be Mains powered, depending on
the location of wall outlets. A UPS battery backup might be of some value.
- The ESP32C3 has on-board lithium battery charge management capability. This would
be convenient for the use of rechargeable batteries. However, such a charging system
significantly extends the scope of the project.
- Alerts made with both sound and light by both the Monitor Station and the Key
Fob would be most effective. Vibration could also be added to the Key Fob.             

*/


// Includes?

void setup() {
  int alarm;        // Switch for alarm buzzer and lights/LEDs.
  int btCodeIn;     // To listen for equipment code.
  int alarmOnTime;  // Duration of alarm.
  // int triggeredUnit;  // Possible later code functionality. For documenting offending equipment ID.
  int idCode;    // Individual equipment ID codes. To trigger alarm and documentation.
  int idIncrem;  // To add identifier to idCode.

  // Configs
  alarm = 0;                     // Low/Off beginning switch state.
  alarmOnTime = 4000;            // Default alarm time is 4 seconds.
  idCode = "1257(int idCount)";  // Syntax? Identifier, for each piece of monitored equipment.
  idIncrem = (0, 9);
  pinMode(PC0, OUTPUT);  // Set pin PC0 as an output to drive alarm switch.
}

void loop() {
  for (int idIncrem = 0; idIncrem < 10; idIncrem++) {
    if (int btCodeIn() == int idCode) {  // How the Bluetooth functions is not known, yet. If the equipment is in the monitored zone...
      int alarm = 1;                     // Then, turn on the alarm.
      analogWrite(PC0, int alarm);       // To drive relay/MOSFET/etc to switch alarm sound and lights on/off.
                                         //[Millisecond Delay] = alarmOnTime;  // Sentax? Play the alarm for a length of time.
      int alarm = 0;
      analogWrite(PC0, int alarm);  // Clear the alarm.
      /* Document Offending Pager Optional Function
 triggeredUnit = code;
 printf = triggeredUnit; // Output to Serial Print, or wherever. 
 TriggeredUnit = 0;  // Clear triggeredUnit
 */
      return;
    }
  }
}

I extend my kindness to you by encouraging a safe, healthy and legal means to eliminate medical staff from "forgetting" their sworn duty. "Do no harm." Your project with the Arduino should be considered an experiment, not a solution to a grave situation.

I encourage experimentation in programming and controlling hardware. It is my hobby, too. I am certain you will do well, and wish you many happy hours of thought and deed.

Unfortunately, there is nothing simple about this proposal. Bluetooth is very complex and very difficult for beginners to master. Low power operation is required for long battery life, and that too is very difficult for beginners to master. Who will manufacture the small, sturdy "dongle" that the nurses will carry around, and the wall receivers with alarms?

If, for example, the battery in the "dongle" dies, the entire effort is wasted.

1 Like

Hint: I have observed that being done with RFID tags, check your local stores.

For liability reasons I do not plan on answering the question.

Thank you, to each and all for your contributions!

Hence, why the project needs a Master Coder. grin... As said, I am not trying to learn to code. I understand that coding "tricks" can be used to extend battery life, such as the Sleep function. The dongle may, or may, not have various alert features. If battery life prevents the dongle from having such features, the Mains powered door monitors can handle those functions, fully.

I will. As said, KiCad (implies the circuit design,) to PCB to working units.

The duty of checking and replacing the batteries will be assigned to the maintenance person and made a part of their monthly routine.
Cheers!

IIUC, the key fobs use energy from the transmission to power the response. If so, that's really neat.

You are a smart cookie - this is a good consideration. I will check will an attorney. However, I think it is covered under the "Good Samaritan" laws.

Thanks!

Common BLE tag and some Esp or nRF board to detect presence. Did I miss something?
On Home Assistant forum you find easily every possible and impossible solution...

Thanks for posting!

Yes, this is the concept. I knew about the DIY BT module boards. I did not know that they are offered as complete key fobs. The completed fobs appear to be priced very reasonably, as well. Using these will greatly simplify the hardware portion of the project build. Thanks!

I know nothing of Home Assistant, other than having heard the name. I thought that it was a line of commercially made/sold smart home devices. Is it a Maker/DIY site?

I will check out the Home Assistant site. But, please clue me in about it. And, a link to a related project would be helpful, as well.

Great leads! Thanks!

It's a lot of modifying/hacking/integrating commercial devices, but also diy - especially Esphome platform. Have a look.
I'm not sending you away from here, but HA guys are pulling presence detection out of thin air...

ps. Esphome platform is standalone, you don't need Home Assistant or any other smart home servers.

kmin, this is great information and a great site! Thank you!

"I'm not sending you away from here, but HA guys are pulling presence detection out of thin air..."
Nope, I did not feel rejected. But, thanks for your concern.

I posted a sister thread at HA, if anyone wants to follow that, too. I will leave this thread, here, to help whomsoever has a similar need and in hopes of getting more great tips.

Cheers!

Typical. Always making the lowest paid person get blamed for the body count when it was Designing, Engineering, Manufacturing and Management pushing out product at 95%.

I would consider buying more pagers, so the spares can be used when staff take their pagers home.
Maybe have a signing in book, to be used when the staff take or return a pager.
Maybe have a huge sign at the entrance/exit .... THINK PAGER!
Staff conditioning could be a simpler and cheaper route to take, but the Arduino solution would be more fun.

2 Likes