[SCRIPT] Using the N900 as Sonar
Hey all,
I hope this is the right place to post this :) I've somehow managed to make my N900 detect movements (and their distances) by checking how the echo of a sound is altered with a Python script that's rather dirty than quick. The way It's recording and playing audio is more a hack than a proper solution, but for some reason it's working. It requires python-numpy and alsa-utils to be installed. EDIT: It seems like Python is not always taking care of the two subprocesses this script is spawning. The right solution might be wrapping the whole thing in a try-catch-block and cleaning up yourself. I prefer the lazy solution: Starting it with "python echo.py; killall arecord; killall aplay;" If the subprocess module doesn't do it's job properly, killall can take care of it :D EDIT2: As Vento suggested, I've added "Script" to the title. Please tell me if there's a way to embed the video that I've missed. Just in case :) Demo Video The script on pastebin |
Re: Using the N900 as Sonar
omg !
{10 characters} |
Re: Using the N900 as Sonar
Hahaha
Too frickin'-freakishly-coollio-weird man! Welcome to the new-guy! And you bring presents to the party! A new toy! Gotta come up with a cool name for it though... sonar for n900 ...makes me think the n900 needs to be waterproofed for submersible diving. :D Hmm...how's this for a name..."The Unsneakable App".."UnSneak-A-App"...or "Kato" .thinkin 'bout the vid there...with you waving your hand behind it and all...tryin to sneak up on it so-to-speak :D... reminded me of Kato from the pink panther movies always trying to surprise attack Inspector Clouseau. Hmm...what is the distance on the sucker? How far? Can it be tweaked to say...cancel out your movements (very tricky that I would imagine) so you wouldn't get your own feedback ?...so to speak. On a more humourous note... Can it detect movement say...in another room? Could it warn me to get under my mistresses bed before her husband comes in the door? :D Better...could it warn me of a planet- invading alien's heavy-breathing while I hide in the closet? At least I'd die then with major points for dying and going out in better than Hollywood sci-fi movie style. :D Hmmm very-way cool .... hmmm... the applications... Y'know ....it just reiterates yet again... maemo ain't dead... the n900 isn't anymore irrelevant than it was when it 1st came out... Not to mention the frickin' way-cool factor of our devices and of the mad innovations of this community... stuff stupidphones and their communities just don't have... The "Other Guys" should be taking notes...want crazy-fast and wild innovations? Open their platforms up for the public to play with them...best and cheapest corporate method of r+d is to let everyone else pool their brain-pans and do it for them. You'd think they would have figured out that cost saving method by now. Hats off to you man....that is...by far one of the most interesting and bizarre innovations...now how to integrate it with some ideas I got.... |
Re: Using the N900 as Sonar
i gotta say thanks!
|
Re: Using the N900 as Sonar
Amazing stuff!
|
Re: Using the N900 as Sonar
well how a simple game or a fun app be put up with this as the input ? think of a ball to put in a hole without touching any sides of the screen or jush make it jump insanley :D a plugin for the photos app that can zoom in or a plugin for omp to forward rewind or play with the volume or any crazy idea that can be implemented:)
|
Re: Using the N900 as Sonar
mahgawd nokiabot...yeah..man...hell....just the tip of the iceberg ....of stuff that could be implemented with this...
hmm...kinda like the xbox kinect interface...that monitors visual input and implements a response in the running prog or game. Better I think...this is crazy sensitive...and unlike the kinect...it isn't limited to direct line of camera sight...you could run an prog/ game/ music... whatever... with the n900 sitting on your desk/ nightstand/ bookshelf...possibly across the room ....BEHIND you..... for all it matters :D hmmm...OP'er can you give a rough guesstimate as to the distance the sonar receives before the signal becomes ...umm..deterioratingly inadequate (for measurements to be applied to possible applications) ? Roughly.... how many feet from device before sonar signal degeneration? Oh my...oh yes....I most definitely could see direct applications OP.....more possible applications are thrown around...the more I'm super-duper impressed |
Re: Using the N900 as Sonar
humm it feels like it can detect movements two way it cannot sense direction lol :D but as the op says its quick and dirty it seems it can be taliored a bit to cerate some fun things or better a script or a app that can be used to intregate whatever one wants like we use shortcutd or camera half press to map any function:)
|
Re: Using the N900 as Sonar
http://www.indianfunpic.com/wp-conte...an-a-Medal.jpg
Btw, it will be nice an little UI app to know the distance of the nearest moving object. No fancy button or strange things... just a number in center of the screen. Okay maybe some settings would be useful like sample numbers... I'm thinking about a simple menu that popup when you press the number. |
Re: Using the N900 as Sonar
Interesting, gotta check the accuracy. I wonder if it would more effectively underwater, for obvious reasons (after altering calculations, of course)? No pun, I mean waterproof bag and underwater-tailored receiver/emitter part connected to headphone socket.
Could become a cool part of RC submarine model, too ;) /Estel |
Re: Using the N900 as Sonar
Little suggestion. Maybe you should change the title... Add [SCRIPT],[POC], [ANNUNCE] or [WIP] before the name
|
Re: Using the N900 as Sonar
Announce is good idea. Otherwise, most people may think it's some...one asking, if his N900 can act as a sonar. Which may result in whole array of reactions - moving along without reading is just one of them ;)
|
Re: [SCRIPT] Using the N900 as Sonar
I think It can detect direction to, if you alter the sound in channels.
|
Re: [SCRIPT] Using the N900 as Sonar
Quote:
|
Re: [SCRIPT] Using the N900 as Sonar
It would be a great idea to take some developer eh did this idea of a real theremin n900
|
Re: [SCRIPT] Using the N900 as Sonar
Quote:
|
Re: [SCRIPT] Using the N900 as Sonar
If it's emitting clicks for sonar, they might not be very musical for a theremin.
A theremin could be fun, though. Maybe you could use the front camera to calculate distance by the monocular depth cue apparent size of a hand: smaller as it's farther away, larger as it's closer, and whether it's at nearer the left, right, top or bottom. |
Re: [SCRIPT] Using the N900 as Sonar
|
Re: Using the N900 as Sonar
Quote:
The details depend on signal frequency as well as medium temperature and pressure. I assumed something in the range of 1-2kHz, 25°C and sea level. |
Re: [SCRIPT] Using the N900 as Sonar
Could range and/or accuracy be increased by attaching more powerful speakers and/or a better microphone?
One could detect movement in another room that way, too (which would certainly be a range increase) ;). |
Re: [SCRIPT] Using the N900 as Sonar
Quote:
|
Re: [SCRIPT] Using the N900 as Sonar
Quote:
For accuracy it's much harder. The key would be to measure signal delays more precisely. Quote:
For a precise sonar you need a highly focused speaker and a highly focused microphone. Otherwise your sonar would be more or less omnidirectional and you won't be able to figure out where a signal came from. |
Re: [SCRIPT] Using the N900 as Sonar
Not sure how granular and real time the digitized sound is but it would be entirely possible to connect a ausio port, USB, or Bluetooth sound card or device for DIY sonar applications, acutally this would also work by converting the audio to RF for radar. For example a sonar transducer and receiver can be found for the small fish and depth finder devices for boats. It may require up and down conversion between our typical audio devices to the higher frequencies needed for good penetration and resolution but that is also pretty easy to do.
The question them becomes is the bandwidth provided by audio devices internal or connected sufficient to do something useful with the N900. Going way off topic but there is no reason the audio output of one of those toy Doppler radar guns couldn't be put through bluetooth and the RF in/output run on a vertical polarized antenna with on a regulated stepper rotator reflector to make a short range real sweep scope readout radar on the N900. If only I had a real use of a small radar set. |
Re: [SCRIPT] Using the N900 as Sonar
Quote:
Quote:
Actually, the whole thing may require some calibrating one way or another. I would love to see this made into a nice GUI app with calibrating options etc. |
Re: [SCRIPT] Using the N900 as Sonar
In an acoustically absorptive environment like an audio recording studio with one or two hard metal or stone targets would do the trick to calibrate the sonar. An audio frequency upconverter gets you into the more useful hundreds of megahertz or even GHz frequencies, up there the resolution is higher due to the wavelength being smaller to detect small objects and doppler shift is much greater then down convert back to something common sound equipment can use.
|
Re: [SCRIPT] Using the N900 as Sonar
Quote:
|
Re: [SCRIPT] Using the N900 as Sonar
Why people are getting crazy ?? It wont be of much practical use aside from some fun and utlity apps games ?
currently we dont even have a app/game that uses the script as input |
Re: [SCRIPT] Using the N900 as Sonar
Quote:
Quote:
|
Re: [SCRIPT] Using the N900 as Sonar
Quote:
I don't know if infrasound is manageable with consumer electronics (it's definitely not healthy for the N900's speakers), but ultrasound is certainly possible. Most people aren't able to hear anything beyond 16kHz and from 21kHz you should be on the safe side. As a teenager I was able to hear frequencies between 18 and 19kHz and I could make my regular PC speaker emit these frequencies via a simple turbo pascal program. So it should be possible to build a secret alarm system based on this sonar script - unless there's a dog nearby going crazy due to the ultrasound pings. ;) |
Re: [SCRIPT] Using the N900 as Sonar
Quote:
BTW, what happened to the OP? He turned up out of nowhere, posted one extremely useful script and disappeared without a trace. |
Re: [SCRIPT] Using the N900 as Sonar
Hi to all,I try use this script,so what i did?
Install python-numpy and alsa-utils(that package i already have) and python2.7,also i created emty file with leafpad(also i try to created file using windows but result it was the same)and rename him echo.py,then copy sonar script from pastebin and paste in echo.py but when type python2.7 echo.py the output from console is: Quote:
although than,i follow advice from above link,that mistake show me again,anyone from you has experience with this script regards edit:finally i manage to run this script(after several time i created and deleted folder numpy and the end i left that folder in /usr/local/lib/python2.7/site-packages/) but for big regret my sonar on n900,won't detected any movement but this time i type python echo.py what the F******* |
Re: [SCRIPT] Using the N900 as Sonar
Use default Python (2.5). NumPy in Maemo-Extras is compiled for Python 2.5, AFAIK.
|
| All times are GMT. The time now is 09:08. |
vBulletin® Version 3.8.8