RockBot System

Drums

Getting Started

This guide describes how to modify the rock band drums for the bot. A solderless, easy-to-fit version is available in the Shop.


Tools you will need:
  • A Soldering Iron & Solder
  • A Multimeter
  • Wirecutters
  • A PIC Programmer suitable for a PIC12F675 chip

Components Used:

  • 2 x Quad ILQ74 or ISQ74 Opto Isolators
  • 5 x 1k Resistors
  • 1 x PIC 12F675
  • 4 x 2 mm Socket Pair (Optional)
  • 4 x 2 mm Plug Pair (Optional)

How the Drums work

On the Rock Band drum kit there are 4 drum pads and 1 kick pedal.

The Pedal

I will start with the pedal as it is the simpliest aspect of the drums.

In the base of the pedal is a reed switch (which is activated when it comes in range of a sufficiently strong magnetic field, in the plate of the pedal, above the switch is a magnet.

When the pedal is depressed the magnet activates the reed switch and this connection is carried to the headphone-style plug at the end of the cable.

Only two wires are used to interface the pedal with the controller board inside the drums, the connector is a 3.5mm mono headphone jack.

This can be verified wih a multimeter.

The Pads

See the Solderless Drums in the Videos section)!

The four pads are a bit more complicated than the kick pedal.

The pads have piezoelectric sensors in which when compressed (hit by the sticks) briefly emmits an oscilating current. It emmits current for as long as the pads are vibrating (generally a very short time unless you hit them very hard.

Under each drum pad is a 'connector board' which allows the sensor to be connected to the drum control board via a 2mm plug and socket pair. Tapping into these connectors is the easiest way to interface with the pads. Using a socket and plug pair you can make a simple device to intercept the signal wires.

The original connector (you may need to use a knife gently between socket and plug to remove the glue they use when manfacturing it):

The intercepting connector:

The final hook-up:

It is hard to see in the pictures but a wire/side of my board is marked to be on the same side of the white/striped wire. This is crucial due to polarity!

Opto Isolators

I will explain (briefly) how opto isolators work as they are key to the drums and guitars.

The the GH3Bot I used relays for simplicity but they are slower to respond than opto isolators because of the mechanical delay.

From Wikipedia:

In electronics, an opto-isolator (or optical isolator, optocoupler, photocoupler, or photoMOS) is a device that uses a short optical transmission path to transfer a signal between elements of a circuit, typically a transmitter and a receiver, while keeping them electrically isolated — since the signal goes from an electrical signal to an optical signal back to an electrical signal, electrical contact along the path is broken.

The ILQ74 or ISQ74 is a quad optoisolator, four isolators in one housing with NPN phototransistors.

Each opto isolator has 4 pins, two for the light source (usually an infra-red LED) and two for the light sensor (usually a phototransistor).

An NPN phototransistor takes negative and switches it to the output (an PNP one would take positive and switch that). This means that polarity (the negative and positive) pins are crucial.

Be wary if using different opto isolators as they can have different pin configurations, for example a single opto isolator could be like:

Where pin 1 is + LED, 2 is -LED, 3 is the output and 4 is - In. (These are not the techical names).

However some double or quad ones alternate the pin pairs, imagine this is a chip:

1.|.........|.5
2.|.........|.6
3.|.........|.7
4.|.........|.8

2 & 3 would be - and 1 & 4 would be +, and 5-8 would also be similar.

ALWAYS CHECK THE DATASHEET FOR THE CHIP FIRST!

The PIC12F675

PIC Chips are programmable microcontrollers made by a company called Microchip. A PIC12F675 is a simple 8 pin chip (6 I/O ports as 2 are power and no crystal is needed). Only 4 ports are needed for this project.

Microchip provide an IDE for writing the code for these chips (which I used for the Advanced USB Interface) but for the drums I used MikroBasic (the demo version is sufficient).

To program them a PIC Programmer is required, Microchip supply them as do the Mikroelectronica (the company that makes MikroBasic).

How to simulate the Pads

It seems that the signals from the piezoelectric sensors are not the easiest things to replicate, I have currently got them to work at about 99% success rate, if I could afford a digial/PC oscilloscope I may be able to improve that.

The PIC Chip is used to simulate the oscillating frequency the piezos product. It does it at about 1kHz.

Each pad is connected with a pair of wires, a coloured wire (red, green, blue or yellow) and a white and coloured striped wire (same colour as the plain wire). The coloured wires are all a negative common.

To trick the pads into thinking they have been hit the opto isolator connects (when required) one of the output pins of the PIC chip to the drum controller.

So when the drum controller is sitting there waiting for a pad to get it, it gets a brief burst of pulsing current which causes it to think a pad has been hit.

4 outputs are used on the chip. One goes (via an opto isolator) to each pad. One common one could be used for all but I got less misses (the drum controller not recognising the signal as a hit) by using 4 seperate outputs and sequencing them as follows:

Time (ms) Output
0 0000
1 0001
2 0010
3 0100
4 1000
5 0000
6 0001
7 0010
8 0100
9 1111
10 0
etc... etc..

So because no pad activates at exactly the same time the drums are more accurate (god only knows why!).

Simulating the Pedal

This is easy. The drums send out a signal down one of the pedal's wires and wait for it to be recieved on the other wire, counting as a 'kick'. The signal sent out is negative so an opto isolator is used to connect the two wires when required.

When using a headphone jack, the shell is negative and the tip is the switched wire which returns the signal:

The shell connector will be the long one with the whole it and the grips, but you should use a multi meter to check which on the tip is. Check both to be sure.

Circuit Diagram

All schematics and PCB layouts are done using the free version of Eagle and the files are available for download at the bottom of this page.

Be careful when using this as this is for the ILQ74's I bought when I first made the board, check you polarities and datasheets.

For LEDs: Positive -|>|- Negative

On the transistors the arrow from the black bar (pin three on the lowest) is negative.

Power 1 is positive (+5v)
Power 2 is negative (Gnd)

Pedal 1 is positive (tip of the drum connector)
Pedal 2 is negative (shell of the drum connector)

Drumpads 1,3,5 & 7 are the negative commons (coloured wires)
Drumpads 2,4,6 & 8 are the positive signal wires (colour/white striped)

Data 1-6 are to be connected to the USB board output pins.

There is a 1k Ohm resistor beween the common of the optoisolator LEDs and ground.

PIC Code

Below is the MikroBasic Code, the configuration code is 0x3F84, the internal oscillator speed is 4Mhz.

program Sound_Generator
TRISIO=0
main:
do
GPIO = 0
delay_us(1200)
GPIO = %00000001
delay_us(1200)
GPIO = %00000010
delay_us(1200)
GPIO = %00010000
delay_us(1200)
GPIO = %00100000
delay_us(1200)
GPIO = 0
delay_us(800)
GPIO = %00000001
delay_us(800)
GPIO = %00000010
delay_us(800)
GPIO = %00010000
delay_us(800)
GPIO = %00100000
delay_us(800)
loop until 1=2
end.

Hex code:

:100000000428FF3FFF3FFF3F031383168501831240
:1000100085010230DB00FF30DA00DB0B10281328EB
:10002000DA0B10280D288C30DA00DA0B15280000C6
:100030000000013085000230DB00FF30DA00DB0B0E
:1000400022282528DA0B22281F288C30DA00DA0B28
:10005000272800000000023085000230DB00FF305E
:10006000DA00DB0B34283728DA0B342831288C30BF
:10007000DA00DA0B39280000000010308500023069
:10008000DB00FF30DA00DB0B46284928DA0B462874
:1000900043288C30DA00DA0B4B28000000002030B7
:1000A00085000230DB00FF30DA00DB0B58285B28CC
:1000B000DA0B582855288C30DA00DA0B5D2800005E
:1000C000000085010230DB00FF30DA00DB0B69281D
:1000D0006C28DA0B692866280730DA00DA0B6E28FC
:1000E0000000013085000230DB00FF30DA00DB0B5E
:1000F0007A287D28DA0B7A2877280730DA00DA0B9D
:100100007F280000023085000230DB00FF30DA007B
:10011000DB0B8B288E28DA0B8B2888280730DA0037
:10012000DA0B90280000103085000230DB00FF3031
:10013000DA00DB0B9C289F28DA0B9C2899280730D3
:10014000DA00DA0BA1280000203085000230DB0045
:10015000FF30DA00DB0BAD28B028DA0BAD28AA2877
:100160000730DA00DA0BB22800000728B628FF3F74
:02400E00843FED
:00000001FF

Copyright © Paul Ridgway 2009 | Pictures by Amanda Taylor | HTML Layout & Base code by James Ridgway