Electronics

Connecting Multiple AVR/Arduinos via I2C/TWI

Since my RF receivers require a full hardware-based UART to function reliably, I decided to opt for adding a simple attiny2313 as a controller connected to an Arduino. Ready to build a simple protocol, I decided to do a little more research into I2C — the inter-integrated-circuit protocol which puts multiple digital micro-controllers on a low-speed bus. As it turns out, the attiny controllers actually implement the full protocol, even if Atmel calls it TWI (two-wire-interface). The protocol defines a master device as well as up to 127 slave devices (7-bit addressing).

(more…)

By |December 30th, 2009|Electronics|0 Comments

iPhone Garage Door Opener

You keep forgetting your keys but would never let your precious iPhone out of sight? Then nothing should seem more obvious than the need to open your garage door with your iPhone. An Arduino and a few microcontrollers, relays, rf link transmitters and receivers and some firmware later, it’s now reality. Check out the prototype (and excuse the slightly shaky video, it was bitter cold outside):

Read more about the setup and software here.

By |December 24th, 2009|Electronics|0 Comments

Remote Controlled Arduinos

I got a pair of these extremely cheap RF Link receiver and transmitter pairs for under $5 each. They operate at 434 MHz and supposedly can transmit at up to 2400bps. I was hoping to be able to build some nifty firmware which allowed these things to flawlessly communicate bidirectionally (well, one at a time), essentially making them into a cheap variant of the XBees. It turns out, these little devices are not quite as stable as I hoped they would be. But there’s still a lot of cool stuff that can be done with them.

The Hardware

434 MHz Transmitter

434 MHz Receiver

They can easily be hooked up to the Arduino data pins. If you want to boost the transmitter’s power, hook the third pin (Vcc) to more than 5V. It can take up to 12V and the more juice you give it the more power it has to transmit, the less dropped data.

The Software

Here is where all the fun started. Hooking it up was easy, using the Arduino software serial library to establish the communication is also a no-brainer. Yet if the receiver finds no signal for 10ms, it automatically turns itself into an auto-sensing mode in which is cranks up the antenna gain and starts just outputting noise. This is not only annoying, but also very counterproductive when trying to get a clean transmission. Also keep in mind that these modules are really bare-bones. They send and receive data. There’s no automatic receipt acknowledgement, no automatic resending of packets, nothing. That’s especially hard considering that these devices only provide a one-way communication path.

The easiest way to go around this is to just have the transmitter continuously transmit data, even if it’s just empty bytes. […]

By |November 5th, 2009|Electronics|0 Comments

Connecting Relays to Arduinos

Finally having re-submerged from project chaos, I finally have a little time to spend playing with circuits again. While I’m toying with pieces to ultimately automate the entire house, like an RFID-based garage door opener. I figured I might as well post about individual pieces along the way.

The first one is a relay driving circuit. The goal is to simply drive a single relay (for now) from one of the Arduino data pins. Since I want to use the built-in 5V power, I opted for a simple 5V relay. It’s powerful enough to drive 5 amps on 220V, so that should be enough for most applications. I can’t recommend you hooking up 110V or 220V to a breadboard though! Getting circuit boards printed for this will be my next undertaking, but let’s dive into the circuit a little first.

Part List

A 5V Relay like the Omron G5SB ($1.95 at Sparkfun)
470Ω, 1kΩ, 10kΩ resistors (one each)
A NPN resistor capable of driving the relay (2n2222 or these do the trick)
A diode such as a 1N4001 or 1N4148 (like this one or this one)
An LED (every circuit needs LEDs!)
A breadboard and some cables

The Circuit

The circuit itself is fairly simple. The signal from the Arduino data pin goes into pin 4 via the resistor R1 to the transistor which switches the relay on and off. Notice R3 which is pulls the data line to ground (reduces unwanted triggering of the Relay while the Arduino is not initialized). The diode is also required as it protects the circuit and ultimately the Arduino from so-called back EMF current.

Result

Arduino LED Driver from Jochen Toppe on Vimeo.

Fun stuff, but all it really does it go click-click-click. But it is controlled via C-code! I […]

By |November 3rd, 2009|Electronics|1 Comment