Tuesday, 29 January 2013

bathroom availability sensor

one to many relationship

The bathroom at work is a high traffic zone. Over 20 gentlemen use its services daily, and understandably experience regular delays. I whipped together a little gizmo (using an arduino, bluetooth serial module, photo sensor, bash, php, memcache, netcat, and ssh) that lets us see the bathroom's status in real time. 

run down

  1. Open browser to secret bathroom website
  2. Observe real time bathroom status

The arduino gets the photo sensor's ambient light reading and when it detects the light has been turned on or off, the bathroom status is updated to occupied or vacant accordingly. At this time, it writes the status to the serial port which is read by the bluetooth module. The module is paired with a workstation that pipes the bluetooth data through a series of scripts to a website that shows the bathroom's status in real time. The script updates a value stored on the server's memcache. Each client polls the server frequently and the server responds with cheap cached results. 

tldr if light is on, your browser shows: 


side note

If you actually look at the sensor, it's a terrible job. I had to switch the bluetooth's 4-pin connector around to fit in the box, but the transmit solder was bad so I ran a jumper cable. I have no idea what the resistor and LED are even doing there tbh. Once it was working, that was good enough for this project so I boxed it up and went with it.

Saturday, 26 January 2013

apple pi

I purchased an Apple IIe Platinum last year and got some pretty sweet programs and games working via ADTPro.

Recently I purchased a Raspberry Pi and picked up a USB-TTL converter while I was at it. 

At home I had a DB9 serial to TTL converter, as well as a DB25 to DB9 cable and a gender changer from previous projects.  

Finally, hooked up a USB keyboard to the Raspberry Pi and enabled the serial port terminal by adding the line:

T0:23:respawn:/sbin/getty -L ttyUSB0 19200 vt220 

to /etc/inittab and restart.Then boot up the IIe with MODEM.MGR and start a new VT220 session using my super serial card at 19200 baud. 

Resuling in a very cool serial terminal.