Many people depend on hospital beds to sleep comfortably, change positions or avoid health risks such as pressure/bed sores. I proposed the idea of making a voice controlled hospital bed for a make-athon I helped organize in 2017. The team who worked on it did an excellent job making an external casing which pushed the buttons but unfortunately that meant the original buttons were no longer available for the user to access. With this project, I have set out to make the first step in building an in line circuit that eliminates the need for cutting cables or tampering with the bed while giving remote access to the beds six functions. I was paralyzed in 2006 and have always thought about an environment I could fully automate and control inspired by Wallace and Grommets catapulting bed, dressing and breakfast alarm contraption. Here is to making that happen.
ResearchFor this project I am using an Invacare 5490 IVC fully electric hospital bed. The cable for the remote uses an RJ45 10 pin connector. All 6 buttons are momentary push-buttons with on side high which when pressed pulls the other signal wire high for the corresponding function. I was surprised to find upon testing that this no load voltage was 34V and pulls ~60mA.
Color Code
- Gray = 1, ?? not used?
- Blue = 2, head up
- Purple = 3, bed down
- Red = 4, common power
- Brown = 5, ??
- White = 6, head down
- Orange = 7, feet up
- Green = 8, feet down
- Yellow = 9, bed up
- no 10th pin after all
I first set out to use PNP Transistors (2N3906) but after getting it to work with LEDs, I was unable translate that over to switching the remote so I fell back on using two relay boards I had laying around given the limited time I had to finish. I hope to change this in the future.
There is documentation on how to wire your given relay board and also most boards have it written directly on it. The connection you will have to make on each relay is simply connecting the corresponding colored wire from the bed to the common red power wire. This happens when the relay is energized by the logic wire from the Photon connected to D0-D5. Also don't forget the relay boards need a Vcc of 5V while the Particle needs Vcc 3.3v-5v. I am powering all these for now from a 5v breadboard power supply with a 9v battery though I don't suggest that.
I will add a Fritzing circuit diagram soon
Here is a bed is a short video of me controlling the bed with a Particle Photon via their Tinker app.
EnclosureA quick CAD for a laser cut acrylic enclosure
We used Ron Lisle's article Alexa Controlled Photon Project Without Alexa Coding to control a simple LED. This was then changed to control 2 functions, head up and head down. Currently the controls are backwards but will soon be fixed once I figure out how.
#include <IoT.h>
#include <PatriotLight.h>
IoT *iot;
void setup() {
iot = IoT::getInstance();
iot->begin();
// Create devices
//Note: D7 is not a PWM pin, so it can only turn on or off
// Alexa will respond to "Alexa, turn L E D on" or "Alexa, turn off L E D"
// You can change the name 'LED' to whatever you like, but it needs to be something
// that Alexa can recognize.
Light *headUp = new Light(D0, "Head Up");
// Tell IoT about the devices you defined above
iot->addDevice(headUp);
// The "behavior" defines additional commands that control things.
// Note that the name of each device can be used to control it, so behaviors are
// not required unless you want to control more than one device with a commands.
// Alexa will respond to "Alexa, turn photon on" or "Alexa, turn off photon"
// You can change the word 'photon' to whatever you like, but it needs to be something
// that Alexa can recognize. For now, use a single word.
iot->addBehavior(new Behavior(headUp, "photon", '>', 0, 0)); // Off
iot->addBehavior(new Behavior(headUp, "photon", '=', 0, 100)); // On
Light *headDown = new Light(D1, "Head Down");
iot->addDevice(headDown);
iot->addBehavior(new Behavior(headDown, "photon", '>', 0, 0)); // Off
iot->addBehavior(new Behavior(headDown, "photon", '=', 0, 100)); // On
}
void loop() {
iot->loop();
}
Next Steps- Fix Alexa Skill
- Design PCB so wires don't fall out
- Improve enclosure
- Move to Snips for a home assistant that can work when the WiFi is out
- Always make it better?
- Create for other beds
If anyone has comments, insights or suggestions, please comment.
Comments