"Space occupied" and other IRC announcements
Posted: Sun Sep 16, 2012 9:11 pm
A while back, Kaldonis set up a light sensor and Arduino to tweet "occupied/unoccupied" announcements whenever it detected that the lights at the space were turned on or off. Then it died. Now, I've resurrected the idea with a UBW (http://www.schmalzhaus.com/UBW/) instead of Arduino and IRC instead of Twitter.
The circuit is very basic. The light level sensed by the photoresistor goes into the analog input (A0) of the UBW. The UBW is connected to SpaceBox over USB (virtual com port). It's not easy to use com ports with mIRC script so I made a Windows application to control the UBW and act as a DDE Server that mIRC can communicate with. This also makes it easier to integrate with other applications or web services, if that becomes necessary. Click the "DDE Commands" button to see the DDE commands available and how to use them from mIRC.
The C# source code is available at https://code.google.com/p/ubw-com-net-library/
Right now, the first analog input is used by the light sensor. There are 3 more available (A1 - A3) for other sensors. With some tweaking, another 2 could be enabled for a total of 6 analog inputs. The rest of the pins default to digital inputs but can be changed to digital outputs in the application. Click the "UBW IO Diagram" button for a pin diagram of the UBW. Outputs can drive up to 25mA.
There is a beacon light that I will probably hook up as well. If anyone else has any other ideas for what to hook up to the UBW, let me know (or just go ahead and do-ocracy it yourself).
The circuit is very basic. The light level sensed by the photoresistor goes into the analog input (A0) of the UBW. The UBW is connected to SpaceBox over USB (virtual com port). It's not easy to use com ports with mIRC script so I made a Windows application to control the UBW and act as a DDE Server that mIRC can communicate with. This also makes it easier to integrate with other applications or web services, if that becomes necessary. Click the "DDE Commands" button to see the DDE commands available and how to use them from mIRC.
The C# source code is available at https://code.google.com/p/ubw-com-net-library/
Right now, the first analog input is used by the light sensor. There are 3 more available (A1 - A3) for other sensors. With some tweaking, another 2 could be enabled for a total of 6 analog inputs. The rest of the pins default to digital inputs but can be changed to digital outputs in the application. Click the "UBW IO Diagram" button for a pin diagram of the UBW. Outputs can drive up to 25mA.
There is a beacon light that I will probably hook up as well. If anyone else has any other ideas for what to hook up to the UBW, let me know (or just go ahead and do-ocracy it yourself).