Detect approaching car/detect distance from home

Hi all,

Last weekend our cat died. A car didn't see him and bang our little 1 year old kitten died. I couldn't blame the driver. It was dusk and cats are then barely visible.

Now I thought of the LED collars we have for our dogs. When we take the dogs walking for their piss before they go to bed we press a button on the collar and the LED's light up.

So I thought, what if I made a LED collar for a cat. The problem is, cats don't come home before dusk and say: "Hey, press the button to make me a shining cat". They just keep messing around in the neighbourhood until they decided to call it a day.

I think I could fix this problem with a light resistor. It detects when it's dark and plop lights go on, problem solved.

Next problem: "Battery consumption", in case the cat stays outside all night hunting down innocent mouse the lights will light all the night. I dont want to replace the battery every day so in perfect circumstances the LED's only light up when the collar detects a car approaching.

So my question for you: Is it possible to create a sound recognition for an approaching car? It doesn't have to be prefect offcourse. In the worst case: No sound at all -> lights off. Any sound -> lights on.

Sorry to hear about your cat.

I think that a detector is not possible. The mic will pick up any sound, like the cat crawling through a hedge or just walking. The car has to see the illumincated collar from about 50 meters ? If it is a silent car, there is not a lot of sound level. A small battery and a ATtiny would perhaps be wearable for a cat, but I don't think that a car can be detected.

Well, it might work. I have a simple sound detector thread that is very sensitive, well, too senstive I am afraid. You can change the threshold level however. Combined with light level detector . . . it is worthy it trying. You can use the code and test it, then convert it into Attiny.

Of course, like @Erdin said, if the cat is running, etc, it makes a lot of noise.

The thread:

http://arduino.cc/forum/index.php/topic,148666.0.html

Thanks for the replies.

Yeah, I thought it wouldn't be possible to detect a car. So I think like I have to use the mic only to detect the difference between no sound at all and a any sound above a certain volume.

It isn't a poblem if the led's light up when the cat is crawling in the bushes or running arround. Its more the idea to save power whenever it can, like the cat is sleeping in a grass field, or sitting on a parking lot watching around.

Think it will be a challenge to tune the sound detector so it isn't to sensitive but sensitive enough to detect an approaching car. Assuming a faster car will produce more sound then a slow driving car, the slow driving car has a shorter brake way.

I think I give it a shot and do some experimenting with it. Thanks for the link to your sound detector thread mjkzz!

A cat may feel that a give-away collar is a problem. What it may do to rid itself of the problem may become a bigger problem.

Alternatively, you can trigger the light to turn on only when the cat is on the road; for example, you can put a color sensor on the collar, facing down, and check what colors the sensor primarily sees. This would be a little crude, but if you take a series of measurements over a few seconds, then you can tell with certainty that the cat is on a road-like surface.

GoForSmoke: A cat may feel that a give-away collar is a problem. What it may do to rid itself of the problem may become a bigger problem.

Yeah thats true. Depends on the cat I think. We'll see how it reacts. If it doesn't like it I make a pierced led on top of his head ;-) (Kidding, just project failed)

giantsfan3: Alternatively, you can trigger the light to turn on only when the cat is on the road; for example, you can put a color sensor on the collar, facing down, and check what colors the sensor primarily sees. This would be a little crude, but if you take a series of measurements over a few seconds, then you can tell with certainty that the cat is on a road-like surface.

Creative idea! But I think it will have some problems 1. Its night, leds are off. I dont think the color sensor will see any colors besides black because its dark 2. When the colar moves/rotates (scratching or running) the color sensor wont look down anymore 3. Our complete neighbourhood is made of the same bricks as the road where cars drive. (Only difference is that our neighbourhood is "walking only")

But the idea to detect a road instead of the cars is something I really like!

New (bad) idea (Rough thinking): A GPS in a collar and based on the location (roads) light up the collar. But I tink this wont work with an ATtiny, will use much more battery than just lighting leds all night, Makes the project WAYYY more complex.

New good idea?? I live almost in the middle of a neighboorhood where cars are not allowed. See it as a square with in the middle my house.

Roads where car drive are (I guess) placed 60 meter in each direction (north, east, south, west) The save zone is between these roads. So if the cat is 60 meters away from home the leds light up. Is it possible to detect if the cat is more than X meters away from home?

You can use a transmitter and cheap receiver. If it receives turn it off. If not on. It will be on more often when it is further away. It will not be a circle and it will go on and off even in the same spot. You will need to experiment. The good news is that you can experiment while you are holding the unit. By adjusting the power or transmit antenna you may find you get decent results. Give it a shot!

How about just using some hi-visibility reflective tape as a collar? That is passive as it uses the light of car headlights and street lights to make the wearer visible.

Why re-invent the wheel? This is what hi-vis reflective material is for.

If you really want to use LEDs then why not just have an LDR to detect when ambient light is low and then flash some superbiright LEDs. The superbright LED's can be used at very low current and will still be visible at night. The human eye is very sensitive to light in darkness; even more so if it's flashing.

As an example I use some blue SMD LEDs as power indicators on my PCB and run them at 5v via a 10k resistor. That's less than 0.2mA and is visible in daylight. You'd need a minimum of 3 LEDs for 360 deg visibility. 0.6mA or less, flashing 1:2 is an average of 0.2mA PLUS whatever the uC uses.

You could run an ATTiny at 1Mhz and it should use about 300uA in Active mode. That's 0.5mA total consumption.

Eking out the power is the biggest challenge, as I'm sure you'll want to use a small power source, like coin cells.

Something like an LR2450 is 120mAH 3.6V. That would run everything for approximately 240 hours or 30 days of 8 hours per day darkness.

It does mean the cat will be lit up all night, but you'll need to decide which is more important to you, the safety aspect or glowing cat.

You may well have all your neighbours reporting strange glowing alien beings in your neighbourhood for a while though.......:P

sbright33: You can use a transmitter and cheap receiver. If it receives turn it off. If not on. It will be on more often when it is further away. It will not be a circle and it will go on and off even in the same spot. You will need to experiment. The good news is that you can experiment while you are holding the unit. By adjusting the power or transmit antenna you may find you get decent results. Give it a shot!

A RF receiver and transmitter might be the sollution. No signal -> leds on.

I was searching down the internet for radio frequency transmitters and receivers but I cant find a small receiver. The receiver has to be in the colar but I can only find "huge" receivers (for a cat).

tack: How about just using some hi-visibility reflective tape as a collar? That is passive as it uses the light of car headlights and street lights to make the wearer visible. Why re-invent the wheel? This is what hi-vis reflective material is for.

  1. Its no fun to make :P
  2. If the cat is facing a car or showing his ass to a car, the collar wont light up

tack: If you really want to use LEDs then why not just have an LDR to detect when ambient light is low and then flash some superbiright LEDs. The superbright LED's can be used at very low current and will still be visible at night. The human eye is very sensitive to light in darkness; even more so if it's flashing.

As an example I use some blue SMD LEDs as power indicators on my PCB and run them at 5v via a 10k resistor. That's less than 0.2mA and is visible in daylight. You'd need a minimum of 3 LEDs for 360 deg visibility. 0.6mA or less, flashing 1:2 is an average of 0.2mA PLUS whatever the uC uses.

You could run an ATTiny at 1Mhz and it should use about 300uA in Active mode. That's 0.5mA total consumption.

Eking out the power is the biggest challenge, as I'm sure you'll want to use a small power source, like coin cells.

Something like an LR2450 is 120mAH 3.6V. That would run everything for approximately 240 hours or 30 days of 8 hours per day darkness.

It does mean the cat will be lit up all night, but you'll need to decide which is more important to you, the safety aspect or glowing cat.

You may well have all your neighbours reporting strange glowing alien beings in your neighbourhood for a while though.......:P

Nice calculations. I think I might make this a little to extreme for a project like this. I havent made the calculation you made yet and by reading it and notice that it will work for around a month with one coin cell battery makes me think; Thats long enough! I dont think using RF signals will improve battery life. Thanks a lot!

You can probably make it run longer by using power save modes.

if you flash an LED at a 1:2 duty cycle then you only need to do something every 330 ish milliseconds. That is still a long time in uC land at even 1Mhz (each cycle is 1 millionth of a second, or 1uS)

So...you could probably go into low power or sleep mode for the rest of the time. I've not played with power saving modes myself yet, so I'm not sure how it affects the ability to hold pin at a set state, High or Low. If that's not a problem then you could sleep most of the time and maybe extend that run time by quite a large factor.

Someone with experience of using power save modes will give more advice I'm sure.

tack, I like your idea of a reflective collar.

nlanaconda, good reflective material will reflect in all directions. Since the cat is probably walking and the car moving, it is almost impossible that nothing is reflected. Fun or not, this is probably the best for the cat.

i havent read the replies, so i dont know if this was mentioned:

i dont think thats a good idea at all. cats climb on trees, go through bushes. if she gets stuck eg while jumping she might be strangeled to death. I wanted to build a rfid cat door, while doing some research ive seen horrible pictures of cats with collars, even with those which are suppossed to break in a dangerous situations

If your cat already has a collar, then I’d have thought that a light dependent resistor and flashing high intensity LED on top and a couple of small batteries underneath would do the job. I suppose you would need to recharge the batteries every day or so. I suspect you could get away just with a transistor based solution rather than needing the complexity of a microcontroller. As previously commented - this would make sense in addition to a passive reflector and not instead of. By far the best defense will be the cat’s natural instinct to stay away from traffic, and hopefully the sad end of your kitten was only caused by its inexperience and older cats will be far less at risk.

Dogs can be trained to stay in the yard with a shock collar (some don't even need that) but cats just don't take clues.