Doppler Gesture Sensing In JavaScript

[Daniel] stumbled on an interesting paper (which we featured before) on Doppler gesture sensing using only a computer’s speaker and microphone. Unfortunately the paper didn’t include source code so [Daniel] created his own implementation of Doppler gesture sensing in JavaScript that works right in the browser.

[Daniel]’s JavaScript library generates a sine wave at 20 kHz that’s played through the computer’s speakers. The frequency is high enough that it’s pretty much inaudible. While the tone is being played through the speakers, the computer’s microphone is used to sample the audio and calculate the frequency spectrum of the signal. As you move your hand closer to the computer while the tone is playing, the frequency of the received signal shifts higher; as you move your hand away, it shifts lower. [Daniel]’s script looks for this frequency shift and uses it to trigger events.

doppler

[Daniel] has some awesome examples included on his website where you can test out the functionality for yourself. He has a hands-free scrolling example, spectrum plot, and even a virtual theremin. Since his code is bundled up into an easy-to-use library, it should be fairly easy to integrate into any webpage. The only real limitation to the library is that it only works in Chrome right now (Firefox doesn’t support disabling echo cancellation).

Hackaday Links Column Banner

Hackaday Links: November 23, 2014

The 2015 Midwest RepRap Festival, a.k.a. the MRRF (pronounced murf) was just announced a few hours ago. It will be held in beautiful Goshen, Indiana. Yes, that’s in the middle of nowhere and you’ll learn to dodge Amish buggies when driving around Goshen, but surprisingly there were 1000 people when we attended last year. We’ll be there again.

A few activists in St. Petersburg flushed GPS trackers down the toilet. These trackers were equipped with radios that would send out their position, and surprise, surprise, they ended up in the ocean.

[Stacy] has been tinkering around with Unity2D and decided to make a DDR-style game. She needed a DDR mat, and force sensitive resistors are expensive. What did she end up using? Velostat, conductive thread, and alligator clips.

You know the Espruino, the little microcontroller board that’s basically JavaScript on a USB stick? Yeah, that’s cool. Now you can do remote access through a telnet server letting you write and debug code over the net.

The Open Source RC is a beautiful RC transmitter with buttons and switches everywhere, a real display, and force feedback sticks. It was a Hackaday Prize entry, and has had a few crowdfunding campaigns. Now its hit Indiegogo again.

Speaking of crowdfunding campaigns, The Mooltipass, the designed-on-Hackaday offline password keeper, only has a little less than two weeks until its crowdfunding campaign ends. [Mathieu] and the rest of the team are about two-thirds there, with a little more than half of the campaign already over.

Hiding Executable Javascript In Images That Pass Validation

Here’s an interesting proof-of-concept that could be useful or hazardous depending on the situation in which you encounter it. [jklmnn] drew inspiration from the work of [Ange Albertini] who has documented a way to hide Javascript within the header of a .gif file. Not only does it carry the complete code but both image and the Javascript are seen as valid.

With just a little bit of work [jklmnn] boiled down the concept to the most basic parts so that it is easy to understand. Next, a quick program was written to automate the embedding of the Javascript. Grab the source code if you want to give it a try yourself.

Let’s get back to how this might be useful rather than harmful. What if you are working on a computer that doesn’t allow the browser to load Javascript. You may be able to embed something useful, kind of like the hack that allowed movies to be played by abusing Microsoft Excel.

Using A Headphone Jack As A UART

We’ve seen audio ports being used to establish a communications channel between a computer and a microcontroller before, but nothing quite as slick as this. [Gordon] is using a webpage running on a tablet to send Javascript to a microcontroller where the entire program is interpreted.

[Gordon] is using the Espruino Pico, a board that’s on Kickstarter right now. This tiny board is built around a javascript interpreter, allowing code to be written and updated on the fly without mucking around with bootloaders.

This technique can be expanded to provide bidriectional communication between a microcontroller and a computer. On the project Github, [Gordon] used the microphone pin on a TRRS jack to sent data to a computer. It needs two more resistors, but other than that, it’s as simple as the one-way communications setup.

[Gordon] put together a few demos of the program, including one that will change the color of some RGB LEDs in response to input on a webpage.

Continue reading “Using A Headphone Jack As A UART”

Espruino Pico, Javascript On A USB Stick

There are probably very few official numbers for this, but web developers at least seem to outnumber the amount of people who regularly poke pins and registers with C. For them, the embedded world must be a scary and foreboding domain, full of bitwise operations and dynamic types. [Gordon] figured there was another way and built a Javascript interpreter for a microcontroller. The latest board built around this interpreter is up on Kickstarter, and its even smaller and more capable than his earlier version.

This isn’t [Gordon]’s first rodeo; last year he launched the (full-sized) Espruino, featuring an ARM Cortex M3 and his very own Javascript interpreter. The large-scale Espruino was a rousing success, and now he’s moving on to a smaller thumb drive-sized footprint for the Pico. The hardware is a bit better, relying on the ARM Cortex M4 STM32F4 with a bit more RAM, and this time the board is slightly cheaper. It still runs the same Javascript interpreter, though, so all the code is exactly what you’d expect.

We haven’t seen many projects using this tiny Javascript of Things, but the new layout does make it fantastically useful. Depending on how the crowd funding campaign turns out, [Gordon] might be adding socket, and USB HID support, along with inline C functions.

Building A Network Controllable RGB LED Lamp From An Old Scanner

EthernetLamp

Being able to use one of your old projects to make a new one better can be quite satisfying. [Steve] from Hackshed did just this: he integrated an Arduino based webserver into a new network controllable RGB lamp.

What makes this lamp unique is that the RGB LED bar comes from an old Epson scanner. Recycling leftover parts from old projects or derelict electronics is truly the hacker way. After determining the pinout and correct voltage to run the LEDs at, the fun began. With the LED bar working correctly, the next step was to integrate an Arduino based webserver. Using an SD card to host the website and an Ethernet Arduino shield, the LEDs become network controllable. Without missing a beat, [Steve] integrated a Javascript based color picker that supports multiple web browsers. This allows the interface to look quite professional. Be sure to watch the lamp in action after the break!

The overall result is an amazing color changing lamp that works perfectly. All that is left to do is create a case for it, or integrate it into an existing lamp. This is a great way to use an LED strip that would have otherwise gone to waste. If you can’t find a scanner with a color wand like this one, you can always start with an RGB strip.

Continue reading “Building A Network Controllable RGB LED Lamp From An Old Scanner”

Your Mouse Is A Terrible Webcam

camera

It should come as no surprise your optical mouse contains a very tiny, very low resolution camera. [Franci] decided to take apart one of his old mice and turn that tiny optical sensor into a webcam.

Inside [Franci]’s Logitech RX 250 is an ADNS-5020 optical sensor. This three wire SPI device stuffed into an 8-pin package is a 15×15 pixel grayscale image sensor. [Franci] started this project by bringing out the Arduino and Ethernet shield. After soldering a pull-up resistor to the image sensor’s reset pin, connecting the rest of the circuit was as simple as soldering a few wires to the Arduino.

The Arduino sketch sends the image data for each pixel to a computer over a serial connection. A bit of javascript and a touch of HTML takes this pixel data and turns it into a webpage with a live view of whatever is directly under [Franci]’s mouse.

Video of the mousewebcam in action below.

Continue reading “Your Mouse Is A Terrible Webcam”