We Assume Control: SPI and a Digital Potentiometer

In the last video I demonstrated a Universal Active Filter that I could adjust with a dual-gang potentiometer, here I replace the potentiometer with a processor controlled solid-state potentiometer. For those that are too young to remember, we used to say “solid-state” to differentiate between that and something that used vacuum tubes… mostly we meant you could drop it without it breakage.

The most common way to control the everyday peripheral chips available is through use of one of the common Serial Protocols such as I2C and SPI.  In the before-time back when we had only 8 bits and were lucky if 7 of them worked, we used to have to memory map a peripheral or Input/Output (I/O) controller which means we had to take many control and data lines from the microprocessor such as Data, Address, Read/Write, system clocks and several other signals just to write to a couple of control registers buried in a chip.

Nowadays there is a proliferation of microcontrollers that tend to have built-in serial interface capability it is pretty straightforward to control a full range of peripheral functions; digital and analog alike.  Rather than map each peripheral using said data and address lines,which is a very parallel approach,  the controller communicates with peripherals serially using but a handful of signal lines such as serial data and clock. A major task of old system design, mapping of I/O and peripherals, is no longer needed.

Continue reading “We Assume Control: SPI and a Digital Potentiometer”

Learning I2C with the Bus Pirate

When an air quality display project needed a display, [Inderpreet] looked into small character-based LCDs. [Inderpreet’s] chosen LCD used an I2C interface, which was new to him. Rather than shy away, [Inderpreet] grabbed his Bus Pirate and dove in!

I2C or Inter-Integrated Circuit serial interfaces are often mentioned here on Hackaday. They generally are easy to use, but as with all things, there are little gotchas which can make the road a bit more bumpy the first time you travel it. One of those things is voltage interfacing – I2C uses bidirectional open drain lines, so interfacing 3.3 V and 5V circuits requires a voltage level shifter circuit designed to handle that requirement. Thankfully in [Inderpreet’s] case, both his TI launchpad target devboard and the LCD used 3.3 volt logic levels.

buspirate2Before using the TI though, [Inderpreet] wanted to test with the Bus Pirate first. This would allow him to verify the hardware, and to make sure he was correctly using the I2C bus. The Bus Pirate can operate at 3.3V or 5V logic levels, and has on-board programming specific to the I2C bus. Controlling the Bus Pirate is as easy as hooking up a serial terminal program and plugging in a USB cable.

The I2C bus protocol is relatively simple, but can still be confusing to a new user. Each transaction needs an address, read/write bit, and a start command sent in the proper sequence before the data bytes can begin flowing. There are also acknowledge bits which prove that the data bytes are actually being received by the LCD. The Bus Pirate made all this easy, allowing [Inderpreet] to quickly display “Hello” on his LCD module.

The I2C bus is just the tip of the iceberg for the Bus Pirate. If you’re interested in learning more, check it out over at The Hackaday Store!

[via Dangerous Prototypes]

Arduino-Powered Alarm System Has All The Bells And Whistles

Put aside all of the projects that use an Arduino to blink a few LEDs or drive one servo motor. [IngGaro]’s latest project uses the full range of features available in this versatile microcontroller and has turned an Arduino Mega into a fully-functional home alarm system.

The alarm can read RFID cards for activation and control of the device. It communicates with the front panel via an I2C bus, and it can control the opening and closing of windows or blinds. There is also an integrated GSM antenna for communicating any emergencies over the cell network. The device also keeps track of temperature and humidity.

The entire system can be controlled via a web interface. The Arduino serves a web page that allows the user full control over the alarm. With all of that, it’s hard to think of any more functionality to get out of this tiny microcontroller, unless you wanted to add a frickin’ laser to REALLY trip up the burglars!

Halo-style Paintball

paintball buggy

It seems as though [Nathan] has taken some serious inspiration from the Warthog. The iconic armored buggy from Halo video games has a turret mounted to the roof. Although [Nathan]’s buggy only shoots paintballs from its turret.

Mounting paintball markers (guns) to various objects such as vehicles, robots, or other machines isn’t quite as straightforward as it seems. Vibrations from anything can transfer through a clamping system and cause paintballs to break. This, of course, inhibits the functionality of the marker and is a messy cleanup to boot. Then there has to be a way to fire the paintballs, which is usually handled by soldering to the electrical connections in the marker. And the entire rig has to stand up to the normal jostling and sudden turns from the buggy.

[Nathan] has solved these problems first by creating a custom fast-change mount that allows any malfunctioning markers to be changed rapidly. The electronic firing mechanism is handled by an ATtiny microcontroller and there is a custom electrical connection that is automatically made when the marker is bolted to the mount.

The new system allows markers to be changed in about 30 seconds, much better than any other system. Maybe in the future [Nathan] can upgrade the buggy’s turret to accommodate a paintball minigun.

Repurposed Laptop Batteries With a Twist

Arduino with lithium ion battery

Lithium ion batteries are becoming more and more common these days, but some of the larger capacity batteries can still carry a pretty hefty price tag. After finding Acer’s motherboard schematics online and doing a little reverse-engineering, [Tiziano] has found a way to reuse batteries from his dead laptop, not only saving the batteries from the landfill but also cutting costs on future projects.

These types of batteries have been used for many things in the past, but what makes this project different is that [Tiziano] is able to monitor the status of the batteries and charge them using I2C with an Arduino and a separate power supply, freeing the batteries from the bonds of the now-useless laptop.

With this level of communication between the microcontroller and the battery pack, there is little chance of the batteries catching on fire when they’re used in another project. Since the Arduino can also monitor the current amount of charge in the batteries, there is also a reduced risk that they will be damaged from under- or over-charging.

This wasn’t just as simple as hooking up the positive and negative leads of a power supply to the battery. [Tiziano] also had to model the internal resistance of the motherboard that the battery expects to see, and get the supply voltage just right so the battery’s safety protocols wouldn’t kick in to prevent them from charging. After a few other hurdles were jumped, [Tiziano] now has a large capacity lithium ion battery at his disposal for any future projects.

Cloning Tektronix Application Modules

Tektronix’s MSO2000 line of oscilloscopes are great tools, and with the addition of a few ‘application modules’, can do some pretty interesting tasks: decoding serial protocols, embedded protocols like I2C and SPI, and automotive protocols like CAN and LIN. While testing out his MSO2012B, [jm] really liked the (limited time) demo of the I2C decoder, but figured it wasn’t worth the $500 price the application module sells for. No matter, because it’s just some data on a cheap 24c08 EEPROM, and with a little bit of PCB design <<removed because of DMCA takedown>>

The application module Tektronix are selling is simply just a small EEPROM loaded up with an <<removed because of DMCA takedown>>. By writing this value to a $0.25 EEPROM, [jm] can enable two applications. The only problem was getting his scope to read the EEPROM: a problem easily solved with a custom board.

The board [jm] designed <<removed because of DMCA takedown>>, with the only additional components needed being an EEPROM, a set of contacts for reading a SIM card, and a little bit of plastic glued onto the back of the board for proper spacing.

UPDATE: Learn about the DMCA Takedown Notice that prompted this post to be altered: http://hackaday.com/2014/08/05/hardware-security-and-a-dmca-takedown-notice/

Adding GPIOs To The Raspberry Pi With The Camera Interface


The Raspberry Pi Model B+ was just released, and now everyone who picks one of those up has a few more GPIO pins to play around with. For the millions of people with the two-year-old version of the Pi, we’re still stuck with the same old, same old: 17 GPIOs on the big header, and that’s about it as far as toggling pins goes.

The Broadcom SoC on the Pi has far more GPIO pins than are broken out on the large header, and a few of those go to the CSI camera interface. These GPIOs can be broken out with a few flat cables (Portuguese, Google Translatrix), giving you four more GPIOs, and this technique can also be used with the new, expanded Model B+.

The CSI camera connector has two I²C lines that go directly to the camera, controllable in Linux as GPIO0 and GPIO1. There are two more GPIO connectors on the CSI connector controllable as GPIO5 and GPIO21. By carefully slicing and soldering wires to a flat cable, these GPIO lines can be broken out onto a breadboard.

There’s a video below demonstrating these GPIO lines being used to control a few LEDs. Of course, anything that is possible with a normal Raspi GPIO is possible with the CSI connector GPIO lines.

Continue reading “Adding GPIOs To The Raspberry Pi With The Camera Interface”