I have a short question about powering a Pro Micro (Arduino Leonardo clone) together with several MCP23017 port expanders (buttons and LEDs) and some potentiometers.
I have 5 expanders with lots of buttons and LEDs connected.
Since the Pro Micro’s VCC can’t supply enough current for all the LEDs, I decided to use an external 5V power supply for the MCPs.
The Pro Micro itself is powered only via USB (for sketches and communication).
Grounds are connected (common GND).
For the potentiometers:
GND → common GND
Signal → Micro input pin
VCC → external 5V supply
This setup works so far, but I have two questions:
Is this the correct way to set up the power supply?
I was worried about damaging the Micro if I connected both USB and the external 5V.
Potentiometer issue:
When I turn one potentiometer, the values of other potentiometers change slightly.
Is this normal, or could it be caused by my power setup?
I can think of lots of way to connect these and the pots, most of them incorrect. Post a simple schematic annotated showing how you have wired these. Since you have a clone post a link to its technical details, I found more then one version of the pro micro clone and at different voltages. On your schematic show all external parts such as capacitors, resistors etc. Define your power supply, that could be a problem. The value of the other posteriors should not change, that indicates a writing or power supply problem.
It is always best to verify the wiring before applying any power as the electronics could be destroyed before the LED lights. Also never change connections with the power on.
Schematic, please. In particular, what is the resistance of the potentiometers, and how are they wired(not what are they wired to, but how?)
Circuit topology is important - if the current in one pot is changing, and that current passes through a path that is common to the other potentiometers, that path has to be very ‘solid’. Poor connections will result in crosstalk.
Thanks a lot for your replies.
Here is a simple schematics, how I wired a MCP and how I wired one potentiometer.
The Pro Micro is the 5V – USB C Version.
I guess the Potis are 100K (maybe they are only 10K – I have to check).
As you see, the power for the potentiometers and the MCPs comes from the external power supply.
Again, the Pro Micro is powered via USB.
Like I said, I have 5 MCPs (with different I2C Addresses).
And 3 Potentiometers (A0, A1, A2).
Again: Everything works for a quite long duration. But I have small issues with the poti values. And Im not sure, if thats the right way to power everything – so I want to learn it once and for all
The ADC is optimized for analog signals with an output impedance of approximately 10k or less. If such a source is used, the sampling time will be negligible. If a source with higher impedance is used, the sampling time will depend on how long time the source needs to charge the S/H capacitor, with can vary widely. The user is recommended to only use low impedance sources with slowly varying signals, since this minimizes the required charge transfer to the S/H capacitor.
You are showing a single 100K pot. I'll assume all the rest that you aren't showing are of a similar value.
The 32u4 has a single ADC. It is muxed to 12 inputs.
If all of your inputs are high impedance, the internal capacitor will not have sufficient time to charge/discharge from the value on the previously selected channel to the value on the current channel. In short, your inputs will appear to have crosstalk on them.
Reduce the input impedance and try again. A simple 0.1uF cap to ground on each ADC input can work wonders for slowly varying signals.
And on an unrelated note, I do hope your circuit doesn't allow for one half of it to be powered while the other half remains unpowered. That will cause problems if it it allowed to occur.
Hi!
My bad! Its a simplified version of my schematics. But I guess its fine to bring my point across, let me clarify this:
Regarding your feedback
Sorry for the confusion, all of the potentiometers are 10K (not 100K as in the schematics). This should be fine for the ADC I guess.
All potentiometers are wired the same way – just to different analog inputs.
True, I didn’t show the power supply of the Micro itself, I’m sorry. It’s powered via its USB port. I didn’t know how to show this in schematics – I thought it’s clear if I mention the USB connection but thanks for pointing that out. So the Micro gets its 5V from the USB and the potentiometer gets its 5V from the external power supply.
You can expect 1-2 bits of noise on an analog input regardless of how stable your power to the pots is. A small capacitor will help that, but there will still be fluctuation. That is where software averaging comes into play.
Are you reading the analog inputs one after the other, this can cause this problem due to the ADC needing time to adjust to each input.
There is only one ADC and it is switched to each of the inputs.
There is a software solution.
Can you please post your code, in particular where you read the analog inputs?
Please use code tags.
Hi,
I ran some tests and found that the potentiometers work flawlessly — no jitter or value drops — when they’re powered from the Micro’s VCC. When they’re powered from the external supply, readings jitter. My conclusion is that the external supply is unstable; as the pot’s resistance changes, the supply droops slightly, shifting the voltage seen by the ADC and causing the jitter.
Something like that.
So to close this:
You can savely power the MCPs vie an external power supply. They will work between a certain voltage area, so the shitty power supply wont bother the MCP.
The potentiometers on the other hand, should be powered by the Micros VCC, this is a more stable power supply, which will result in perfect reading and no value changes as expected.