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!
We have been looking after a cat for quite a little while now. He is a sweet, gentle Russian Blue with a very good nature, however he has a habit of waking us up with meowing and scratching at 4am to tell us he wants his breakfast.
We made a number of attempts to find a happy solution, however we discovered that the extra food left out the night before was not fit for catsumption in the morning and that cats can overcome the muting of a closed door when they really want to be heard. I opted for a smart solution to his early morning antics.
I had seen an automatic candy dispenser available around Xmas as a cheap gift option. At $20 it included a large clear hopper for holding lollies, an infrared sensor to detect a ready hand and a motorised dispensing system to send lollies into a waiting hand. I bought a couple thinking that the hopper would store cat nibbles sufficiently well for freshness and the dispenser should be able to cope with what I took to be a slightly smaller product then the designers had anticipated.
I toyed with the idea of leaving the IR senor in the future Cat Feeder but expected the cat might just keep on going if a fresh food source was available (he likes his nibbles…so long as they are fresh). My goal was to hook the device into the existing Home Automation system such that any mobile phone in the household could trigger a food release. This would also allow us to trigger food releases while away from home as well as to script food releases on a schedule.
The existing Home Automation system is run from a PC using WAMP Server – all automation devices are held in a MySQL database and the front end and switching commands are managed using PHP5. I needed a way to connect the Cat Feeder back to the PC, without having to use additional hardware om the PC side. I toyed with adding X10 capability to it but haven’t been at all impressed with the performance of X10. Wireless would work best, and WiFi seemed the ideal solution as it could hook into my existing network allowing the PC to address the Cat Feeder directly.
My design was to hack the Cat Feeder to include a WiFi board, put it on my WiFi network at home and have it always listening on HTTP port 80 for a command to turn on. It would then execute a couple of commands to turn the feeder mechanism on for a second then off again. Simple. So I thought.
I did a bit of research on WiFi modules and found a growing number of hardware options with varying levels of sophistication. Since I was already pretty familiar with Arduino I started there and purchased a WiFly WiFi shield based on the Roving Networks RN171 chip. This board plugs directly onto an Arduino Uno board, allowing you to connect the Arduino to your computer to quickly program it to send and receive data over WiFi. It has support for all kinds of protocols (from raw TCP sockets to FTP and HTTP) and was cheap at around $60 (compared to the more common WiFi Shield at around $100).
After getting this board and connecting it up I very quickly ran into troubles. Although Roving Networks has a really good user guide for their chip, writing the require code for the Arduino to communicate over serial to the chip was a big undertaking…and frankly at the periphery of my abilities. The board manufacturer included a Arduino library which covered the basics (such as associating to a wireless network, sending packets etc) but which seemed more targeted towards using the board to automatically log into a WiFi network and post HTTP data to a server in response to hardware triggers. This made it highly suitable to a telemetry application such as sending temperature readings to a server etc, but become increasingly challenging to get it to listen on port 80 for HTTP traffic and respond intelligently. The library didn’t provide enough of the groundwork to do what I needed out of the box and tackling the learning curve that would enable me to update the library to support what I needed was more work than I wanted to invest. Furthermore the device had a habit of dropping off the network. I guess if its implementation only called for it to log on to a server over WiFi, send a bunch of data then drop off again but I needed it on all the time. I was also never really happy with it’s behaviour over a local serial connection; when using the Arduino serial monitor to connect directly to the board the output from it was always highly garbled, in some cases leading to anomalous operation.
So I looked into alternatives. By this stage I was also aware that using an Arduino board was a bit of overkill for this project – it simply didn’t require that level of smarts. To cover my bases however I immediately bought three other WiFi options!
The official Arduino WiFi shield was a little more expensive but had much better support with a full library covering everything I wanted to do, lots of examples and most importantly a healthy online community for support!
The Electric Imp seemed like it could provide a minimalist solution being the smallest of the lot. Its an amazing little device and I was keen to have a play with it.
The RN-Xv Xbee module I picked up courtesy of a Hack A Day article about a guy that used it to control his garage door over WiFi. He had a pretty good walk through of what he did and I liked that he didn’t use the Arduino board.
Since I wanted to proceed without using an Arduino board I next tried the RN-XV module. Since it is based on the same chip as the WiFly module I had been playing with, much of the operation was already familiar. Communications between the WiFly and Arduino was managed over a serial link, whereas to connect to the RN-XV I first got it going in ad-hoc wireless network mode by putting 3.3v on pin 8 and turning it on. This allowed it to come up with it’s own SSID which I could connect my laptop to in order to establish a serial connection to the board. Worked brilliantly and I was quickly able to set my WiFi network parameters (SSID, WPA2 passphrase etc) on it. Removing the 3.3v to pin 8 and rebooting it brought it up on my WiFi network – success!
I could then telnet to it and send the relevant serial commands to turn the dispenser motor on and off…however not using Arduino meant that my ability to emulate HTTP on the device was limited (again, at the periphery of my ability). So I instead turned to my PHP code and looked for an easy way to telnet to the device and send commands using PHP. After tinkering with a number of classes based on fsockopen I found one that worked well – TelnetDog.
From here it only took a few minutes to update my Home Automation PHP script, add the device to the database and presto! I had a new ‘Feed Cat’ button on my Home Remote page!
I’m happy to report that the cat is indeed eating from the Cat Feeder tray and is not put off by the noise it makes when dispensing his nibbles.
Now if I can only automate the cat litter tray…
A year or so ago I was given a Revell model of the USS Voyager (thanks Rick). While I don’t have the patience and attention-to-detail for model kits, I had been looking for an Arduino project and thought this might be a nice kit to consider a multi-mode lighting system controlled by Arduino.
I’ve tinkered with circuit design for model lighting before to flash LEDs to simulate a aircraft rotating beacon, and had scribbled away somewhere an early design. However messing around witch matching capacitors and resistors to get just the right attack and decay curve is *so* much work, the option of just coding the behaviour into an Arduino controlled set of lights had obvious appeal.
My goal for this project was to have a fairly complete set of lighting installed into the model with a button or other means of cycling through different lighting modes. The lighting was to include:
- running lights – these are steady-on red/ green lights located either side of the hull
- navigation lights – flashing white lights running through the hull midline
- cabin lights – white lights behind the windows in the hull
- impulse engine lights – there are two of these, the red light in the warp nacelles and a soft orange glow coming out of vents on the back of the nacelles
- warp engines – these are the long blue glowing lights along the edges of the warp nacelles
- deflector arrays – there are two of these – the main one has a blue glow around it, the secondary one a soft red glow
- hull spotlights – these pick out details on the hull, such as the ship name
- photon torpedos – these are pulsing red lights located front and rear of the main hull
In the end I came up with the following modes:
- Mode 0 – all off
- Mode 1 – running lights and navigation lights on
- Mode 2 – cabin lights come on in sections moving through both hulls
- Mode 3 – engines on. Impulse engines glow red and warp nacelles fade up blue
- Mode 4 – fire torpedos – the torpedo lights pulse in a firing sequence
- back to mode 0
A lot of other people have completed this exact model with custom lighting, however everyone seems to use LEDs for the blue warp engine lighting. I don’t really like this approach as it results in obvious point sources of light in the blue strip of the nacelle, whereas in the show the blue light is a more consistent intensity glow throughout. I was interested to see how effective electroluminescent lighting would be for this task. Electroluminescent lighting (EL for short) provides a soft, consistent light along the length of a wire or strip – picture those amazing costumes from Tron. EL wire comes in many forms including flat strips which seemed like a good fit for this project. EL wire isn’t cheap however (around $30 for a 1 metre strip), uses High Voltage (ouch when you touch it) and is an absolute pain to cut and shape as it is prone to shorting out.
After much trial and error I managed to cut blue EL strips to length and embed in the model nacelles – I think the result is pretty much bang on for the real thing.
My recent obsession with Arduino brought me back to an old interest: autonomous flight!
I totally love the open source community and the great stuff that people throw in together on…such as DIY Drones.
DIY Drones is a community built project using Arduino microcontroller to control a multi-rotor helicopter (though it also can control a single rotor heli or fixed wing aircraft). A dedicated Arduino board (ardupilot) connects to an IMU sensor board which contains minuscule gyros that sense the orientation of the aircraft and the built in software responds to changes in attitude by adjusting the speed of separate motors.
I have added GPS support and a magnetometer to sense magnetic heading, along with a bunch of pretty lights that help identify which way is front!