Dangerous Prototypes

In development => Project development, ideas, and suggestions => Topic started by: pppd on February 18, 2011, 12:34:49 am

Title: Indoor cat locator
Post by: pppd on February 18, 2011, 12:34:49 am
For a while now I have been thinking about creating some kind of indoor cat location system that would be used to prevent my cat from walking on the kitchen table and a few other places. The problem with cats is they only obey rules when you are around and can see them. Once you go out or even to another room the do wherever they like.

There are a few ways of keeping your cat off the table and the only one proven successful is getting rid of the table altogether :) There are a few other but as they use motion sensors they would also be triggered by me. Personally I love the Blender Defender ( http://www.plasma2002.com/blenderdefender/ (http://www.plasma2002.com/blenderdefender/) ) but it is too noisy and depends on motion detection.

My first idea is to put a collar around my cat's neck and have it carry a small 868MHz/2.4GHz transceiver and a CR2032 battery to power it up. A few receivers located in the corners could give me approximate position by signal strength analysis. Then I could set forbidden zones and trigger some kind of either noise or flash to teach the cat to keep off my shelves and tables :)

Another idea is to use a web cam with an IR pass filter installed on its lens and then have the cat carry a flashing IR LED. I have a small ARM Linux box ( NSLU2 ) which I could use for that.

I am open to any suggestions as I would really like to get it done. I do not want to use a cam and video processing for this.
Title: Re: Indoor cat locator
Post by: rsdio on February 18, 2011, 06:44:45 am
If cell phones are really bad for children, then wouldn't it be bad for your cat to wear a microwave transmitter?  i.e., the IR solution might be safer.

What about ultrasonic radar?  I suppose that's still a form of image processing, even if it isn't video.
Title: Re: Indoor cat locator
Post by: ian on February 18, 2011, 08:11:25 am
Quote
Another idea is to use a web cam with an IR pass filter installed on its lens and then have the cat carry a flashing IR LED. I have a small ARM Linux box ( NSLU2 ) which I could use for that.

I'd start here too, maybe using another IR LED also as a simpler IR detector. It seems like signal strength analysis could be complicated to get right in a confined space over short distances, but I don't speak from experience or anything.
Title: Re: Indoor cat locator
Post by: Sjaak on February 18, 2011, 08:45:22 am
There is an other (proven to work) option: get rid of the cat ;)

You could use the sensor built into the wiimote to track IR signals. It contains a camera specially made for tracking IR signals.
Title: Re: Indoor cat locator
Post by: pppd on February 18, 2011, 09:29:04 am
Hmm, how about reversing the transmitter/detector placement? Maybe my cat should wear a photo transistor connected to a MCU interrupt ( good for deep sleep and power saving ) or comparator ( easier to handle signal strength calibration ) input and the forbidden places zones be lighten up with IR LEDs in a way that would minimize reflections so it can safely walk on the floor :)

@Sjaak: That's true.. but I think I will give the cat a chance before sending it to sleep on the balcony when it's -10'C outside ;P
Title: Re: Indoor cat locator
Post by: MichaelZ on February 18, 2011, 11:19:29 am
I remember a project where they used a camera pointing down at a work area and software to detect motion.  Seems like some of the new cameras have that built in.

Now if I could just keep track of my wife.
Title: Re: Indoor cat locator
Post by: rsdio on February 18, 2011, 12:03:28 pm
Keep track of your wife and your cat: Max Home (http://http://www.maxhome.org/)
... probably not what 'pppd' wants, since it has video cameras as part of the system components.
Title: Re: Indoor cat locator
Post by: pppd on February 18, 2011, 12:36:43 pm
My girlfriend doesn't require tracking.. I am doing my best to focus on her when she's around so I do the tracking myself :P

The next thing I will document in the project log is an electrical energy meter optically interfacing the power company analog  device :) For now I just want to solve the cat problem.
Title: Re: Indoor cat locator
Post by: MichaelZ on February 18, 2011, 12:43:28 pm
I frequently lose my wife in crowds or department stores.  I frequently end up calling her cell phone and ask where are you.
Title: Re: Indoor cat locator
Post by: sqkybeaver on February 18, 2011, 01:28:29 pm
[quote author="MichaelZ"]I frequently lose my wife in crowds or department stores.  I frequently end up calling her cell phone and ask where are you.[/quote]

are you suggesting a cat phone?
Title: Re: Indoor cat locator
Post by: pppd on February 22, 2011, 10:13:56 pm
I started the project from forcing my cat to wear a collar. It doesn't like it and desperately tries to tear it off ( well, it's a she but I keep referring to it simply as a cat ) .. I hope that given some time it won't be able to live without its collar :) I will post some IR experiments results soon.
Title: Re: Indoor cat locator
Post by: pppd on March 28, 2011, 04:13:35 pm
It's been a while since my last update.. but the project is definitely not dead. Actually I found quite a few people interested in this solution so this might go into limited production once proven successful :)

Idea which is being tested right now:

Cat wears a collar with an IR receiver ( TSOP1736 ) connected to INT0 of ATTiny2313 which stays in power-down mode. The receiver is powered up from another uC pin. In sleep/power-down mode the INT0 is configured for low-level wake-up as this is the only way to wake the CPU from power-down mode except for RESET. In this mode the current usage is below 400uA. This is still too much, but I don't think I could save much more with different IR receiver so I will need to live with that.

When it wakes up, it changes INT0 to be triggered by either edge. It then does all the data processing which is checking received ZONE ID. Current required for active mode at 4MHz / 8 is about 1100uA. After a successful zone identification it starts beeping and when cat leaves the forbidden area it goes back to sleep. Now this is the simple mode, but there of course gotta be more.. as I am a data collection freak :P

The collar will also be equipped with a small 2,4GHz transceiver (HopeRF RFM70). It will be powered down at all times ( just in case you are worrying about my cats health ) and will be used to notify supervising device about cat entering forbidden zone. The device will log each event in a database so I know if the cat is actually learning. Also depending on the time of day and my presence at home different penalty will be issued. For instance, I do not want beeping at night so instead the cat might get a puff of air or won't get a treat the next day.. we'll see.

The main problem is powering it up. Button cells do not provide enough operating time and I don't want to replace it every week or so. I was thinking about a small LiPo cell ( I have a few 240mAh, 180mAh, 300mAh which I use for DLG model planes ) protected by BOR reset so it goes into power-down mode when it's under safe voltage. Power usage in complete power down mode is about 15uA measured. I would need to put it in some kind of a fire-proof case as these batteries can be dangerous and I don't want my cat to burn in flames.

I will publish some clips and schematics next week :)
Title: Re: Indoor cat locator
Post by: rsdio on March 29, 2011, 12:32:48 pm
[quote author="pppd"]The device will log each event in a database so I know if the cat is actually learning. Also depending on the time of day and my presence at home different penalty will be issued. For instance, I do not want beeping at night so instead the cat might get a puff of air or won't get a treat the next day.. we'll see.[/quote]Ha!  I love cats, but I've never met one that was willing to be disciplined.  I would say that cats are incapable of learning, but they certainly learn things that they want to learn.  As far as disciplining goes, they seem incapable of learning what humans want them to do.

Good luck.  Sounds like a fun project in any event.
Title: Re: Indoor cat locator
Post by: ian on March 29, 2011, 03:50:25 pm
Quote
The device will log each event in a database so I know if the cat is actually learning.

lol, I also thought that was funny :) Thanks for the update. Is it the demodulator or uC that takes the power? You might be able to use another IR LED as a passive receiver.
Title: Re: Indoor cat locator
Post by: pppd on March 29, 2011, 05:40:36 pm
It's the IR demodulator that takes the power. I might try two stage triggering with a photo transistor which will activate the CPU and then the CPU will power up the IR demodulator. We'll see if this brings any savings. The good thing about demodulator is that it doesn't trigger when it gets lighten up by anything but a properly modulated IR signal. So the photo transistor/diode will only help if the power saved during IR demodulator being shut down is greater than required for running the CPU.

I will just do some testing.. I am not a big fan of theoretical calculations in such simple cases :)

Regarding cats not being able to learn.. I have heard/read that cats obey you only when you are around, so if you want them not to do something there must be something that's scaring them at all times not just when you are looking :) We'll see how it goes.. I will make the log public and accessible in real-time ;)
Title: Re: Indoor cat locator
Post by: Rubu on March 29, 2011, 08:22:17 pm
[quote author="pppd"]
Regarding cats not being able to learn.. I have heard/read that cats obey you only when you are around, so if you want them not to do something there must be something that's scaring them at all times not just when you are looking :) We'll see how it goes.. I will make the log public and accessible in real-time ;)[/quote]

I sometimes feel cats kind of perceive things the other way around, one cat I know always seems to think it's her house and you are just visiting.. It's great to see where this is going!
Title: Re: Indoor cat locator
Post by: pppd on March 29, 2011, 11:25:11 pm
I've done some more testing with dual stage triggering and it seems to be the way to go. The stand-by current is now 24uA ( it was around 400uA before ). Once the phototransistor is activated by IR ( I've used LTR4206e in a  'black' plastic package which cuts out visible light ) it triggers INT0 low level interrupt, then the CPU wakes up and cuts transistor power off and activates the IR demodulator and INT1 edge interrupt for a few seconds. Once done processing it goes back to sleep enabling the transistor and INT0 again.

This is very good news because it's now reasonable to use CR2032 batteries rather than LiPo cells. It should easily last for about 3 months even if the cat violates zones frequently. It also means that I do not to worry about it being discharged below 3V and there is no need for voltage regulator to power the RFM70 transceiver :)

And here is the victim.. her name is Yuki
(http://http://farm5.static.flickr.com/4054/4437995425_eb29772af3_m.jpg) (http://http://www.flickr.com/photos/piopawlu/4437995425/) (http://http://farm5.static.flickr.com/4056/4420923726_281755faf1_m.jpg) (http://http://www.flickr.com/photos/piopawlu/4420923726/)
Title: Re: Indoor cat locator
Post by: arhi on March 30, 2011, 03:26:03 am
they can learn - they can learn very complex things (like turn the switch on one room and run to other room to enjoy the heater that switch turns on) ... but all cause-effect must be "immediate" ... the "I will not give you a treat because you did/didn't do something *last night*" ain't gonna work with a cat (not going to work with a dog neither and they are trainable). Only way to "control" her is to have 24/7 monitoring and immediate reward/punishment.

Now, I know we discuss electronics here but if you really want your cat to leave "xyz area" alone - use citrus... just put a lemon, lime, orange or some other citrus there and cat will avoid it. They hate the smell of those fruits.
Title: Re: Indoor cat locator
Post by: pppd on March 30, 2011, 09:00:11 am
[quote author="arhi"]the "I will not give you a treat because you did/didn't do something *last night*" ain't gonna work with a cat (not going to work with a dog neither and they are trainable). Only way to "control" her is to have 24/7 monitoring and immediate reward/punishment.[/quote] That was more a joke than an actual solution, like asking my cat if it jumped on the table last night and expecting her to tell me the truth ;-)

You are right about the citrus fruits.. but it only works if you squeeze them on a cat. There is a a fruit bowl on my table and it doesn't work :) Besides.. where is the fun in that :P?
Title: Re: Indoor cat locator
Post by: arhi on March 30, 2011, 06:59:49 pm
that's one resilient cat, mine 10kg monster (http://https://picasaweb.google.com/lh/photo/jDVdlJjzDFWhLbaodzjAXg?feat=directlink) keep min 2m distance from any citrus .. she's allowed on the kitchen table for e.g. but she will not go there if a single orange or lemon is on the table ..
Title: Re: Indoor cat locator
Post by: sqkybeaver on March 30, 2011, 07:13:14 pm
i have been paying attention to this thread because my cat is always keeping us up at night, he loves to tap dance in the bathtub. closing the curtain does not help and i cant shut the door because that is where we hide his litter box.

I have thought about building a sentry gun that will squirt him if he jumps in the bathtub.

my cat is also fairly large, when he runs down/up the stairs, i sometimes think some is knocking on my front door.
Title: Re: Indoor cat locator
Post by: pppd on March 30, 2011, 09:33:48 pm
wow, mine is about 3/4kg summer/winter, but still can make a lot of noise whenever she wants to annoy me :) Sometimes I'm wondering if I have a cat or a pony when it makes noise jumping around.

Coming back to the project.. I am now working on bringing RFM70 transceivers to life.. I would use RFM12B but they need external antenna and use 868MHz.
Title: Re: Indoor cat locator
Post by: arhi on March 31, 2011, 04:34:43 pm
This monster is quiet as night :D .. no sounds while she moves .. and when she want attention she "yells" .. that sound can wake up anyone :D

wrt transcievers not sure if 2G4 will be better then 868M ... but you can always put antenna in the collar :D ... now there's another idea ... have you seen the rfid key pendants .... they are small enough to add to the collar and they can store few kbits too .. so you could store the data in rfid device (pendant for e.g.) and from time to time read that data using external rfid reader to dl the data to computer ... or install one rfid reader with transmitter on the litter box .. that will insure data transfer at least 2 times per day :D
Title: Re: Indoor cat locator
Post by: pppd on March 31, 2011, 04:50:22 pm
I guess I could put the antenna inside the collar, but I want to test these 2,4GHz modules anyway. I've bought them 4 months ago and still not tested. They should be swappable pretty easily together with SW of course.

For some reason my cat likes to use the litter box at 3am.. and since my flat isn't really big you can imagine how much being woken up in the middle of the night by my digging in wood based litter.

Yeah, RFID would be nice,, but that's more and more hardware. I will use on-chip EEPROM to store events in case the supervising station is down for some reason. So no data will be lost :)
Title: Re: Indoor cat locator
Post by: MichaelZ on April 01, 2011, 07:01:46 am
I ran across this ...
Title: Re: Indoor cat locator
Post by: sqkybeaver on April 01, 2011, 02:33:10 pm
if i got one of thoes i don't think my cay would ever poop again!
Title: Re: Indoor cat locator
Post by: arhi on April 01, 2011, 03:18:33 pm
I think mine cat would find some nice hidden spot in my apartment to get the "job done" ... and taking into account what my appt looks like - plenty of room to do that .. so I'd keep litter box "stationary, clean and easy to find"
Title: Re: Indoor cat locator
Post by: pppd on April 01, 2011, 08:55:37 pm
This reminds me of another "invention" which suits April Fools' Day perfectly :)

(http://http://www.swapmeetdave.com/Humor/Cats/CatCarrier.jpg)
Title: Re: Indoor cat locator
Post by: pppd on September 02, 2011, 02:25:49 pm
It's been ages since I was supposed to work on it.. but it seems the primary goal of my university was to kill creativity by having me finish my MSc... not entirely true, but a good excuse for being late :) I am finally "free" to work on my hobby projects and this needs to be pushed forward as the first, but there are other coming up.

By now my cat is finally used to wearing a collar so I will be able to swap it to my e-collar any day now :) I have also used hidden cam to find places he visits when I am not around and I must say it's just asking for trouble :P
Title: Re: Indoor cat locator
Post by: dpropicweb on September 03, 2011, 04:09:36 am
In the absence of your continuing posts, I'd imagined that the cat had trained you :)
Title: Re: Indoor cat locator
Post by: buxtronix on September 03, 2011, 03:36:24 pm
Cat's don't have owners, they have staff.

I must remember to post the details of my GPS cat collar. Found it quite amazing just how much of the neighbourhood he'd cover in only 2 hours..

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01842159552session_write_close ( )...(null):0
20.01872291128ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01872291904Database_MySQL->query( ).../DatabaseHandler.php:119
40.06202430624Database_MySQL->error( ).../Db-mysql.class.php:273