Modular Music Box – Hall Effect Sensors

I wanted to test the hall effect sensors I’d bought to see if they could be used for my idea of a rotary magnetic sequencer for the Modular Music Box.

There’s a link to the data sheet and a handy Hall_ Applications_Guide.PDF as well as some useful advice on the Sparkfun Hall Effect Sensor page and in the comments… and the Arduino:Playground provided a bit of code to test the sensor in action…

“You’ve got 3 pins from the front (the triangle edge). Left to right, power, ground, output.
Stick a 10k pull up between 5v and output. Then it’ll latch on/off depending on the poll you use.”

Arduino playground – Hall Effect

These are latching sensors i.e. they switch and then stay in that position until the polarity of the magnetic field is reversed and is of sufficient Gauss…

and hey… it works… and with a little additional code I’m now able to turn on and off an LED by moving alternating N & S magnetic poles in front of the sensor (I stuck four in a line onto a piece of Selotape alternating the polarity of each)

Now to find smaller magnets – possibly encoder magnets?

DONE – from http://e-magnetsuk.com/ – 3mm dia x 1mmA, Grade N42 – NiCuNi plated with a Pull (Kg) of 0.2kg

tested and work – at least as a single…but will need to order more – 12 x 64 spoked per disks = 768 – not that it’ll need to play all the notes all the time…

– and design and fabricate a prototype rotary sequencer

started on this… sourced prototyping components/materials at least… and designed layout of various acrylic elements…

but now need to rationalise the circuitry and component layout…

and play head…

The LED calculator helped me to work out the resistor values required for the orange MV7744 LEDs I bought from Mouser – with a forward voltage of 2.1V and diode forward current of 30mA according to the details found at datasheetcatalog.com – is a 1/4W or greater 100 ohm.

I tried to code for an array of 12 hall effect sensors and LEDs – though as Nick suggests we actually need 13 for a full octave – and managed with a couple of online tutorials in arrays in C++ and Arduino ‘for statements’ to develop something that worked – which Nick subsequently shook his head at and then reduced by a half…

But 13 hall effect sensors exhausts the 12 analog ins on the Arduino Mega – so I need to find a way to increase the number of input pins – and I’ve found a number of possible solutions:

[UPDATE] Not true – Arduino Mega has 16 analog ins – so this isn’t required – but still interesting…

As far as the physical dimensions of the various boxes go I realised quite early on that it’s probably not possible to fit all the components within an internal height of 26mm – so I’m going to use the Golden ratio to help me work out various heights of boxes in the hope these proportions will fit all the components and also be aesthetically pleasing.

Posted January 3rd, 2011

One comment/trackback:

  1. Array of Hall Effect Sensors + Multiplexer « daily:

    […] Hall Effect sensor array http://blog.monomatic.net/247/ […]