2

I am planning out a midi controller because not enough of those exist. Down to my inexperience please point out some gotcha I may be missing.

The short version of what I am doing.
Basically 16 hall sensors connected to an analog multiplexing board. From there scale the output to 0-2.9 volts, and the read it with the ADC on a microcontroller. Adding resistors and a diode along the way to limit current and prevent negative voltage.

The long version of what I am planning is~
I would power it from a power bank 5v 2amp(min 4.7v to max5.5v). I would be reading with 3.3v logic micro controller. Probably esp32.

The main feature is 16 hall effect sensors for reading long spring loaded buttons like a trumpet.

Most hall effect sensors want higher voltage (5v typically) and around 5ma of current.

49E seems a good choice for supply voltage 2.3v to 10v. It outputs 2.5v to 4.2v or 2.5v to 1v. 1200gs range.

44E seems good too. It wants 4.5-5.5v in. Outputs 0.12v to 2.5v and 2.5 to 4.88v. A greater range of linear voltage to magnetic field. 1700gs range.

These 16 hall effect sensors should be in parallel. Shared power rail, shared ground. A large resistor should be on the input +5v 2amp power rail. 846 ohms spits out as the answer for 5.5v and 6.5mA. But I am not sure if that is the correct calculation when it is 16 sensors in parallel.

I imagine 900 ohms would be a safe number which would be cut down to 800 or 700 if I am drawing too little current.

Next it seems people put a 10k or 20k ohm resistor between the first and third pin of the sensor. Pin 1 being +voltage, pin 2 ground, and pin 3 output.

Then some people also put 0.1uF capacitor between pin 3 output and pin 2 ground. Maybe that is to help cut down on noise/smooth the signal.

I would then connect the 16 hall sensors to a 1$ analog muxer board.

The output of that would connect to an op amp resistor configuration as described by this Texas Instruments excel sheet. https://e2e.ti.com/blogs_/b/analogwire/posts/three-ways-to-scale-an-analog-input-signal

https://e2e.ti.com/support/amplifiers-group/amplifiers/f/amplifiers-forum/942778/faq-voltage-scaling-for-almost-any-application-single-ended/3482726#3482726

The resistors chosen would be relatively low because there would be no further need to lower current. The reference voltage I plan to be 3.3 from the microcontroller.

The output of 2.5-4.88 or 0.12v to 2.5v would be scaled to 0v to 2.7v. I am only interested in reading one or the other. They represent either reading a North or a South pole magnet but in my case it is only ever going to be one side or the other. A different poled reading would have to come from someone sticking a magnet up to the instrument. Which I have to assume is a possibility.

Given that I think I should chose the 2.5-4.88 power range because it has a higher balance vcm value. That way if 0.12 to 2.5 volts get fed in it won't go over 3.3 v out but might go negative volts. So I plan to add a diode on the output then it should stop reading anything below 0 volts.

Would there be problems with the signal if I hook these 5v 5mA sensors up to an analog multiplexer and then amplify/scale the output on the other side with an op amp and then read it with a microcontroller like an esp32.

Is this or anything else I missed going to be a problem. I am sorry if this is not a good question.

Audo Voice
  • 71
  • 5
  • It comes down to how low impedance output your hall sensors are, which you have not provided info on. "*A large resistor should be on the input +5v 2amp power rail. 846 ohms spits out as the answer for 5.5v and 6.5mA*" Why? I am a little skeptical about the implication that hall sensors are wired up like LEDs. – DKNguyen Feb 07 '22 at 03:51
  • 49E Hall sensor says it has a output resistance of 40 ohm typically and 100ohm max. AH3503 doesn't even list a resistence it has 5mA input current and 3mA output current. I don't want the voltage to get divided because it wants around 5v and I am starting with a 5v power supply. So I thought it should be wired in parallel. – Audo Voice Feb 07 '22 at 04:07
  • I think I know what's going on. You're treating the 49E as if it were an LED and it's not. It needs no power supply resistor to limit current. It will draw the proper amount of current without you needing to do anything extra as long as you use the rated voltage. You give it a supply voltage and it produces an output voltage: https://electronoobs.com/eng_arduino_tut82.php – DKNguyen Feb 07 '22 at 04:11
  • To bring 5v 2amp power supply down to the range of 6.5 mA which is what 1 hall sensor wants. I used a Ohm's Law Calculator with 5.5 volts as the input because what would be what I might get off a fully charged phone power bank. I thought I would fry the hall sensor. – Audo Voice Feb 07 '22 at 04:16
  • That's the wrong assumption there about how the 49E works, and the power supply. the 5V,2A power supply you have it a voltage supply. Which means it provides 5V and *up to* 2A. The load will draw the current it needs. If it were a current supply, then it would supply 2A *up to* a 5V. In this case, load will resist the current flow which will require the supply to increase the voltage until that 2A current does flow. One number in the rating is what it will produce and the other number is it's capacity to produce. – DKNguyen Feb 07 '22 at 04:16
  • Thank you for clearing that up. Its nice to know it won't break that easily. – Audo Voice Feb 07 '22 at 04:19
  • So 40Ohm is pretty high for output resistance but there's far higher. The op-amp buffer's input resistance will be many thousands of times higher so the voltage divider effect between output resistance and input resistance will be minimal. As long as you get a low resistance analog mux (low relative to 40Ohms) you shouldn't notice much inaccuracy. You don't need an extra resistors anywhere. You give it a supply voltage and it magically produces an output voltage ready to use. – DKNguyen Feb 07 '22 at 04:20
  • Well thank you for the help. It is always the things that you don't think to ask. My understanding of how a phone power bank works was lacking. And I didn't think about the analog mux adding resistance. But hopefully it will all be accurate enough for midi. 0-127 is good enough for most signals. Though I do hope to get more accuracy than that, I suspect it will mostly come down to how I actually wire things up and space out the magnets. – Audo Voice Feb 07 '22 at 04:27
  • One last thing though if you are still there. Why do some people put a resistor between the input + and output of the hall sensor? Is it to offset the voltage to 5v? – Audo Voice Feb 07 '22 at 04:30
  • https://electronics.stackexchange.com/questions/91655/connecting-linear-hall-effect-sensor-directly-to-microcontroller-adc https://imgur.com/tFWsx8z https://imgur.com/a/RukL3BQ – Audo Voice Feb 07 '22 at 04:33
  • You mean the RL? That's not between input and output. That's between output and GND. It's a load resistor...for reasons? You shouldn't need it. The Megaohm level input resistance of your op-amp buffer will be the load resistance. – DKNguyen Feb 07 '22 at 04:34
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Voltage Spike Feb 07 '22 at 05:01
  • If you want to read 1 among 16 hall sensors (and not too fast), one can use a multiplexer on supplies, and another on outputs. you don't need a big supply. – Antonio51 Feb 07 '22 at 07:34
  • As an HCT4051 or CD74HCT4067 ? – Antonio51 Feb 07 '22 at 07:54

0 Answers0