It is currently Fri Mar 29, 2024 1:09 am


Hall sensors

Building organ consoles for use with Hauptwerk, adding MIDI to existing consoles, obtaining parts, ...
  • Author
  • Message
Offline

andrewmorley

Member

  • Posts: 19
  • Joined: Thu Sep 21, 2017 1:52 pm

Hall sensors

PostSat Jun 19, 2021 11:45 am

I have bought hall sensors and all wired up to encoder all are working except that when I put magnet to sensor and hold it instead of getting a constant note I just get repeated note on/note off. Any ideas?
Offline

larason2

Member

  • Posts: 752
  • Joined: Thu Feb 04, 2016 9:32 pm

Re: Hall sensors

PostSat Jun 19, 2021 12:51 pm

What hall sensors and what encoder are you using? Does the flip flop stop if the magnet is closer?
Offline

andrewmorley

Member

  • Posts: 19
  • Joined: Thu Sep 21, 2017 1:52 pm

Re: Hall sensors

PostSat Jun 19, 2021 2:02 pm

It is midi boutique sensors into a midi boutique keymux64 but then into an arduino encoder. No it stays as a repeating note however close the magnet is
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Hall sensors

PostSat Jun 19, 2021 3:33 pm

Last edited by engrssc on Sat Jun 19, 2021 3:33 pm, edited 1 time in total.
Offline

Coenraads

Member

  • Posts: 73
  • Joined: Fri Feb 01, 2019 10:13 pm

Re: Hall sensors

PostSat Jun 19, 2021 3:33 pm

Do you get a series of alternating ON/OFF messages when the magnet is brought near or do you get a series of ON only messages when the magnet is applied and then a series of OFF messages only once the magnet is removed?
If the former, I'm at a loss, but if the latter, does your encoder keep track of notes that are already on and only transmit a MIDI message when a change occurs?
For example (from code that I have used):

//MIDI ON message is sent only if note is not already ON.
void turnONswell (byte noteNumber)
{
if (swellDebounceArray[noteNumber] == 0) //meaning note is OFF
{
Serial.write (0x92); //note ON, channel 3
Serial.write (noteNumber);
Serial.write (0x7f); //medium velocity
swellDebounceArray[noteNumber] = debounceCount;
}
}
Offline

larason2

Member

  • Posts: 752
  • Joined: Thu Feb 04, 2016 9:32 pm

Re: Hall sensors

PostSat Jun 19, 2021 4:25 pm

I think if you are getting a steady stream of "On/Off" it's probably a bounce problem, or a problem with the code in the arduino. Also, make sure the Keymux64 board is wired correctly to the hall sensor board. I think I looked into this in the past, and the Keymux64 board is expecting 64 inputs going to ground, with the ground contact on the Keymux 64 board, and the hall sensor array is a series of 32 inputs, and then the last two contacts are a ground, then a 5V+. So, the hall sensor array should go to the Keymux 64 board inputs, except for the ground, which should go to the Keymux 64 ground, and the 5V which should be coming from whatever is also powering your Keymux 64 board.

If that is all hooked up correctly, then your problem is the Arduino. What code do you have uploaded to the arduino? It would be helpful to have it in front of us so we can see if the problem may be coming from there.
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Hall sensors

PostSat Jun 19, 2021 6:08 pm

What happens if you disconnect the midi boutique keymux64 from the Arduino then momentarily connect an Arduino input connection to the Arduino ground?

What are you using to view the MIDI messages? MidiOx?

Rgds,
Ed
Offline

andrewmorley

Member

  • Posts: 19
  • Joined: Thu Sep 21, 2017 1:52 pm

Re: Hall sensors

PostSun Jun 20, 2021 6:30 am

I’m using midiview to see midi messages but at the moment it seems to be getting continuous midi messages out saying controller 9:24 and 9:25 on channel 12. My manuals and pedals should be on channels 1,2 and 6
When I connect an input to the ground as you suggest I get all pedal notes sounding at once.
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Hall sensors

PostSun Jun 20, 2021 7:07 am

Which computer are you using?

Just exactly what did midiview show when your observe all pedal notes playing?

Do you have Midiview virtually connected between the controller(s) and the computer?

What I would suggest is disconnecting everything on the input side of the Arduino initially.

Then try (connecting momentarily to ground) different Arduino inputs with the midi boutique keymux64 disconnected? To make sure the Arduino is functioning properly.

Then begin to reconnect controller devices to see their effect or problem (error).

Rgds,
Ed
Last edited by engrssc on Sun Jun 20, 2021 7:37 am, edited 1 time in total.
Offline

andrewmorley

Member

  • Posts: 19
  • Joined: Thu Sep 21, 2017 1:52 pm

Re: Hall sensors

PostSun Jun 20, 2021 7:20 am

Ok so I was slightly misinforming you but it’s sounding all four notes on the input row and I’m seeing the relevant note on and then not off messages.
I am however still getting these constant controller messages which I am now wondering if is coming from the potentiometer on my swell pedal. I have attached that properly and grounded it to avoid this but I’m wondering if that is having an effect
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Hall sensors

PostSun Jun 20, 2021 7:42 am

When you say "all four notes on the input row" is that referring to four input connections being shorted together somehow?

Likewise all unused analog inputs must be grounded to avoid spurious control messages.

Rgds,
Ed
Offline

andrewmorley

Member

  • Posts: 19
  • Joined: Thu Sep 21, 2017 1:52 pm

Re: Hall sensors

PostSun Jun 20, 2021 8:06 am

Yes I think it probably is. How would I go about grounding the other analogue inputs? Should I take a connection from each of them to a ground connection on the arduino?
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Hall sensors

PostSun Jun 20, 2021 8:20 am

Assume you are using an Arduino Mega?

You can do the grounding of unused analog inputs right at the Arduino board.

You can join them together to one of the GND pins on the Power terminal connector (near the power input barrel connector.

Rgds,
Ed
Offline

Coenraads

Member

  • Posts: 73
  • Joined: Fri Feb 01, 2019 10:13 pm

Re: Hall sensors

PostSun Jun 20, 2021 4:39 pm

I should add that the first time I wrote a procedure for reading the potentiometer on a Swell pedal, it suffered from jitter. I.e., it kept outputting a stream of control data that kept alternating rapidly between two values. I cured the problem by adding in a double check but I'm still not sure I understand the basic cause.
Here is the code that did work:

//Expression pedal input: Method 1 (Preferred)
//Voltage inputs from 0 to 5V are converted to a 10 bit integer from 0 to 1023 by analog to digital converter.
//Adding 1 and dividing by 64, yields an integer from 0 to 16. This is used as an index into the controllerArray
//to select the controller value to be output.
void scanExpressionPedal()
{
newExpression = analogRead (69); //0 to 1023
newExpression = (newExpression + 1) / 64; //0 to 16
if ((newExpression != oldExpression) && (newExpression != oldOldExpression)) // double check avoids jitter
{
oldOldExpression = oldExpression;
oldExpression = newExpression;
newExpression = controllerArray [newExpression]; //extract controller value from array
if (newExpression > 127)
{
newExpression = 127; //correct out of range controller value
}
Serial.write (0xB0); //controller (channel 1)
Serial.write (0); //number zero
Serial.write (newExpression);
}
}
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Hall sensors

PostSun Jun 20, 2021 5:48 pm

I would understand this jitter effect would only be present if you used pin 69 for an expression pedal input, yes?

Rgds,
Ed
Next

Return to DIY organ consoles / MIDI

Who is online

Users browsing this forum: No registered users and 8 guests

cron