Video: Learning To Program For The ATmega328p Part I

Many of you are familiar with the Arduino. Many of you hate it…* This post isn’t about the Arduino. It is about the processor that is at the heart of many Arduino boards. If you are in the camp of people who can’t understand why others dislike the Arduino so much, this series is for you. In this series of videos, [Jack] will explore how to program for the ATmega328p processor using C. If you have been programming for the Arduino, you may have had some issues with the speed of your code at points. Programming in C will allow you to wring out nearly the last ounce of processing power that the ATmega processors can provide. It will also let you access the peripherals on the processor directly and to switch between different processors when you need more (or less) capabilities.

In this first video, [Jack] shows you all of the features of the 3pi robot, which he will be using as a fancy development board for the ATmega328p. He then shows you how to get your development environment set up and then walks you through one of the sample programs provided for the 3pi robot.

*Here at Hackaday, we are officially neutral in the ongoing Arduino love/hate war. We don’t care what microcontroller is used in the hacks that we show, only that they are cool.

Video is after the break!
Continue reading “Video: Learning To Program For The ATmega328p Part I”

Reverse Engineering The Nike+ Hardware

The Nike+ hardware is obviously an interesting device.  We haven’t heard a whole lot about hacking one until now, but [Dimitry] has decided to change that. Many would assume that the data transmitted off of these sensors is quite simple, however there’s a bit more than meets the eye. Amongst other challenges, all the data packets coming out of the transceiver are encrypted. [Dimitry] claims to have decoded this data stream and made use of it.

This hack also outlines how one can use this without the stock iPod receiver using a 2.4 GHz chip from Sparkfun. A lot of work has been done to figure out how these packets are decoded and the process one goes through to do this is well outlined in this post. This could serve as a good example for those wanting to figure out similar devices.

One thing [Dimitry] hasn’t done yet is release the source code for this hack. He cites some ethical issues that might not seem obvious on first glance, including the ability to follow someone in a crowd or simply jamming their data. He does add though that if you have a good reason for wanting it, to simply email him. We’re looking forward to what [Dimitry] comes up with in the future using this setup!

Laser Level Tripod Made From Recycled Parts

laser_level_tripod

[msuzuki777] is a self-proclaimed “Lazy Old Geek” with way too much free time on his hands. He recently picked up a laser cross and figured that he would use some of that time to make a laser tripod for various projects around the house.

He pulled out an old camera tripod, and modified an unused CD jewel case so that it could be screwed onto the traditional camera mount. He added three bolts to the platform, on which he mounted another CD case, letting him adjust both the laser platform as well as the tripod.

He put together a simple power supply for the laser, and then mounted it on a pair of CDs sandwiched on top of one another. The CD platform was then popped onto the guts of an old CD player, allowing him to spin his laser pointer in any direction without having to re-level it.

The laser cross tripod certainly looks a bit complicated, but [msuzuki777] says it works a treat, allowing him to easily hang pictures and the like. He also mentions that he wants to throw an Arduino at it to automate the leveling process, which is something we’d love to see.

POE Home Automation Control Panel

poe_home_automation_control_panel

[Scott] wrote in to share a project he is currently working on, a home automation system that relies on Power over Ethernet. While he’s not completely finished, he’s made some great progress, and the work he has done so far definitely piqued our interest.

Part of [Scott’s] design relies on some reverse engineered Blackberry screens we showed you a while back. He has constructed a small control panel for his apartment, which incorporates one of the aforementioned Blackberry screens, along with 10 tactile switches and a PIR sensor. The panel is built to be mounted in a wall or as a standalone unit, allowing him to control various lights and appliances throughout his home.

[Scott] spent a lot of time working on the communications protocol and UI for his control panel. As it sits now, the panel takes advantage of a VNC-like protocol he designed, which allows him to interact with a Java application residing on his desktop computer.

Things are looking awesome so far, and [Scott] already has a handful of improvements planned for the near future. We can’t wait to check it out when it’s finished.

N64 Controller Input Using An ATtiny85

[Larsim] worked out the timing necessary to read button and joystick data from an N64 controller using an ATtiny85 microcontroller. The project was spawned when he found this pair of controllers in the dumpster. We often intercept great stuff bound for the landfill, especially on Hippie Christmas when all the student switch apartments at the same time.

Instead of cracking the controllers open and patching directly to the buttons, [Larsim] looked up the pinout of the connector and patched into the serial data wire. In true hacker fashion, he used two 5V linear regulators and a diode in series to step his voltage source down to close to 3.6V, as he didn’t have a variable regulator on hand. It does sound like this causes noise which can result if false readings, but that can be fixed with the next parts order.

The controller waits for a polling signal before echoing back a response in which button data is embedded. This process is extremely quick, and without a crystal on hand, the chip needs to be configured to use its internal PLL to ramp the R/C oscillator up to 16Mhz. With the chip now running fast enough, an external interrupt reads the serial response from the controller, and the code reacts based on that input.

It seems the biggest reason these N64 controllers hit the trash can is because the analog joystick wears out. If you’ve got mad skills you can replace it with a different type.

Electronic Die Rolls Up To 100

If you’re gaming on the road, or just don’t have a die with the right number of sides on hand, an electronic polyhedral die will be quite handy. [Marcus] built this using a printed circuit board of his own design, and we think an electronically simple project like this is a great way to get your feet wet with PCB fab house techniques. He suggests Seeed Studios’ service, or the DorkBotPDX group PCB order. But this would not be a hard project to build on perfboard as well.

The concept is simple. A two-digit 7-segment display shows the value of the top face of your die. when it’s time to roll, just pick up the box and tip it over. A tilt switch senses this action and rolls the die by displaying the next pseudo-random number. The single button, seen here with a pyramid die glued to it, lets you select between die with different number of sides; from 2 (like a coin flip) all the way up to 100.

We like [Marcus’] projects. He’s the same guy that built a scoring system in a game storage box.

Building Your Own Replacement Refrigerator Thermostat

refrigerator_thermostat_repair

[Ron’s] refrigerator broke shortly after he came home from his weekly grocery trip, and since this was his second dead fridge in three years, he wanted to fix it rather than buy a new one…again. It turns out that the thermostat was toast, and a replacement would cost him $80. That was well more than he was willing to pay, but his groceries were starting to get warm, so he had to do something.

Being the tinkerer he is, he figured he could rig up his own thermostat that would work at least as well as the one that died on him. He scavenged an ATmega328 from a failed project, and after digging around online, put together the most barebones Arduino setup he could find. The microcontroller is tucked away in the back of the refrigerator where the old thermostat used to live, and takes input from a TMP36 temperature sensor, triggering a relay to start the refrigerator’s compressor whenever the the temp goes above 4°C.

[Ron] says his fix is just about the “worst kludge ever”, but as he saved $80 in parts and $150 in labor, we’re inclined to think it’s a job well done.