Posts with «arduino» label

Check Broadway Discounts with tkts Ticker Tape

If you’ve ever been to Times Square in New York City, you’re probably familiar with the tkts booth, which offers discounted Broadway tickets for same-day shows. Using an Arduino with an Ethernet Shield, a Staples Easy Button, and a thermal printer, Chris D’Angelo created a device that prints the current discount for each show. Since tkts doesn’t have a public API, Chris used their iPhone app and a man-in-the-middle proxy called mitmproxy to determine the URL that the app requests to get the latest data. The Arduino requests that URL and parses the response, which is then formatted for output on the serial thermal printer. Nice thinking! I’m definitely adding mitmproxy to my toolset. [via Adafruit]


Fitting a sphere

Today I had to write a program to fit a sphere to a bunch of points that were supposedly near the surface of a sphere, but were noisy and sampled in a very biased way.  Since this is obviously not a new problem, I started out doing web research.  but I didn’t look for fitting a sphere, but for fitting a circle, since that is a simpler related problem.

I found a lot of papers, including several review papers, on how to fit a circle to a bunch of points.  The “obvious” method is to  do a least-squares fit to minimize the distance between the points and the circle, minimizing , where is the radius and is the center of the circle.  Unfortunately, that is a difficult problem to solve, and even numerical methods require a lot of iterations to get decent solutions.  What most people do is to change to a slightly different problem that optimizes a different fitness function.  For example, Kåsa’s method minimizes .

There is a very nice, but very formal, presentation of the methods in a paper by Vaughn Pratt from 1987: Direct Least-Squares Fitting of Algebraic Surfaces.  This paper introduced Pratt’s method, which was later slightly improved to make Taubin’s method. I did not read these original papers (other than skimming Pratt’s paper).  Kåsa’s paper (A curve fitting procedure and its error analysis. IEEE Trans. Inst. Meas. 25: 8–14) does not seem to be available on-line.  The IEEE digital library is missing the whole 1976 year.

I did find a recent paper that does careful error analysis of both the geometric approach and several of the algebraic approaches (including the most popular ones: Kåsa, Pratt, and Taubin):

Ali Al-Sharadqah and Nikolai Chernov
Error analysis for circle fitting algorithms
Electronic Journal of Statistics
Vol. 3 (2009) 886–911 ISSN: 1935-7524 DOI: 10.1214/09-EJS419

This paper shows that Taubin’s method is theoretically superior to Pratt’s which is theoretically superior to Kåsa’s (having less essential bias), and gives a very weak example showing it is also tru empirically.  More interestingly, it also gives a “hyperaccurate” algorithm that has less bias even than Taubin’s method.  I did not read the error analysis, but I did read the description of their Hyper algorithm and the implementations of it that Chernov has on his website.

Since I needed Python code, not Matlab code, and I needed spheres rather than circles, I spent a few hours today reimplementing Chernov’s Hyperfit algorithm.  I noticed that the basis suggested by Pratt for spheres, , was a simple modification of the one used in both Pratt’s paper and Chernov’s paper for circles, .  I decided to generalize to dimensions, and use the Numpy package in Python for all the matrix stuff.  I hope I got the generalization right!

From starting to look for papers until getting the code working was about 6 hours, but I had lunch in there as well, so this felt like pretty speedy development.  I’ve released the code with a Creative Commons Attribution-ShareAlike 3.0 Unported License, and would welcome corrections and improvments to it.

Of course, after all this buildup, you are probably wondering why I needed to fit a sphere to points—that is not a common problem for a bioinformatician to have.  Well, it is for the robotics club, of course.  They’ve been having a lot of trouble with the magnetometer calibration and heading code, so we decided to try doing an external calibration of the magnetometer, which has an enormous arbitrary 3D offset.  By waving the magnetometer around in different orientations (which means tumbling the ROV once the magnetometer is installed), we can sample the magnetic field in many orientations, though far from uniformly.  The center of  the sphere fitted to the readings gives us the 3D offset for the magnetometer.

My son and I tested it out with Python code and Arduino code that he had written to get the data from the magnetometer to the laptop, and the magnetometer readings do seem to be nicely centered around (0,0,0) after we do the correction.  We’re still having trouble using the accelerometer to get a tilt correction to give us clean compass headings, but that is a problem for tomorrow morning, I think.


Tagged: Arduino, circle fitting, magnetometer, NumPy, Python, sphere fitting

WTF is going on here? Triggering External Audio via Grounding on Arduino

I'm using Fizikus' design to add audio cues to a project.  The schematic, from Ar-Du, looks like this:

read more

IRL: Logitech UE Air Speaker, the Canon Rebel XT and an Arduino non-starter

Welcome to IRL, an ongoing feature where we talk about the gadgets, apps and toys we're using in real life and take a second look at products that already got the formal review treatment.

Welcome back to IRL, and if we do say so ourselves, this week's edition is a doozy. On one end of the gadget-loving spectrum, Jason is still happily using his Canon Rebel XT, while Darren remains thoroughly unsatisfied with his $400 AirPlay speaker (it was easy to set up, at least -- he'll give it that). And, just for good measure, we threw in an Arduino fail. So, which piece of audio gear is on our "do not buy" list? Who needs to take a course in wiring-based coding? And does Jason have anything negative to say about his DSLR? Head past the break to find out.

Continue reading IRL: Logitech UE Air Speaker, the Canon Rebel XT and an Arduino non-starter

IRL: Logitech UE Air Speaker, the Canon Rebel XT and an Arduino non-starter originally appeared on Engadget on Fri, 20 Apr 2012 15:00:00 EST. Please see our terms for use of feeds.

Permalink | Email this | Comments

‘Cubicle fun’ just levelled up with Arduino

In case you hate the office music next time, just throw a paper at it. Just not in front of the boss!

Agency republic in London chose to tackle this issue in an R&D project by putting up a poster in the office that says “change the tune” and when you hit it with a piece of paper (or other things handy) an Arduino powered simple piece of hardware in the poster changes the tune on Spotify.

Via:[christianheilmann]

Arduino Blog 20 Apr 18:24
arduino  hacks  music  office  

Phone Booth becomes a Photo Booth

A project by Chris Bell, Liangjie Xia, and Mike Kelberman called Rotobooth is a hacked rotary phone that takes your picture as you’re calling your own cell phone, then sends a link of the photos to you by SMS.

The rotary phone was hacked using Arduino, the photos were collected on a Flickr page, and finally the SMS notification is sent using Twilio. The exterior design is clean (dig the orange phone!) and recently took 3rd place at Twilio’s Photohack Day 2.

[via Twilio]

More:


Using the MakerShield – Servo Control

If you’ve ever wondered how to use the potentiometer on the MakerShield (available in the Maker Shed) to control a servo with an Arduino, wonder no more. Now there is a simple tutorial to show you how on Make: Projects!

Servos are very useful things; they provide precise movement in 180 degrees of motion. This guide will show you how to hook a servo up to your Arduino and use the potentiometer on the MakerShield to control it.

All the parts you need are available in the Ultimate Microcontroller Pack. There’s just something fascinating about seeing a servo rotate to a position dictated by your fingertips!


Arduino + Flamethrower + Guitarhero = Rockstar

Get a little more adventurous and play with fire. Feel like a true rockstar complete with guitar (hero) and flames!

Here are the complete instructions to build one for yourself.

Via[HacknMod]

Arduino Blog 18 Apr 15:11
ar(t)duino  arduino  fire  game  

Measuring battery capacity with an arduino

A yet another reason to have arduino in your basic-electronic toolkit. You can build your own battery capacity measuring device. Now compare all the brands of the so claimed ‘long lasting batteries’. Know what you are buying!

Follow the instructions to build from here. and get building!

Via: [Instructables]

Beatbearing using Arduino

This is an interesting project for an extreme geek and an amateur music maker. All you have to do, is to follow the tutorial here, and get a complete parts list.

Via[Jameco]

Arduino Blog 18 Apr 13:50