# Push Button Digital Potentiometer Understanding

Thread Starter

#### Jeff Aurand

Joined Sep 17, 2019
7
Hi All,

I currently have a two 5 volt fans wired in series controlled with a analog rheostat (https://www.digikey.com/product-detail/en/cts-electrocomponents/026TB32R500B1A1/CT2153-ND/203774). The amperage of each fan is 0.3mA and ohm rating for a fan is ~50 ohms. I would like move this design to a push button potentiometer. (one buttom increases fan speed and other decreases).

As I am new to the digital pots, I am not understanding the wiper ohm rating on a digital pot as well as the overall resistance rating.

Thank you in advance for any help you can provide.

#### danadak

Joined Mar 10, 2018
3,573
What are you going to control the pots with, a micro ?

Amerage on motor, you stated .3 mA, did you mean .3 Amps ?

Regards, Dana.

Thread Starter

#### Jeff Aurand

Joined Sep 17, 2019
7
Amerage on motor, you stated .3 mA, did you mean .3 Amps
Yes .3 Amps.

For controlling the pots, I thought it was possible to program the pot, then set it up with a 5v supply, and the push buttons to control up and down.

Do all pots need to constantly be controlled? Sorry for all the questions, but my online searching and understanding only got me so far until I could really grasp how to use digital pots.

#### BobTPH

Joined Jun 5, 2013
2,021
There are digital pots that have an up / down interface, but...

Digital pots cannot themselves handle the power of the fan. You would need to use the digital pot to control a PWM controller for the fans.

Bob

#### SamR

Joined Mar 19, 2019
1,136
There are several types of digipots. Look at the PDF for ones that have inputs for up/down. The digipot has 100 gates and will up/down one gate at a time for each input so your button will need to repeat pulse. Start with the PDF to chose which digipot to use.

Also Welcome to AAC!

Last edited:
Thread Starter

#### Jeff Aurand

Joined Sep 17, 2019
7
Thank you all! Sounds like I need to look for a digi pot with up/down inputs along with a pwm controller to get it working

#### SamR

Joined Mar 19, 2019
1,136
PWM typically says microcontroller or some kind of timer to pulse the V. The 2 ways I have played with the digipots were push-button or rotary indexer going into an Arduino to either send repeating pulses as I held down a momentary PB to the digipot or write a 2 wire communication setpoint signal to it. Just to PWM speed control for a fan the microprocessor alone is all you need with an input for the microprocessor to tell it where to control it's PWM output to. But digipots are fun to play with and understand how they work as are rotary encoders.

#### danadak

Joined Mar 10, 2018
3,573
Here is a basic approach (attached) -

Uses ATTINY85, you program it with an Arduino Nano or Uno board, either < $5. For coding use mBlock. This is a starting example. You drag and drop programming visual blocks, and the tool from that GUI representation generates the Arduino code shown in the right window. The middle two windows, one on the left, is a "library" of blocks that equate functional behavior, like set a pin, read a pin, add two numbers, compare numbers, etc. The right of these two windows is where you drag and drop the library element to that window which will instruct the compiler/converter how to interpret what you have done graphically and generate Arduino code. The above is a working example that converts V to Duty Cycle in ATTINY internal PWM. mBlock can directly program an Arduino Nano or Uno board. Programming the ATTINY a tad more involved. You first program one of the boards with a program in Arduino example projects that turns it into a programmer for the ATTINY, then program the ATTINY. Regards, Dana. #### Attachments • 114.4 KB Views: 3 Last edited: Thread Starter #### Jeff Aurand Joined Sep 17, 2019 7 Here is a basic approach - View attachment 186425 Uses ATTINY85, you program it with an Arduino Nano or Uno board, either <$5.

For coding use mBlock. This is a starting example. You drag and drop
programming visual blocks, and the tool from that lash-up generates the
Arduino code shown in the right window.

View attachment 186426

The middle two windows, one on the left, is a "library" of blocks that equate
functional behavior, like set a pin, read a pin, add two numbers, compare
numbers, etc. The right of these two widows is where you drag and drop
the library element to that window which will instruct the compiler/converter
how to interpret what you have done graphically and generate Arduino code.

The above is a working example that converts V to Duty Cycle in ATTINY
internal PWM.

mBlock can directly program an Arduino Nano or Uno board. Programming
the ATTINY a tad more involved. You first program one of the boards with
a program in Arduino example projects that turns it into a programmer for
the ATTINY, then program the ATTINY.

Regards, Dana.

Well thank you Dana! I thought I'd struggle with it for a bit and ask more questions, def not expecting a full schematic! I appreciate it

#### danadak

Joined Mar 10, 2018
3,573
Feel free to ask questions.

Let me explain code blocks -

The top block is called the top hat, basically tells the code interpreter tool
where the program starts.

The second block declares a variable AtoDval to hold the value measured by the A/D.
And sets it to 0 to just initialize it.

The third block is the "forever" block, basically executes over and over the
blocks between its arms.

The fourth block reads the A/D value on pin A2, and divides it by 4, then
stores it into the variable AtoDval. The value from the A/D is a 10 bit value,
but the PWM value is only 8 bits. So one has to take the top 8 bits of the
AtoDval. A /4 is equivalent to right shift the 10 bit value by two bits, thereby
taking only the most significant bits of the A/D result.

The next block simply writes the 8 bit AtoDval out to PWM duty cycle register
updating it.

Regards, Dana.

#### danadak

Joined Mar 10, 2018
3,573
Thats not supported in the block languages I am familiar with, does not seem to
have a PWM or A/D converter (datasheet I looked at).

Maybe some of the PIC experts can handle this.

If you want to run fans at other than 5V MOSFET handles that. In
other words its load attached to drain does not care what the gate is
doing in a PWM oriented approach.

Regards, Dana.

Thread Starter

#### Jeff Aurand

Joined Sep 17, 2019
7
that makes sense. in the schematic you provided, PWM duty cycle control, does that have to be a potentiometer/rheostat or can push buttons be used?

#### danadak

Joined Mar 10, 2018
3,573
Buttons no problem. The code changes a little.

Regards, Dana.

Thread Starter

#### Jeff Aurand

Joined Sep 17, 2019
7
In your image this is a capacitor right?

what size would be correct?

#### danadak

Joined Mar 10, 2018
3,573
1 - 10 uF should be fine.

Regards, Dana.