Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
deutrino
deutrino
@deutrino@mstdn.io  ·  activity timestamp 4 days ago

questions for #electronics builders from a noob:

I want to build a weird lamp composed of sub-lamps with a slider pot to control the brightness of each one via a microcontroller watching the pot on an ADC pin and doing PWM.

* what resistance range is good for this such that the slider will have an effect over its full range of travel?

* slider pots tend to have a huge tolerance of like 20%, is this usually fixed by testing each one and adding fudge factors to the code?

#LearnElectronics

  • Copy link
  • Flag this post
  • Block
Kazinator
Kazinator
@Kazinator@mstdn.ca replied  ·  activity timestamp 4 days ago

@deutrino I have a synthesizer from circa 1995 which has four control knobs that are just carbon potentiometers under the hood: the Alesis QuadraSynth Piano Plus. These four knobs are scanned by the digital firmware, converted into numbers for MIDI control. Let me tell you, they are horrible. When I got the synth from someone over 17 years ago, those four controllers were flaky as hell. As you turned them, the position indicators on the display would jump between high and low values sporadically while being turned and sometimes settle on an incorrect value not matching the position. I opened up the synth and sprayed some cleaner and lubricant into the pots; then they behaved much better. Depending on how you design the circuit and the software around it, you can make things less susceptible, to a point.

  • Copy link
  • Flag this comment
  • Block
deutrino
deutrino
@deutrino@mstdn.io replied  ·  activity timestamp 4 days ago

@Kazinator hmm, yeah, I have encountered many pots in my life with that exact problem, and I do kind of want this lamp to last for many years. but I was kinda hoping for the tactile effect of either sliders, or (second choice) knobs with a defined start and end to their rotation.

(the inputs are going to mic deep red, red, green, blue, warm white, and cold white light based on their position)

  • Copy link
  • Flag this comment
  • Block
Kazinator
Kazinator
@Kazinator@mstdn.ca replied  ·  activity timestamp 4 days ago

@deutrino If you're using a microcontroller, then the resistance range is pretty much irrelevant since it is decoupled from actually controlling the circuit. Your firmware determines the pot position somehow and then programs the PWM accordingly. The total resistence of the potentiometer doesn't matter because a potentiometer just gives you a fraction of the voltage. That is to say, you can implement the potentiometer circuit such that it does not matter whether you wire in a 5 kΩ pot or a 25 kΩ pot. What matter is that (assuming a linear pot rather than audio taper) when the pot is in the halfway position, you get half the voltage. If you used the potentiometer as a rheostat, then the absolute resistance would matter (because it would then form a voltage divider with something external).

  • Copy link
  • Flag this comment
  • Block
deutrino
deutrino
@deutrino@mstdn.io replied  ·  activity timestamp 4 days ago

@Kazinator I have no idea what the difference is between being a rheostat vs not, I've heard all these terms but thought they were just fancy words for resistor 😂

  • Copy link
  • Flag this comment
  • Block
Tobias Klausmann
Tobias Klausmann
@klausman@mas.to replied  ·  activity timestamp 4 days ago

@deutrino I can only speak to the second part: usually, the pot/fader/... is used in voltage divider mode. That is, the surrounding circuitry "cares" more about the relative amounts of the resistances between (one fixed end and the wiper) and (the total resistance of the resistive track).

  • Copy link
  • Flag this comment
  • Block
deutrino
deutrino
@deutrino@mstdn.io replied  ·  activity timestamp 4 days ago

@klausman this is how noob I am to actual building with electronics, I have read immense amounts of material about how various components are made over my life, but didn't know that

  • Copy link
  • Flag this comment
  • Block
Robin Tarsiger
Robin Tarsiger
@dasyatidprime@mastodon.online replied  ·  activity timestamp 4 days ago

@deutrino My live electronics days were long ago, so take this with some salt and combine with more experienced answers, but:

  • Copy link
  • Flag this comment
  • Block
Robin Tarsiger
Robin Tarsiger
@dasyatidprime@mastodon.online replied  ·  activity timestamp 4 days ago

@deutrino 1. The pot is used as a three-terminal voltage divider (V+, V−, wiper terminal as control voltage), not as a power component, right? So you probably want a linear taper and as large a resistance as you can get away with (since passthrough current is wasted). Determining how much you can get away with requires reading the ADC datasheet, but several kΩ is common. The ADC will see the full range in that configuration regardless, if it's sensing the voltage.

  • Copy link
  • Flag this comment
  • Block
Robin Tarsiger
Robin Tarsiger
@dasyatidprime@mastodon.online replied  ·  activity timestamp 4 days ago

@deutrino 2. When I was doing microcontroller work a few decades ago for driving a bunch of servos (which similarly have a bunch of variance), I had the MCU store linear calibration values (offset&multiplier) in configuration EEPROM and added online calibration commands to the incoming command set over serial, driven by a little Python GUI with sliders per channel. You could use a similar principle here…

  • Copy link
  • Flag this comment
  • Block
Robin Tarsiger
Robin Tarsiger
@dasyatidprime@mastodon.online replied  ·  activity timestamp 4 days ago

@deutrino … but you might not have to worry at all, come to think of it, because I just realized the voltage divider effect cancels absolute-resistance variance out anyway so long as the taper is still an acceptable _shape_ (sorry, part of me was imagining a different configuration apparently, d'oh). Then you just need to make sure the highest possible resistance within spec is within the ADC's tolerance. If the taper curves are wobbly you have a different problem (don't know if common).

  • Copy link
  • Flag this comment
  • Block
deutrino
deutrino
@deutrino@mstdn.io replied  ·  activity timestamp 4 days ago

@dasyatidprime thanks! and now to figure out if LED PWM should be adjusted linearly or otherwise to seem linear to the human eye... 😵‍💫

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-beta.35 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct