This component can control tons of circuits! Digital Potentiometer Guide! EB#51

You Know There Is One Big Problem With All Of Those Circuit Boards...

There is one big problem with all of those circuit boards. And don't get me wrong, they all work perfectly fine and do jobs like creating a variable output voltage, dimming a light bulb, reacting to a magnetic field or for example acting as a distance sensor. But did you notice that while showcasing the function of each board I was always using some kind of potentiometer to either set the output voltage or a threshold value at which the sensor reacts.

Now in most projects this is not a problem because setting the potentiometer value once is most of the time sufficient. But let's imagine we got a project in which we drive a high power LED with a beefy boost converter which as you can see works perfectly fine at max brightness with an output voltage of 32V.

But the project also involves dimming the brightness of the LED at different times of the day. To do this, we need to adjust the voltage level that is supplied to the LED. This is where the potentiometer comes in handy. But, as you can see from my previous projects, using a mechanical potentiometer has its own set of problems.

So, I started looking for an alternative solution - a digital potentiometer. You know, those three terminal devices that are used to adjust voltage levels. Sounds good so far but this setup actually comes with three possible problems for us.

First off, we have to replace the mechanical potentiometer with a digital one that comes with the exact same resistance value because this time the value is crucial. Next, the voltage drop across the potentiometer can be quite high in this boost converter topology that obviously outputs a high voltage and can vary in my example from 0V up to 25V.

This is of course way higher than the max voltage given by the datasheet of the digital potentiometer, but at least the given maximum current flow of 4.4mA is higher than the actual current flowing through the potentiometer later on. So it was time to do some stress testing with the IC to see whether I could use it with 25V.

But sadly I have to report that the IC can not handle such a voltage and instead destroyed itself. While I was at it I also tested the maximum current flow through the wiper as a variable resistor and this value seems to be around 100mA before complete destruction. That sadly means we can not use this particular digital potentiometer for the boost converter.

But luckily I got this MCP 41HV51-10k just in time. The HV apparently stands for high voltage which is true because we can apply a maximum of 36V to it. The resolution of the IC is also bigger than before but unfortunately we have to deal with SPI code in order to control it.

But since I found a very awesomely written instructables article about the IC with given schematic and code, it was super simple to wire it up on a breadboard and so some simple testing. Before that though I obviously had to solder the IC to a breakout board and create a bit of code on my own which either increases or decreases the wiper position depending on whether I send over 'u' for up or 'd' for down to the Arduino.

And as you can see my test worked out just fine which means it was time to desolder the old mechanical potentiometer, add the digital one in its place, wire everything up and do one final test which as you can see also worked perfectly. With that being said you should now be familiar with digital potentiometers and be ready to use them in your next project.

If you enjoyed this video then consider supporting me through Patreon so that I can produce more of them. As always don't forget to like, share, subscribe and hit the notification bell. Stay creative and I will see you next time.

WEBVTTKind: captionsLanguage: enYou know there is one big problem with allof those circuit boards.And don't get me wrong they all work perfectlyfine and do jobs like creating a variableoutput voltage, dimming a light bulb, reactingto a magnetic field or for example actingas a distance sensor.But did you notice that while showcasing thefunction of each board I was always usingsome kind of potentiometer to either set theoutput voltage or a threshold value at whichthe sensor reacts.Now in most projects this is not a problembecause setting the potentiometer value onceis most of the time sufficient.But let's imagine we got a project in whichwe drive a high power LED with a beefy boostconverter which as you can see works perfectlyfine at max brightness with an output voltageof 32V.But the project also involves dimming thebrightness of the LED at different times ofthe day.To keep track of time you can combine a microcontrollerwith an RTC aka real-time clock.But how can we adjust the potentiometer valuewith the microcontroller in order to decreasethe voltage and thus dim the brightness?The solution are those little ICs right herewhich are digital potentiometers and theycan be a really handy digitally controlledalternative to mechanical potentiometers.And in this video I will tell you all aboutthem and how you can easily use them to controlpretty much any circuit that uses potentiometers.Let's get started!This video is sponsored by Altium.They offer probably the most professionalPCB designer software on the market that comeswith all the bells and whistles you couldever need in order to create professionalPCB designs.And right now you can even test their softwarefor free by following the link in the videodescription.So why not give it a try yourself?First of the digital potentiometers I initiallywent with were the X9C103 and the X9C104.The reason was that those were the only onesthat I could get quickly.But as you can see I had to get another typein hindsight due to a rather big problem youwill see later in the video.And generally speaking there is a huge varietyof digital potentiometers you can choose from.But while looking through the data sheet ofsome of them I noticed that the majority usesI2C or SPI for communication which is quitea bit more complicated to work with than thesimple 3 digital input pins my first potentiometersuse which I will talk about in a second.Before that I had a look at the pinout ofthe ICs in order to find out where to hookup the supply voltage and GND, what pins representthe pins of a traditional mechanical potentiometerand what are the 3 digital inputs which Iwill firstly connected to tactile push buttonswith pull up resistors and debouncing capacitorson a breadboard.And by the way I am using the 103 versionof the IC here which is a numerical code youcan often see on potentiometers and it simplystates the resistance value.We basically got 10Ω with 3 zeros behindit which equals 10kΩ and thus the 104 ICis a 100kΩ digital potentiometer.Both ICs also share the same datasheet alongwith the other available values you can get.But anyway for the power supply I went witha voltage of 5V which is already close tothe 7V max input voltage.I also connected 5V and GND to the upper andlower terminal of the digital potentiometerrespectively.This voltage is also close to the given limitbut let's just say that I will properly stresstest the given voltage and current limitslater on and for now we should try to understandthe IC properly by looking at its detailedblock diagram.As you can see it consists of 99 resistorswhich are connected between the upper andlower terminal.The IC can now activate one of those switchesat a time which connects the wiper to thispoint and along the way creates two resistances.Depending on whether we move the switch closedposition closer to the upper terminal or closerto the lower terminal, one of the two resistanceswill increase while the other decreases.And since a voltage difference is usuallyapplied between the upper and lower terminalwe successfully created an adjustable voltagedivider which is exactly the same thing amechanical potentiometer does.The only disadvantage of the digital potentiometerso far is that its wiper can only have 100different positions and thus a voltage offor example 5V can only be divided with aresolution of 100 and thus those voltage stepsare certainly noticeable.Mechanical potentiometers especially precisiontrimmers definitely do not have this problembut then again you can also look for digitalpotentiometers with a bigger resolution.But anyway after adding my multimeter in voltagemeasuring mode to the wiper pin, it was timeto change the wiper position with my 3 digitalinputs.And according to this mode selection tablethat should be super simple to do.You have to keep chip select low and dependingon whether the Up Down pin is connected toVcc or GND, the wiper either moves one stepup or down as soon as the increment pin isbeing pulled low.So you basically only have to keep those twolines in mind and maybe this lower one aswell in which you pull the chip select pinhigh in order to save the wiper position inthe memory of the IC so that after a new powerup it still remains in that position.And with the theory out of the way I triedout the just learnt push button combinationsand as you can see I was able to increaseand decrease the output voltage without aproblem.Now this three terminal potentiometer setupis great if you want to use it for audio amplifiersto decrease the input voltage or for operationalamplifiers to adjust the threshold triggervoltage.But when it comes to such voltage convertersthen you quickly notice that two of the potentiometerspins are always shorted.That means the potentiometer is being usedas a two terminal variable resistor whichin combination with some other resistors buildsup a voltage divider and thus creates a feedbackvoltage for the control IC.Sounds good so far but this setup actuallycomes with three possible problems for us.First off, we have to replace the mechanicalpotentiometer with a digital potentiometerthat comes with the exact same resistancevalue because this time the value is crucial.Next the voltage drop across the potentiometercan be quite high in this boost convertertopology that obviously outputs a high voltageand can vary in my example from 0V up to 25V.This is of course way higher than the maxvoltage given by the datasheet of the digitalpotentiometer, but at least the given maximumcurrent flow of 4.4mA is higher than the actualcurrent flowing through the potentiometerlater on.So it was time to do some stress testing withthe IC to see whether I could use it with25V but sadly I have to report that the ICcan not handle such a voltage and insteaddestroyed itself.While I was at it I also tested the maximumcurrent flow through the wiper as a variableresistor and this value seems to be around100mA before complete destruction.That sadly means we can not use this particulardigital potentiometer for the boost converter,but luckily I got this MCP 41HV51-10k justin time.The HV apparently stands for high voltagewhich is true because we can apply a maximumof 36V to it.The resolution of the IC is also bigger thanbefore but unfortunately we have to deal withSPI code in order to control it.But since I found a very awesomely writteninstructables article about the IC with givenschematic and code, it was super simple towire it up on a breadboard and so some simpletesting.Before that though I obviously had to solderthe IC to a breakout board and create a bitof code on my own which either increases ordecreases the wiper position depending onwhether I send over u for up or d for downto the Arduino.And as you can see my test worked out justfine which means it was time to desolder theold mechanical potentiometer, add the digitalone in its place, wire everything up and doone final test which as you can see also workedperfectly.With that being said you should now be familiarwith digital potentiometers and be ready touse them in your next project.If you enjoyed this video then consider supportingme through Patreon so that I can produce moreof them.As always don't forget to like, share, subscribeand hit the notification bell.Stay creative and I will see you next time.