Autobed: A Web-Controlled Robotic Bed

We (the Healthcare Robotics Lab at Georgia Tech) have developed an additional module for an Invacare fully electric hospital bed (Model 5410IVC) so that the bed can be controlled from a web-based interface. This module can be easily plugged between the hand control and the Invacare bed, without having to modify any existing hardware on the bed. We call a bed so modified an ‘Autobed.’ With this feature, users who are unable to operate the standard bed controls, but can access a web browser, are able to position the bed by themselves without having to rely on a caregiver (for example, patients with quadriplegia). This page describes how to make the Autobed module using relatively inexpensive, commercially available hardware. Note: Documentation and build instructions for the older, deprecated Autobed v1 are available here.

WARNING: THIS WEB PAGE AND ITS ASSOCIATED CONTENTS DESCRIBE PROTOTYPE RESEARCH HARDWARE AND SOFTWARE. USING THESE MATERIALS OR DERIVATIVE MATERIALS COULD ENTAIL RISKS, INCLUDING THE RISK OF SERIOUS BODILY HARM. AS DETAILED IN THE SOFTWARE LICENSE AND HARDWARE LICENSE, WE PROVIDE THIS INFORMATION “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.

Once completed, the Autobed module plugs in between the hand control unit (provided with the bed by the manufacturer), and the bed controller box as shown in the image below (left image). A web interface (like the one in the image to the right) can be used to control the bed.

Autobed_case_img_completed_buttons_in Autobed_GUI

Warning: The bed may be damaged if the 2 right-most pins (pins #1 and #2 of 10) of the handset jack on the motor control box are electrically shorted while the bed is powered. For this reason, unplug the bed from power before making any modifications or before attempting to connect or disconnect the Autobed adapter box to the bed.

Table of Contents

  1. Overview
  2. Raw Materials and Equipment
  3. Open Hardware: Building the Autobed
    1. Electrical Circuit Assembly
    2. Enclosure, Electrical Connections, and Assembly
  4. Open Source Software: A Web Controlled Autobed
  5. Using the Autobed
  6. Troubleshooting
  7. Additional Notes
  8. Support
  9. License
  10. The Team

Overview

Autobed Estimated Price: ~$80
Invacare Bed and Mattress Estimated Price: ~$2000 MSRP (out-of-pocket costs may be lower with Medicare subsidy in US, or if purchased from 3rd-party sellers)
Total Estimated Time: ~4:30 (hrs:mins)

The Autobed adapter box is arranged as follows: A Raspberry Pi single-board computer serves a web interface. When a web-browser loads the web interface, it makes a websocket connection to the Raspberry Pi. Commands from the web interface control the General-purpose input/output (GPIO) pins of the Raspberry Pi. The digital GPIO signals control an optoisolator circuit that mimics the hand-controller typically used with the bed. The original hand controller is connected in-line, and continues to work as usual, even when the Autobed adapter box is powered off.

The process of creating the Autobed adapter box occurs in three main stages: assembling the control circuit, assembling the connection and enclosure hardware, and installing the software. In the first section, ‘Open Hardware: Building the Autobed’, we describe how to construct the Autobed adapter box to relay commands from the web interface to the bed control box. In the second section, ‘Open Source Software: A Web-Controlled Autobed’, we describe how to setup the software for the Autobed adapter box on a Raspberry Pi. We provide detailed instructions for each step along with usable code. The pictures below show the finished Autobed system.

 

Autobed_case_img_complete_plugged_in

Autobed_case_img_completed_buttons_in
Autobed_case_img_completed_inside_connected

 

NOTE: We have developed and tested this method on the Invacare model 5410IVC bed, and it may or may not work for other models manufactured by Invacare. Do not attempt this modification on hospital beds from other manufacturers. By performing this modification, you will probably void the warranty on your bed, so proceed with caution.

Skills Required:

Raw Materials and Equipment

Here are the required materials and equipment with suggested retailers. You may be able to find these materials at lower prices from other vendors depending on your location. See the alternatives column of the tables below to see if an alternative part can be used.

  1. Invacare Bed
  2. Tools Required:
    • Soldering iron, w/small diameter solder
    • Phillips screwdriver
    • Needle-nose pliers
    • Wire stripper
    • Multimeter
    • Shear cutter (for clipping wire after soldering to PCB)
    • Drill (Drill Press preferred), w/5mm and 3.5mm bits
    • Hot Glue Gun, w/Hot Glue Stick
    • Felt-tipped Pen/Marker
    • Computer
  3. Parts Required: 
Raspberry Pi and Accessories
Description Vendor Part # Quantity Cost Total Alternative
Raspberry Pi Model B + 512MB Element14 1 $25 $25 Another model of the Raspberry Pi with 2×20 GPIO pins (Raspberry Pi 2, B+, A+)
8+ GB Micro SD Card Amazon 1 $8.95 $8.95 Compatible SD Cards
SD card reader/writer 1 May be built in on your computer
Wireless USB adapter or Ethernet cable Amazon 1 $9.23 $9.23 Any RPi Compatible Wi-Fi Adapter

 

Circuit Components
Description Vendor Part # Quantity Cost Total Alternative
Perma-Proto HAT for Pi Mini Kit Adafruit 2310 1 $4.95 $4.95
Brass M2.5 Standoffs for Pi HAT Adafruit 2336 1 $0.75 $0.75
22-24 AWG solid-core insulated wire Sparkfun 8022 1 $2.50 $2.50 Any wire suitable for prototyping.
1/8 watt 150 ohm resistor DigiKey CF18JT150RCT-ND 6 $0.10 $0.60 Any 150 ohm (+/-5% or less) resistors
PS2501-1-A optoisolator (1-channel) Digikey PS2501-1A-ND 6 $0.52 $3.12 Also available in 4-channel chips. Need 6 channels total.
7-pin Male PCB Headers Molex 22-27-2071 2 $0.49 $0.98 Various Suppliers
7-circuit Molex Crimp Housing Molex 22-01-2075 2 $0.45 $0.90 Various Suppliers
Crimp Terminals Molex 08-50-0136 14 $0.72 $1.01 Various Suppliers, Spares recommended
Breakaway Headers Sparkfun PRT-00116 1 $1.50 $1.50 Various Suppliers
2-wire Jumpers Sparkfun PRT-10362 1 $0.95 $0.95 Various Suppliers
Green LED Sparkfun COM-09592 1 $0.35 $0.35 Various Suppliers

 

Enclosure and Mounting Hardware
Description Vendor Part # Quantity Cost Total Alternative
Plastic Box (Autobed Housing) Digikey HM1095-ND 1 $7.51 $7.51 Any box in which holes can be made easily that is at least 5″x 4″x 3″
Raspberry Pi Plastic Case Adafruit 2285 1 $5.00 $5.00 NO LID REQUIRED
Strain Relief Cord Grip McMaster-Carr 69915K52 1 $2.82 $2.82 Any strain relief grip for ~0.19mm cable
Female to Male Ethernet Cable Cable Leader C5203-3200 1 $3.17 $3.17 Any female to male Ethernet extension cable
2+ ft. Ethernet cable Newegg N82E16812452074 1 $0.99 $0.99 Any Ethernet cable

 

Open Hardware: Building the Autobed

This section describes the assembly of the hardware necessary to relay inputs from the web interface to the bed.

Total Estimated Time: ~2:30 (hrs:mins)

Electrical Circuit Assembly

The Invacare Bed is designed to be operated by a six-button, corded remote control. This control plugs into the motor control box (MCB) with a 10-wire, Ethernet-like cable. When connected to the MCB, pin #2 on this cable carries 35V to the handset. Each button in the handset is a physical switch, which, when closed, allows 40 mA of current to flow from the 35V line back into the MCB where it activates one of 6 relays (1 per motor direction). This relay then engages one of the motors, moving the bed.

Autobed_hand_control_circuit

A circuit can be constructed that uses optoisolators to emulate these physical buttons on the hand remote. A optoisolator (also called an ‘optocoupler,’ or ‘optoisolator’) contains a light-emitting diode (LED) and a light-sensitive transistor. When current (here, from a GPIO pin on a Raspberry PI) flows through the LED, the light produced allows current to flow through the light-sensitive transistor. We use six of these optoisolators to allow current to flow from the 35V wire back to each of the motor relays. The schematic below shows the circuit diagram for micro-controller command of a single relay. This circuit will be repeated 6 times, once for each relay.

Autobed_circuit_v2

A Perma-Proto Mini HAT from Adafruit provides the base for the circuit used to control the Autobed system from the Raspberry Pi. This prototyping board connects securely to the Raspberry Pi, exposes the needed GPIO pins, and provides sufficient room for the required circuit components in a compact size. Instructions for building the circuit follow with detailed pictures.

Parts Needed:

  • Soldering Iron w/Solder
  • Multimeter (to check circuit)
  • Solid-core wire
  • 1 Perma-Proto Mini HAT
  • 6 PS2501-1-A optoisolators
  • 7 150 ohm resistors
  • 2 7-pin male, polarized PCB headers
  • 1 2-pin breakaway header

NOTE: All subsequent instructions will refer to the board as viewed from above (looking at the labeled, printed side) with the header at the top (as seen in the following images).

  1. (Estimated time: 15 mins) We first place the optoisolator chips onto the Perma-Proto board. Solder each of the optoisolator chips into place, across the central span, end-to-end in consecutive columns of the Perma-Proto board, with pins 1 and 2 on top side (nearest the GPIO breakouts and GPIO Header (there is a dot on the chip by pin 1, and a groove along the edge of the chip on the same side as pins 1 and 2)). Start at the left edge the Perma-Proto board. The optoisolators should all be placed to the left of the groove cut for the Raspberry Pi camera cable.
    Autobed_circuit_img_optoisolatorsAutobed_circuit_img_optoisolators_pic
  2. (Estimated time: 20 mins) We then connect the cathode of the LED of each optoisolator (pin #2) to the Raspberry PI’s ground on the Perma-Proto board. Solder wires from the Perma-Proto board’s ground strip near the top of the board to any hole in the column of pin #2 on each optoisolator chip. Pre-cut and stripped jumper wires may be useful here, but are not necessary.Autobed_circuit_img_input_groundsAutobed_circuit_img_input_grounds_pic
  3. (Estimated time: 10 mins) We next connect software-controllable GPIO outputs from the Raspberry PI to the anode of the LED of each optoisolator through a 150 Ohm current-limiting resistor. The 150 Ohm resistance is chosen to maximize the current through the optoisolator LED without drawing more power than is allowed from a single GPIO pin on the Raspberry PI. Solder a 150 Ohm resistor to pin 1 of each optoisolator chip from GPIO through-holes 4, 17, 27, 23, 24, and 25 respectively from left to right. Ground wires and 150 Ohm resistors will now alternate down one side of the optoisolators, in 6 pairs. This completes the inputs to the optoisolators.Autobed_circuit_img_resistorsAutobed_circuit_img_resistors_pic
  4. (Estimated time: 20 mins) We next need to connect the 35V source from the motor control box to the collector of the output transistor of each optoisolator (pin #4). Solder a wire from the the bottom right corner through-hole on the Perma-Proto board (will be connected to the 35V line later) to the bottom hole in the row connected to pin 4 of the right-most optoisolator.Now, solder a wire from the second-to-bottom hole in the same row to the second-to-bottom row connected to pin 4 of the next optoisolator (two columns to the left). Now connect the bottom hole of this row with the bottom hole connected to pin 4 of the 3rd optoisolator. Continue this alternating pattern until the optoisolators have all been connected together via pin 4 (see images below). Pre-cut and stripped jumpers may be useful here, but are not necessary.
    Autobed_circuit_img_35V_linesAutobed_circuit_img_35V_lines_pic
  5. (Estimated time: 20 mins) We next need to connect the 35V source from the motor control box to the collector of the output transistor of each optoisolator (pin #4). Solder a wire from the the bottom right corner through-hole on the Perma-Proto board (will be connected to the 35V line later) to the bottom hole in the row connected to pin 4 of the right-most optoisolator.Now, solder a wire from the second-to-bottom hole in the same row to the second-to-bottom row connected to pin 4 of the next optoisolator (two columns to the left). Now connect the bottom hole of this row with the bottom hole connected to pin 4 of the 3rd optoisolator. Continue this alternating pattern until the optoisolators have all been connected together via pin 4 (see images below). Pre-cut and stripped jumpers may be useful here, but are not necessary.Autobed_circuit_img_wire_jumpersAutobed_circuit_img_wire_jumpers_pic_2
  6. (Estimated time: 20 mins) We next connect the emitter of the transistor in each optoisolator to its own output channel (directing the current back to the appropriate relay in the motor controller box). Using the two rows remaining, solder wires from pin 3 of each optoisolator to one of the 6 remaining rows at the right of the Perma-Proto board, between the camera-connector slot and the right edge of the board.To avoid changing software later, make sure to connect the emitters in the following manner: Connect the closest two points first: pin 3 of the right-most optoisolator to the first column to the right of the camera connector slot (left-most of the 7 columns with vertical jumpers). Connect pin 3 of the next optoisolator to the next column to the right, and so on, working outward in both directions. See the image below for reference. It is probably best to lay out these connections before soldering to determine the best layout, as wires will need to overlap.Autobed_circuit_img_output_linesAutobed_circuit_img_output_lines_pic_2
  7. (Estimated time: 15 mins) Finally, we will add two polarized PCB headers to the Perma-Proto board so that connections coming in from the hand-held control pad and out to the motor control box can be made securely and correctly. Solder the first male PCB header to the top of the Perma-Proto board across the right-most pins, with the locking mechanism toward the top of the board. Then, solder the second male PCB header across the same seven pins in the second-to-bottom row above the central gap, leaving space between then so that they are accessible.Autobed_circuit_img_PCB_headersAutobed_circuit_img_PCB_headers_picC
  8. (Estimated time: 3 mins) To have some feedback about when the Autobed adapter box is plugged in and running properly, we will add a single LED, controlled by one of the GPIO pins, to indicate when the software is running and receiving input from the web interface. We recommend a green LED, as red, yellow, and orange typically indicate errors, but any color may be used. To add the LED, solder a 2-pin header to the Perma-Proto board with one pin in the ground rail and the other pin in the top hole of one of the free columns, between the inputs to the optoisolators and the PCB headers.Autobed_circuit_img_LED_headerAutobed_circuit_img_LED_header_alt
  9. (Estimated time: 2 mins) Next, solder another 150 Ohm resistor from the number 5 GPIO through-hole to the column with the breakaway header from the previous step. A 2-wire jumper will connect the header pins to the LED mounted in the side of the enclosure.Autobed_circuit_img_LED_resistorAutobed_circuit_img_LED_resistor_alt
  10. (Estimated time: 10 mins) Finally, solder the provided GPIO header onto the Perma-Proto HAT (2×20 holes along edge of HAT board).Autobed_circuit_img_header
  11. (Estimated time: 10 mins) Lastly, we should check that the circuit has no accidental shorts or defects. Using the multimeter (in continuity mode, click here for more info), check each of the connections, and ensure that: All of the optoisolator #4 pins are connected to each other, and the far-right row of the board, but not to any other locations or optoisolator pins. Confirm that all pins 3 of the optoisolators are connected to the header pins, 1 each, in order, and not to one another or the 35V line (connected to pins 4). Confirm that pin 2 of each optoisolator is connected to the ground rail and not to any of the number 1 pins. Also confirm that each optoisolator pin 1 is connected with a resistance of ~150 Ohms to the intended GPIO breakout location. Once the circuit is correct, proceed to next section in which the housing will be constructed.

Enclosure, Electrical Connections, and Assembly

The Autobed adapter box hardware is housed in a plastic enclosure which can be mounted to the Invacare Bed. This enclosure contains the Raspberry Pi and Perma-Proto HAT assembled above. The enclosure must be modified to allow cables for connecting the Autobed adapter box to the Bed’s motor control box to pass through as well as cables connecting the hand-held controller to the Autobed adapter box which will allow the hand controller to continue to operate as normal. Modifications must also be made so that the power cord for the Raspberry Pi can pass through as well. An LED is mounted through the side of the box to indicate when the Autobed adapter box is powered and running properly.

In this section, we will run two Ethernet cables into the enclosure, one with a female socket outside the enclosure for connecting the Invacare handset, and the second with a male plug outside the enclosure to plug into the motor control box on the Invacare bed. These cables should pass through opposite sides of the enclosure via strain-relief bushings to prevent any force on the cables from pulling the electronics inside the enclosure. We will also make a slot for the micro-USB power cord for the Raspberry Pi to enter the enclosure, and mount the activity LED and connect it to the circuit board.Autobed_case_img_completed_with_ethernet_cables2

Parts Needed:

  • Soldering Iron w/Solder
  • Multimeter
  • Drill w/5mm and 3.5mm bits
  • Small-diameter file
  • Hot Glue Gun w/Glue Stick
  • Felt-tip pen/marker
  • Terminal Crimping Tool
  • 1 Plastic enclosure at least 3″x4″x5″
  • 1 Raspberry Pi Case
  • 1 M/F Ethernet extension
  • 1 2′ length of Ethernet cable
  • 2 7-circuit crimp housings
  • 14 crimp terminals
  • 2 strain relief cord grips
  • 1 green LED
  • 1 4″ 2-wire jumper
  1. (Estimated time: 15 mins) The cables will terminate inside the box to the 7-pin Molex connectors, which will attach to the male PCB headers on the circuit already built. The holes for the strain-relief bushings should be placed so that the cables can travel easily from the inside of the bushing to the PCB headers on the circuit. For simplicity, all holes will be made in the two removable side panels of the enclosure. A good location for the strain-relief bushings seems to be toward the top of the panel, slightly more than 1/2 way across the longer direction (see image). It is helpful to place the Raspberry Pi in its case, attach the Perma-Proto HAT to the Raspberry Pi (including standoffs), and place it in the enclosure to estimate a preferred location. It is preferred to place the end of the Raspberry Pi AWAY from the USB and Ethernet ports against one wall, to leave as much room as possible for these ports on the opposite side. The strain relief bushings should line up with the PCB headers, so that the incoming cables are required to bend as little as possible. Autobed_case_img_holes_final_labeledOnce the desired location for the holes has been identified, trace the bushing to mark the desired location on the inside of each panel. Then, using the 5mm drill bit (or larger, if available), drill away as much of the material within the desired hole as possible, and use the file to shape and extend the hole as necessary to fit the strain-relief bushing, checking the hole against the bushing regularly to avoid removing too much material. The plastic of the case files easily by hand with a medium-roughness file. Repeat this procedure for both bushings, one in each panel.
  2. (Estimated time: 10 mins) We also need to add a hole to one side panel to allow the LED to be mounted. To place the LED, drill a 5mm hole, in line with the strain-relief bushing in the wall panel which will be nearest the PCB headers on the Perma-Proto HAT (and nearest to the LED pins). The hole should be beside the hole for the strain relief bushing, allowing some separation. A diffused LED is preferred, so that it is easier to see whether the LED is active from all directions. If the LED is clear (not diffused), sandpaper can be used to score the surface of the plastic dome, which will effectively diffuse the light. Place the 5mm Green LED into this hole so that the wire leads are on the inside of the panel, and the plastic dome is outside. Secure the LED into place using a small amount of hot glue on the inside of the panel. Once secured, use a marker to note the Anode (+) and Cathode (-/GND) of the LED (the longer lead is the anode), and trim the leads down to approximately 3/8″, so that they will fit into the slots of the 2-wire F/F jumper. As the leads are narrow, the jumper may be secured to the LED using hot glue.Autobed_case_img_LED_glued
  3. (Estimated time: 10 mins) Lastly, we need to make a passage for the power cable of the Raspberry Pi. We will cut a narrow groove into the side of the panel without the LED to allow the cable in. To estimate the best location, place the Raspberry Pi (in its case) into the enclosure with the sides in place, so that the LED side-panel is AWAY from the Raspberry Pi’s micro USB port. Mark the bottom of the panel where it aligns with the Raspberry Pi’s micro USB port.Using the 3.5mm drill bit, drill a hole just above the groove in the edge of the side panel where it fits into the base, and further holes to the near edge to make a clear channel for the cable to be set into. Use a small hand file to smooth out these edges and make the groove at least 3.5mm wide along the full width. Check progress by gently attempting to slide the power cable into the groove.Autobed_case_img_groove_cut_labeled
  4. (Estimated time: 5 mins) Once these holes are all cut and properly sized, attach the strain-relief bushings to the panels, so that the adjustable cord-grip is facing outward.Autobed_case_img_groove_with_cord
  5. (Estimated time: 5 mins) Once the strain-relief bushings are in place, cut the male Ethernet plug off of the M/F Ethernet adapter cable, and feed the cable into the bushing so that the female jack is to the outside of the box. Feed the cable completely through to leave as much loose cable as possible while attaching the connector to the recently cut end. Repeat this procedure with the 2+ ft. Ethernet cable, leaving a male Ethernet plug outside of the enclosure.
  6. (Estimated time: 10 mins) We will now attach each of the Ethernet cables to a female connector housing, which will connect to the PCB headers. Start by removing one inch of the cable shroud from the cut end of each Ethernet cable, exposing the 8 wires (typically in 4 twisted pairs, separate and fan out as necessary). Next, strip slightly over 1/8 inch of the insulation from each of the wires.cable_stripped_wires
  7. (Estimated time: 30 mins) To make a secure electrical connection with the male pins of the PCB headers, we will attach crimp terminals to the wires of the Ethernet cables. These terminals are then inserted into the female housing, forming half of the connector. The crimp terminals and housing provide a mechanically secure, electrically sound connection, and the polarized connector prevents the pieces from being connected improperly. However, the crimp terminals can be delicate. If properly crimped, they should fit easily into the housing and stay secured by a locking tab. However, improper crimping, bending, or other problems can make this difficult. For this reason, a crimping tool is recommended, though this can be done carefully with needle-nose pliers. Also, if the terminals are connected by a metal strip, be sure to cut away the ‘wings’ from the connectors completely. It is recommended to read or review this page from Molex and this thorough tutorial before beginning the crimping process. Practicing on spare wire with extra terminals may also be useful. Begin by fanning out the wires in the Ethernet cable in the order they are in within a traditional connector: orange-white, orange, green-white, blue, blue-white, green, brown-white, and brown (more information and image available here). At this point, cut the solid brown wire short, at the base of the cable shroud, as it is not needed or used. Next, with the cables held in this order, left-to-right, begin attaching the crimp terminals to each wire, so that the springy loop faces away from you (orienting the terminals this way is not strictly necessary, but helps to avoid having to twist wires to fit all of the cables into the housing later.) Repeat this procedure for both cut Ethernet cables.Autobed_case_img_fanned_crimped_wires
  8. (Estimated time: 10 mins) To further secure the connection between wires and crimp terminals both electrically and mechanically, a small amount of solder can be added to the wire to secure it to the terminal. Add a small amount of solder to the terminal near the exposed wire, being careful not to allow solder to contact the spring loop.
  9. (Estimated time: 5 mins) Finally, the terminals need to be inserted into the female connector housings. For each of the two cables: align the wires in the standard order (OW,O,GW,Bl,BlW,G,BrW,[Br]) from left to right. With the tabs on the connector housing (which are at the bottom of the housing) facing down, insert the crimp terminals from left to right in the above order. THE ORANGE-WHITE CABLE SHOULD BE ON THE END CONNECTOR WHICH CONNECTS TO THE FAR RIGHT PIN ON THE PERMA-PROTO BOARD. The orange-white wire carries the 35V input from the motor control box, and must connect to the line on the Perma-Proto board which powers all pin #4’s of the optoisolator outputs.wired_connector_housingThis is what the enclosure looks like, after the all the necessary IO connectors are added to the enclosure.Autobed_case_with_connectors
  10. (Estimated time: 10 mins) Once we have completed the connectors, the wires can be secured to the connectors using a small amount of hot glue across the top of the connector housing, especially if some of the locking pins do not appear to hold securely. The connectors can then be attached to the PCB headers (either connector can attach to either header, interchangeably). The side panels of the enclosure can then be moved back into place, feeding most of the excess cable to the outside of the box, so that the connectors are not strained by the cables. Once the cables are so arranged, secure them into place by tightening the outer cap of the strain relief bushing. At this point, the LED can also be connected to the Perma-Proto board using the 2-wire, 4″ F/F jumper. Connect the jumper so that the anode of the LED is connected to the GPIO via the 150 Ohm resistor, and the cathode is connected to the ground pin.
  11. Autobed_case_img_header_wires_in_place2(Estimated time: 5 mins) At this point, the hardware and enclosure assembly is complete. The following checks can be used to verify that the circuit is correctly connected. Using a multimeter in connectivity mode, verify that every pin #4 on the output side of the optoisolator is connected to the left-most pin in the female Ethernet connector (when the tab-slot is down). Similarly, verify that each of the pins #3 of the optoisolators are connected to one and only one pin in the female Ethernet connector. Finally, insert the male Ethernet connector into the hand-controller position in the Invacare motor control box (the tab can be left in place, and will hold the cable securely). To remove this cable later, first UNPLUG THE BED FROM POWER. The plastic retaining tab must be lifted using a plastic-coated paperclip or similar item to pry up the tab while pulling gently on the cable. Warning: The bed may be damaged if the 2 right-most pins (pins #1 and #2 of 10) of the handset jack on the motor control box are electrically shorted while the bed is powered. For this reason, unplug the bed from power before inserting any items to help remove this cable, and only use non-conductive items. Insert the hand-controller into the female Ethernet jack (this connection can be taped to ensure they do not come apart, since the tab has been removed from the handset’s connector). Plug in the bed, and the hand controller should work as normal (without any requirement for the Autobed adapter box or Raspberry Pi to be powered).

 

Open Source Software: A Web Controlled Autobed

Our open source software runs on the Raspberry Pi single-board computer. The Raspberry Pi serves as a web interface with buttons for each of the bed controls, and uses websockets to provide real-time interaction between the interface and bed movements. Full instructions on setting up the Raspberry Pi and installing the software are included below for two methods: Direct install of a pre-configured Raspbian Image, and manual installation.

Setting up the Raspberry Pi

There are two main ways to set up the autobed software on a Raspberry PI:

  1. Pre-installed Raspbian Image
  2. Install Script

If you only intend to use the Raspberry Pi as an Autobed controller, it is easiest to use the pre-installed Raspbian Image. This is a copy of Raspbian (2015-05-05-Raspbian-wheezy), with the Autobed software already installed and configured. Note: To keep the image size small, compontents of Raspbian required to run the graphical user interface (GUI) were removed; however, the command line interface is still accessible by connecting the Raspberry Pi to a monitor or by connecting via SSH over a wired network.

If you already have a Raspberry Pi with Raspbian installed, and want to test the Autobed software on your existing installation, an install script is available, which will completely install and configure the Autobed software for you, but which may interfere with existing setups (most notably an existing Apache configuration). For more fine-grained control of the install, the install script is commented, and the individual steps can be followed manually.

After either installation method, the Wi-Fi connection must be set up on the Raspberry Pi so that the web-based interface can be accessed.

Installing the Pre-configured Raspbian OS

  1. Download our zipped, pre-configured image of the Raspbian OS here.
  2. Unzip the image file once downloaded.
  3. Use the instructions located here to write the image file to an SD card. More information available here or here.
  4. Place the micro SD card into the slot on the back of your Raspberry Pi and plug it in to power (see the Raspberry Pi documentation for help with this step). The red power light on the Raspberry Pi should come on and the green activity lights beside it should start to flash as the Raspberry Pi boots. If the green activity light does not flash, you have not written the image file to the SD card correctly.
  5. Once booted, the Autobed’s hostname is ‘autobed-pi’, with username: ‘pi’ and password: ‘autobed’. We recommend running raspi-cofig on the Raspberry Pi after booting.
  6. In raspi-config, you should select to:
    • Expand the filesystem (to use the full SD card size)
    • Change the default password (and the username and hostname if desired)
    • Enable graphical boot (if desired for further configuration)
    • Change internationalization options: location and language (if desired)

Installing from Install Script

  1. Connect to a terminal on your Raspberry Pi (either via SSH, or else by opening a terminal in the graphical interface).
  2. Download the install script, make it executable, and run it:
    wget https://github.com/gt-ros-pkg/hrl_autobed_dev/blob/2.1/web_only/install_autobed 
    chmod +x install_autobed
    ./install_autobed
  3. (Advanced Users) The install script is a commented bash script, and each piece of the installation can be performed manually and modified as necessary to avoid conflicts with other installed software (notably existing Apache configurations).

Setting up Wi-Fi

  1. Plug the wireless USB adapter into one of the USB ports of the Raspberry Pi, and power the Raspberry Pi on.
  2. Once your Raspberry Pi has booted, access a terminal either via SSH by connecting to a wired network, or by opening a terminal in the graphical interface with a monitor and keyboard plugged into the HDMI/VGA and USB ports.
  3. Use these instructions to connect the Raspberry Pi to your wireless network.
  4. It is likely useful to assign a static IP address to your Raspberry Pi, to simplify opening the web interface. This can be accomplished following the directions here.

Using the Autobed

Once the Raspberry Pi boots properly, and the interface can be loaded on a browser on the local network, shutdown the Raspberry Pi and assemble the full setup within the enclosure.

Once the Autobed adapter box is fully assembled, unplug the Invacare Bed from power, and remove the hand-held controller from it’s plug in the motor control box.

Plug the male connector from the Autobed adapter box enclosure into the connector jack on the motor control box normally used for the hand controller, and connect the hand controller into the female Ethernet jack on the Autobed adapter box.

Leaving the Autobed adapter box unplugged from power, plug the Invacare bed back into power, and confirm that the hand controller still works as normal when plugged into the Autobed adapter box. This hand controller should function even when the Raspberry Pi on the Autobed adapter box is not powered.

Plug the Autobed Raspberry Pi into power. Once powered, the green LED on the Autobed adapter box will likely be dimly lit. After ~30-60 seconds, once the Raspberry Pi has finished booting, the green LED should light brightly, indicating that the Autobed server is running. The LED will turn off when the bed circuits are activated, making it possible to determine if commands are bing received from the web interface as a signal of activity.

Autobed_case_img_complete_plugged_in Autobed_case_img_completed_buttons_in

 

See the video below to watch the installation of the Autobed adapter box:

Open a new tab or window in your web browser (any modern browser, or Internet Explorer 10 or later, see this link). You must have JavaScript enabled for the web interface to work. To access the web interface, go to the following URL on your local network: http://<IP_ADDRESS_OF_RASPBERRY_PI>
For example: 192.168.0.104 would be the URL if the Raspberry Pi had the IP address 192.168.0.104. Note: If controlling the bed wirelessly, you must be connected to the same wireless network as the computer running the Autobed software.
This will bring up a GUI (like the one in the following image), which you can use with a mouse to control your robotic bed:

Autobed_GUI

 

Once this is done, and you have verified that the Autobed is working expected, place the Autobed adapter box in a place where it doesn’t interfere with the motion of the bed.

Troubleshooting

Buttons control the wrong functions: Depending on the wiring, it is likely that the commands from the web interface will not control the correct function on the bed. To fix this:

  • In your favorite text editor, on the Raspberry Pi, open ~/Autobed/hrl_autobed_dev-2.1/web_only/autobed_server.py.
  • Find the line (toward the top of the file):
    cmdMap = {'headUP': 23,
    'headDN': 27,
    'bedUP':25,
    'bedDN':24,
    'legsUP':4,
    'legsDN':17}

    This tells the python script which pin to activate based on the command from the web interface.
  • While running the web interface, make note of which command buttons produce which effects.
  • Determine from this list which pins produce which effects.
  • Modify the cmdMap variable in autobed_server.py so that the proper pin numbers match the correct commands. For example, the new arrangement might be:
    cmdMap = {'headUP': 4,
    'headDN': 27,
    'bedUP':24,
    'bedDN':25,
    'legsUP':17,
    'legsDN':23}

Finding the IP Address of the Raspberry Pi: In order to get the right URL for the Autobed web interface, you will need to know the IP address of your Raspberry Pi. To find the IP address use either the ifconfig command on the Raspberry Pi, use these instructions, or check the list of clients connected on your router’s web interface.

Additional Notes

Bluetooth/Zigbee alternative: In case there is no WiFi installed at the user’s home, a bluetooth version of the same bed can be constructed in a similar manner. We have also tested the Zigbee technology as an alternative to WiFi. However, the scope of the above tutorial is limited to the web controlled Autobed and we do not plan to release tutorials for the above technologies.

Autobed Computer Security: We have not made specific efforts to address computer security or limit access to the Autobed Raspberry Pi. We strongly recommend setting a strong, non-default password on the autobed user account. Any computer which can ‘see’ the Raspberry Pi over a network can access the interface website or the underlying websocket data connection (used by the interface to send commands to the bed). For this reason, the Autobed is intended for use on a local network only, and it should not be made accessible to the internet at large (do not enable public access through your home router). The web interface does not use secure https or wss (web socket secure), because currently no private data is sent over these channels. To further limit access, you may wish to disable SSH access on the Raspberry Pi once the Autobed is properly configured.

 

Support

This work was supported in part by a grant from the National Institute on Disability, Independent Living, and Rehabilitation Research (Department of Health & Human Services, Administration for Community Living) Grant 90RE5016-01-00 under the auspices of the Rehabilitation and Engineering Research Center on Technologies to Support Successful Aging with Disability (TechSAge). The contents of this website were developed under a grant from the Department of Health & Human Services, Administration for Community Living. However, those contents do not necessarily represent the policy of the Department of Health & Human Services, Administration for Community Living, and you should not assume endorsement by the Federal Government. The NSF Graduate Research Fellowship Program and the Petit Undergraduate Research Scholars Program at Georgia Tech provided additional support.

License

This work requires the user to download and modify Raspbian OS. Raspbian is distributed for free under the GNU General Public License v2.

The software for this project is licensed under The MIT License.

Creative Commons License“Autobed v2: A Web-Controlled Robotic Bed” Hardware by Healthcare Robotics Laboratory is licensed under a Creative Commons Attribution 4.0 International License.

 

The Team

The main contributors to the development of this hardware were Phillip Grice, Yash Chitalia, Megan Rich, Henry Clever, Henry and Jane Evans and Prof. Charles C. Kemp. Henry Clever and Phillip Grice were the lead students for the first versions of the hardware for the Autobed and also initiated this documentation process.Yash Chitalia and Megan Rich were the main student developers of the embedded version of the first verison of the Autobed. Phillip Grice was the lead student developer for the second version of the Autobed described in this page (Autobed 2.0). We would like to thank Henry Evans and Jane Evans for their support throughout the continuous testing of the Autobed.

pgrice yash mrich hclever
Phillip Grice
Ph.D. Student
Yash Chitalia
Ph.D. Student
Megan Rich
Undergraduate Student
Henry Clever
Ph.D. Student
at NYU
henry_jane

Charles C. Kemp, Ph.D. Director

Henry and Jane Evans
Research Collaborators
Charles C. Kemp, Ph.D.
Director

 

 

Autobed V1: A Web-Controlled Robotic Bed

DEPRECATED
DEPRECATED
DEPRECATED
This webpage describes the older deprecated version of the Autobed (v1). We recommend building the updated version of the Autobed (v2), which requires fewer materials, less time to build, and does not require directly modifying the Invacare bed components. For the newest version of the Autobed (v2) please go to this page.
DEPRECATED
DEPRECATED
DEPRECATED

We (the Healthcare Robotics Lab at Georgia Tech) have developed a process to modify an Invacare fully electric hospital bed (Model 5410IVC) so that it can be controlled from a web-based interface. We call a bed so modified an ‘Autobed.’ With this feature, users who are unable to operate the standard bed controls, but can access a web browser, are able to position the bed by themselves without having to rely on a caregiver. This page describes how to make this modification to an Invacare bed using relatively cheap, commercially available hardware.

WARNING: THIS WEB PAGE AND ITS ASSOCIATED CONTENTS DESCRIBE PROTOTYPE RESEARCH HARDWARE AND SOFTWARE. USING THESE MATERIALS OR DERIVATIVE MATERIALS COULD ENTAIL RISKS, INCLUDING THE RISK OF SERIOUS BODILY HARM. AS DETAILED IN THE SOFTWARE LICENSE AND HARDWARE LICENSE, WE PROVIDE THIS INFORMATION “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.

Overview

Total Estimated Price: $125 + Cost of the Invacare Bed and Mattress (~$2000)
Total Estimated Time: ~6 hours

The Autobed system is arranged as follows: The user’s browser sends commands to a Raspberry Pi, which serves the custom web interface. The Raspberry Pi relays these commands to an Arduino microcontroller, which uses digital signals and a custom electronics board to mimic the press of a button on the control pad. These signals are then fed directly into the control box of the Invacare bed where they activate the motors.

The process of modifing the bed is described below in two stages. In the first section, ‘Open Hardware: Building the Autobed’, we modify the Invacare bed’s control box to accept inputs from the Autobed system, and construct the circuitry required to relay inputs from the Arduino board to the bed control board. In the second section, ‘Open Source Software: A Web-Controlled Autobed’, we setup the software for the Autobed system on a Raspberry Pi and an Arduino Uno. Detailed instructions are given for steps, and directly usable code is provided.

NOTE: We have developed and tested this method on the Invacare model 5410IVC bed, and it may or may not work for other models manufactured by Invacare. Do not attempt this modification on hospital beds from other manufactuers. By performing this modification, you will probably void the warrenty on your bed, so proceed with caution.

Skills Required:

  • Through-hole Soldering
  • Basic tool usage
  • Basic Familiarity with the Arduino
  • Basic Familiarity with the Raspberry Pi
  • Basic Familiarity with the ROS

Raw Materials and Equipment

Here are the places where we purchased the different raw materials and equipment: Keep in mind that you may be able to find these materials for cheaper from other vendors depending on your location. See the alternatives column of the tables below to see if an alternative part can be used.

  1. Invacare Bed
  2. Tools Required:
    • Soldering iron
    • Small diameter solder (less than 0.05”)
    • Flat screwdriver
    • Phillips screwdriver
    • Dremel tool (for making a hole in a plastic casing)
    • Needle-nose pliers
    • Wire stripper
    • Multimeter
    • Shear cutter (for clipping wire after soldering to PCB)
    • Computer
  3. Electronics Required:
Raspberry Pi Accessories
Description Vendor Part # Quantity Cost Total Alternative
Raspberry Pi Model B + 512MB Element14 1 35$ 35$ A computer of your choice that can support ROS
16 GB or higher SD Card and Adapter Compatible SD Cards 1
SD card reader/writer Amazon 1 May be built in on your computer
Wireless USB adapter or ethernet cable Amazon 1
6 ft. ethernet cable Startech C6PATCH6BK 1 $7.99 $7.99 any ethernet cable
ABS Plastic Box (to house everything) (8.40″ X 5.15″ X 3.15″) Digikey 377-1614-ND 1 $22.40 $22.40 Any box in which holes can be made easily that is at least 8″x 5″x 3″

 

Arduino Accessories
Description Vendor Part # Quantity Cost Total Alternative
Arduino Uno Sparkfun DEV-11021 1 $24.95 $24.95
Arduino Stackable Header Kit Sparkfun PRT-10007 1 $1.50 $1.50
6 in. USB A to B cable Amazon 1 $7.16 $7.16 Any A to B cable shorter than 2 ft should work

 

Circuit Components
Description Vendor Part # Quantity Cost Total Alternative
PNP amplifying transistors-10 pack DigiKey 2N4403-APCT-ND 1 $1.70 $1.70 Any 6 TO-92 PNP transistors
NPN amplifying transistors-10 pack DigiKey 2N4401-APCT-ND 1 $1.70 $1.70 Any 6 TO-92 NPN transistors
1/8 watt 10K ohm resistors – pkg. 50 DigiKey CF18JT10K0CT-ND 1 $1.78 $1.78 Any 10K ohm resistors work
1/8 watt 4.7K ohm resistors – pkg. 50 DigiKey CF18JT4K70CT-ND 1 $1.78 $1.78 Any 4.7K ohm resistors work
1/8 watt 1K ohm resistors – pkg. 50 DigiKey CF18JT1K00CT-ND 1 $1.78 $1.78 Any 1K ohm resistors work
1/8 watt 220 ohm resistors – pkg 50 DigiKey CF18JT220RCT-ND 1 $1.78 $1.78 Any 220 ohm resistors work
Solderable prototyping PCB DigiKey V2010-ND 1 $7.33 $7.33 Any solderable prototyping PCB at least 3″x4″ will work
3 ft Serial cable DB9 M/F Amazon 1 $8.27 $8.27 Any DB9 M/F serial cable at least 3 ft long

 

Open Hardware: Building the Autobed

This section describes, in two parts, the the modification of an existing electric bed and assembly of the hardware necessary to relay inputs from the Autobed system to the bed. The first section, ‘Modifying the Invacare Bed’, contains instructions to modify the contrl box of the electric bed. The second section, ‘Building the Autobed Hardware’, contains instructions to build the relay circuit that will allow the Autobed system to send signals to the bed.

Modifying the Invacare Bed

Total Estimated Time ~ 2 hours

  1. Unplug the Bed from the Wall. Make sure power is disconnected from the bed before proceeding.
  2. (Estimated time: 5 mins) Locate the main relay control box on the bed frame (shown circled in the picture below). This is the box that the main AC power cable (from the wall), hand control pad, and all three motors plug into.controller
  3. (Estimated time: 5 mins) Disconnect cables from this control box: the AC power cable, the three motors (one plug for each color coded red, yellow, blue), and the bed adjustment controller plug. The AC power cable can be left in place, just make sure the bed is unplugged before proceeding.
  4. (Estimated time: 5 mins) Remove the control box from the bottom of the bed. If the main relay control box is vertically oriented, it is held in place with a large silver colored bolt and nut. If this is the case, use a pliers to loosen the nut. If the main relay control box is horizontally oriented, it is held in place with a large plastic C-clip. If this is the case use a flat screwdriver to pry off the plastic C-clip.
  5. (Estimated time: 5 mins) Use the Phillips screwdriver to unscrew the 6 screws holding the relay box together and remove one side of the grey plastic cover. The parts may be lightly stuck together due to sealant along the edge.
  6. (Estimated Time: 15 mins) Once it is open you will notice the bottom of the circuit board that looks like the diagram below (Fritzing files for the diagram available here). Cut the DB9 Serial cable approximately 18 inches away from the female end and strip off 4-6 inches of the outer casing. This will reveal the 9 wires that make up this cable. Strip about half an inch of the insulation off of the end of each of these wires.circuit_1
  7. (Estimated Time: 10 mins) Using the multimeter (in continuity mode, click here for more info), figure out which pin of the serial cable connects to which wire. It may be useful to label the wires to keep track.
  8. (Estimated Time: 15 minutes) Use the dremel tool to bore out a hole in the plastic casing of the control box that is big enough to pass the stripped end of the serial cable through. Make the hole on the side of the box as shown in the image below. Pass the end of the cable through this hole and tie a knot in the cable on the inside of the plastic enclosure approximately 7 inches from the stripped end of the cable.serial_hole
  9. (Estimated Time: 1 hour) Following the diagram above, solder the serial cable wire connected to pin 2 to +34 volts on the PCB and the wire connected to pin 9 to common ground on the PCB. Solder the wires connected to pins 3-8 to one of the six relays one per relay. Do not use the wire connected to pin 1. While it is okay to mix and match the wires leading to the relays (pins 3-8) because you can reprogram the Arduino microcontroller to command different ones later in the section ‘Setting up the Arduino’, it is critical that the +34 volts and the ground are connected properly.
  10. (Estimated Time: 5 minutes) Wrap the wires around the side and under the circuit board so the top piece of the large plastic enclosure can fit back on. Reassemble the control box, replacing all 6 screws.

Building the Autobed Hardware

Total Estimated Time ~2 hours

Now that a connector has been wired to the bed’s control circuits, a circuit with switching transistors can be constructed to take the place of the physical buttons on the hand remote. The schematic below shows the circuit diagram for micro-controller command of a single relay (The Fritzing files for this schematic can be downloaded here for better viewing). Using common 34V and ground pins, this single relay control circuit will be replicated 6 times to command all 6 relays.

circuit_2

Now you will solder together the transistor circuit that can take a microprocessor signal and turn the switches on. In addition to the schematic above, there is a circuit board diagram and detailed pictures below.

Parts needed:

  • 1 solderable PCB from DigiKey (V2010-ND).
  • 6 NPN transistors (These are 2N4401-APCT-ND)
  • 6 PNP transistors (These are 2N4403-APCT-ND)
  • 6 10K ohm resistors, six 5K ohm resistors, six 1K ohm resistors

Following the circuit diagram below, first solder the resistors onto the protoboard. Next, solder on the transistors. Make sure the correct transistor and resistor pins are connected to the +34v rail voltage and ground passing horizontally through the center of the board.

circuit_3

  1. (Estimated time: 15 minutes) On the remaining serial cable (side with the male connector left over from above) strip approximately 4 inches of the outer casing off of the cut end to reveal the 9 wires inside. Strip about half an inch of insulation off the end of each wire.
  2. (Estimated Time: 10 mins) As previously, using the multimeter (in continuity mode, click here for more info), figure out which pin of the serial cable connects to which wire. It may be useful to label the wires to keep track.
  3. (Estimated Time: 15 minutes) Use the dremel tool to bore out a hole in the ABS plastic box (or your alternative) that will house the Raspberry Pi, Arduino, and circuit board. The hole should be large enough to pass the stripped end of serial cable through.
  4. (Estimated Time: 5 minutes) Pass the end of the serial cable through this hole and tie a knot in the cable on the inside of the plastic enclosure approximately 6 inches from the stripped end of the cable to provide strain relief (pulling on the cable from outside the box should pull the knot against the inside of the box, rather than pulling on the connection between the cable and circuit when connected).
  5. (Estimated Time: 5 mins) Referencing the circuit diagram above, solder the RED wire in the diagram (corresponding to pin 2 on the serial cable and 34+ volts on the Invacare board) to the upper leftmost pin on the protoboard. Then solder the BROWN wire in the diagram (corresponding to pin 9 on the serial cable and common ground on the Invacare board) to the adjacent pin on the protoboard.
  6. (Estimated Time: 15 mins) Still referencing the diagram above, solder the BLUE wires (corresponding to pins 3-8) to their corresponding places on protoboard, according to the diagram. Note that in the picture on the right, some of the colors are incorrect — follow the left diagram for wire coloring and use the picture on the right as a reference for soldering components on the protoboard.
  7. (Estimated time: 15 mins) Connect small bare jumper wires on the protoboard leading from each of the BLUE wires to the respective collector of each PNP transistor. Use the picture above on the right to visualize the orientation of these jumpers.
  8. (Estimated time: 10 mins) Connect RED and BROWN jumper wires from just below two uppermost pins where RED and BROWN wires on the serial cable were soldered to the +34V rail and ground rail passing horizontally along the protoboard. The upper rail (in the image) is for +34v and the bottom rail is for ground. NOTE: At this point, set your multimeter to the “Continuity Tester” mode. Check whether the entire 34v and GND rails are connected throughout the circuit. This is a common source of problems. Also, make sure that the +34v and GND rails are not shorted together at any point. In other words, make sure that the RED and BROWN wires are not connected to each other. A short can seriously damage components and possibly the bed controller itself, so check twice before moving on.
  9. (Estimated time: 15 mins) Connect GREEN wires leading out of the bottom pin row on the protoboard and solder them adjacent to the 4.7k-Ohm resistors. Similarly to the BLUE wires, the pictures on the right above show incorrect wires coloring, so follow the left diagram.
  10. (Estimated time: 5 mins) Connect the GREEN wires that are already soldered to the protoboard into digital I/O pins 2 through 7 on the Arduino. Then connect a BROWN ground wire leading from the Arduino to the protoboard. However, before you do this, please see the instructions in the ‘Setting up the Arduino’ section first.
  11. (Estimated time: 20 mins) Mount the circuit board into the ABS plastic enclosure. You may want to use a dremel tool to bore out necessary holes for the other wires such as the power cable for the Raspberry Pi. However, do not screw the lid onto the enclosure yet because the Arduino and Raspberry Pi still must be configured in the software section.

Open Source Software: A Web Controlled Autobed

Our open source software includes code to send signals to the Autobed hardware (constructed in the previous section) with a web interface in order to control your Invacare electric bed. We assume some familiarity with ROS, but full instructions on setting up your own Raspberry Pi with ROS are located below.

Setting up the Raspberry Pi

If you wish to use a Raspberry Pi to run the Autobed software, please use the following setup instructions. Otherwise, proceed to the section “Setting up the Arduino”.

Setup

Installing the Operating System (Raspian)

  1. We use the Raspian OS for the Raspberry Pi. The image file can be downloaded here.
  2. Use the instructions located here to write the image file to an SD card.
  3. Plug the wireless USB adapter into one of the USB ports of the Raspberry Pi.
  4. Place the microSD card into the slot on the back of your Raspberry Pi and plug it in to power(see theRaspberry Pi documentation for help with this step). The red power light should come on and the activity lights beside it should start to flash as the Raspberry Pi boots. If the green light does not flash, you have not written the image file to the SD card correctly. If you are having trouble writing the Raspian image file to your SD card see this link for additional help.
  5. Once your Raspberry Pi has booted, connect it to the internet through either an ethernet or wireless connection. Use these instructions to connect the Raspberry Pi to your wireless network.

Installing ROS

The Autobed software runs on ROS Fuerte. See these instructions for installing ROS Fuerte on your Raspberry Pi. Note that only the ROS-Base install is required, NOT ROS-Full or Desktop Installations.

Installing Pillow

Pillow (the Python Imaging Library) is required to run the Autobed software. Download and installation instructions can be found here. More information about Pillow can be found here.

Installing the Autobed Software

The following instructions will walk you through installing the Autobed-specific software onto your Raspberry Pi.

  1. Dependencies: To run the Autobed software you will need to install the following ROS packages, using ROS Fuerte versions of each, if applicable:
    • rosbridge_suite (Source and installation instructions can be found here)
    • hrl_lib (Source can be found here)
    • m3skin_ros (Source can be found here)
  2. Get all the code from the Autobed Git Repository and unzip it to get the latest version of the code.
  3. Make (cd into directory, then type rosmake) the following ros packages:
    1. autobed_engine
    2. autobed_web
  4. Finding the IP Address of the Raspberry Pi: In order to get the right URL for the Autobed web interface, you will need to know the IP address of your Raspberry Pi. To find the IP address use either the ifconfigcommand on the Raspberry Pi, use these instructions, or check the list of clients connected on your router’s web interface.
  5. Setting a static IP Address for the Raspberry Pi: If your Raspberry Pi disconnects from your router, it will often receive a new IP address when it reconnects, which will change the URL for the Autobed controls. It is therefore preferable to assign it a static IP address, which can be done following the instructions here.

Setting up the Arduino

The following instructions will help you set up your Arduino UNO to communicate with your Raspberry Pi and Autobed Hardware.

  1. Retrieve the code: Download the file ‘hrl_arduino.ino’ from our GitHub repository here.
  2. To upload this Arduino code to your Arduino UNO you will need the Arduino IDE, which can be downloaded and installed folling the instructions here.
  3. Upload the Arduino sketch to the Arduino UNO:
    1. Open the Arduino IDE.
    2. Open the file ‘hrl_arduino.ino’ in the IDE. It should look like this:arduino
    3. Connect your Arduino UNO to your computer with the USB cable.
    4. In the development environment, go to ‘Tools’ then ‘Serial Port’ and select your Arduino board.
    5. Find and press (and release) the reset button on your Arduino UNO (see picture below). Depending on the specific version it should be a small silver button either on the middle right side of the board or on the upper left-hand corner or the board.arduino_pins
    6. In the Arduino IDE press ‘Upload’ (the button with an arrow pointing to the right).
    7. Make sure that the sketch compiles and uploads successfully. The IDE should show success, or any errors, at the bottom of the window. The TX/RX lights on the Arduino UNO should flash during the upload.
    8. After the program has finished uploading disconnect the Arduino board from your computer.See this page for help with the Arduino development environment or this page for help uploading a program to your Arduino board.
  4. Connect the Arduino to the Autobed Circuit
    1. On the circuit board, find the 6 wires that are each connected to a 4.7k resistor (The GREEN wires in the diagram below).circuit_3
    2. Find the digital I/O pins on the Arduino board located along the top edge (see picture above).
    3. From left to right, connect these wires to digital pins 2-7 on the Arduino board respectively.
    4. Connect the BROWN wire in the diagram above to either of the ground pins marked ‘GND’ on the bottom edge of the Arduino board (see picture above).
    5. Using the 6 inch USB cable, connect the Arduino to the USB port on the Raspberry Pi.After these steps, it should look like this:autobed_wiresHere’s a close up view of the digital I/O pins on the Arduino:autobed_pins
  •  On the Raspberry Pi, navigate to hrl_autobed_dev/autobed_web and run the command: /bin/bash ./scripts/autobed_start.sh. This should start the Autobed’s web server, and make the web interface available on the local network.
  • Go to the following URL on your local network, and control your robotic bed:http://<IP_ADDRESS_OF_RASPBERRY_PI>:8888/autobed_web/autobed.html
    For example: http://192.168.0.104:8888/autobed_web/autobed.html would be the URL if the Raspberry Pi had the IP address 192.168.0.104. Note: If controlling the bed wirelessly, you must be connected to the same wireless network as the computer running the Autobed software.
  • Depending on the wiring, it is likely that the commands from the web interface will not control the correct function on the bed. To fix this:
    • In your favorite text editor, on the Raspberry Pi, openhrl_autobed_engine/src/autobed_engine.pi.
    • Find the line (toward the top of the file):
      CMDS = {'headUP': 'A',
      'headDN': 'F',
      'bedUP':'C',
      'bedDN':'D',
      'legsUP':'B',
      'legsDN':'E'}

      This tells the python script which command to send to the Arduino based on the command from the web interface.
    • While running the web interface, make note of which command buttons produce which effects.
    • Determine from this list which letter commands produce which effects.
    • Modify the CMDS variable in autobed_engine.py so that the proper letters match the correct commands. For example, the new arrangement might be:
      CMDS = {'headUP': 'F',
      'headDN': 'A',
      'bedUP':'B',
      'bedDN':'C',
      'legsUP':'E',
      'legsDN':'D'}
  • Once this is done, and you have verified that the Autobed is working expected, place the Autobed controller box in a place where it doesn’t interfere with the motion of the bed.

Useful Links

Support

This research is funded by the Department of Education (National Institute on Disability and Rehabilitation Research, H133E130037).

License

This work requires the user to download and modify Raspbian OS. Raspbian is distributed for free under the GNU General Public License v2.

The software for this project is licensed under The MIT License.

Creative Commons License“Autobed v2: A Web-Controlled Robotic Bed” Hardware by Healthcare Robotics Laboratory is licensed under a Creative Commons Attribution 4.0 International License.

The Team

The main contributors to the development of this hardware were Phillip Grice, Yash Chitalia, Megan Rich, Henry Clever, Henry and Jane Evans and Prof. Charles C. Kemp. Henry Clever and Phillip Grice were the lead students for the first versions of the hardware for the Autobed and also initiated this documentation process.Yash Chitalia and Megan Rich were the main student developers of the embedded version of the first verison of the Autobed. Phillip Grice was the lead student developer for the second version of the Autobed described in this page (Autobed 2.0). We would like to thank Henry Evans and Jane Evans for their support throughout the continuous testing of the Autobed.

pgrice yash mrich hclever
Phillip Grice
Ph.D. Student
Yash Chitalia
Ph.D. Student
Megan Rich
Undergraduate Student
Henry Clever
Ph.D. Student
at NYU
henry_jane

Charles C. Kemp, Ph.D. Director

Henry and Jane Evans
Research Collaborators
Charles C. Kemp, Ph.D.
Director