Wired Living

Sunday, 15 April 2007

Bluetooth Proximity Prototype - XPL Application

With the success of the USBMicro Switch/PIR prototype - I thought I'd have a crack at also building an XPL Bluetooth proximity application. One which simply fires off triggers for any bluetooth device found in the area.

It's obviously a good way to work out who's at home, especially if it's mashed up with PIR detection - so thought it would be a good little experiment which I could also definately build into my HA project.

Being an old VB6 guy - I went on a google search mission to find an active-x object to do all the hard work. I already had a USB dongle I bought a year or so ago (another eBay cheapy)

I found a control built for transferring files over bluetooth called ActiveBlue2 - which unlike others, also allows visibility of unknown (unpaired) devices. There's a shareware version available which times out - but doesn't look like a trial key is required if you're simply searching for devices! Just means I can't actually release this app - so may have to look at alternatives so I can share the app/code (As the object license fee is around AU$300!). Feel free to drop me a line if you know of any free alternatives I can use (Active-X)


Anyway - It didn't take too long to build a quick app as a test which:
  • stores a list of visible devices in memory (simply used a list control)
  • polls the visible device list every 10 seconds and adds any new devices it finds to the list
  • removes devices that are no longer in range
  • fires off a xpl trigger message (used sensor.basic - device:input) for any new or removed item.

Works great! Only problem is my phone needs to be left in discoverable mode - which isn't ideal - as paired devices always show up as connected - even if they're not in range.

A possible workaround is to look at the last connected time and build in some configureable timeout functionality into the application. I'll get back to this if there's any interest (once I've finished the USBMicro XPL project)

Labels: , ,

Saturday, 14 April 2007

USBMicro - XPL Application (Input)

After a visit to the local Electronics store to pick up some bits and pieces (been a very long while since I've touched a soldering iron!) I setup a basic circuit to wire a switch & a PIR (a cheapo eBay purchase too!) to the USBMicro board.


I used XPL VB6 Framework demo app - and mashed it with the demo USBMicro input app - and before I knew it - I had it broadcasting status changes over my network!

The current app works by polling the device every 500ms and if any changes are detected, sends the status for all ports on the device.

Other functions to add:
  • Add code to only send status updates on the changed input - to reduce noise.
  • Stick in some checks (like to make sure the USBMicro device is attached first would be useful! :) - and perhaps re-check periodically
  • Allow the ability to set friendly names of each port in XPLHal (instead of device0>device16).
  • Respond to status requests (so XPLHal can get initial status on startup)

Since this USBMicro also supports reading of 1-wire sensors, I may have a crack at wiring one up to this too - so I don't need to use the temperature sensor kit and obviously build the functionality into the XPL app as well.

May also find some other useful applications for this. I'm open to any suggestions on ways of utilising this device too - so drop me a comment on here if you come up with any.

USBMicro's Capabilities:

  • 16 Digital inputs (ie. this project)
  • 16 Digital Outputs (could use to control relays)
  • Interface to SPI Devices
  • Interface LCD Controllers
  • Stepper Motor Control
  • 1 Wire Sensors (temprature)

Anyway, all I can say is I really enjoyed getting this up and running! Was a good mashup of electronics & coding - which I haven't done either of for quite a while. It has gotten me thinking about other devices I have around that I can integrate into my XPL network. Perhaps something with bluetooth....

Labels: , ,

Tuesday, 10 April 2007

USBMicro - Digital I/O Device - Arrived

Got the USBMicro unit last week - and looks like it will be pretty easy to write up a little xpl app to read the inputs. (Comes with a DLL and loads of sample code).

Have already started working on it - just getting my head around it all as I haven't built any xpl apps before - but do have some VB6 experience (albiet quite a while ago) but have found loads of samples I can use as a base (nice work Ian Lowe) I'll just be building it to support the digital input side of things - as I'm going to use it to read in PIR/switches into XPLHal for my own HA project - but will share the code once I have it working - so that it could be improved upon to control external devices/relays etc.

The device looks damn useful - as it can also be used for 16 digital inputs or outputs, read 1 wire devices / stepper motors / spi / control LCDs / Relays and a bunch of other potentially useful stuff - so definately worth a looking into if you're looking for cheap but powerful way to get something connected.

Was under $50 australian (US$40) including worldwide shipping Got mine from here

Labels: ,

Sunday, 25 March 2007

How Hot is it? 4 Channel Temp Logger

I thought it would be great to get some real-world temperatures feeding into my system to:
  • Control HVAC
  • Curtains/Blinds
  • Display on Squeezebox / Touchscreen

The idea is to have 1-wire sensors setup in the main living areas, one outside and another in the equipment encloser.

I saw there was an xpl application to get a Quasar 3145 Temprature board onto an xpl network.

Did a bit of searching and found a local supplier that sold them here, both in kit form and assembled (Under a different brand - but looked identical). Being a little lazy - I went the assembled route :)

Arrive a couple of days ago, plugged it in, installed the app - and presto - worked a treat.

Total cost: a little over $100. (4 sensors)

Labels:

USBMicro: Cheap I/O Interface


Was after a cheap way of getting some PIR & Door Switches hooked up to my system

Stumbled across one of these USBMicro which looks like a fairly simple & affordable way of getting 16 digital i/o ports connected

I've just ordered one so will have a crack at writing an XPL Application to get it on my XPL network..
Should be a good learning exercise at the very least

Will keep you guys posted.

Labels: ,