Zombie Detector

Status
Not open for further replies.

shouldice

New member
Hi all.

I'm a software developer by profession, but I've really enjoyed what little electronics tinkering I've done. My only project so far has been using a Teensy and the USB keyboard library to make an arcade game controller. (http://andrewshouldice.com/like-honey/)

My next project is more ambitious, mostly because (correct me if I'm wrong) it involves running on external power.

Here's the idea:

I live with my girlfriend, who is really spooked by the dark in our house. I'll occasionally hear "there's no such thing as zombies" only half-jokingly muttered at night. We've got night lights, but what I'd really like to give her is 100% assurance that no zombies are within, say, 500 meters.

A small enclosure has a status LED, a two-digit seven-segment-display, and a pushbutton. Whenever the pushbutton is pressed, the status LED starts blinking, and the 7SDs play a little figure-8 "scanning" animation. After a few seconds, the status LED locks to "all clear" green, and the 7SDs happily display that there are exactly 0 zombies within 500 meters. It'd be neat if there was a little speaker crammed in there to make a cheery beep.

So, does this seem reasonable? Any gotchas leap out at anyone? Any tips for someone new to this sort of thing?

I'm pretty sure I can figure out the wiring part, possibly excepting the sound effect. (Pulse width modulation I guess? Haven't played around with that before.) It's the battery thing I'm apprehensive about.

How long should I expect 3 AA batteries to last if I follow the low power tips? (http://www.pjrc.com/teensy/low_power.html) The page seems like it's missing some parts, so I'm a little nervous about making something that'll drain power unnecessarily or melt or something.

Thanks!
 
Last edited:
Last reply dissapeared. I've read of someone doing something similar for their child. For an adult you strongly need a slight but nonzero chance of detecting zombies just far enough away that you might not be able to detect them yourself. And oh yeah, to accurately detect zombies takes a lot more than a teensy amount of horsepower. We're talking 8 cores, 32gb ram, 400+ gpu stream processors, 128gb ssd, a few terabytes of spinning disk storage. Whatever you think you can milk it for.

Seriously though, nothing you describe sounds like a battery hog. LED's for viewing in near total darkness don't require a lot of current. The audio can be a few hundred milliwatts tops, and its low duration. The thing can sleep virtually all the time. The only potential power hog is your data storage / processing requires a lot of horsepower.
 
Use Teensy 2.0, running directly from the batteries. In the lowest power mode, the current is under 30 uA. The batteries should last for a few years if you stay in that mode.

Then again, I need to see a datasheet for the "zombie sensor" to know how much power is uses.....
 
I have a stockpile of them I use for more mundane purposes. The pullup (or pulldown, if its active low) swamps the power dissipation calculation. However...

You really should also consider a companion project. RTC + Photocell + PIR. If dark, between 12am - 530am, on motion detect emit a random "Braaaaiiinnnnsssss"
random chance low enough to cast doubt on inferences of causality.
 
Last edited:
Thanks, everyone. First, replies.

Paul: Teensy 2.0 it is.

warfrat: Your motion detector idea sounds fun, but I think she'd kill me.

Now, all kinds of questions.

Interrupts: After some experimentation I've figured out how to use the INT0 interrupt on D0. Because I just want the device to sleep and have the button perform a fixed routine, I just have an empty ISR. The interrupt still wakes up my while(1) loop in main() and re-executes the routine. Comme ça:

Code:
	main(){
	
		// ...Setup...

		while(1){
			sleep_enable();
			sleep_cpu();
			sleep_disable();
			// ...Do something...
		}
	
	}

	ISR(INT0_vect) {
		;
	}

Is that pattern kosher?

"Pin change" interrupts: As above, I've got the INT0 interrupt firing when I ground D0. That sounds like a "pin change" to me, but the datasheet also talks about "pin change" interrupts as something seperate. (PCINT01, for instance) What's the difference?

Audio: I learned a bit about PWM, and got a lovely square wave coming out of a pair of headphones. PWM, it seems, is for changing the duty on the wave, not for precisely controlling the frequency. If I want to get cute and have this thing play a little tune, how can I more precisely control the frequency? I've seen the ISD1820 audio chip mentioned a few times on these forums, but I'll hold off on something that fancy for the time being. I sort of want to write a Tone(int freq, int duration) function that uses _delay_us(), but is there a better way to do this? Perhaps something asynchronous, so I'm not using the main program loop to flick the pin on and off at the right frequency?

Also, is a little piezoelectric speaker ok for this? It doesn't need to sound good, just be audible and capable of playing a few notes. (http://ca.mouser.com/Search/Product...virtualkey66500000virtualkey665-AT-1220-TT-5R)

A side note: I'm compiling a shopping cart at Mouser and I was overwhelmed with the selection they have, and not always in a good way. In the case of resistors: what am I looking for if I want "the old beige peanut" style? Is this ok? http://ca.mouser.com/Search/Product...Fvirtualkey66000000virtualkey660-MF1/4DC47R0F

Putting it all together: I found a handheld enclosure I like on Mouser (http://ca.mouser.com/Search/ProductDetail.aspx?R=1593PTBUvirtualkey54600000virtualkey546-1593PTBU), but I'm wondering how to actually organize the internals. Do I need something like this? http://ca.mouser.com/ProductDetail/Parallax/28310/?qs=sGAEpiMZZMtgbBHFKsFQghwteFaXWDFuWTbAOwjryy8= My previous project (the arcade controller, above) is an absolute nightmare on the underside, but it doesn't really matter because there's just the chip and wires going to the controls; there's no real chance for shorting. I don't imagine cramming a knot of resistors, etc. into my zombie detector box is going to work as well. Am I on the right track with that perforated board I linked to?

This is all very exciting to me.
 
Status
Not open for further replies.
Back
Top