2x pot and 1 led

anyone have an idea how i can use 2 pot to controll the brightness of 1 led?
i was hopeing to avoid a switch, but maybe its the only way? anyone have a idea for a solution?

i*m working on a project where i need to controll 1 led from 2 different controll panels.

Depends on what you mean by "control"
Do you want to be able to control the brightness of the LED by turning either pot?

yes =)

Are both pots attached to the same analog input? That would give some unexpected results, not what you wanted, I think. If one pot is fully clockwise and the other is fully anticlockwise, there will be a dangerous short circuit.

You must always have a current limiting resistor in series with your led, otherwise the Arduino pin and also the led could be damaged.

Your led is shown connected to A1 pin. Most analog input pins can be used as output pins, but on Nano they do not have PWM capability, which is required to dim a led.

Have you thought in detail about how your 2 pots would control the led?

For example if pot A is set at 50% position and pot B is set at 75% position. What % of brightness should the led be? What if pot A is then reduced to 25%? What happens with the led then?

Simple.
Connect one pot to A0, the other to A1. Connect the LED with resistor to a PWM pin.

When you want to change the LED brightness using either pot, first set the pot to zero then move it to the level you want. In your code you monitor the pot values and find out which one went to zero then to a new level, then use that pot value to set the brightness.

thank you, the scetch was drawn in 5min, jsut to show the example. =)
thank you going for 2x different A inputs on pot =)

Hello mikki1211

What is the task of the sketch in real life?

One possible way is to light the led according to whichever pot as adjusted last. This is not quite as easy as it sounds, because analog inputs always have some noise which will change the value from one reading to the next, even if the pot has not been adjusted. So some threshold must be used to ignore small changes that are not due the adjustment of a pot.

Do you understand what I described?

If you are able to remove potentiometers (ten-turn, ever-changing values) and use rotary encoders (continuous sweep pulse generators), your code will count pulses from either input and not varying resistances.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.