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.
Subscribe to:
Posts (Atom)