AliciaPaterson.com

Tag: Automation

Wireless Cat Feeder Update

by on Feb.27, 2013, under Home Automation, Open Hardware, Smart Home

Nothing is ever as simple as first seems.

Although my new Wireless Cat Feeder has been operating brilliantly, the cat was still often waking us up for pre-dawn breakfast.  Although I would grab my phone from the bedside table and hit the ‘Feed Cat’ button, the cat was unable to grasp the concept that food was now available since the people didn’t get out of bed and get it for him.

In the past we had established a kind of Pavlov’s Dogs association when giving him cat nibbles.  We would shake the bag of cat nibbles before putting some on the plate.  The noise of the bag being shaken would get him running over every time.

So I wondered was there a way to include this in my solution…?

I had picked up an MP3 player/ trigger board from Sparkfun a couple of weeks earlier for another project but didn’t need it straight away.  I saw an opportunity to re-hack my Cat Feeder, add in the ability to play an MP3 recording of the cat food bag being shaken, wait a second, then trigger the food.

This clever board has a built-in MP3 player plus support for playing sounds based on either commands though a serial connection or by bridging one of 18 trigger pins on the board.  Shorting the pins for Trigger 1 would play a file on the SD card with a filename starting 001.

The modifications were quickly made: 5V power to the MP3 Trigger board, SD card loaded with the relevant sound effect with filename 001catfeeder.mp3, a transistor connected to the relevant trigger pins with the base connected to another GPIO pin on the RN-XV.  I modified the PHP script a bit to send the telnet command to power on/off the GPIO pin for the MP3 player, wait a second, then trigger the cat feeder as before.

The setup inside the Cat Feeder was a bit ugly, but I was hoping I would only need the sound effect for a week or two then remove once the cat had also associated the mechanical sound of the dispenser with food.  Speakers were external, connected by a short mini-stereo cable from the MP3 trigger board running out through the dispenser tube to speakers hidden behind the unit.

Once all set up it was time to test it.  I pressed the ‘Feed Cat’ button on my phone, the shaking bag sound played, the cat food came out and the cat came trotting over to have some nibbles!

In the end I only had to run the enhanced version for one week before the cat got used to the idea that food could be made available without the people having to put it there, and went running over even when the bag shaking sound wasn’t being played.

Since I set this up people have suggested I make this a commercial product. Although an interesting idea I don’t think it could be made cheap enough to get to the kind of price point that would get mass market appeal.  As it stands this until represents about $70 in parts.

A commercial version would also need to have a different feature set.  My hacked cat feeder will only work in my house.  It has been configured for my local wifi network only.  If I change my wifi network settings I have to crack open the Cat Feeder to re-configure it.

It also relies on having my web server in the loop.  The ‘Feed Cat’ button is presented on a web page provided by the server.  When pressed the server must telnet to the Cat Feeder to send it the commands to operate.

A commercial version would need an easy way to re-configure the wifi settings, or just work in ad-hoc wifi mode.  There are similar products in the market that use wifi to connect to other devices (eg AR Drone or Withings Scale).  It could be set up so when first setting up the Cat Feeder you download a mobile app you could use to configure your wifi network settings, then place into normal operations mode where the app then connects and sends the operations commands over the local wifi network.

If I ever get around to building a second one to give to someone else I figure this is how I would do it next to make it more user friendly, and plug’n’play!

 

Leave a Comment :, , more...

Samsung Galaxy S3 opens doors…

by on Nov.20, 2012, under Access Control, Everything, Home Automation, NFC, Smart Home

A little while ago I was interviewed on the radio here in Australia about ways in which people are using their phones that the tech pundits never anticipated. I spoke about the phone increasingly becoming an intersection point for the real and virtual worlds; a kind of remote control for more and more things in your life.

I explained how at our house we have come to be using our mobile phones to let ourselves into the house, something which I set up as a kind of joke (“Siri, let me in”, “I’m sorry, I cant do that Dave”) but has become so useful we no longer bother fishing the keys out when we get home.

We have accomplished this to date fairly simply by combining some off the shelf home automation hardware with a little web scripting know-how.  Our phones have a shortcut on the home screen, which opens up a web page that’s only available on our local WiFi network.  Among controls for lights and appliances, this page contains a button to unlock the door. Pressing the button sends the command back to the computer running the PHP script which in turns sends the command through the x10 home automation controller to an x10 unit wired to the existing remote door-release circuit, unlatching the door for 3 seconds before it again locks.

About as simple as could be. Or could it be simpler…?

I very recently bought a Samsung Galaxy S3 which has inbuilt support for something called NFC, and I have been thinking about some of the applications we can expect to see from NFC technology in the coming years. NFC (Near Field Communication) is a new technology that uses low-power radio to pass information across short distances, a bit like the RFID technology that has been around for years (think holding your building access card or fob against a panel to open a door) but with the ability to pass more complex information with greater security.  Some of the applications we are likely to see coming with NFC include tapping your phone at a grocery item to pick up product information, tapping another phone to pass over a picture, tapping a movie poster to get session times (yay, no more bloody QR codes), tapping at the register to buy a can of drink….or tapping your front door to open it.

To provide secure access through a door you would usually require two things: a lock and a key.  With RFID the lock is a reader mounted near the door and the key is the RFID tag or card. The RFID tag contains an antenna and a small amount of storage. When brought close to the sensor the RFID tag is powered up via induction and transmits back to the sensor the contents of it’s storage – usually an encrypted password that the sensor system has listed as allowed access.  It’s a lot like the traditional lock and key, however unlike a normal key the lock doesn’t need to be replaced when a key is lost; the sensor system can just be updated to prevent that tag from having access in the future.  And just like a physical key, if you don’t have it on you when you want to get in you’re stuck.

An NFC system presents an opportunity for a solution where both the lock and key are ‘smart’. Like the RFID system the reader at the door can check to see if a specific tag has access or not. However the extra smart bit is the NFC enabled mobile phone, which can contain an app that stores the relevant code encrypted on the SIM card. When the mobile is tapped at the reader the mobile NFC passes over the code stored on the SIM and the reader confirms access. If the mobile phone is lost the code can be remotely wiped from the phone. Similarly to provide a new person access is a simple as remotely providing their mobile with an access code securely over the internet.

As a first step I have taken a simple approach that builds on the current system. I’ve encoded an NFC sticker with the URL for the local webpage that sends the command to open the door.  When I tap my Samsung Galaxy S3 to the tag the mobile opens the URL, unlocking the door.  One of the implications of this system is that any NFC enabled phone could tap the tag to be pushed the same URL, though this is not really an issue since the page is only accessible on my local WiFi network. While not an ideal solution it does provide me with the tap-to-enter experience now while I work on the more challenging solution using an NFC reader at the door.

Some resources for trying this at home:

 

Leave a Comment :, , , , , , more...

Stuck at the lights

by on Jul.18, 2012, under Everything, Smart Traffic

Douglas Adams once observed that intelligent aliens traveling to  Earth might assume from their surveillance that the car was the superior form of life on the planet.  I think he was almost right, though I suspect they would mistake the traffic light as the top of our planet’s pecking order, as the pulse of life in every major city is defined by the commands issued from these oligarchs.

They are however really pretty stupid.

Many times I have sat in a line of traffic waiting for the green in spite of there being no other traffic using the intersection.  On these occasions I wonder that surely there must be a better way.

It turns out there are efforts being made to make Traffic Lights ‘Smart’, and these typically centre on efforts to connect cars via wireless technologies (wifi, 3G etc) to each other and to a central network.  Such a world would usher in a huge host of attending benefits:

  • Predictive braking, so when the car in front puts on the breaks it announces to all cars following which then disengage the accelerator and start braking in anticipation of the driver doing the same
  • Faster Emergency Responses as all cars on a stretch of road are warned via the network of an approaching emergency vehicle and can then warn the driver where to go to get out of the way – even before the lights or siren get in range
  • Less traffic strain on existing roads, since due to predictive braking cars can travel closer together allowing for higher traffic density
  • Better incident management, as traffic data is captured in real time allowing for identification and immediate management of trouble spots
  • More effective infrastructure planning, due to highly granular traffic data

While this is all great and brilliant, of course the realisation of the above technology is greatly hampered by the huge number of industry participants and the lack of any standard or leadership in the area (efforts by BMW and Siemens notwithstanding).  Experience from other similarly fragmented industries tells us that it will take years before a single technology is adopted broadly enough to make it worthwhile.

In the meantime however there is an opportunity to make traffic lights smarter even though cars are still dumb.  Every traffic light installation today has a basic level of intelligence; induction coil sensors in the road pick up the presence of cars waiting at the intersection and inform the timing pattern of the lights such that while no cars are waiting on a crossroad the default route gets the green a little longer.  I can see an opportunity to improve on this behaviour in two ways.

  1. Link sets of lights.  By providing a set of lights (A) with data about cars passing over sensors at an adjacent set of lights (B), lights A can anticipate traffic coming their way and better time cycles of changing lights.  This approach requires some physical networking of light sets and re-tooling of traffic light algorithms however would result in a significant (>10%) improvement in waiting times, carbon emissions, general sanity etc
  2. Give traffic lights the power of sight.  There has been much advancement in the technology of video object recognition, much of this due to investment in devices such as Microsoft Kinect and Google’s Goggles.  Which the idea suggested above at (1) would provide traffic lights with a degree of better visibility of coming traffic, equipping lights with cameras and the means to understand what they are seeing would allow a greater resolution and overcome limitations inherent in a sensor only solution – such as recognising and responding to bikes, pedestrians and traffic incidents.

The second solution has the potential to allow for even greater granularity in traffic management.  Imagine waiting at a quiet intersection in the future where the lights give green signal just long enough for you to get through before the next wave of traffic approaches.  There is room for highly significant improvements in traffic flow rates with such a setup, although it would have to take into account driver response times for starting and stopping.  It also provides the benefit of additional sets of traffic cameras for transport authority monitoring of roads and incident recording.

Since the light cycle times become more granular in this solution it is important that drivers understand that they are being allowed to proceed under a smart lighting scenario; effectively they must not delay when moving through the intersection, as well as be alert to oncoming traffic. To signal this I introduce a new colour light located below the green. The flashing blue light indicates it is safe for a single car to proceed through the intersection without delay.

The beautiful thing about the smart traffic light solutions I’ve suggested is that no industry concordance is needed in order to make them work;  a suitable technology solution from any player can be implemented by any forward-thinking council anywhere.  It might become obsolete in 10 years when smart cars become predominant on our roads, but by then the solution would have paid for itself many times over though reduced investment in new roads and lower carbon emissions.

Something to think about next time you’re stuck waiting at the lights…

Leave a Comment :, , more...

Digital House keys via SMS

by on Mar.19, 2012, under Access Control, Everything, Home Automation, Smart Home, SMS Integration

I had been considering this project for a while: the ability to send a link to someone they can use on their smartphone to open our front door.  Useful for deliveries or when friends or family come over while you are not home.  For example I recently had a friend come and stay while we were away for the weekend, however getting a key to him was going to be a challenge as he lived interstate.  In the end I left a key in the mailbox which is a terribly inelegant solution and not especially secure.

So I have now developed a script that allows me to send an SMS with a web link that when clicked unlocks the front door for a couple of seconds.

Obviously when designing this I had to think carefully about how it would be secured.  I wanted to ensure it was well protected enough that the effort required to hack it was much greater than the effort required to just break in.

The solution builds on my existing x10 home automation which already has the ability to open the door via a set of controls on iPhone, which is already secured such that it can only be accessed while on the local wifi network or via a pin code to access the mobile web page.  It works so well we now typically use our iPhones to open the door when we get home almost never bothering to fish out our keys.

When the destination mobile number is entered in the control page the php script sends an SMS (using directsms.com.au API) with a link.  The link includes a randomly generated alphanumeric key which has already been stored on the database, along with the timestamp of when it was originally sent and when it was then used.  The link has to be used within one hour or it will not work.  After the first use it will continue to work to open the door for two minutes, after which it will no longer work.

I’ve also implemented IP tracking to capture who has used the link but also to check for maliscious use (ie brute force attempts to guess the key), blocking access in the case of supicious behaviour.

Leave a Comment :, , , , , more...

Siri, Let me in!

by on Mar.07, 2012, under Access Control, Everything, Home Automation, Smart Home, Solutions, Technology

Siri answers the door…vacuums the floor.

I have been playing around with SiriProxy which provides a mechanism to override spoken commands to Siri on an iPhone 4s.

Normally when you talk to Siri your iPhone sends the voice packets off to an Apple server which interprets them into words and then tries to interpret what you mean.  It then sends a response back down to your handset, which is why Siri only works when you have a working internet connection.

In order to hijack this process it is neccessary to have your iPhone send Siri commands to a computer on your local network which has been set up to run SiriProxy.  SiriProxy can then intercept the commands, figure out what you said and then look to see if it has local instructions for responding before sending on to Apple’s servers to respond.

The upshot of all this is that as long as your iPhone is connected to your local wifi network you can customise your own Siri responses.  Siri will continue to work normally where you haven’t created a specific local command.

Since I had already set up home automation for many activities in the house including watering the garden, kicking Roomba off to vacuum and opening the front door, it was easy to hook SiriProxy into this.  When SiriProxy figures out you asked to be let in, it calls a web page that runs a PHP  script that sends an x10 command to unlock the front gate.

The full set of Siri’s capabilities at my home include turning on or off the watering system, turning Roomba on or off, opening the front gate and front door, and controlling lights around the house.

SiriProxy has allowed many similar innovations to evolve from controlling the TV to starting the car.  These examples continue to show the value of the smartphone as a remote control for your life.  SiriProxy is deeply restricted however due to it being shackled to your local network only – it is not possible (or at least fairly difficult) to use your own custom Siri commands when out and about.  Although this is unlikely to change for Apple’s devices anytime soon, as speech recognition becomes more widespread on all smartphones (read Android) expect to see the evolution of a modular, configurable speechrec service that will allow easy integration into other devices.

While using Siri to start the vacuuming is fun, it is not very practical.  However with a bit more tinkering I expect I can give Siri the ability to schedule specific home automation events which will be done even if I, my iPhone and Siri are not present.  I can see that asking Siri to turn off the light at 11pm or do the vacuuming in an hour will be much more useful…

Thanks to Natia for starring in the demo video!!

 

Leave a Comment :, , , more...

Home Automation

by on Apr.03, 2011, under Everything

I’ve been running Home Automation with control extended via the internet and to mobile devices in the home for a few years based on the x10 standard.

My equipment is predominantly winplus stuff that I bought dirt cheap when Bunnings dumped all of their stock a few years ago.

Controlled by the setup are:

  • Living room lamp
  • Bedroom lamp
  • Entertainment Unit (to shut off power for all equipment to avoid using vampire power)
  • External lighting
  • Insect repellant (mozzie zapper)
  • Irrigation system
  • Home alarm system

There are RF remote controls, however my Home Server also controls all elements; the Home Server also extends control to IP devices either on local network or via the internet.

I have written an iPhone compatible webpage to control all elements, which uses filtering security to provide easy access to all controls when the phone is using the local network, but needs an PIN entered to access controls from external networks.

1 Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!