Motor Controller Also Does Nyan Cat

As a freshman at UC Berkeley, [Keegan] has been helping out with his school’s Pioneers in Engineering program that gives high school students some hands on experience with engineering principles, usually by building robots. This year, [Keegan]’s project is a motor controller that just so happens to play the nyan cat song over the motor PWM output.

The motor controller is meant to replace the Pololu simple motor controller the PiE team is currently using. Onboard is an H-bridge chip and an ATmega328 that takes commands from an I2C bus. The ‘328 is loaded up with the Arduino bootloader making the firmware very accessible – a good thing for the high school students that will be building and programming these robots.

[Keegan] put up the Eagle files for the board up on the PiE Wiki. For now, just enjoy the dulcet tones of the pop tart cat theme song after the break.

Continue reading “Motor Controller Also Does Nyan Cat”

Resetting The Page Count On A Laser Printer

[Brian] really liked his Samsung color laser printer right up until it was time to replace the toner cartridges. A full set of toner cartridges sell for about the same price as the printer itself, so [Brian] figured he could simply refill the toner in the cartridges he already has. The printer sends out the ‘low toner’ warning  based on page count and won’t print if the page count is too high, negating the economy of a toner refill kit. Luckily, [Brian] figured out a dead simple way to reset the page count so he can use those third-party refill kits.

All the configuration settings and page counts for the printer are stored on an I2C EEPROM. After dumping the data held on this EEPROM with an Arduino and sniffing everything going into the EEPROM with a Bus Pirate, [Brian] was nearly at his wit’s end. Thankfully, serendipity intervened. When [Brian] restarted the printer with the Bus Pirate attached, he noticed it took much longer to initialize. Printing a configuration report, he was trilled to see that all page counts have been zeroed.

The final hack that allows [Brian] to reset the page count and used refilled toner cartridges is a simple wire that ties the SDA line of the EEPROM to ground on boot. [Brian] used a momentary switch, but given this is a once-every-few-months operation, a simple wire would suffice. Check out [Brian]’s page reset demo after the break.

Continue reading “Resetting The Page Count On A Laser Printer”

Wii Nunchuck On An 80s Computer

For a computer that debuted in the early 80s the MSX was a very respectable machine. Of course  these were the days that superimposing graphics over a video was an amazing feat, but  [Danjovic] and [Igor] are still having fun with their boxen. They designed a software interface for the Wii Nunchuck (translation) on their trusty MSX computer.

The plug coming out the back of a standard Wiimote is just a simple I2C bus. Many things can be done with this port from plugging in ancient controllers to controlling robots. [Danjovic] and [Igor] managed to write a routine in Basic that converts the I2C data coming out of the Nunchuck to data the MSX can understand without any modification of the hardware whatsoever.

All the guys needed to plug the Nunchuck into the MSX was a voltage divider and a few pull-up resistors between the computer and controller. They got data from both buttons, the joystick and the accelerometer in the Nunchuck and made a small program to display some sprites on the screen to demonstrate this. Check that out after the break.

Continue reading “Wii Nunchuck On An 80s Computer”

Programming AVR I2C Interface

I2C as many of you know, is a simple serial interface for many peripheral devices to micro controllers, but it can quickly become confusing to people who may not be accustom to it. Because of that, I2C tutorials are always welcome, and this new tutorial by [Embedds] does an excellent job of how to use I2C with an AVR with a 24C16 2Kbyte EEPROM.

The first half of the tutorial provides a clear explanation of how I2C works, including its signal structure, addressing, and data packets. It then moves on to AVR territory showing how to setup the I2C in an AtMega micro controller. The author uses a pretty standard to most of us Arduino, with software written in AVR C and a nifty little GUI programming application which eases the hassle of dealing with AVRDude directly.

Plenty of code samples follow from twiddling registers to a full blown application reading and writing bits from the EEPROM to a serial terminal on a PC.

I2C Level Converter

You’ve got several devices which communicate via the I2C protocol, but some of them can only operate at 3.3V while the rest are hungry for a 5V connection. What to do? [Linux-works] built this I2C level converter to solve the problem.

The circuit comes from an NXP app note (PDF) on the issue. You can take a quick peek at the suggested schematic from that document. The design uses two MOSFETS for each side of the adaptor. Perhaps a better way to explain this is that you need one for the higher voltage and one for the lower voltage on each of the two data lines for a total of four parts. This allows for both of the buses to communicate as one, while still having their own 3.3V and 5V pull-up resistors.

[Linux-works] concedes that there are chips designed to do this for you, but he was able to source the BSS138 MOSFETs locally and for about ten cents a piece. Not a bad alternative to putting in a parts order.

FT-2232 Bridges Python And I2C/SPI

You might already have the hardware on hand to easily interface I2C and SPI devices with Python scripts on your computer. The board seen above is an FT-2232 breakout board. These chips are often used to facilitate JTAG programming via USB, but they have other features that might be useful to you as well. The chip has a Multi-Protocol Synchronous Serial Engine (MPSSE) which can speak the I2C and SPI protocols, you just need to know how to active them in your code.

[Craig] makes this easy with his MPSSE Python wrapper. Simply install his module, and you’ll be able to import all the commands you need. He demonstrates reading the data out of a 1 MB SPI flash memory chip. This could be used for a lot more, including debugging peripherals à la the Bus Pirate, or reprogramming chips to add to your projects (we’re thinking font arrays and sprites for displays, or look-up tables).

If you’re not aware, these FTDI chips were the go-to for USB support for a long time. We’ve got a guide for bit-banging using this hardware. Lately more chips have become available with USB hardware built-in. They’re quite useful and cost-effective, especially with the availability of open-source stacks like the LUFA project.

Auxiliary Display For Beat707 Works Via I2C

Bigtime is a simple way to create an auxiliary display for the Beat707 MIDI controller. The right half of the display shows the beat pattern that the drum machine is using, while the left half keeps track of the current measure.

Just a few components went into the extra hardware. A four-digit seven segment display is fed data from an ATtiny85. Since that microcontroller has only eight pins, a 595 shift register and CD4067 take care of translating serial data into the outputs necessary to light the display. The entire thing connects to the Beat707’s I2C bus, which means you don’t need to make hardware alterations to the original, and this leaves plenty of room for more addons.

The code package includes a Fritzing file, but for your convenience we’ve embedded a PNG of the hardware connections after the break. You’ll also find the demo video where [Guilherme] explains how this works.

Continue reading “Auxiliary Display For Beat707 Works Via I2C”