Hardware SPI With Python On A Raspberry Pi

While the Raspberry Pi has very good support for an I2C bus, a lot of very cool chips – including the in system programmer for just about every ATtiny and ATmega microcontroller – use an SPI bus. [Louis] sent in a tutorial for getting hardware SPI on his Raspi, and even though it’s rather limited right now, it’s a step in the right direction.

Previously, [Brian Hensley] put up a tutorial for using the Linux SPI drivers with the Raspi. [Louis] wanted to play with SPI in Python, so he added a C extension to the spidev.c file (available here) that allows him to open an SPI connection, initialize, transfer, and close the connection.

After connecting an Arduino to the MOSI, MISO and SCK pins of his Arduino, [Louis] was able to transfer data from his Raspi over an SPI bus. It should be noted that a level shifter would be a really good idea here, but this is an excellent project if anyone would ever want to port AVRDude to Python.

 

Who Would Win In A Fight, Robot [Lemmy] Or Robot God?

[youtube=https://www.youtube.com/watch?v=3RBSkq-_St8&w=580]

So this is what happens when a fan of The Rock-afire Explosion grows up. Meet Compressorhead, a musical trio of hydraulic and pneumatic musical mastery.

Compressorhead is a lean band, consisting of only three members. Stickboy, the drummer, is a four-armed beast reminiscent of [General Grievous] that plays a 14-piece Pearl kit with a double bass. His listed influences include [Danny Carey] and the original MPC60.

Fingers is the guitarist and a wonder of mechanical linkages consisting of 78 hydraulically actuated fingers. Influences include [Yngwie Malmsteen], but with more fingers and less of an ego, we expect Fingers to be an even better guitarist than his idol.

Bringing in the low-end is Bones, the robotic tread-mounted bassist for Compressorhead. Like Fingers, he plays an unmodified instrument. He’s also the newest member of the band, completed in 2012.

If you’d like to check out Compressorhead in person, they seem to be touring Australia right now. If you’d like to schedule them, their rider lists a requirement of 65 Amp, 3 phase power, 3 liters each of hydraulic fluid and motor oil, and suspiciously no requirement for removing all the brown M&Ms from a package. Be sure to check out the videos of the band in action on their media site.

Thanks [BadWolf] for sending this one in.

Brute Forcing A GPS PIN

pin

[JJ] picked up a Garmin Nuvi 780 GPS from an auction recently. One of the more frustrating features [JJ] ran into is it’s PIN code; this GPS can’t be unlocked unless a four-digit code is entered, or it’s taken to a ‘safe location’. Not wanting to let his auction windfall go to waste, [JJ] rigged up an automated brute force cracking robot to unlock this GPS.

The robot is built around an old HP scanner and a DVD drive sled to move the GPS in the X and Y axes. A clever little device made out of an eraser tip and a servo taps out every code from 0000 to 9999 and waits a bit to see if the device unlocks. It takes around 8 seconds for [JJ]’s robot to enter a single code, so entering all 10,000 PINs will take about a day and a half.

Fortunately, the people who enter these codes don’t care too much about the security of their GPS devices. The code used to unlock [JJ]’s GPS was 0248. It only took a couple of hours for the robot to enter the right code; we’d call that time well spent.

You can check out the brute force robot in action after the break.

Continue reading “Brute Forcing A GPS PIN”

Hackaday Links: January 5, 2013

Do not aim laser at remaining eye

laser

Over on the reddits, [CarbonGod] thought he had a slightly overpowered laser pointer. His red laser pointer had a label that said it outputs less than 5 mW. The only problem is it melted black plastic and heated a thermocouple up to 140°F. [CarbonGod] is begging, borrowing, or stealing a power meter from an engineer friend, but until then we’ve got measurements from [The_Sourgrapes]. His lasers put out 105 mW (red), 56 mW (blue), and 53 mW (green).

While <5 mW lasers are fairly safe, these lasers that are labeled as having < 5 mW of output are not. Now if we only knew where to buy these overpowered lasers…

 It’s impossible to find this video in HD

rickroll

[Zach] created a physical rickroll device. It’s an Arduino and an MP3 shield hooked up to an ultrasonic sensor. When someone walks within six feet of the device, the Arduino starts playing Never Gonna Give You Up. When that person walks away, the song is paused only to start again when something else is detected by the ultrasonic sensor. There’s a hilarious video of [Zach] triggering his physical rickroll device, or you can check it out on the build page.

Hey, you! Write some code!

react

[William] wrote in to tell us about a project called ReactOS. The goal of the project is to create a free and open source operating system that is binary comparable with Windows XP. Yes, this project has been around for a very long time, but with Microsoft dropping support for XP, the ReactOS team could really use a few devs to get a beta out soon. If you know a bunch of low-level Windows stuff but haven’t ever contributed to an open source project, check out the developer’s wiki.

I’m [Johnny Knoxville] and this is electrostatic discharge

ouch

It looks like [Mehdi] is making a few instructional videos for EEs and those tinkering around with electricity. So far he has tutorials for making proper wiring connections, what not to do with ESD, how to take capacitors for granted, and demonstrating how electricity can kill you.

Penitent man shall pass…. Penitent man shall pass…

[youtube=http://www.youtube.com/watch?v=Cj8wXlSXGk0&w=470]

If gift giving were a contest, [Bradley] would win. His sister’s favorite movie is Indiana Jones and the Last Crusade, so when he needed to wrap a gift (a coffee cup, fittingly), he went all out. All the challenges required to obtain the Holy Grail are present in this present including the breath of God (needs more circular saws), the name of God (why was the letter ‘J’ even in the movie?), and the Leap of Faith (sand included).

Coming up for his sister’s birthday, a face-melting hair dryer.

Electric Imp Makes A Cat Door Tweet Its Activities

electric-imp-tweeting-cat-door

This Tweeting cat door uses the Electric Imp to read a sensor and report back to the server. The hardware is pretty neat. The board hosts an ARM Cortex-M3 processor and gets on your home network via WiFi. The mini-USB cable simply provides the power. Programming is done over the network. Our own [Brian Benchoff] had a chance to try the Imp out earlier in the Fall.

Monitoring a cat door is as good a reason as any to undertake a project. The hardware added to the board includes a reed switch mounted on the jamb along with a magnet on the door itself. There is also a blue LED that gives a bit of user feedback. The software isn’t quite as easy but it still wasn’t that bad. As with most web-connected projects getting all the parts to talk to each other was a bit of a chore. The Imp reports back to a server on the local network which then activates a PHP script that uses Sen.se to push out a Tweet.

[Thanks Pat]

Is Entropy Slowing Down Your Android Device?

071210_1705_AndroidDev11.jpg

[Lambgx02] got tired of his Android device getting bogged down and decided to dig down to the cause of the issue. His investigation led him to believe that entropy is causing the slowdown. He believes that his workaround reduces 90% of the lag on the average Android device.

So how is it possible that entropy is causing the problem? It seems there is a bottleneck when an app requests a random number from the Linux kernel running at the lowest level of the device. Android is set up to use /dev/random for all random number requests, but [Lambgx02] says that location has a very shallow pool of numbers available. When they run out the kernel has to reload with a new seed and this is blocking the app that requested the data from continuing.

His solution was to write his own app that seeds /dev/random once every second using a number from /dev/urandom. He mentions that this might cause a security vulnerability as seeding the random data in this way is not quite as random. There may also be issues with battery life, so make sure to monitor performance if you give it a try.

[via Reddit]

Estimate Velocity Using Quadrature Encoder Data

quadrature-encoder-velocityMany motors offer a quadrature encoder that give feedback on whether, and in which direction, the motor shaft is moving. But if you’re clever about analyzing the data you can use a quadrature encoder to estimate motor velocity. [Jason Sachs] makes the case that it’s fairly easy to get this wrong. Lucky for us he has carefully laid out his process of extrapolating velocity from the two edge-trigger data sources.

The process starts with reading from the encoder. Many chips have peripherals that will interface with a rotary encoder, but hardware lacking that built-in helper can still be used by monitoring pin-change interrupts. Once connected samples are taken over time and the rest is left to the quality of your algorithm.

What can this velocity data be used for? That’s up to you. But we can think of a couple of projects. It may be useful in a spinning POV display like this FPGA-based beauty. You also find quadrature encoders in exercise equipment. Knowing the velocity will help if you’re building your own computer to replace what came with that Stairmaster.

[via Reddit]