[Ed Rogers] has the unfortunate privilege of living right next to a set of train tracks, and as a man who holds his sleep in high regard, he needed to find a way to keep the noise in his bedroom to a minimum. To combat the sound of passing trains, he built himself a system that automatically closes his windows when a train passes by his apartment.
The setup relies on a web cam, which uses motion-sensing software to detect a passing train. The video is analyzed by a computer in his room which passes a message to an Arduino when a train is near. The Arduino then sends a pair of window mounted linear actuators into action, slowly (and quietly) shutting his windows.
The linear actuators move pretty slowly as you can see in the video below, but we doubt that matters. Since it looks like [Ed] lives in a slow zone, it likely takes quite a bit of time for a freight train to pass, making the 40-second closing period more than reasonable.
[youtube=http://www.youtube.com/watch?v=aBhF_qfG4Qc&w=470]
Pneumatic cylinders with dampers would be much faster but I still question how a window being closed truly blocks low frequency sounds such as a freight train would generate. My guess is not too much.
Haha I can only imagine! Psssssst SLAM smash *cry*
I can see it being faster but in this application I don’t think it would be safer. Not to mention you’d need a compressed air source.
Another improvement would be an automatic loading of walnuts/peanuts/etc into the jamb for a dual purpose closing and nut cracking!
All in all this is a good build. I cant see why to dedicate a whole computer to image processing though. You could probably pick up a cmu-cam2 cheap … check with FIRST teams. This would allow the removal of the computer and usb and allow for a single serial line for communication with the camera!
The really low frequency sounds from the locomotives would be hard to muffle, but the video shows that it does a good job of quieting the squeaks and rattles from the cars. I suspect that those sounds are more frequent and distracting than the engine noise.
can you say “flange squeal”?
What’s up with the lotion and the tissues on the nightstand!?
hah nice find! lmao
Nice work but i would be awaken in the first 5-10 seconds :(
runny nose, dry skin… ;-)
The tissues are for blowing my loa… nose, and the lotion is for lubrication before, during, and afterwards.
Lol. they are clearly visible the second time he goes to the night stand. Perhaps lube for the actuators ?
Um, maybe its just me, but wouldn’t it be easier to just,, move ?
I that he would have known the tracks where there but moved there anyway, probably means that affordable alternate housing wasn’t/isn’t available. In general someone is going to have to put up with the annoyances from what benefits us all.
To soften body parts?
@Hackerspacer:
It doesn’t really matter, because the higher frequence sounds are more annoying. Otherwise I agree with you, it shouldnt be hard to make this work a bit faster – a bit of gearing could do the trick.
But it works right now, so no need to pull apart the fancy linear actuators.
Love these practical hacks – nice build! If only the trains ran on a tight schedule, you could just use an RTC… Personally, I’d dispense with the webcam + computer and just use an accelerometer or resistive vibration sensor attached to some structural member of the house (or maybe water pipes). Get the magnitude of the vibrations, and if the magnitude exceeds some preset for more than a few seconds, close the windows. You could get fancy and use an FFT to only respond to the train’s vibration signature, but that’s probably not necessary.
Since Ed is already using an Arduino, and given availability of accelerometer shields w/ (what I hope is) acceptable sensitivity, I think @giacomo has the right idea for rev 2.
I’ve got barking dogs to deal with, so I was going in hoping Ed had some active noise canceling solution. Trying to get at the root of my problem, short of calling the cops on my otherwise good neighbor, I’ve been using the Dog Silencer Pro. It’s mounted on my house only 30 feet from the canines.
It has helped a bit, but I think it needs a bit more amplification to motivate them to shut the @#!#$ up.
To me that sounds like a much worse solution that is sensitive to error and reacts too slow.
Why? Many cheap accel’s are sensitive enough to detect footsteps. I think it could work, especially if you go with an FFT. I guess the only way to know would be to try it. Too bad/fortunately I don’t live near any train tracks. Anyone want to take their accel shield on a field trip to test?
This is a really cool idea, I think the webcam and PC image processing is way overkill though. I bet you could use an electret microphone feeding into a comparator to trigger the actuator. Granted you might have to mount the mic outside, id have to think about that.
And that brings us to the question of: why not process the sound of the train? The high pitch sounds are probably pretty distinctive.
This is a great idea, and you could use a parabolic microphone off ebay to pick up the train at a great distance. Dial the action to a volume of the test sample and you could have the windows closed before you could ever hear the train. Additionally the parabolic is very good at canceling noise from anywhere that the dish is not pointed and it keeps you from having to mount anything far from the house (like a vibration sensor on a track tie.
Cheap laser pointers and some reflectors mounted on trees or posts in the background. He’s 2nd story, so he might even be able to get some range.
I use to live near a rolling stock/hot axle detector. when the train passed by the sensor, the radio kicked on and transmitted the total number of cars. Since this was a mile or so down the road, it would have made a perfect heads-up, at least for traffic coming one way.
it should check train times instead!
great, if the trains run on time… round where I’m from trains run when they are needed which is whenever they feel like it
Especially freight trains.. have you ever seen a publicly available freight train table? And even if you could find one, I would guess it’s would be even less on time than passenger trains.
if you are already into recording the train… hack one of this noise cancellation headsets and create a noise cancellation bedroom.
I remember once I saw a project (guess was commercial) who created noise cancellation windows by using the window glass (as a membrane) itself to cancel out the noise.
Anyhow I would definitely go with an easier solution as mentioned above… noise, vibration
the webcam solution is kind of not very green. How much power does your system burn just to wait for a train event?
The sound of the fans in the PC should not make you happy either.
You could combine several principles noise, vibration and time tables to make the system rather fault proof. A simple rule set…
is there noise?
is there vibration?
does it lay within a time table slot for a train?
close the window
I like this concept! And he definitely couldn’t use a clock to manage the opening and closing. I deal with CN rail and their shipping trains follow anything but a regular schedule.
My criticism: i think it’s overkill to use a webcam and computer. Sound is the problem so I’d use a microphone. There are quite a few great electret mic drivers for microcontrollers online.
Make a directional enclosure and point it at the farthest away a train can be.
With a bit of calibration, he’ll have it activate when it gets loud.
Heck, it’s even possible that he could stick the mic to the ground/windowsill and use the FFT library to look for super loud low frequencies if the response time of a mic in air isn’t good enough.
I think a microphone would respond in about the same time as a webcam would so I figure he’d get the same results at a fraction of the energy requirement. Plus no noisy computer fans :P
His sleep? Do cameras work in the dark? Or is he a nightwalker?
Trains have headlights :)
Sound activation makes more sense than motion activation for the problem he’s solving. But for motion detection, there are lots of cheap IP cameras available now that have nc/no alarm outputs that are triggered by motion.
For those of you that don’t live within earshot of a railway line. Your brain does start to tune out a lot of the noise after a while. I’m not as close to the railway line as he is, and I can definitely hear the trains pass by. But the sound doesn’t grab my attention or wake me up at all. I find passing light aircraft & helicopters of similar volume much more distracting, probably because they don’t pass by that often.
I would go with sound level / frequency detection. However, like Fogger said, you will eventually get used to it. I know, since I lived very close to a firehouse once and thought I would never sleep again … a few weeks later and my brain filtered it out and I didn’t hear it much anymore.
Yeah, only trouble is by the time you see the train, the loud part is gone.
*to add, how tricky would it be to screw a reflector to a tree way in the distance and use a very low power laser to have a trip BEFORE the train gets there…
Not too hard, aligning the laser would be hard. also the circut board would have to be a tad more complex. i like the mic idea that would work great
So…what about the air horn that they hold down as they go by at 2MPH at 2AM?
long! long! short! looooong!
Aah yes, Rule 14(L).
it does not sound like he’s living near a “whistle stop”.
I did. You might kid yourself that you can get “use to it”. But I’ll guarantee it’ll knock you out of the critical deep sleep phase every time.
I’m just glad I sleep days and am up at night…the train never blows the whistle as it drives by the residential zone during the day; only in the middle of the night. I guess the driver figures, “If I have to be up at 2AM, so does everyone else!!!”
@killerbug: maybe the driver figures: damn dark out there..beter let them know im comming before they stumble on the tracks? :)
If you could see the train, isn’t it a little bit late?
I love the build, but the most important thing I’ve drawn from this is that I have /got/ to get myself a makerbot.
So… useful…
Cool WSOR’s anniversary SD40-2. Why are the windows closing instead of opening? More train videos please.
I think an Active Noise Control device is a lot more suitable for this kind of tasks, but good hack anyway.
If possible, microphone could be attached to the track. (or accelerometer). That way train can be detected early enough.
He could also drive a few miles down the line and remove one of the rails…that would quiet things down a bit.
Just reposition the camera to see the train a bit earlier, and the window might be closed before the train is that close, even if it’s slow and silent. I guess silent is the key word here. ;-)
As mentioned, there are now cheap cameras available with built in detection (I had one that let me set up zones/boxes for detection, ignoring the rest of the image) and no/nc outputs.
Nice idea! I love to have this for rain detection.
Are there any methods to detect rain?
I have read of a simple one. An aspirin holds a clothes pin open. After the aspirin dissolves it allow contacts to contact.
The way I would have done it would be to build a small AM transmitter triggered by a wire on the rail or a piezo and a reciever. That way the windows would close before the train arrives. With enough piezos and a capacitor the system could be made to work without batteries.
How about if you just angle the camera or put it outside or something so that it spots the moving train earlier, and thus start to close the window earlier?
Cool build anyhow! :)
Neat! How about listening for the radio transmissions from the FRED? This could mean you’d close the windows before the train arrived. Apparently they can be detected up to two miles away?
http://en.wikipedia.org/wiki/Flashing_rear-end_device
best idea yet. I forgot about those things.
nice build, he could even sell it if he built in a few safeties like an obstruction switch/bar, to prevent it from closing on little fingers or critters.
Very cool build! Makes me want a Makerbot, also makes me want to live near a train, maybe not that close though.
Why not keep the windows closed all the time? Seems like a much easier solution. Also by the time those windows are closed I would already be awake.
imo it would have been easier to hack a disto (laser measurer) and aim it onto the track. That way you could stop false alarms from birds etc.
Also, as previously mentioned, the train will have passed by the time the windows close.
Much easier to implement in my home automation with my Jalacy windows and a window actuator motor out of a car.