A lot of great ICs use I2C to communicate, but debugging a non-working I2C setup can be opaque, especially if you’re just getting started with the protocol/bus. An I2C bus scanner can be a helpful first step in debugging an I2C system. Are all the devices that I think should be present actually there and responding? Do they all work at the bus speed that I’m trying to run? If you’ve got an Arduino or Bus Pirate sitting around, you’re only seconds away from scanning your I2C bus, and answering these questions.
What started off as a quick prank-hack to re-map a colleague’s keyboard turned into a deep dive in understanding how keyboards work. [ch00f] and his other work place colleagues are in a habit of pulling pranks on each other. When [ch00f]’s buddy, who is an avid gamer and montage parody 1337-sp34k (leet speak) fan, went off on a holiday, [ch00f] set about re-mapping his friend’s keyboard to make it spit out words his friend uses a lot – “SWAG” “YOLO” and “420”. But remapping in software is too simple, his hack is a hardware remapping!
The keyboard in question used mechanical keys mounted on a keyboard sized PCB. Further, it was single sided, with jumper links used in place of front side tracks. This made hacking easier. The plan was to use keys not commonly used – Scroll Lock, Print Screen, and Pause/Break – and get them to print out the words instead. The signal tracks from these three keys were cut away and replaced with outputs from a microcontroller. The original connections were also routed to the microcontroller, and a toggle switch used to select between the remapped and original versions. This was eventually not implemented due to a lack of space to install the toggle switch. [ch00f] decided to just replace the keyboard if his friend complained about the hack. A bit of work on the ATMega PCB and firmware, and he was able to get the selected keys to type out SWAG, YOLO and 420.
And this is where a whole can of worms opened up. [ch00f] delves in to an explanation on the various issues at hand – keyboard scanning/multiplexing, how body-diodes in switching FET’s affected the scanning, ghosting and the use of blocking diodes. Towards the end, he just had the word SWAG activated by pressing the Pause/Break key. But he does get to the bottom of why the keyboard was behaving odd after he had wired in his hack, which makes for some interesting reading. Don’t miss the video of the hack in action after the break.
[Jordan] managed to cobble together his own version of a low resolution digital camera using just a few components. The image generated is pretty low resolution and is only in grey scale, but it’s pretty impressive what can be done with some basic hardware.
The heart of the camera is the image sensor. Most consumer digital cameras have tons of tiny receptors all jammed into the sensor. This allows for a larger resolution image, capturing more detail in a smaller space. Unfortunately this also usually means a higher price tag. [Jordan’s] sensor includes just a single pixel. The sensor is really just an infrared photodiode inside of a tube. The diode is connected to an analog input pin on an Arduino. The sensor can be pointed at an object, and the Arduino can sense the brightness of that one point.
In order to compile an actual image, [Jordan] needs to obtain readings of multiple points. Most cameras do this using the large array of pixels. Since [Jordan’s] camera only has a single pixel, he has to move it around and take each reading one at a time. To accomplish this, the Arduino is hooked up to two servo motors. This allows the sensor to be aimed horizontally and vertically. The Arduino slowly scans the sensor in a grid, taking readings along the way. A Processing application then takes each reading and compiles the final image.
Since this camera compiles an image so slowly, it sometimes has a problem with varying brightness. [Jordan] noticed this issue when clouds would pass over while he was taking an image. To fix this problem, he added an ambient light sensor. The Arduino can detect the amount of overall ambient light and then adjust each reading to compensate. He says it’s not perfect but the results are still an improvement. Maybe next time he can try it in color.
Let’s face it, we all have keyboard peculiarities. Don’t try to deny it, everyone who types a lot has an opinion of the keyboard they stroke so frequently. We know [Brian Benchoff] swears by his model M, and we’re guessing he was the one that bumped into [Evan] and convinced him to write about his conversion of a Commodore 64 keyboard for use as a USB device.
This is not [Evan’s] first rodeo. We recently saw him fixing up the worn off letters of his own model M. But this time around there’s some clever microcontroller work at play. Apparently mapping 122 keys using an Atmel AVR 32u4 chip (built in USB connectivity) is quite a task. Luckily someone’s already worked out all kinds of good things and is sharing the love with the Soarer’s Keyboard Controller Firmware. Of course it handles scanning, but also includes debounce, muxing, and the trick to scan more keys than the uC has pins for. We still don’t fully understand that bit of it. But [Evan] did post the config file he’s using so perhaps after we get elbow-deep in the code we’ll have a better understanding.
If you give this a try, we want to hear about it. Anyone have any modern keyboards they’re in love with? Leave a comment below.
The Hack-a-Day logo challenge keeps on bearing fruit. This tip comes from [Enrico Lamperti] from Argentina who posted his follies as well as success creating a Hack-a-Day logo using a home built scanning laser projector.
The build consists of a couple small servos, a hacked up pen laser and an Arduino with some stored coordinates to draw out the image. As usual the first challenge is powering your external peripheral devices like servos. [Enrico] tackled this problem using 6 Ni-MH batteries and an LM2956 simple switcher power converter. The servos and Arduino get power directly from the battery pack and the Arduino controls the PWM signals to the servos as they trace out the stored coordinate data. The laser is connected to the servo assembly and is engaged and powered by an Arduino pin via an NPN transistor. He also incorporated a potentiometer to adjust the servo calibration point.
His first imported coordinate data generated from some Python script was not very successful. But later he used processing with an SVG file to process a click-made path the Arduino could use as map data to draw the Hack-a-Day logo. It requires a long exposure time to photograph the completed drawing in a dark room but the results are impressive.
It’s an excellent project where [Enrico] shares what he learned about using Servo.writeMicroseconds() instead of Servo.write() for performance along with several other tweaks. He also shared the BOM, Fritzing diagram, Processing Creator and Simulator tools and serial commands on GitHub. He wraps up with some options that he thinks would improve his device, and he requests any help others may want to provide for better performance. And if you want you could step it up a notch and create a laser video projector with an ATMega16 AVR microcontroller and some clever spinning tilted mirrors.
[Oliver Kreylos] is using an Xbox Kinect to render 3D environments from real-time video. In other words, he takes the video feed from the Kinect and runs it through some C++ software he wrote to index the pixels in a 3D space that can be manipulated as it plays back. The image above is the result of the Kinect recording video by looking at [Oliver] from his right side. He’s moved the viewer’s playback perspective to be above and in front of him. Part of his body is missing and there is a black shadow because the camera cannot see these areas from its perspective. This is very similar to the real-time 3D scanning we’ve seen in the past, but the hardware and software combination make this a snap to reproduce. Get the source code from his page linked at the top and don’t miss his demo video after the break.
[Kyle McDonald] has kept himself busy working on 3D scanning in realtime. He’s posted a writeup that takes us through the concepts, tools, and assembly of a DIY 3d scanning camera. You should remember a preview of this method posted earlier this month, but now it’s time to build your own. You’ll need a camera, a projector, and some open source software to process the image data. Using these simple tools, [Kyle] turned out much better video than before. Take a look after the break to see his results from scanning at 60 fps using a PS3 Eye. The trick to this setup is getting the correct synchronization between the projector and the camera, something that could be improved with a bit of extra hacking.
Does [Kyle’s] name sound familiar? It should, he’s got a long history of quality hacks that we’ve featured over the years. If you’re looking to use a scanner as a multitouch, add some music to tea time, or play with your skittles his work will give you a shove in the right direction.