Archive for the 'Modification' Category

12
Oct
17

The Carousel Keyboard

‘Carousel’ was just the brand name of this toy keyboard, it didn’t unfortunately look like a carousel . . .

. . . but having just finished the Animal Band and The Telephone, I wanted, while it was in my mind, to work on another device that could be controlled by the Bigfoot, only this time with a full two octave span, the ability to play a variety of different scales, and be tuned to play these scales in any key.

I opened up the Carousel, and it looked as though it would fit the bill.  The chip on which it was based was securely hidden under a black blob, but there were sufficient additional components to make me think a few simple hacks would be possible.

First of all, I wanted to check the instrument’s ability to be tuned.  I inserted batteries, switched on and began testing the circuit using the traditional wetted finger method – that is, starting the instrument playing one of its demo tunes and applying a wetted fingertip to different resistors on the board.

After a short test, I found the resistor that controlled the instrument’s pitch and timing.  It was a tiny SMD (surface-mounted) component, just 3 or 4 millimetres long, so was easily – though carefully – removed.  Its value – again, printed on the circuit board – was 300k, so after it was removed I replaced it with a 1M potentiometer, to increase the range of notes the instrument could produce.  The spot from which the resistor was taken is arrowed on this photograph, and the two leads going to the potentiometer can be seen:

(Also visible in the background are the wires connected to the PCB tracks required to trigger the notes).

I experimented with the resistance and found that the minimum the device would accept without crashing was about 200k, so I added an extra couple of 100k resistors before the 1M potentiometer, and found that a considerable variation in the pitch was achievable.

*

Early on in this process I disconnected the internal speaker, which was quite terrible, and added my standard 4mm banana sockets for attaching an external speaker.  The sound was 100% improved, and experimenting became a great deal more pleasurable.

Just beneath the speaker sockets a switch can be seen, which I connected up to allow the internal speaker to be selected, if an external speaker wasn’t available.

I later added an audio out socket, to allow the Carousel Keyboard to be played through the Taurus amplifier.  At first this didn’t work at all – virtually no sound came out, even though it would work with the internal or external speakers.  But I realised the output of the circuit needed a load in place of the speaker, so I put a 10 ohm resistor between the audio out and ground pins on the audio out socket, and after that it worked fine with an external amplifier.

*

I was saved from having to do the job I had performed on the Animal Band and The Telephone, working out which PCB tracks needed to be connected to produce the different notes: to my surprise, this was printed on the back of the circuit board.

There appeared to be an 8 x 5 matrix, so connections were made to the relevant PCB tracks, ready to be brought out to a new board.

*

The intention was to be able to control the keyboard with the Bigfoot sequencer, so I added a 5-pin DIN socket and 4050 buffer, as usual, ready to accept the Bigfoot’s 4-bit binary input.  This is in the form A B C D, where A is the last – rightmost – bit in the binary number, and D is the leftmost.  A is sometimes referred to as the LSB (Least Significant Bit) and D the MSB (Most Significant Bit).

The binary number 0010, for example (the number 2) would mean that D was 0, C was 0, B was 1 and A was 0; in practical terms this means that input D was 0v, C was 0v, B was +v and A was 0v.

I needed one of the inputs (D) to be inverted – i.e. if the input was 0v, I needed +v, and if the input was +v, I needed 0v – so with the 4050 was a 40106 inverter, with sections which change 0v to +v and +v to 0v.  There was very little space inside the keyboard case, so the board with the 4050 and 40106 was tucked under the output socket.  (This was before I added the 10 ohm resistor on the socket).

The circuit of the input section was like this:

There are 6 buffers in the 4050 chip; 4 of these are used (marked A B C D) and the inputs of the other two are connected to ground.  Likewise, there are 6 inverters in the 40106; 1 of these is used and the inputs of the other 5 are connected to ground.  Unused inputs on CMOS chips should normally be grounded like this to ensure correct operation.

Normally, I would use a 4067 to cover the two octaves produced by the Bigfoot – as in the Animal Band and The Telephone – but in this case that wouldn’t work.  The 4067 is essentially a 16-way switch with a single pole; in this case there were 4 different ‘poles’ to which connections needed to be made, since the notes are produced by a matrix.

Using four 4067’s would be perfectly possible, but unnecessarily expensive – each one costs between 30 and 50p, and is physically quite large, being in 24 pin wide format.  As there would only be 4 or 5 connections to each pole, it would be more effective in terms of cost and space in this circuit to use 4051’s.  The 4051 is an 8 pole switch which works in more or less exactly the same way as the 4067, but is physically smaller  – and costs less than 15p!

An important difference between the 4051 and the 4067 – related to the number of outputs – is that the 4067 requires a 4-bit binary input (16 numbers, from 0000 to 1111), but the 4051 only a 3-bit (8 numbers from 000 to 111).  This means that a different way must be found with the 4051’s to ensure that outputs for the first 8 numbers are separate from the outputs for the second 8 numbers.

This can be done by using the Enable/Inhibit pins of the 4051’s.  Each 4051 – just like the 4067, in fact – has an Enable/Inhibit pin: if this pin is at 0v, the chip will work, and convert its binary inputs into individual outputs; if the pin is at +v, it won’t work.

So, the first 3 inputs from the Bigfoot binary input socket, A B & C, are passed on to the 4051’s in the next part of the circuit, but the 4th input, D, is not.  Instead, the 4th digit is used to turn pairs of the 4051’s off and on via their Enable/Inhibit pins.

4051’s 1 & 2 output the lower 8 numbers (0000 to 0111), so as long as the 4th, leftmost, digit is ‘0’, these two 4051’s are enabled.  0v at the Enable/Inhibit pin achieves this.

4051’s 3 & 4 output the higher 8 numbers (1000 to 1111), so if the 4th digit is ‘1’, an inverted signal from the 40106 sends 0v to enable these two.

The circuit to convert the binary input to separate outputs looks like this. (The 40106 gate is repeated from the diagram of the input circuit):

The lower 8 notes are divided between the top two 4051’s in the diagram, which work together with no overlap in notes, and the higher 8 notes are divided similarly between the bottom two, according to which common pin they must connect to.  The pin connections are named in the diagram as they appear printed on the keyboard’s main PCB: the 4 common pins are connected to tracks named BP10, BP11, BP12 and BP13.

The reason there are many more than 16 output pins shown is connected with the principle of the Bigfoot sequencer.  The idea is that the sequencer outputs the notes of a scale – do, re, mi, fa, so, la, ti, do – but the exact scale – major, minor, melodic, harmonic, etc. – is determined by switches on the receiving instrument.  Normally there would be 5 double pole switches, but due to the configuration of the pins in the Carousel keyboard, one of the switches (SW2) needs to have 3 poles.

*

As with other of my designs like this, there wasn’t a lot of circuitry as such – just a lot of interconnection between the chips.  After soldering the dozens of wires needed to link the 4051’s with the switches and the Carousel keyboard’s PCB, the inside of the instrument looked like this:

There was just enough room for the new circuit board with the four 4051’s on it.

The Chessboard Keyboard proved very useful in checking that everything was working properly – one wrong note revealed a connection error on one of the switches! – and the 4 LEDs were a good double check that the binary input was being interpreted correctly.

*

Although the pitch control potentiometer worked well, I decided there was a need to be more precise about the pitch, which would effectively set the key the instrument would be playing in when controlled by Bigfoot.  So, as I had done earlier with The Telephone  – referred to above – I added a switch to change between the potentiometer and a 12-way switch.

Between each of the output pins of the switch, I inserted a 100k trimmer – with an extra 100k trimmer before pin 1 – so that the pitch of the instrument could be set to any one of the 12 steps in the octave.

In The Telephone I used ordinary single-turn trimmers, but I though it would be a good test to see if multi-turn trimmers would be as good – that is, as accurate in establishing the pitch, remaining in pitch, and not taking up too much space in the cramped enclosure.

The type I chose looked like this:

Buying 20 at a time enabled me to get them at a reasonable price – about 8p each, although this was probably twice as much the single-turn trimmers I had used in The Telephone.  They were also much more than twice as big.

However, I soldered them all in place and set about adjusting the pitches.

In this instance, I didn’t really find a big advantage in using the multi-turn trimmers.  I was tuning the pitches by ear – maybe I was able to be more accurate than with the single-turn trimmers, maybe not.  It took longer to tune each note, of course, because of the number of extra turns required.

I would have been glad if the potentiometer/trimmer arrangement had been a bit smaller, but I found space on the right-hand side of the keyboard to fit it in with the potentiometer and the other switch.  This picture shows 1 – the 12-way switch with trimmers, 2- the 1M potentiometer, and 3 – the SPDT switch which allows either the 12-way switch or the potentiometer to be selected.

I chose two knobs which fitted the space available on the top surface, drilled holes and fixed them in place.

*

That was everything I planned to do with the Carousel keyboard for now, so I carefully closed up the case and screwed it back together.  I had to cut some rectangular holes in the base to make room for the 5 switches, but surprisingly everything else fitted in.

 

Advertisements
23
Sep
17

The Alien Choir

The Alien Choir wasn’t a device I particularly wanted to circuit bend- the alien voices it makes are fine as they are!  – but I wanted to do a couple of things to make is easier and better to use.

The Alien Choir is one of the ‘Finger Beats’ series.  These are recognisable by their distinctive design, and are all operated in a similar way, using light finger pressure in certain places on a colourful illustration on the front.

I don’t have an instruction book with mine, so it’s not clear that all of its functions are working – in particular, recording samples with the built-in microphone – but it makes 8 excellent alien voice sounds.  The volume of the sounds can be turned up or down with the ‘+’ and ‘-‘ buttons on the left-hand side.

*

First of all, although 3v isn’t an odd or unusual value, I decided to add a socket and dc converter to allow the device to be powered by a mains adapter or larger – e.g. 9v – battery.  To this end I also added a small square of velcro to the back, as I had with other instruments before, to allow one of my 9v battery holders to be attached.

The dc converter was a small and inexpensive (less than 50p) module, which didn’t need any additional components, just an input voltage from 20v down to about 1v higher than the desired output voltage.  The output voltage is set by means of a small trimmer on the board.

In this case I found that the required voltage, as measured on my multimeter, needed to be a little lower (about half a volt lower, in fact) than the anticipated 3v in order for the circuit to work smoothly.  I don’t know if this is something specific to the Alien Choir, a difficulty in measuring the voltage precisely, or what.

Inside the device, I added a switch to choose between the battery or the external socket.  In the following picture  1 indicates the socket, 2 the dc converter and 3 the switch.

The device has a 3.5mm audio out socket (and an audio in, in fact, as can be seen in the lower right-hand corner of the picture above), but I decided to add banana sockets for connection to one of my external speakers.  This always produces a much better sound than the small built-in speakers these devices are fitted with.

The small switch on the right selects either the internal or external speaker.

I hope this will be a useful – and certainly attractive – addition to the ‘Outer Space’ section of my instrument collection.

06
Sep
17

The Animal Band & The Telephone

This project came about as I was looking through my collection of electronic toys for additional devices that could be controlled by the Bigfoot sequencer or the Chessboard keyboard.

I don’t know if ‘Animal Band’ and ‘Telephone’ are the correct names for these toys, but they are sufficiently descriptive to identify them amongst my various devices.

Both the Bigfoot and the Chessboard encode the 15 pitches (2 octaves) they can produce into 4-bit binary numbers so that they can use standard 5-pin DIN connecting leads – the same as MIDI leads – rather than more complex multi-way connectors to control sound-making instruments.

I came across two devices, which were rather limited in that they played only a one octave scale; but it was the same scale – B major – and one of them had not only small animal musicians who moved as the notes were sounded, but was also capable of playing a scale with various animal noises.  For some reason, this scale turned out to be A major, but this was only a minor inconvenience.

The additional electronics required would be similar to those in The StyloSound, the main thing being a circuit to convert the binary number input from the Bigfoot or The Chessboard to the individual notes of the scale.  Both the devices would need one of these.

The basic circuit I use looks like this:

Receive circuit 3

At the beginning, the input passes through a non-inverting buffer.  (There are 6 connections from the input to the buffer in case a later plan for operation via MIDI is implemented, which is designed to use 6 bits.  For the time being, only the first 4 are being used, the other 2 remaining unconnected).

The purpose of the buffer is to reduce the incoming signal level (which, from both the Bigfoot and the Chessboard, is at 9v) to 4.5v, the voltage of the Animal Band.  The 4050, unusually, is able to deal with an input signal which is higher than its supply voltage, which makes it ideal for this purpose.

When functioning, the 4067 will interpret the 4-bit binary input on pins 11, 12, 13 and 14 as a decimal number from 0 (0000) to 15 (1111) and act as a switch, connecting pin 1, the Common, to one of its 16 outputs on pins 2-9 and 16-23.  Each of the 4 binary inputs is held at 0v by 100k resistors, interpreted as a ‘0’ by the 4067, so a +v pulse on one or more of the inputs pulls them high, acting as a ‘1’

To avoid silences – Bigfoot produces 16 notes, the Animal Band produces only 8 – the output pins for notes 9 – 15 are connected to the pins for notes 2 – 8.

Pin 15 is brought out to an SPDT switch.  When connected to +v, the 4067 is turned off; when connected to 0v, it is turned on.  The Telephone would have a similar switch.  In this way either instrument can be set to work or not work without disconnecting the power.

*

To find exactly where to connect the Common and output pins of the 4067 I needed to search inside and test different points on the printed circuit board.

I removed the top:

Animal Band top

and examined the inside:

Animal Band inside marked

The important sections are marked.  (Normally the LEDs are pointing upwards, but I was in the process of examining them when I took this picture and had unscrewed the circuit board on which they are mounted).  In the centre of the device you can also see the rod by which the stepper motor moves the figures of the animal band when notes are sounded, and at the bottom the actuators which are pressed by the keys.

The first thing I did after opening the case was to give the actuators a clean.  They are the typical type – like computer keyboards or game controllers – which, when pressed, connect together two narrow tracks on the PCB.  If dust and dirt get inside them, they can operate erratically.

This is a typical example (from The Telephone) of the PCB tracks underneath a button:

Button pad

Apart from cleaning these small PCB tracks, I gave the carbon or graphite blocks which make the connection a light scrape to make sure their surfaces were also free of dirt and dust.

The important connections inside the Animal Band seemed to be grouped together in the bottom left-hand corner, so these are the connections I looked at first.  After testing them, I could see that the following connections needed to be made:

Animal Band PCB

The point marked ‘Common’ needed to be connected to pin 1 of the 4067, and the 8 notes to first 8 output connections on the 4067.  (Actually, output 1, pin 8, in the Bigfoot system is not connected, so the unit is silent on receipt of 0000.  The first note sounded is 0001, so the outputs used are 2-9, starting with pin 7).

In the Bigfoot system, an instrument which can sound all 12 notes  in an octave would have switches to raise or lower some notes of the scale (the 2nd, 3rd, 4th, 6th and 7th notes), but the Animal Band and the Telephone are fixed to play a major scale, so these switches aren’t needed.

*

Finally, there needed to be a circuit to connect the Animal Band and The Telephone.  This would have to combine the input from Bigfoot, the Chessboard (or other 4-bit binary input) and send this in binary form to The Telephone.

This consisted only of inputs from two DIN sockets, entering via diodes, and passing through a second 4050 buffer.

The circuit board ended up looking like this, as I had originally planned to include a further circuit which would convert 16 individual inputs to a 4-bit binary output (as used in the Chessboard):

circuitboard

The large 24 pin chip at the bottom left is the 4067; the two chips above are the input and output 4050 buffers; the other 3 chips are two 4532’s and a 4071 for the unused binary-converting ‘Send’ circuit.  The diodes in the bottom right are for the inputs from Bigfoot and the Chessboard.

The board was designed to fit into the rear section of the Animal Band, behind the ‘organ pipe’ section with the LEDs in it.  I added 6 extra LEDs here, connected to the 6 outputs of the 4050 input buffer.

Most of the connections – including the 6 new LEDs – can be seen in this view of the inside, just before putting the case back together.

IMG_0947-2

This picture shows 3 of the new sockets and switches.  1 = the 5-pin DIN Out socket; 2 = the 4067 Enable/Inhibit switch; 3 = the audio out socket.  When a 3.5mm plug is inserted into the socket, the speaker connection is cut out.

IMG_0950-2

*

The Telephone needed a similar circuit.  The 4067 is one of my favourite chips, and I’ve been using it for some years, but recently, it seems , the Arduino hobbyists have started to use it, as there is now a reasonably-priced breakout board available, using an SMD version of the chip.  This looked like a real time-saver for me, so I bought a stack of them – at a cost of about 70p each – and The Telephone was my first chance to use one.

4067-Breakout-BoardAs can be seen, the 16 outputs are brought out on the left-hand side of the board, and on the right-hand side are ‘SIG’, which is the Common output on pin 1; the 4 binary inputs S0-S3; ‘EN’, the Enable or Inhibit pin; +v and Ground.

I couldn’t use this breakout board in every situation: the information with it said the maximum voltage should be no more than 7v – elsewhere I have even seen 6v.  I think the intention is that it would be used with 5v, like the Arduino, but in any event the 4.5v I was planning to use with the Animal Band and Telephone would be well within the limits.

Inside, The Telephone looked like this:

Telephone inside

The main circuit board inside The Telephone sits under the 12 buttons of the keypad.  It looked as though the important connections were down the right-hand side of the board, so, tracing the tracks, it was possible work out which ones needed to be connected to produce each of the notes The Telephone was capable of.

Track 8 was the ‘Common’.  This track needed to be connected to one of 8 of the other tracks to produce the notes of the scale.  I identified which 8 tracks these were and connected these, plus the Common, to the 4067.  As with the Animal Band I connected outputs 9 – 15 to outputs 2 -8 to make sure The Telephone would be constantly sounding – except when in receipt of a 0000 input.

According to the circuit diagram of the module, it appeared that the Inhibit or Enable pin  was tied to Ground with a 10k resistor, so the unit would automatically be working when the power was switched on. 4067 breakout board schematicThis meant that only a SPST switch would be required to connect the pin to +v if it was necessary to stop it functioning.

The telephone was a less complicated unit than the Animal Band, so I just needed to connect the 4067 module to the input via a 4050 buffer, for which I just used a 16-pin i.c. socket, rather than a piece of veroboard:

Also visible in this picture are the four 100k resistors connecting the inputs of the 4050 to ground, and the audio out socket, which cuts out the internal speaker when a 3.5mm mono plug is inserted.

The outputs of the module were connected to the appropriate points on the Telephone PCB:

The only other thing to add was a switch attached to the enable/inhibit pin of the 4067 to allow the unit to be switched off without removing the power.  As mentioned above, the enable/inhibit was attached to ground internally in the module, so the switch just required a connection to +v, which would stop the 4067 from functioning.

This switch can be seen on the front left of this view of the outside of the finished unit:

On the rear can be seen the audio out (top) and 5-pin DIN (bottom) which can accept input from the Bigfoot sequencer, or a device compatible with the Bigfoot 4-bit binary note system (e.g. the Chessboard keyboard).

*

Having reassembled everything, it was time to check the devices in operation with the Bigfoot and the Chessboard, plugging them together with standard 5-pin DIN (or MIDI) cables, like this:

Everything seemed to work as expected, and the two units played in unison – or individually if one or other of the enable/inhibit switches were turned off – when operated either by the Bigfoot or the Chessboard.

Click here for a short film of the set-up taken on my iPhone.

 

26
May
16

Stylophones 5 – The Melophone

There are a number of different instruments called the ‘Melophone’ or ‘Mellophone’.  The one on the left in the picture below (by Kc8dis at the English language Wikipedia) is a brass instrument used in marching bands and the one on the right is ‘a cross between a guitar and a harmonium’, according to the Squeezytunes blog (at http://squeezyboy.blogs.com/squeezytunes/2008/02/melophone.html, from which the pictures came).

Mel(l)ophones

However, this Melophone which I recently acquired, is clearly a type of Stylophone – and a very stylish type of Stylophone at that!

Melophone2

Melophone1

I had never heard of this Melophone before, and found only a single reference to it on the internet.  A glance at the accompanying booklet – which, as you will see below, follows exactly the same style and format as the booklet from a 1960s/70s Stylophone – shows that it was not written by a native English speaker.  The company that manufactured it is (according to this website: http://www.pewc.com.tw/eng/) or was (according to this Wikipedia entry: https://en.wikipedia.org/wiki/Taiwan_Mobile) founded in Taiwan in the 1950s and acquired the name ‘Pacific Electric Wire and Cable Company’ on December 30th 1957.

The company would, therefore, have been in place to manufacture the Stylophone after its invention in 1967.  It looks as though it may have done so for some years as the picture on the box shows a Melophone with the early Stylophone keyboard with the black non-playing sections; just as the Stylophone was updated with a new keyboard, so it seems was the Melophone.

Box

The flap has a sticker on it showing the colour as yellow, which this one is; but other colours were presumably available.

It is, incidentally, not ‘Colour’, but ‘Color’, which may be an indication of the market it was intended for: Asia or America.  There would be no reason why it should not be intended for the UK, as the legend ‘Made in Taiwan’ was commonly seen during that period – except that genuine, British-made Stylophones were available over here, and Dübreq would surely not want to allow or encourage competition.

*

The similarities with the Stylophone – its appearance as well as its booklet – are striking: particularly the distinctively-shaped keyboard with its recess above to hold the stylus.

Stylus01

As can be seen  in the above photograph, the size and method of connection to the stylus are also the same as the Stylophone, and a detailed comparison of the yellow Melophone stylus with a black Stylophone stylus, shows that their dimensions are more or less identical:

Stylus02

Nevertheless, there are significant differences – aside, of course, from its handsome ‘Grand Piano’ shape!

First of all, although apparently identical, the Melophone keyboard is longer.  With a standard Stylophone on top, this can be clearly seen:

Keyboards

There are 2 extra notes at the bottom end of the keyboard, G and G#, and 1 extra note at the top, F – that is, 23 notes in total, as opposed to the Stylophone’s 20.

You can also see in the above photograph that the Melophone lacks the traditional Power and Vibrato switches at the left-hand end of the keyboard.  Instead, the Power On/Off switch is incorporated into a volume control on the top of the Melophone, to the left:

On_Off_Volume

The Vibrato switch is found on the left side, together with a control the standard Stylophone never had – an Octave-change switch!

Side

Using this switch, the range of the Melophone can be extended by another 12 notes, giving the instrument an exceptionally wide range.

Turning the instrument over reveals the battery compartment – like the original Stylophone, the Melophone requires a 9v PP3 battery – and the three screws which need to be undone to access the inside.

Back

The circuit board inside is quite different from the standard Stylophone – and so is the circuit itself: no fewer than 6 transistors can be identified in the following pictures (These are 1 x ED1402A, 3 x ED1402D, 1 x ED1402E and 1 x ED1602E, which are all NPN General Purpose transistors – except the 1602E, which is a PNP):

Inside1

Inside3

Inside4

Inside2

It has no tuning control like the standard Stylophone; I wonder if the top has been removed from one of the potentiometers in the first internal picture in order to make some pitch adjustment.

*

Comparing the Melophone Booklet with a typical Stylophone booklet of the period, the close similarity is evident:

Two CoversRead the Melophone Booklet

Even the two pieces of music at the back of the booklet are the same: ‘Silent Night’ in the key of Bb and ‘The Londonderry Air’ in the key of C, although references to ‘Stylophone’ or ‘Dübreq’ are noticeably absent.

*

One website (http://www.miniorgan.com/lib/view.php?miniorgan=80&view=E&srch=&srch_type=&sortby=&output=14) pictures and describes as ‘another very cheap STYLOPHONE clone’ an obvious copy (which they date to 1976 – the year after production of the original Stylophone ceased, according to the Stylophone Collectors Information Site  at http://www.stylophone.ws/index.html).  ‘Sounds poor and very poor plastic’, they say; but this Grand Piano Melophone seems like a step up from that, in sound and construction.

Here’s a brief example of the tones made by the Pacific Melophone:

Sufficiently Stylophone-like, I’m sure you’ll agree!  The two low notes beneath the Stylophone’s normal lowest note don’t come out too well, though.  I’ll have to see if something can be done about that.

Describing a Hong Kong made Stylophone, the Stylophone Collectors Information Site says ‘Problems were experienced by the Dübreq company regarding patent infringments, but licences were apparently also granted, so it is very difficult to categorise this particular model.’  Perhaps the same can be said for the Melophone: it definitely isn’t a Stylophone, but it seems to me reasonably built and with some very close similarities – was it somehow produced under licence, or just a clever copy?  If anyone has any further information, please let me know.

13
Mar
15

Guitar FXBOX – Part 2, the hardware

In my previous post on the FXBOX, I described a series of PureData patches used for guitar effects, and the need for a Foot Controller to operate it.

I happened to have a suitable case for this project – the remains of a previous mixer project which was never entirely finished. It was a large console-style case, about 18″ square, which I had already drilled with about 80 or 90 holes. The holes were too close together for all of them to be foot controller buttons, but about half of them could be used.

Outside of box DSCF0003

There were to be 4 sections to the controller, which would be: 1. Audio in/out and Audio to USB; 2. Audio to MIDI and MIDI to USB; 3. Keyboard Letters and Numbers, output via USB; and 4. Also via USB, Buttons and Potentiometers from a game controller.

*

1. AUDIO

The audio section was slightly more complicated than it might have been, as I’ve been using a twin-necked (6 and 12-string) guitar, and at some point intend to separate the output of the two sets of pickups.  For this reason, I added two audio input channels to the Controller.

The system basically works so that it can accept inputs either via a 6.35mm stereo socket or separate 6.35mm mono sockets, and can be routed either to a 6.35mm or 3.5mm stereo output, or two 6.35mm mono outputs. Each channel has a separate mono Send and Return, and there is stereo Send and Return covering both channels.

Audio DSCF0012

The 3.5mm output was included simply because this is the normal type of audio input socket on a laptop – which I was using to run Pure Data – and this would remove the need for a 6.35mm to 3.5mm adapter. Internally, there are connections to a Sonuus G2M Audio-to-MIDI converter – described in the next section – and an Audio-to-USB converter.

I took a chance on a cheap Audio-to-USB converter. I tried a few of the very cheapest type (99p on eBay), which worked OK, but I experienced too much latency, and these can only be used when the delay between playing and sounding isn’t important – on automatic or aleatory devices, for example. In this case, the next cheapest type (£2) seemed to work fine.

audio_usb

The intention of the Controller was that all four elements (the Audio to USB , the MIDI to USB, the keyboard numbers and letters, and the gamepad controls) would all be capable of output via a single USB socket. To accomplish this, I added an extremely reasonably priced (£3.95) 7-input USB hub. Given the number of items it would need to cope with, I got a powered one, which came with a 2-amp 5v mains adapter.

The inside of the box was going to be a bit like an enclosed pedalboard, and I simply velcroed this unit in position inside the case.

7 port hub

The hub was connected to a double USB socket unit – the type that would be fitted on a PC – with one socket connected to the type B output socket on the hub, the other one serving as an extra external input.

*

2. MIDI/USB

I added the MIDI section for two reasons: the first was that although MIDI implementation wasn’t really the point of this Controller, it could, I thought, come in handy for later applications, and be a convenient place to house my Sonuus G2M – a monophonic guitar-to-midi converter. The G2M, like the USB hub, was velcroed in place and linked up via internally-connected plugs.

G2M 27589983

Secondly, I’d successfully used a very cheap MIDI-to-USB converter in a previous project (‘A new use for USB keyboards‘), and decided for £3 or £4 that one could be included here. In this case, I didn’t even remove the outer casing as I had done the previous time, but simply shortened the IN, OUT and USB leads to fit and velcroed the unit to the inside of the case.

MIDI Inside box 1 DSCF0001

Audio and MIDI inputs would normally be via internal connections, but I added two 5-pin DIN sockets to the outside of the case. The first was for MIDI Out; the second, via a DPDT toggle switch, allowed input to the converter to be internal or external in case I wanted to connect a MIDI instrument or controller, such as my Behringer FCB1010, use another audio-to-MIDI converter, or decided not to use the G2M inside the case.

MIDI DSCF0012

*

3. LETTERS & NUMBERS

I had worked out for the previous project referred to above how to use the PCB from a defunct Apple keyboard as a means of outputting ASCII codes. The [key] function of Pure Data can be made to interpret and take action on these in any way required. I wanted to include this feature to help in using my looping program, Jesse Chappell’s Sooper Looper.

sshot6

As well as being controllable via MIDI, many of the Sooper Looper functions are controllable by input from the computer keyboard.  I wanted to include a simple system which would output some of the keyboard letters required to record, overdub, reverse and so on.

A 10×4 matrix would output all the letters in the alphabet, and the numbers 0-9, so I could put up to 40 buttons on the Controller (including a couple which represented punctuation marks), but I wouldn’t need anything like 40 buttons for this application.

I started confidently, as before, disassembled one of my collection of broken keyboards and took out the PCB.  It was very similar to the one I had used before: very wide, and with two USB input sockets on the ends – but it was a completely different make! So, I plugged the USB out cable into the computer, got the crocodile clips out, started up Open Office and began touching the matrix points together to see what letters came out – it had an entirely different layout from the one I’d used before!

However, after a certain amount of testing, it became clear that the matrix lines were essentially the same, but just in a different order on the board, which meant I could still get the 40 letters and numbers I wanted, and the pinouts on the sockets I planned to use (15 pin DIN HD) would still be compatible with the unit I had previously built.

In fact, it didn’t really matter about compatibility, as this would – at least as initially conceived – be a self-contained Controller unit, but I wanted to keep things consistent across my range of devices, and perhaps at a later date allow for an alternative or supplementary control unit to be connected to the Foot Controller.

I carefully connected the appropriate pins of the matrix to a ‘break out’ board, to which I connected a 15-way PCB header.

Apple PCB DSCF0004

This would make it a relatively simple job to connect buttons later.

*

4. GAME CONTROLLER

Again, I had used a game controller before, for the Theresynth/Cybersynth project, using the PureData [hid] function; but this time I needed to be more ambitious and use the joystick potentiometers as well as the buttons.

Of course, there are companies which produce USB controller modules, mainly for arcade controller enthusiasts, for example Ultimarc: http://www.ultimarc.com, and GroovyGameGear: http://groovygamegear.com.  The best value seemed to be the ZD (Zero Delay) Arcade controller, which is readily available on eBay.

Arcade Controller

I bought a couple of these two years ago at £8 each, but they seem to be even cheaper nowadays.

Good though they are, however, these units are limited to 12 buttons and two potentiometers.  Game controllers tend to have quite a large number of buttons – especially if you include the hatswitch buttons – and potentiometers on a single circuit board.

I needed 18 buttons, so I decided to use a game controller board for this part of the project.

There are a number of explanatory articles on the internet, such as this one: http://kevinreems.com/WorkShop/Joysticks//, and a lot of valuable information on this forum: http://forum.arcadecontrols.com/, as well as a few videos on YouTube. I like this one, which, although not captioned in English, is nicely visual: http://www.youtube.com/watch?v=9Y6ZqgT4Uk0.

Even Nic Collins’ classic book Handmade Electronic Music [http://www.nicolascollins.com/handmade.htm] has a chapter on the subject.

There are many different makes and models of gamepad, and one thing I’ve learned is that they’re all different – or liable to be different – in their electrical connections, so a certain amount of cautious experimentation is required to find out, for example, whether button connections are made to ground or some other voltage value in the circuit; if they’re arranged in a matrix; or if there’s a mixture of different systems. Sometimes this can readily be determined by looking closely at the circuit board and following the tracks around, sometimes it can’t.

So, if you’re reading this for hints on how to make the connections, use it as a guide to the type of thing you may need to do, but you may not necessarily be able to copy the steps precisely.

The other thing to note is that the connections on these PCB’s are usually very delicate, so you need to proceed carefully to avoid the narrow copper tracks coming away from the board.

As far as my gamepad was concerned, I used a Nyko Airflo, which was around £5 on eBay.

I removed the outside and an internal plastic piece which supported the two main PCBs and the fan which gives the Airflo its name.

Disassembled 2 IMG_1647

The idea was to reconnect the gamepad’s buttons to buttons on the FXBOX foot controller, so I detached the fan and looked for the button connections on the PCBs.

PCB 1 & 2 IMG_1650

Four of the 12 buttons were on their own mini-PCBs, connected by wires to the main board; the function of the wires was marked on the board, so I cut off the small PCBs and left the wires.

The various hatswitch connections and 6 of the remaining buttons were on the main board. These all had suitable spots in the copper tracks where it would be possible to solder wires.

The remaining two buttons were part of the joystick assembly on the second main board. It was easy to see the connections, and as the buttons were normally open (not connected), it would just be necessary to connect wires to the two sides of each one – or one side if the buttons all proved to have a common side, which is the usual practice.

I also needed to use the 4 potentiometers, two on each joystick, and wasn’t looking forward to de-soldering them, as I was anxious about damaging the tracks on the board. It doesn’t look too difficult on the videos, but I noticed on mine that there was small gap above the board where you could see the three legs of each potentiometer – the small ‘preset’ type – just enough room to insert a hacksaw blade and cut them off.   This is what I planned to do.

pots

First, as with the other devices in the Controller, I needed a much shorter USB out cable to connect to the hub, so I shortened the lead, but reconnected it before going any further, as this would be needed for testing.

The next step was to bring out the button connections to a ‘breakout’ board and find out exactly which ones I needed.

In most cases – perhaps all – I was sure that it wouldn’t be necessary to use 2 wires per button, as I had done with the Cybersynth; one side of the button connection would usually be Ground, and I hoped it would be possible to use one Ground connection for all of the 12 buttons.

This did prove to be the case, and I didn’t have the problem reported by some others of the unit not working at all without the joysticks connected.

I connected the 13 wires (one for each button + one for Ground) from the gamepad board to the breakout board, and a 13-way PCB header to give easy access to them.

The hatswitch connections looked as if they might be the same – except that there were 4 buttons, and I knew that 8 separate outputs are available from a hatswitch, meaning that 4 outputs were available from the 4 buttons individually and 4 outputs were available by connecting adjacent buttons simultaneously.

To make it easy to access these 8 outputs with 8 separate buttons, I connected diodes like this:

hatswitch-diodes-2

The connections at the top go to buttons in the Controller, and connections 1, 3, 5 and 7 at the bottom go to the 4 button positions on the circuit board; connections 2, 4, 6, 8 and 9 don’t need to be connected directly to the board.

This arrangement means that, for example, pressing Button 1 activates only Button 1, and pressing Button 3 activates only Button 3, but pressing Button 2 activates both Buttons 1 and 3 at the same time.

Only adjacent buttons are meant to be connected at the same time, which is why a hatswitch has 8 different outputs; but I discovered that connecting any two non-adjacent buttons on this particular board produced a ninth different output, recognised by PureData, which is why a ninth button is shown.

As a Ground connection was already available on the breakout board, I only needed 9 further connections for the 9 hatswitch buttons. This meant that 21 separate buttons would be available altogether.

*

The next task was to replace the two 2-axis joysticks with 4 potentiometers. Two of these would eventually be footpedals so that certain settings – volume and pan, for example – could be adjusted while playing.

I started by cutting through the legs of the existing potentiometers, as described above.  Once cut off, the potentiometers were easy to remove, exposing the three connections for each one.

Tracing the lines on the PCB, I could see that the ‘top’ and ‘bottom’ connections of each one were the same: only the middle pins had individual connections.

The bodies of the joysticks didn’t need to be removed from the board – and in fact were best left where they were, as some Ground connections from one part of the board to another appear to made through them.

I knew the potentiometers were likely to be more difficult to make use of than the buttons, but I was puzzled that I wasn’t able to get them working easily when I connected them to the board. For some reason they didn’t move smoothly from zero at one end to 255 the other as they were supposed to; on occasions they would return to zero and then refuse to move.

In the end, I read something that doesn’t seem to be mentioned much in articles on gamepad hacking, which seemed to be the root of the problem: joysticks are sprung to return to the centre of their travel, so a gamepad is expecting a midway reading on each one when it’s plugged in, and calibrates itself at that point to make sure the joysticks go back to the middle when let go. If potentiometers are used, and left at random values when the unit is plugged in, then the gamepad will get confused, try to calibrate itself wrong, and consequently fail to work properly – or at all.

The value of the joysticks in my gamepad was 100k, and they looked to be connected as voltage dividers, with the ‘top’ and ‘bottom’ tags all connected together, so, assuming these were +v and 0v (although it doesn’t really matter what they are) – I created a midpoint 50k from the top and 50k from the bottom (two 100k resistors in series = 50k). This would be connected to the centre tags of the potentiometer inputs to the board when the unit was turned on, the circuit would be calibrated, then the actual potentiometers could be connected and would correctly produce values from 0 – 255.

The writer of the article quoted above [http://kevinreems.com/WorkShop/Joysticks//] had a neat solution to this, using switched jack sockets, but I wasn’t able to use this method, as I wasn’t always going to be plugging into sockets. Instead, I connected the centre tags of the four potentiometer inputs to the centre tags on a 4 pole, two-way switch: this switch would be in the ‘off’ position when the unit was plugged in, which would connect the inputs to the ‘halfway’ voltage, enabling them to be calibrated, then when the unit was ready to be used the switch would be moved to the ‘on’ position, where the potentiometer inputs would be connected to actual potentiometers.

As a result, I ended up with a breakout board with 12 pins representing the 12 buttons numbered on the board, 9 pins representing the hatswitch buttons, 4 pins representing the 4 potentiometer outputs, and 3 pins representing +5v, 0v and +2.5v.

I also used 2 further pins for the game controller LED which lit up when the USB connection was made: I connected these to an LED on the outside of the case where I could see it and verify that the board was working.

That made 30 pins. Even when I calculated that I needed only 6 of the 9 hatswitch buttons, that still made 27 pins, plus 15 pins from the Apple keyboard PCB described earlier.

All the connections needed to be in place while the case was still open, so I needed to join all these pins on one side of the box where the circuit boards were to connectors on the other side of the box where the buttons were. To bridge this gap, I decided to use 40-pin ATA cables, normally found inside a desktop PC, which are inexpensive and compatible with the PCB connectors I was using.

ATA cables

These cables (as in the above picture) frequently have two separate connectors quite close together at one end. This made it easier to make connections not only from one side to the other, but also to special output sockets on the back of the case.  These could be used if alternatives were required to the buttons on the unit.

The 15-way socket on the back of the Controller has the same pin designations as my previous keyboard PCB-based project; the 25-way socket is a new arrangement, specific to the game controller:

Keybd & HID out DSCF0012

*

Finally, there was one downside with internal fixing of the Sonuus G2M ‘Guitar to MIDI’ unit – it runs off a PP3 battery: this would mean firstly that the ‘Battery low’ indicator couldn’t be seen from outside the case and secondly that the battery couldn’t be changed without taking the case apart. As this is held together with about 10 self-tapping screws, this would be too much trouble.

The main electrical supply was the the 5v adaptor that came with the USB hub, so I bought a small step-up voltage module for a couple of pounds to provide a 9v supply for the G2M.

voltage converter

I adjusted it to slightly over 9 volts, to make sure the G2M would be operated reliably and added a second power on/off switch for the 9v supply.

*

This is the almost finished base of the unit, showing the 7 elements.  All the connections are in place, except the power connector lead, which runs from connector 7 in the picture over to the power switches on the front of the unit:

Inside captioned IMG_1397

1: MIDI to USB

2: 7-port USB hub

3: Audio to USB

4: Apple keyboard PCB

5: Sonuus G2M, Audio to MIDI

6: Gamepad PCB

7: Power connector

This is the almost complete top section:

Top captioned IMG_1395

I gingerly put the two halves of the case together, and all the functions seemed to work, so I screwed it firmly together.

Now, with minimum use of the laptop keyboard, I was able to control the Looper with the buttons on the Top Panel:

Top Panel DSCF0009

and the FXBOX PureData program with the buttons on the Front Panel:

Front panel DSCF0010

I left space for additional button descriptions as the unit isn’t limited to controlling the Sooper Looper and FXBOX: in fact, it could be used to control any PureData patches which required [key] or [hid] inputs.

In addition to this, I had made provision on the front of the case for 4 footswitches which could duplicate the effect of any of the buttons on the panels:

Front DSCF0011

So far, I have just implemented two of the four possible: Footswitch 1 duplicates the ‘Overdub’ control in the Looper; Footswitch 4 duplicates the FXBOX ‘Freeze’ control.

I obtained some very nice momentary footswitches for only about £3 each from eBay.  They are apparently intended to operate tattoo machines, and have the advantage of coming with 1/4″ (6.35mm) standard mono jack sockets attached, perfect for this application.

tattoo switches

As for the footpedals, I haven’t implemented those yet.  When I do, I’ll describe this in a further post.

04
Nov
13

Fun with the Apple IR Remote, Part 3: Additions

In the previous post in this series, I dismantled and modified a white Apple infrared (IR) Remote control.

In this post I describe a foot controller which can be plugged into the DB9 socket on the modified remote, and then go on to consider what you can do if your Mac doesn’t have an IR receiver built in.

I had already constructed a very simple foot controller, which I had used with the Superstylonanophone.  The controller was  – well it was exactly what it looks like: a length of plastic guttering with a few push switches inserted into it, and a multi-way socket.

Footswitches1

There were just 4 buttons on the foot controller: two for bass drums and two for hi-hats.  These were connected very simply underneath: one side of each switch was a common connection, the other sides went to 4 appropriate pins on a 15-way D socket.

Footswitches2

It occurred to me that the same controller could also be used for the IR Remote, which also required a number of push switches with a common connection.  There would need to be more of them – at least 6 – and an alternative 9-way connector, but provided both connectors weren’t used at the same time, the controller could operate either device.

I had some spare buttons of the same type, so I added 3 extra ones in the spaces between the 4 originals (not in a very straight line between the 4 originals, it has to be said!), a new DB9 connector, and an LED which would come on when the foot controller was connected to the modified remote.

Outside DSCF0004

Only 6 of the buttons were required to duplicate the functioning of the Apple remote.  Using my IR Remote Tester in iRedLite, I verified that all the button presses – short, long and double – were being received and transmitted correctly from the six buttons I had wired up.  I connected the seventh so that the LED – which can be seen illuminated at the bottom of the picture – would go out if it was pressed, as a warning that it had no function.

Inside DSCF0003

I moved the bass drum triggers to the two leftmost buttons, and hi-hat triggers to the two rightmost.  At some point, when I revisit the Superstylonanophone, I can consider adding in further drums as there are now 3 spare buttons in the middle of the controller.

Connection DSCF0002

*

The foregoing is all very well if you have a MacBook, MacBook Pro or whatever, which has a built-in IR receiver – but what if your Mac doesn’t have this capability?

Fortunately, if this is your situation, all is not lost.  As I implied when discussing Joystick and Gamepad Tester, the Mac’s IR receiver is part of the USB system – this can be verified by checking the machine’s System Profiler:

system profiler ir receiver2

So, to add IR control, the ideal thing to get hold of would be an Apple IR receiver module which has a USB connection.

Luckily just such a device exists!

There may be a number of these, but the one I got was either Apple part number 922-7195 or 922-8355, not sure which: one is from a MacBook 15″, the other from a MacBook Pro; both have an IR receiver input and a USB output, so I daresay both would work equally well in this application.

IR Rec module IMG_0679L

I bought mine here: http://www.powerbookmedic.com/MacBook-Pro-Infrared-board-p-18041.html at a cost of less than £10, including postage from the U.S. – a bargain!

I got the idea for this part of the IR project from this article: http://photos.pottebaum.com/2009/IR.  The aim was to install this module in a new case with a USB lead, thus enabling a Mac with no IR receiver to benefit from the remote, or to use  the remote at a distance or from an angle where a direct line of sight to the computer wasn’t available.

The new case I chose was this one:

IR REC front IMG_1567

It’s a Fisher Price ‘CD Player’.  It doesn’t, in fact, play CDs at all, but I picked it partly because of a definite stylistic connection with the modified Apple remote described above, partly because of its large front ‘window’ – which might allow for a certain degree of repositioning of the IR receiver inside – and partly because it was powered by three AA batteries, somewhat similar to the 5v provided by USB.

IR Rec back IMG_1568

I undid the 6 screws in the back (four of them are already out in the above picture, the two at the top remain), revealing the internal structure.

IR Rec inside IMG_1571

It was very well made, and very difficult to get apart as a matter of fact, as the two large white surfaces you can see were glued together.  It looked like blobs of a sticky adhesive which stretched when pulled, so I was able to prise the two halves apart slightly and cut the glue with a craft knife.

The speaker is visible in the top right-hand corner.  One of the three circuit boards in the unit can be seen at the bottom of the back section; the other two are underneath the two sides of the front section.

Circuit boards IMG_1569

The 8 press switches that can be seen on the tops of the circuit boards are operated by the 4 buttons on the front of the unit.  The switches are in pairs and the two switches in each pair are identical.

I tested each switch in turn and noted their outputs.  They worked by cycling through a number of samples: a short bell-like tune, some spoken phrases (‘Sing with me!’, ‘Oh, yeah!’ and ‘Let’s Boogie!’) and some longer songs with voices and instruments (‘One, two, buckle my shoe’, ‘Itsy-bitsy spider’, ‘Row, row, row the boat’, and some songs that sounded as if they may have been specially written for the unit).  Three of the pairs had a 9-step sequence, one of them a 6-step.

I wasn’t, in this instance, interested in the songs, as I wasn’t intending to circuit bend the device, but I wanted the LEDs to come on when IR input was received.  The best LED display was seen while a song was playing; during the bell tune and the spoken phrases the lights came on only for a short time.  The sequences weren’t the same for each button, and I decided that button three (bottom left)  was the best one to concentrate on, as there was a higher proportion of songs in the sequence compared to short phrases.

Steps in the sequence were initiated simply by a short +V pulse to an appropriate point on the PCB, which should be easy to generate.

*

First of all, however, I needed to connect up the IR receiver module.

Being color-blind, I’m always nervous about connecting up colour-coded wires – especially to a USB plug which would be going into my laptop.  However, the module seemed – to my eyes at least! – to follow the conventional red-white-green-black USB wiring scheme (+5v, Data +, Data -, Ground, in that order), so I snipped off the small 4-way connector it came with and connected the four wires to a short length of multi-core cable.  The other end of the multi-core cable was connected to a USB plug, via a small PCB connector.  There was no PCB: this was just a convenient way of joining together various wires – the four USB wires, power leads from the batteries and some others I’ll explain shortly.

So, the Apple IR receiver module was connected to a USB plug.  I didn’t want the unit to have a long lead trailing out from it, so the lead to the plug was kept very short, and plugged into a small USB hub which I fixed to the battery compartment lid on the back of the unit:

hub IMG_1585

hub 3 IMG_1587

It was an excellent little hub – only £2 or £3 on eBay, and capable of being powered, if required.
Now ready for testing, the unit looked like this:
Back&Front_IMG_1603

The new receiver module can be seen lying in the middle of the front of the unit.  The short USB lead and plug can be seen emerging from the back, and at the bottom of the picture the mini-USB lead goes from the hub to the laptop.  The purpose of the three unused wires in the multi-core cable is explained later on, and is not to do with the Apple receiver.

Checking in the System Profiler, I now saw two IR Receivers instead of one:

System profiler 2510

I experimented simply by covering up one or other of the receivers and making sure, using iRed Lite, that my remotes – especially the new modified one – were able to control various functions in Safari and would print the correct numbers in Text Edit.  The two receivers seemed to work in tandem on the MacBook – it didn’t matter which of the two I covered up, the other would immediately register the button presses and carry out the required function.

*

The vital question was: what would happen if I connected the unit up to a computer that didn’t have a built-in IR capability?

I started with my eMac, which runs the same OS as the MacBook, 10.5.8.  I checked the System Profiler – no mention of an IR receiver; then I plugged the unit in and was gratified to see the IR receiver shown (I needed to close the System Profiler and reopen it to make the new device show up):

eMac before&after IMG_1605

I didn’t have Joystick and Gamepad Tester or iRed Lite installed on the eMac, so I had to content myself with testing the functions the remote normally performs on a Mac – opening and closing Front Row and turning the volume up and down.  Using the new modified remote, I confirmed that it would do this.

I then tried the same procedure on an old G5.  I can’t remember what OS it uses, but I think it’s either 10.5 or 10.6.  Once again, using the System Profiler, I verified that no internal IR receiver showed up at first, but when plugged in the new device was registered:

G5 before and after IMG_1608

The one thing that did appear first of all in the USB section was my iPazzPort.  I’ve described in a past post what this is – a very handy little device, no more than 4 or 5 inches tall, which duplicates the function of the keyboard and trackpad:

iPazzPort_IMG_1607

As can be seen, it connects via USB – not a problem, even on the G5, which only has one USB socket on the front, as I was able to plug it into the hub on the back of the new receiver and use the two devices together.

Once again, the remote worked exactly as intended, proving that IR functionality could be added to a Mac which originally had none.

*

I didn’t immediately reassemble the unit, as there were a couple more things I wanted to do with it.  First of all, as mentioned earlier, I wanted to include a method of making the lights flash when an infrared signal was received from the remote.  As described, this needed something to give a +V pulse when the signal came in.

I didn’t want to interfere with the Apple receiver module, so added a second IR receiver like this:

AX1838

This device, an AX1838, has three leads: two for the power supply, with the third giving an output when it detects an IR input.  It wouldn’t be necessary to interpret the input – which is what the Apple module does – just give an output pulse on receipt of a signal.  Unfortunately, according to the data sheet, the output of the device goes low when IR input is detected, not high, which is what the ‘CD Player’ circuit requires.

I was under the impression that the low level output from the device would be sufficient, when inverted, to operate the switch in the CD Player, but this wasn’t the case.  In the end I looked around at circuits for simple infrared-operated switches, and used an adapted version of this one, using just three components, a BC588 transistor, a 22μF capacitor and a 100k resistor.

Apart from the existing electronics concerned with playing the samples and sequencing the lights, the electronics I added to the device looked like this:

IR Receiver Electrics Revised2

In fact, this is what I intended, but as I didn’t have a 100Ω resistor, I added a 470Ω instead.  I don’t know if this was too large a value, but I’ll find out when I come to use the wii later.

I didn’t bother with a piece of stripboard, I just wired everything up to the three legs of the transistor.  This addition to the circuit seemed to have the desired effect: the output of the transistor is normally kept low; an incoming IR signal is detected by the AX1838 and as the capacitor charges up the multiple signals are smoothed out into one.  The output of the transistor goes high and is boosted to a level sufficient to operate the CD Player switch and turn on the lights, giving a visual indication that an instruction has been received by the Apple IR receiver.

Stiff wires were attached to the two IR detectors, anchored inside the unit, so the detectors could be repositioned within the CD Player front window.

*

Finally, while on the infrared theme, I just had two more things to do  before reassembling the finished unit.

Firstly, I added two infrared LEDs to the front of the unit.  These had nothing to do with the receiver or the flashing lights: they’re a little closer together than the original, but they’re designed to duplicate the function of the wii ‘sensor bar’.

IR LEDs IMG_1609

I’ll be blogging about the wii system later, but the ‘sensor’ bar’ is a most inaptly named device, since it doesn’t ‘sense’ anything at all, but instead provides two points of infrared light which the wii remote controller – or ‘wiimote’ – uses to fix its position.  Being a little closer together than the Nintendo original isn’t a problem – the wiimote might just think it was further away from the sensor bar than it really was.  As I’m not proposing to use my wii controller for playing sports, I don’t anticipate a problem with this.  Further information will appear in my wii posts.

The new infrared device had one more secret, hidden in the carrying handle:

Candles 1 IMG_1612

There are many reports on the internet of wii users who have substituted candles for infrared LEDs when using their wiimote, so I thought I’d guard against battery failure in the unit by adding candle holders – the kind you buy for birthday cakes.  Believe it or not, this does work!

*

Front & Back

After reassembling the unit, and thinking again about the wii remote, I added an extra external item to the USB hub: a tiny Bluetooth dongle.  I found this in Poundland, for £1 (obviously!) and thought for that price it would be worth experimenting with.

22
Oct
13

Fun with the Apple IR Remote, Part 2: Modifications

In the first part of this series of posts, I described the Apple infrared (IR) Remote system and some software which allows you to use the IR signals for controlling apps on the Mac.

In this post I take a closer look at the Remote controller itself, and describe the way I modified mine.

I must say that I’m not familiar with the silver aluminium remote, although I have no reason to believe it’s substantially different on the inside from the original white remote.  This is the one I have experience of.

What’s good about the white remote is also what’s bad about it – it’s very tiny.  This is great if you just want to tuck it away somewhere and not have a bulky TV/DVD player-type remote to lug about, but not so good from the point of view of it easily being overlooked or mislaid.

So, one reason you might want to modify the remote is to make it larger and more suitable for the human hand.

Frankly, the most cunning solution to his problem is the one described here by Brad Moon.  I hope he won’t mind me using his picture:

Remote wood block

Yes, what Brad has done is simply to glue his Apple remote to a hand-sized piece of wood.  Job done!  As he says in his blog post: ‘Too big to lose, too big to slip behind a cushion or slip into a pocket . . . The Apple TV remote hack has been in place for roughly a month.  In that time, the remote has been lost exactly zero times.’

This certainly takes care of the problem of the unit itself being rather small, but to address the problem of the size of the buttons themselves and their awkward layout, the unit has to be taken apart.  At the time of writing, you can still get hold of these white remotes on eBay for about £3, so if you want to try this, there’s no need to sacrifice the one that came with your Mac.

This is how it’s done:

1_IMG_1533

The picture above shows the unit and the tool (or maybe one of the two tools) you need to open the remote unit.  This is a small Philips or crosshead screwdriver.

As well as being used in a moment for taking out screws, the first thing you can do with it is poke the small depression on the right-hand side of the base of the remote unit.  This releases the battery tray, which pops out on a spring:

2_IMG_1534

Next, you have to undo a screw which is right down inside, next to the release button:

3_IMG_1536

Undo the screw and take it out:

4_IMG_1535

The next bit is the most difficult.  On the opposite side – the lower side in these pictures – is the spring which pushes the battery compartment out.  The spring is firmly attached to the bottom of a small piece of plastic, and you have somehow to grab this piece of plastic and pull it out, with the spring on the bottom of it.

The next picture shows what the spring and the plastic piece look like.  You might reach in and grab it with tweezers or narrow long-nosed pliers, but it’s right up against the edge of the case, and hard to get hold of:

6_IMG_1538

If you look at the full-size version of the picture, you can see that the piece of plastic has tags on it, so I was able to poke the screwdriver under a tag and drag the plastic and spring out.

Underneath where the spring was is another small screw.  Unscrew this and take it out:

7_IMG_1539

You can then pull the battery compartment out.  I did this with a pair of narrow pliers, gripping the white release button, which you can see in this photograph.

8_IMG_1540

Then you can push out the remaining parts left inside the case.  I did that by inserting the screwdriver here:

9_IMG_1541

The circuit board, with the springy battery connectors behind, slid out very easily:

10_IMG_1542

You can carefully detach the end  piece from the circuit board, clicking it off the tabs which hold it in place over the end of the board and the IR LED:

11_IMG_1543

This an exploded view of the remote, with all the parts visible:

11B_IMG_1547

Putting it back together, of course, is the reverse of this procedure.  The trickiest part is undoubtedly getting the spring and its plastic top back in.  This video by Andrew Williams, to which I’m greatly indebted: http://www.youtube.com/watch?v=vuP6CH770NM shows a remote being put back together, and explains the direction in which the tabs must face – front and back – for the plastic piece to go back in the correct position.

*

I wasn’t interested in putting it back together again, so I looked more closely at the circuit board:

12&13_IMG_1545&6

You can see in the top part of the picture the infra-red LED and the 6 buttons.  You can also see 4 screws which attach the circuit board the the plastic fitting.

The first thing to do was take off the six silver ‘domes’ which make the contacts when the buttons are pressed, and see what connections they made.  These are often, in my experience, attached together to a transparent sticky sheet which peels off, and so it was in this case.

Remote PCB IMG_1554

As you can see from this photograph – taken after I’d removed the four small screws holding the PCB to the plastic fitting – each button makes a contact between an outer ring and a centre spot.  All the outer rings were connected together, to what looked like +V, while the six centre spots were separate.  What I wanted to do was transplant the board into a larger unit, so I needed to solder seven wires to the board, and connect them to buttons in the new unit.

The larger unit I’d chosen was this one:

vtech_tinytouch_phone

This is a vtech Tiny Touch Phone: it’s powered by two AA batteries – 3v, same as the Apple Remote; has 12 buttons – exactly twice as many as the Remote, which could be handy for dissociating short, long or double presses; and has flashing lights – which is always good.  It also makes sounds, and under normal circumstances I would be looking to ‘bend’ these, but in this instance making noises wasn’t what the project was all about, so I decided I’d remove the sounds completely by taking out the speaker.

The Phone also has a hollow plastic ‘antenna’, which was perfectly placed for installing the IR LED.

aerial

This is what it looked like inside.  In  this picture the large mechanical unit, which looks like the film sprockets in an old 35mm film camera is obscuring the speaker housing.  With the speaker removed there looked as though there’d be plenty of room for the small Apple Remote PCB there.  The wires for the LED could easily pass from there up into the antenna.

Phone inside IMG_1552

The general idea would be to rewire the button connections on the Apple Remote PCB to the Tiny Touch Phone buttons.  The Phone buttons (visible in the first picture above) are, however, hollow, and make connections with a membrane, rather like  QWERTY keyboard, via their edges .

I wanted to leave the membrane intact, to operate the flashing lights, so I decided to add small tactile switches with longish 3.5mm actuators which would be glued in the hollows with the actuators sticking out through a hole in the top of the Tiny Touch buttons.  It was these switches which would actually operate the IR remote.

Gluing these in without gluing them together so they wouldn’t function proved difficult.  Letting superglue anywhere near them – even the gel type which I usually use – could prove fatal, as it has a habit of running everywhere.  In the end I used epoxy, which is stickier and less runny, and tiny pieces of tissue paper soaked in epoxy to keep the switches in place.  The moon and star buttons aren’t hollow, so I stuck tactile switches with short 1mm actuators to the top of them, on the outside, with wires running in through a small hole.

In the end I only connected up the star: it would have been difficult to make the hole in exactly the right place in the moon and route the wires inside without disturbing the membrane too much.  The star operates the ‘Menu’ button, which is less important than the others and doesn’t require more buttons to distinguish types of presses.

Buttons IMG_1550

In the event, all but one of the tactile switches worked after this treatment, which was OK, as there were two new buttons for each button on the original remote, so all functions would still be available.

To modify the new unit, I first removed the speaker and replaced it with a resistor (two 22Ω resistors in parallel, actually, as I had these lying about.  I didn’t have any 8Ω resistors to match the speaker, but 11Ω, I reasoned, was close enough).

This created enough space in the top of the unit for the small Apple remote PCB.

I reinstalled the buttons in their places and connected the tactile switches together.  One side of each switch was connected to +3v, the other sides of the switches were connected together in pairs (except the moon, as explained above).  This made 7 extra wires running down to the bottom of the unit.  The presence of the wires might have an effect on the operation of the TouchPhone’s original buttons, but this wasn’t important as their only function now was to light up LEDs when the remote was operated, a feature which Apple neglected to provide in the original.

Buttons_connector_IMG_1574

As can be  seen in the above picture, there was just about enough room for a 9-way D socket in the base of the unit.  I put this in partly because it would allow for external operation of the 6 remote buttons – perhaps by means of a footswitch – and partly because it provided a handy link point between the tactile switches and the Apple remote PCB.

To attach the remote PCB, wires were connected to the centres of the 6 switch points, and one of the outer rings, which were all connected together on the board.  3v and 0v power cables were connected to the springy metal pieces which formerly connected to the coin-battery in the original remote housing.  These connectors were shortened in order to fit the PCB neatly in the space where the speaker had been.

PCB_LED_IMG_1577

At the same time I detached the infrared LED and put it on the end of a longer lead, so it would reach to the front of the unit when in operation.

At this point everything was connected up, although not back in place, so I made a quick check, using iChat and the laptop camera in the way described before.  I pressed all the buttons in turn, pointed the unit at the camera, and watched for the infrared LED to come on.

When I was satisfied that it did so, I replaced the membrane and the TouchPhone PCB, as this would make pressing and testing the buttons a great deal easier.

*

For the next step I needed a way of thoroughly testing if the remote worked as intended.  I did this by creating a Tester program, using iRedLite.

It takes quite a few steps to create a ‘Layer’ – a set of instructions for each remote button – in iRedLite, but this is how I created a ‘Remote Tester’.

The ‘Menu’ button has special functions in iRedLite, but the other 5 buttons respond to short presses, long presses and double presses, so 15 separate instructions would be required.  What I decided to do was use Text Edit, and simply have it print the numbers 1 – 15, according to which remote button was activated.

Step 1 was to open iRedLite.  You can set it up in various ways in the preferences, but I have it set so it just opens an icon in the menu bar:

1 iredlite menu bar

The first step is to select the Editor from the drop-down menu:

2 Show editor

This brings up the Editor screen.  The top half of the window is a copy of what iRedLite calls the OnScreen Display (OSD).  The bottom half allows you to edit Layers and Buttons, and select the actions the buttons perform.  I began by creating a new Layer for my Text Edit actions:

3 New Layer

Then I entered the details of this Layer:

4 Name new layer

I typed a name for my Layer into the ‘Title’ box, and then made choices about what would happen when the Layer was selected.  I chose not to have the Layer activated when I switched to Text Edit, in case I wanted to type some text while using iRedLite with another application; but I did choose to have Text Edit activated when I switched to this Layer, because the actions all required text to be typed in it.  I have several remotes, so to be certain which remote was being tested, I set it to respond only to a particular one: in this case, the one with the ID No. 214.

Having finished creating the Layer, I clicked on the small arrow in the bottom right-hand corner of the Editor window.  I believe they call this the ‘Expert’ button, but it’s simply for accessing the section where actions are created and organised.

5 Editor window

Clicking this button opens the right-hand side of the Editor.  In here, if you look in the ‘Application’ column and can’t find the application you intend to use the remote with, click the ‘+’ button at the bottom of the column to add it to the list:

6 New Application

Type the application name in the box which appears.  The program will be recognised if its name is written the same as it would appear if you moved your mouse over it in the Dock.  Text Edit is actually written ‘TextEdit’, so that’s what I typed in the box:

7 Type New Application

Next you have to create a ‘Group’ – not for any special reason, I don’t think: it just works that way.  If you create a lot of actions for one particular application, this allows you to put different types of actions together, i.e. Keystrokes in one Group, AppleScripts in another, and so on.

I just wanted keystrokes, so I created a group called ‘Keys’.  Group names are your personal choice.  Once again, I clicked the ‘+’ sign under the ‘Groups’ column, and typed ‘Keys’ in the box which appeared.

8 New Group

Then it was time to create some actions.  Each action is entered individually, so I had to click on the ‘+’ sign at the bottom of the ‘Actions’ column 15 times, name the actions in the boxes which appeared, and specify what was to be done.

They were all more or less the same, and this is an example:

9 Create actions

Click the ‘+’ sign; name the action – again, this is entirely your choice: I just called them ‘1’ to ’15’; type the name of the application, or choose it if it appears in the drop-down list; check the box if you need the application to come to the front – which I did, because I wanted to read what it had printed; and type in what keystroke or keystrokes should be made.

Allocating the actions to the buttons is just a matter of dragging and dropping the action onto the appropriate button, and clicking ‘Assign Action’:

10 Drag and drop

The button will be given the name of the action – in this case ‘1’, which is the name I had given to the first action, which was to print the number 1.

11 Button number 1

You can rename the button, and I did, calling it ‘1/2’.  This is the reason why:

iRedLite shows the pattern of buttons in the way that it does to indicate that the button nearest the centre performs the short press action (which they call ‘Action on click’), while the button on the outside performs the double press action.  In reality, of course, these actions are performed by pressing exactly the same button on the remote, but it makes it clearer to see which number of presses produces which action.

So the ‘short press’ and the ‘double press’ are specified, but the ‘long press’ action (which they call ‘Action when holding’) remains to be allocated.

I decided to add the long press action to the instructions for the inner buttons, so in the example below I selected the appropriate inner button (Action 4, the ‘+’ button on the remote) and the ‘Advanced’ tab.  This allowed me to drag and drop the action I wanted to be performed as the long press action, printing the number ‘5’.

12 Button 4_5

I added a long press action to buttons 1 (the ‘Left’ button on the remote), 4 (the ‘+’ button), 7 (‘Right’), 10 (‘-‘) and 13 (the centre button) and renamed the buttons in iRedLite accordingly (‘1/2’, with ‘3’ being the double press action for that button on the remote; ‘4/5’, with ‘6’ as the double press, and so on).

When I’d finished, the set-up looked like this:

13 Finished

Note the button in the top right-hand corner,  marked ’15’.  There are 12 more places in the grey area of the button window where you can drag and drop actions, 6 on the left and 6 on the right.  If you drag and drop an action somewhere in the grey space, a new button will be created there.  This might come in handy if you had a modified control with differently positioned buttons.  In this case, I used one of the spare places for the double press action associated with the centre button.

Removing buttons, should this be necessary, is one of the functions on the drop-down menu where I chose ‘New Layer’ at the beginning.

I opened Text Edit and pressed all the buttons in order, single press first, then long press, then double press, hoping to see the numbers 1 to 15 displayed.  This what I saw:

14 Text Edit Numbers

The numbers were all printed out in order, so the combinations of short press, long press and double press all worked as predicted – but the long presses produced a continuous stream of outputs, even though I tried to take my finger off the button as quickly as possible.  The exception was the Centre button, which produced a single output of the number ’14’, no matter how long I held the button down.

This behaviour might not be what you require if, instead of printing numbers, you want a single specific action to be performed.  You might find the action repeated many times unless you’re able to take other steps to avoid this.

However, for testing purposes, this was fine, and I had established that the remote should, with iRedLite, be able to distinguish between 15 separate actions, despite only having 6 buttons.

*

The final stage of the project was to try out the new Tiny Touch Apple IR Remote to see if it would function correctly, using the iRedLite TextEdit Tester.

I quickly opened Joystick and Gamepad Tester to check the ID number of the new remote, which was 211.  I then opened iRedLite, went to the correct Layer for my Tester, and changed the remote number to which it would respond from 214 – the remote I had originally use to create the Layer – to 211.

The TouchPhone has a Power switch, but in fact the IR Remote worked even when it was in the ‘off’ position; in the ‘on’ position it worked with added lights.  As before, I pressed each button in turn with a short press, a long press and a double press, checking to see that the correct numbers were printed in Text Edit.

They were, so now it was safe to put the unit back together.  I glued the IR LED into the ‘antenna’:

top IMG_1580

fixed the 9-way socket in place:

bottom IMG_1584

and  wrote the ID number on the back.  Now I had the world’s most colourful Apple IR remote!  It could have been the world’s noisiest, had I not removed the speaker, but I felt this would be gilding the lily – and would probably have been a distraction, given that I had conceived of the remote as being part of a sound-modifying system, not a sound-producing system.

Alternative Remote

I was a little upset as, just as I was putting it back together, I broke the plastic link behind the ‘telephone’ button that mechanically ‘winds the film’ and changes the picture on the screen.  However, this only deprived me of more ways of turning LEDs on, and didn’t in any way affect the IR  controls, so ultimately I was satisfied with my achievement.  I didn’t want to spend more time on it at this stage as I wanted to move onto the next part of the IR project.

For this, see Part 3: Additions.

 

[Edit: I’ve since managed to get hold of another Tiny Touch Phone and replace the broken film winder, although I haven’t yet had time to change the tactile switch that got glued together].




andymurkin

October 2017
M T W T F S S
« Sep    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Enter your email address to follow this blog and receive notifications of new posts by email.