Wednesday, August 12, 2015
Sunday, August 9, 2015
Our Finished Product (Voila!)
The Arduino and relay in action |
We have finally reached the end of our programming journey with the Bed Control apps. We first had to strip the wires of a serial cable in order to connect them to the relay pins. We diagrammed which wires went to which connections and figured out which functions we wanted them to perform.
We then attached them to the relay board. The serial plug will ultimately be connected to the bed itself, allowing for both manual control (with the already-existing buttons to push) and voice control of the bed.
The serial plug that connects to the bed and relays |
Above: the iPad app interface Below: the Arduino (behind) and relay board system |
To sum everything up, here's how our project works:
1. Mom tells Siri "Hey Siri, open Bed Up" (or Bed Down, Knees Up, or Knees Down)
2. The app entitled Bed Up opens, which contains a simple program that causes the iPad to send a Bluetooth signal to the Arduino (the red-colored board in these pictures), which is running a script to constantly check for the iPad signal
3. This in turn tells the Arduino to send an electric current to the pin that is attached to the wire that controls the bed up function
4. The current travels from that wire (see green wires above) to the relay board (white board above), where it is carried through traces underneath the board to the designated relay (the yellow rectangles)
5. The current triggers a switch in the relay to close a circuit, which allows the electrons to flow to a designated wire of the serial plug (see colorful wires in above image)
6. The electricity flows through a colored wire to the bed controller, into which the serial plug is plugged. This causes the bed to tilt up for 5 seconds, after which the Arduino is programmed to set the pin low again, cutting off the electricity and stopping the bed's motion.
All of this happens in a matter of seconds!
See the software interface for the iPad app above (it was not essential to have so many options, but it allows for manual testing. The program connects to the Arduino automatically, so pushing the buttons on the interface is not needed in order for the program to work).
Mom is now happily able to control this simple aspect of her life, making herself more comfortable in bed without having to rely on us to push the button for her to tilt the bed.
Sunday, August 2, 2015
Discovering the Wires
August 2nd, 2015
I opened up the current manual bed controller so we could have a look inside. What we found was a circuit board showing traces from each of the buttons to each of the wires in the main cord that connects the controller to the power source. We documented which wire corresponds with each button (and subsequent bed function) and took detailed notes so that we could find which wires would then correspond on the 9-pin serial connector (shown below).
We found out the following:
- Bed up is the white wire
- Bed down is the red wire
- Knees up is the green wire
- Knees down is the brown wire
We then looked inside the connector to see which wire went to which hole. Each of the five (including the black ground wire) were located on the top row on five pins. From left to right, they were as follows: brown, green , black, white, red
We also assigned each of the relays on the relay board a specific function, so relay 1 = bed up, relay 2 = bed down, relay 3 = knees up, and relay 4 = knees down.
We tested to see if the LEDs by each relay on the relay board would light up with an electronics testing lab, as shown below.
Thursday, July 16, 2015
Checking In (#1)
July 16th
We downloaded a few sample sketches to the Blend device and tested them successfully on an iPhone. Our next step is to modify the SimpleControls sketch (which was already built in as a sample) so that instead of simply lighting up LEDs, it will adjust the four bed pins to tilt up, down, bring knees up, and bring knees down. We will then connect the blend to the bed controller to test it and create 4 different iPad/iPhone apps for each of the separate bed functions.
We downloaded a few sample sketches to the Blend device and tested them successfully on an iPhone. Our next step is to modify the SimpleControls sketch (which was already built in as a sample) so that instead of simply lighting up LEDs, it will adjust the four bed pins to tilt up, down, bring knees up, and bring knees down. We will then connect the blend to the bed controller to test it and create 4 different iPad/iPhone apps for each of the separate bed functions.
Saturday, May 2, 2015
Where It All Began
May 2nd, 2015
For a while now, we have been thinking about creating an iPad app that will allow mom to voice control her electric-powered hospital bed. After doing some research, we think that it is actually quite a realistic goal. We are modeling much of our project off a garage door-opener project that we saw online (created by Delian Asparouhov). If it works, she will be able to tell Siri to tilt her bed up or down, and the bed will then do so for a set time interval.
All it takes: an Arduino Blend board, a relay board, lots of wires, a 9-pin serial plug, a mac computer for programming, a 9V power adapter, an iPad, and a mission.
We downloaded Arduino IDE and followed the "getting started with Arduino" instructions on creating a program that would light an LED light and then turn it off every second. We modified the program to include two bulbs, where one went on, the other went on, one went off, and the other went off. We wired a breadboard to make it work, which enabled us to have multiple wires connecting to the same port. In this exercise, I learned how relays work to electromagnetically output a much larger current than what they originally received. I was able to do much of the coding for the testing because I am familiar with the similar Processing environment.
In sum, OUR MISSION is to create 4 iPad apps to be activated by Siri to open 4 different switches that either raise, lower, or adjust the knees on my mom's hospital bed so that she can be more independent in making herself comfortable.
In sum, OUR MISSION is to create 4 iPad apps to be activated by Siri to open 4 different switches that either raise, lower, or adjust the knees on my mom's hospital bed so that she can be more independent in making herself comfortable.
Subscribe to:
Posts (Atom)