Econo Monome
Econo Monome
Introduction
A Monome is basically a simple eight by eight grid of push switches and lights. However, the official Monomes have always had a nod towards eco friendliness by incorporating renewable wood in their construction. Well I wanted to go at least one better and use parts that I already had in my junk box, or surplus obsolete parts I could scrounge, all based on a Arduino. This dictated the electronic and mechanical design, resulting in a unique variant on the Monome theme, which is why I call it the Econo Monome.
Let’s kick off by saying that 40 years of working, and playing, with electronics has given me a junk box that is perhaps deeper than most people’s, your mileage may vary. I also was in a position to scrounge samples and surplus parts from my work, finally I did end up buying one or two things but they were minor.
They had the words “ NOT RoHS “ written on in red biro. Since the introduction of Reduction of Hazard Substances legislation has come in to Europe, manufactures are not allowed to use these in any product they sell. As I am not selling this then I thought it fair game, also better to actually use something than throw it away and buy a replacement. Next up, was the prototype board, this was an odd ball board that I had bought about 20 years ago and never used. It has holes space at the usual 0.1” pitch but ever other row was displaced by 0.05”. It had lane in the draw a long time never quite finding a project, but now was it’s time to shine. In fact it was just a touch too small, but just by two holes but I thought I could get round that. When I bought my last Arduino board I also purchased two pre programmed ATMEGA chips, one for a project and one as a spare. As that project was now completed it was time for it to come off the substitutes bench and be a star. Now in the world of professional electronics surface mounting resistors and capacitors have moved on from the small 0803 size parts to smaller 0602 parts and even smaller. Therefore there were plenty of these parts of no use any more, and in an odd juxtaposition large DIL ICs I had bought over ten years ago were sitting in their tubes. I had an MM232R USB to serial bridge hanging about for 3 years from an investigation that went in an other direction. That just left the case, and using the aluminium U section technique I have used in the last project and combining that with spare unused PCBs gave a high tech but recycled appearance.
Well what did I have to buy? Well the green paint for the sides, the styrene I beams for the button dividers and the styrene sheet for the cover. Finally there was a bit of foam to make it all fit.
Finished unit
The Cast List
The major consideration was to reduce the cost as much as possible, so first off I came across a batch of tack switches that had been sent to my works for approval. In fact the lead spacing was wrong and they had been rejected and as the company didn’t want them back they were destined for the skip and land fill, they were rescued. Next up was the remains of a reel of surface mount blue LEDs.
A Monome from the junk box
By Mike Cook
The Play
Having assembled the cast, what was needed was the play, or in other words what to get each cast member to do. The normal Monome design uses a 7918 display multiplexer, I didn’t have one, and at the price they charge I didn’t want one, fortunately I didn’t need one either. I wanted to make the Arduino do most of the task of multiplexing the display, so all I needed was a 74LS42 to act as the row selectors and a ULN2803A to act as the column current sinks. This left the row drivers where I used a TCP6108 p-channel FET being driven by the outputs of the 74LS42 encoder. In order to read the push buttons I used the LED’s row drive lines to also drive the row of the switch matrix and a 74LS165 shift register to clock the data in. This meant that the data input was synchronised with the display multiplexing.
The idea was to use two LEDs, one each side of the switch to illuminate it, so for each display matrix point there are two blue LEDs. As I wanted to keep the current consumption down to what could be provided by the USB lead, that’s under 500mA, I settled on a 75R current limiting resistor for each one. That gave about 24mA per LED which is over the maximum continuous current rating but well within the 60mA pulse current. I was multiplexing them with a one to seven duty cycle so all was safe. As only one row is on at any one time, that gives a maximum LED current of 16 * 24 = 384mA.
Schematic
The schematic is shown above, but as you see it is a bit too big to display on a web page you can down load a PDF of it here 8 X 8 LED Matrix.pdf. There are basically two parts to the circuit, the switches and the LEDs but both have a common row driver. The row is selected by feeding it’s binary address to the 74LS2. This chip only puts one output line low, that whose address is on the input lines. Each output line is connected to a P-channel FET which switches power to the row. On the LED side each column can be switched to ground through the ULN2803A drivers. These drivers are connected directly to the Arduino’s output pins. This switches only one row of lights on at a time so at regular intervals the row is changed and a new byte of data set on the output pins. In this way each row has it’s own display time. This is known as “time division multiplexing” which normally gets shortened incorrectly to just multiplexing.
Now when each row is powered I take the opportunity of also addressing a row of the input switch matrix. In this case the columns go into a parallel load serial out shift register a 74LS165. The inputs of this are normally pulled down by a resistor but when a button is pushed the input is connected to the powered row through a diode. The diode is required to prevent two keys being depressed looking like four keys, it stops power being back fed along unpowered rows. Just before the powered row is changed the data is clocked into the shift register using the shift / load line and it is then clocked into the Arduino one bit at a time.
The MM232R interface module converts USB into serial data at the TTL level and so can be fed straight into the processor. Unfortunately the DSR signal line is not brought out on this module so you can’t have an automatic reset. This means when downloading a sketch you have to time hitting the reset button just right.
Construction
There is a lot of wiring up in an 8 by 8 matrix and I was using mainly surface mount parts. To aide me I was using Vero wire, this is a thin wire with a polyurethane insulation coating, this is designed to melt when a soldering iron is applied. The basic technique is to wrap the wire round an IC lead pull the wire to the lead to connect it to, and wrap it round that. This continues until all the connections are made. Then the wire is cut and soldered. Normally plastic combs keep the wiring neat but here I was mixing surface mount components with it and so I had to alternate between this technique and tinning the end of the wire and soldering it to a pad. I wanted the buttons to be close to the top of the case, and I didn’t want to make allowances for the height of the components. Therefore the buttons and LEDs are on one side of the board and the ICs are on the other. It took a time to get my head round that but it all worked out in the end.
Basically, I just made up the wiring as I went along, tackling the LEDs first then the buttons and diodes and finally adding the ICs. When you look at it it can look an absolute mess but it is not that difficult to do. I had to remember to take special care on my overhanging column but it all worked.
The case
The I decided to use my standard form of case construction, using extruded U channel aluminium. However, in order to make it as thin as possible, I opted for using some blank PCBs that were being thrown out at work for the top and bottom faces. The hardest part was cutting the large square hole in the front, I used my newly acquired scroll saw. I used a tap to thread the holes in the U channel to attach the base and spaced the board down a bit in the case with a strip of aluminium. This allowed the top of the buttons to be flush with the top cover. The aluminium was then painted to almost match the colour of the PCB. The thin styrene sheet acted as a diffuser for the LEDs and also had the bonus of allowing you to slide your finger and still push the buttons. There is good tactile feedback. However, in order to separate the lights I had to use a lattice of 4mm styrene I beams. Again it was a matter of trial and error, laying out the beams first horizontally and trimming away the bits to be clear of the LEDs. Then doing the same thing vertically. I numbered them lightly with pencil to make sure everything was fitted back in the same place after trimming the individual struts. This took some time!
Software
The software is written in the Arduino environment and is a simple extension of my Mini Monome. It can be downloaded here Arduinome_8x8.zip.
The main loop just consists of two calls:-
void loop () {
checkRefresh(); // check if multiplexing the matrix is due
checkSerial(); // look at serial port and do the commands if received
}
This allows the refresh to take a back seat if momentarily it is overwhelmed by an inrush of events. This should result is only a flicker, in practice I have never even seen this, even with the notoriously message heavy “NerdScroll”.
The refresh routine starts off by reading in the row of keys currently being powered. This row has been powered for the whole of the refresh period and so should be stable. The shift register is loaded by toggling the shift / load line and then its contents are clocked in one bit at a time and added to the array holding the state of the switches. If any change has occurred since the previous scan the appropriate message is sent out. Then the active row is changed. First the multiplexer is disabled turning off all LEDs, then the new data is put out to the Darlington buffers and finally the multiplex is enabled with the new row enable.
To make the process of refreshing proceed as quickly as possible I have used direct port access to perform the read and writes.
The check serial routines implement a simple state machine where by it can be in the state of waiting for a command and then in the state of waiting for it to be completed. This allows refreshes to occur even when a command has only been half received.
Showing the buttons