Aquaticus

Projects for geeks

I²C driver

06 Jun 2006
I2C driver board

Features

  • I²C bus, only 2 microcontroller lines are required
  • 8 independent channels, each 500mA (650mA peak)
  • Output can be paralleled
  • Controls 2 unipolar steppers 500mA/phase or 1 stepper 1000mA/phase
  • Selectable I²C address
  • Externally powered (50V max) or 5V from I²C header
  • Simple small single sided PCB
  • Based on cheap and popular ICs

Applications

  • Unipolar stepper control
  • Led or Luxeon power
  • Power for small DC motors (direction of rotation can not be controlled)
  • General purpose output lines
  • Power management

Designed to control camera pan and tilt using 2 unipolar steppers.

Schematic

The circuit consists of only two ICs, a ULN2803 that drives the steppers and a PCF8574 8 bit I²C expander.

Two jumpers JP1 and JP2 allow selecting power source for the driver and I²C bus address. 2 or 4 drivers can be connected to one I²C bus. ULN2803 chip contains clamp diodes, so it is safe to connect inductive load.

PCB

Single sided, size: 83×42mm.

Assembling

The device is really simple to build. First solder all the elements. Then connect SL3 header with one of the I²C headers on the control unit PCB (or any other I2C master device). Power the control unit; red diode should be bright. Check the power (it should be 5V) on IC1 and C3 chips.

Configuration

Address

By default you can select one of two I2C addresses to use: 40hex or 42hex. If you use PCF8574*A* chip it is 70hex or 72hex. JP2 jumper selects the address.
Short pins 1-2 to select 42hex (or 72hex for PCF8574A)
Short pins 2-3 to select 40hex (or 70hex for PCF8574A)

Maximum number of I2C drivers connected to one I2C bus is limited to 2. If this is not enough you can cut the wire that connects PAD1 and PAD3 and connect PAD1 with PAD2. This creates two additional addresses that allow you to connect up to 4 devices to 1 bus.

If you not sure which version of PCF8574 chip you have it is probably version without ‘A’ (address 40hex or 42hex).

Power

JP1 jumper lets you select power source for X2 and X3 headers. If you short pins 1-2 the power is taken from SL3 header. That means, control unit is your source of power and the voltage on X2 and X3 is 5V. Use this power configuration only for small receivers. 7805 voltage regulator that is used in control unit can give you maximum 1A. Theoretical power consumption of I2C driver is 8×0.5A=4A. This too much for poor 7805 chip.

In case you control steppers or any other device that needs more than 0.5A@5V you must provide external power source that is sufficient for your needs. Short pins 2-3 of JP1 and connect power lines to X1 header. Maximum voltage you can use is 50V.
Note that IC1 and IC2 chips are still powered from SL3 header and red diode indicates power on SL3 not on X1.

Parallel power

Maximum current for one output is 0.5A. If you need to control devices that require more power you can parallel outputs. For example you can short X2-1 and X2-2. In that case maximum current is 1A. If you short 4 lines X2-1 to X2-4 you can use 2A. You can short any output line except X2-5 and X3-1. Additional holes around X2 and X3 headers are for that purpose.

Warning If you parallel output be sure you properly control PCF8514 chip. You must always set the same output values 1 or 0 for output lines that are connected. For example if you set 1 for one line and 0 for another it is short circuit! The ULN2003 chip became very hot quickly and can be damaged.

Software Example

Please find attached PCF8574_stepper.bas program written in BASCOM AVR. It is a simple example how to control unipolar stepper motor from control unit
It is important that you properly connect phases of the motor. Unipolar motor has usually 5 wires. Connect common wire to X3-5 pin and other wires to X3-1 to X3-4.
If you improperly connected phases motor would vibrate not rotate. In that case try to swap phase wires.
If you use atmega32 microcontroller instead of atmega16 uncomment $regfile = "m32def.dat" line.
Step_mode variable changes full step(=0)/half step mode(=1).