Ask MAKE: Hospital Availability Toggle Switch

Ask MAKE: Hospital Availability Toggle Switch

Phil asks:

A geek friend of mine suffered a stroke last week and will be in a rehabilitation hospital for a few weeks. His room has WiFi in it.

I’d like to make him a device with a single rocker switch (or slider switch) where he can indicate whether he is up for having visitors.

The setting on the device will show up on a web site (that I make) where there will be a green light saying: “Jim is up for having visitors today.” or a red light with the words: “Jim would prefer not having visitors today.”

Could this be done pretty simply with an Arduino? How about the wifi communications part?

Sorry to hear of your friend’s stroke, but how nice of you to want to make something to aid in his recovery. Your idea immediately reminded me of a project done at ITP called Is The Floor Open. It is a simple knife switch attached to an Arduino with an Ethernet shield that forwards the switch state to a website and Twitter account. Co-creator Greg Borenstein (author of Making Things See) writes:

The structure of the project was as follows:

– Arduino w/Ethernet shield that looked for a change in the state of the switch: open->closed meant floor closed at the end of the night. closed->open meant floor opened in the morning. When it detected that change it made an HTTP POST to a web service

– That web service was written in Ruby using Sinatra and DataMapper and runs on Heroku. The web service receives the data from the Arduino, records the time of the event and which direction the switch was thrown. It sends a tweet to twitter under the credentials for the istheflooropen twitter account. It also displays the current status on one web page and the full log of all received events in the past on another.

Greg has documentation of different versions of the Arduino code at these two links. However, if you need to connect to WiFi, the Ethernet shield isn’t the right beast for your needs. You’ll need something like the Cupperhead WiFi shield, and then you’ll be able to connect to the hospital’s WiFi network.

I hope this helps, and that your friend makes a speedy recovery. Please let us know how your project works out. And for readers, please give any suggestions you have for Phil in the comments.

See all of the Ask MAKE columns

8 thoughts on “Ask MAKE: Hospital Availability Toggle Switch

  1. Anonymous says:

    As a Network Administrator for a Healthcare company that owns a few hospitals, I can say that he will have much more luck connecting to a “Guest Wireless” connection as opposed to a wired connection. As much as we’d like to offer switchports to patients for their own devices, its just not really feasible for us at this point in time. Looking at other hospitals in the area, this seems to be the norm.

    Instead of building something from scratch, perhaps he already has a cell phone with WiFi capability? You could just code a page for him to toggle the status from his phone. Also, you could use a service like Twilio ( or Google Voice to accept text messages as a toggle entry and update your site accordingly. It’s easier than you would think.

    Good luck!

  2. Anonymous says:

    I work at a regional hospital where we provide each of our patients with their own, customizable web portal so friends and family can track their progress (obviously, with appropriate security measures.) One of the features of the portal is exactly what you describe — an “accepting visitors” status indicator, which the patient can set themselves, or our nurses can set at their request.

    It might be something you ask your friend’s care provider if they offer. If not, you may want to offer it as a suggestion on how thy can better serve the needs of their patients.

  3. Tijmen Leroi says:

    Phil might also want to take a look at how we hacked together a SpaceStateSwitch at our hackerspace:

  4. Michael O says:

    I’ve been playing around with the RN-XV WiFly module ( which can be configured to periodically call any web page and POST the voltages on each of its IO pins. It does this autonomously so you don’t even need an Arduino or other microcontroller – just hook the WiFly up to 3.3v, connect the switch (and maybe a pull-up resistor?), and configure the module over telnet.

    Having said that, it’s not quite as much fun as programming it yourself!

    Good luck with the project.

Comments are closed.

Discuss this article with the rest of the community on our Discord server!

In addition to being an online editor for MAKE Magazine, Michael Colombo works in fabrication, electronics, sound design, music production and performance (Yes. All that.) In the past he has also been a childrens' educator and entertainer, and holds a Masters degree from NYU's Interactive Telecommunications Program.

View more articles by Michael Colombo