Author Topic: New to Adruino - Bathroom In Use Notifier  (Read 5420 times)

vtanman

  • Newbie
  • *
  • Posts: 1
New to Adruino - Bathroom In Use Notifier
« on: August 27, 2012, 10:34:41 am »
Hi,

I've always wanted to mess with an Adruino and I thought this project would be a good one after getting to know the basics.  

I work in a work place where there's one bathroom among 10 male programmers.  We all hate it when we get up to use the bathroom, and since the bathroom is around the corner, no one knows if it's occupied.  So there's always a constant of getting up just to sit back down and it would be cool to have some desktop app or web app to inform us if it's available or not.  What I want to do is pretty much create a bathroom in use notifier that can communicate with a server.

similar projects that i've found online...
http://www.youtube.com/watch?v=qZ0uNrQBUG4
http://www.intuity.de/blog/2012/05/02/making-things-talk-peenodes-a-jeenode-powered-toilet-laser/

So far i've got a bunch of different type of shield kits included with my pledge to experiment with, but i'm not sure if the kits I have are the right ones for this project.

My requirements are to use a wall outlet for power and somehow communicate with a server (probably using RESTful web services) and using some type of sensor to determine if it's in use or not.

This is how i'm thinking of going about the project.

- digispark
- Grove Shield Kits
- Grove Light sensor  (Maybe to detect the light on)
- MOSFET Shield Kits (So i can get the wall outlet to be the power source)
- ??? How to get it to communicate with a server ???

If size wasn't a factor, could i maybe use a breadboard and hook up some type of wifi component to it to communicate to the server?  Or am I going the wrong way about doing this.

Any help or ideas i could use to help me get started would be appreciated.  Looking forward to getting started with adruino and digispark.

Thanks again!

« Last Edit: August 27, 2012, 10:34:41 am by vtanman »

smithincanton

  • Newbie
  • *
  • Posts: 3
New to Adruino - Bathroom In Use Notifier
« Reply #1 on: August 28, 2012, 07:55:49 am »
They just launched a wireless shield for the digispark. You could use it (digispark + Light sensor) and another Arduino with a Ethernet shield to communicate with your server.

Kyemo

  • Newbie
  • *
  • Posts: 1
New to Adruino - Bathroom In Use Notifier
« Reply #2 on: August 28, 2012, 07:09:21 pm »
I might have totally missed something here (I\'m new to Arduino too), but the MOSFET shield is not going to let you power the Digispark from a wall outlet. Like an ordinary transistor, or triac, or relay, they just work like gates allowing you to switch higher voltage or current supplies using the low current of the Digispark controller. Just buy a simple DC plug pack transformer? Or recycle an old phone charger?

weaslyd

  • Newbie
  • *
  • Posts: 3
New to Adruino - Bathroom In Use Notifier
« Reply #3 on: August 31, 2012, 08:45:36 pm »
Just one of many cool features for me is the ability to use a common USB wall adapter to power the Digispark. The spare wall adapter from my Samsung Galaxy Nexus is perfect - only about 1 inch x 1 inch.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
New to Adruino - Bathroom In Use Notifier
« Reply #4 on: September 06, 2012, 04:32:22 am »
TLDR; Batteries would actually last for ages if you put the digispark to sleep - cheap radios from ebay work great and the transmitters use no power when not in use, reed switches are cool.

Personally, I\'d just use a battery and a digispark, with 433.92mhz radios. If you search ebay for \"433.92mhz ook\" you can get a pair of 433.92mhz radio transmitter and receiver for about five bucks - sometimes much less. These only require a short length of wire as an antenna, and each have a data pin which connects to one of the digital IO of the digispark or similar gadget. Functionally, they work a bit like morse code - you send pulses through the data pin, and can send information by the varying length or interval between your pulses. This is the same system used by those cheap radio doorbells, and a lot of car remotes and other little random home RF gadgets. Better still, the transmitter boards are very tiny (smaller even than the digispark) and consume entirely no power at all when they aren\'t transmitting a data pulse.

By using the sleep modes of the AVR, you can have the digispark go in to a deep sleep where it uses far far less than a milliamp, and wakes up resuming your program as soon as one of the IO pins changes state. By connecting a reed switch you can have the digispark go to sleep and wake up whenever it detects a change, broadcast out a few times a little message announcing the new state, and have a computer, arduino, or another digispark pick up the message somewhere else in the building and relay it to whichever web services you want. If you like, you could even repurpose infrared remote control libraries to do this work for you - they already implement simple protocols for sending button presses over unreliable mediums, and are well maintained for the arduino platform. Otherwise I\'d be inclined to have the receiver digispark or arduino time the distance between each pulse and send a message to the host computer with those numbers - then you can have a little ruby, python, or c program look at those and compare them to a list of recognised commands and see if the timing closely resembles your door gadget. Alternatively you can recognise the codes inside the digispark and have it emulate a keyboard and just type in some hotkey on the host computer which launches a little notifier script somehow - I ended up using a script which watches my digispark-equivilent doorbell receiver because I found hotkeys didn\'t work when my mac\'s screen was locked.

If the digispark\'s come with brown-out detection disabled, you should be able to have the digispark consume roughly 0.0001ma while asleep, watching for changes. If you used a pair of 3v lithium button batteries and a diode to knock the 6v down to about 5.4 (which the digispark can accept directly). Button batteries have a capacity of roughly 200ma, which gives you a sleep time per battery change of about 7 years. Broadcasting would happen for about 10 milliseconds each time the state changes, with power consumed during pulse send only, and that power is about 10ma, so you can probably figure broadcasting consumes about 5ma for a moment. For comparison, a tv remote uses about 50ma when sending, averaging about 20ma between the on and off pulses, but they also transmit slower and for longer, and transmit repeatedly when holding buttons down.

Just food for thought.

Of course, if I had this problem I\'d be more inclined to solve it with lasers and mirrors, not computers and radios.
« Last Edit: September 06, 2012, 04:38:07 am by Bluebie »