Turn your Wireless Keyboard into a MAME Controller!

posted Sep 27th 2011 9:03am by
filed under: misc hacks, peripherals hacks

For those of you that have a wireless keyboard laying around, you might be tempted to turn it into something else, like a wireless MAME controller. For those not familiar with it, MAME stands for “Multiple Arcade Machine Emulator” and is generally used to run older arcade games on a computer.

Encoders are available for this purpose, however, intending to save some money, and having an unused wireless keyboard, I decided to try to make one myself.  As far as I know there are no wireless encoders available for this purpose, so that was part of the motivation for trying this.

In this post I go over my mechanical design for the cabinet as well as the electrical process of going from keyboard to MAME controller. I did eventually get the thing working, but if more than a couple buttons were pressed simultaneously, some presses were omitted. The conclusion I eventually came to was that it was better to use an encoder to control everything. Not wireless, but much more reliable. If I absolutely needed a wireless controller in the future, I would think modding an actual wireless controller (or two) in a similar manner would have worked better for my purposes.

DIY breadboard modules for easy prototyping

posted Sep 27th 2011 9:01am by
filed under: tool hacks

[Rajendra] got tired of building the same basic circuits time and again on the breadboard. He decided to build some simple, modular circuits on protoboard and make them easy to interface with the breadboard. As you can see, he ended up with seven modules that make prototyping faster and easier.

At first glance some might not seem all that beneficial. For instance, making a board for an 18-pin PIC microcontroller into a single-in-line form factor would seem like you’re actually wasting breadboard space when compared to the DIL package of the chip. But consider that the oscillator and its capacitors, reset button, and programming header are also on the breakout board and will not have to be built in place. There are also several I/O boards, one with five buttons, another with an LED bar graph, and a set of LEDs with a SIL resistor package on-board. These modules can be plugged into a breadboard and wired up with jumper wires, or connected directly to the same rows as the microcontroller module.




Two dice, one 8-pin uC

posted Sep 27th 2011 8:03am by
filed under: Microcontrollers

[Mike Shegedin] makes full use of an 8-pin microcontroller with this ATtiny13-based dice project. With a maximum of six I/O pins (that includes using the reset pin as I/O) he needed a couple of tricks in order to drive 14 LEDs and use a momentary push button for user input. We’re certainly familiar with the concepts here, but it still took quite a while to figure out what is going on with the schematic that [Mike] posted.

You’ve probably already guessed that he’s using Charlieplexing to drive more LEDs than he has pins. But when we started looking at the layout we thought he had drawn the schematic wrong, because there are six pairs of LEDs where the two diodes in each pair a not reverse biased, but hooked up in parallel. That, plus the fact that his battery is hooked up backwards. After several minutes of study the light bulb finally clicked on. Dice add pips (the dots on each side of a die) in pairs with the exception of the center pip. That means that you only need to control four total lines for each die (three pairs plus the center pip). There’s two ways to handle this, you could use four rows and two columns with traditional multiplexing, or you can reverse bias the two sets of LEDs for each die and use Charlieplexing. The former is a bit easier to program, the latter saves you one I/O pin and meant that [Mike] didn’t need to use the reset pin as I/O.

This is a clever addition to the collection of dice projects we’ve seen like the battery-less die, and the ATtiny2313 powered dice.

Building a battery-powered motion alarm

posted Sep 27th 2011 7:02am by
filed under: Microcontrollers

[Brad] was asked by his Sister to design a motion-based alarm that would help her catch her son sneaking out of the house at night. Obviously this didn’t need to be a long-term installation so he decided to throw something together that is only active at night and can be battery-powered. What he came up with is a light-sensitive motion sensor that uses very little power.

He knew that an Arduino would be overkill, and decided to try his hand at using the Arduino to develop code for an ATtiny85. It has an external interrupt pin connected to the output of the PIR module, which triggers action when motion is detected. The first thing it does is to check the photoresistor via the ADC. If light levels are low enough, the buzzer will be sounded. [Brad] measured the current consumption of his circuit and was not happy to find it draws about 2.5 mA at idle. He spent some time teaching himself about the sleep functions of the AVR chips and was able reduce that to about 500-600 uA when in sleep mode. Now all he has to do is find a nice place behind the house to mount the alarm and there’ll be no more sneaking around at night.

If you’re trying to keep a tight leash on your own kids you could always make them punch the time clock.

Sustainability Hack: Wind turbine battery charger

posted Sep 27th 2011 6:00am by
filed under: green hacks

Hit your parts bin and set aside an afternoon to build a wind turbine that recharges batteries. You can see two AA batteries hanging off the side of this small generator. You only need a few parts to make this happen, and chances are you have them sitting in your junk bin already.

The generator itself is a small stepper motor which can be pulled from a floppy disk drive or a scanner. The blade is cut from a single piece of 3.5″ (90mm) PVC pipe, with another piece of smaller-diameter pipe serving as the body of the turbine. The tail-fin makes sure it’s always pointing into the wind and was made from some plywood. As the blade spins, a current is induced on the control pins of the stepper motor. By building a pair of bridge rectifiers and using an RC filter you’ll get the most out of the generated current.

This turbine can charge a pair of NiCad batteries in about 10 hours, but it might be worth developing some smart circuitry to manage charging. If it were able to choose between a dedicated storage battery and the on-board battery holder you could put all of the wind energy to good use.

[Thanks Michael]




Toilet paper printer made from scrap parts

posted Sep 27th 2011 4:02am by
filed under: arduino hacks, misc hacks

toilet_paper_printer

Some of our favorite hacks are those made with scrap materials, so we were delighted to see a contest being held by the German technology magazine c’t which focuses on using salvaged components. “Mach flott den Schrott” is the name of the competition, which loosely translates to “Make fast the scrap”.

German builder [Mario Lukas’] entry into the contest (Google Translation) is definitely unique, and certainly fits within the theme. He built a toilet paper printer that uses a bunch of recycled components to write anything he desires on a roll of the soft white stuff. His blog walks through the build details, including a bill of materials for all of the scrap bits he used to put it together. Several CD-ROM drives, printers, and even inline skates donated some components to the printer, while an Arduino controls the entire printing process.

Though [Mario] is using RSS and Twitter feeds as a data source for his toilet-side scribe, we imagine it will only be a matter of time before advertising companies seize upon this sort of technology to create personalized advertisements geared towards a decidedly captive audience.

Continue reading to see a quick video of his toilet paper printer in action.

[via Make]

Read the rest of this entry »

Bluetooth communications for Android devices via Processing

posted Sep 26th 2011 2:01pm by
filed under: android hacks, arduino hacks

[Oscar] shows us how to use a Processing sketch for Android to communicate with Bluetooth devices (translated). It turns out this is easier than you might think. Processing and Android are both closely related to Java, and you can just import the Android libraries that deal with Bluetooth within the Processing sketch. That makes it easy to enable the Bluetooth modem when the sketch is launched, and manages connecting with devices as well as sending and receiving data.

For this example [Oscar] is using an Arduino with a Bluetooth module as a test device. His sketch first shows what devices are available, then connects to the one you select from the list. The 11 lines of Arduino code transmit a value via the serial port, and listens back for a command to toggle the LED on pin 13. [Oscar] takes time in his tutorial to show us how each step of the Processing sketch is assembled, instead of only posting the finished code.

[Thanks Sara]

Python on a microcontroller

posted Sep 26th 2011 1:01pm by
filed under: Microcontrollers

The team at LeafLabs was looking for something cool to do with their new ARM development board. [AJ] asked if anyone had ever played around with Python, so [Dave] cooked up an implementation of PyMite and put it on a Maple board. While the writeup is only about blinking a LED with a microcontroller, they’re doing it with Python, interactively, and at runtime.

The build uses the Maple Native board the team is developing. The board has a 32-bit ARM chip with 1 Meg of RAM – more than enough horsepower to run PyMite. The tutorial for putting PyMite on a Maple is up on the LeafLabs wiki.

PyMite is theoretically able to control every pin on the Maple Native and do just about everything a regular Python distro can do. The LeafLabs team is still working on the necessary libraries for their board (although we don’t see anything on the Google code page), so right now only blinking the LED is supported. Still, it’s pretty cool to have Python in your pocket.




Hack a Day serves up fresh hacks each day, every day from around the web as well as hacking related news.

Send us your hacks










     




Hacks

Resources