No video

Digital Potentiometer Control Using Arduino - X9C103

  Рет қаралды 46,632

Gadget Reboot

Gadget Reboot

Күн бұрын

The X9C series of digital potentiometers feature a simple 3 wire control interface, provide 100 steps of wiper adjustment, and can optionally save the wiper position for automatic recall of the setting after power on.
Here's an Arduino Uno sketch showing how easy it is to control and use the X9C family of digital pots.
This is a follow up to two previous videos:
Digital Potentiometer Control Basics - X9C103
• Digital Potentiometer ...
Digital Potentiometer and Rotary Encoder Direct Control X9C103
• Digital Potentiometer ...
Sketch: github.com/Gad...
Original Library:
github.com/phi...
Workbench equipment I regularly use:
946C Solder Hot Plate 200mm x 200mm www.banggood.c...
ANENG AN8008 True RMS Multimeter www.banggood.c...
Minleaf NPS3010W Power Supply www.banggood.c...
FY6900 Dual Channel 60MHZ Signal Generator www.banggood.c...
Siglent SDS1104X-E 100Mhz Digital Oscilloscope 4 Channels Standard decoder
Amazon.com: amzn.to/36fH1ui
Amazon.ca: amzn.to/36fNWUc
(These are affiliate links. I may earn a commission if you shop through the links, it supports the channel and doesn't cost you extra)
Support me on Patreon: / gadgetreboot
#ElectronicsCreators

Пікірлер: 62
@LandMineFX
@LandMineFX 10 ай бұрын
I've been building guitar pedals, and I think you just opened up a whole new world for me
@GadgetReboot
@GadgetReboot 10 ай бұрын
i’m about to do a video on a different digital pot because I think these are more obsolete right now so maybe that will be of interest as well in the next couple of weeks.
@LandMineFX
@LandMineFX 10 ай бұрын
Is it the MCP41010? I ordered just one of those on my last parts order, but then lost it @@GadgetReboot 😆
@GadgetReboot
@GadgetReboot 10 ай бұрын
it’s the MCP 42100 so it’s a dual 100 K version. I have to set up some experimental circuits for it but the video should be out within a week.
@WilliamDeboer
@WilliamDeboer 6 жыл бұрын
Just started looking at these online. Thanks for the explanation
@markusmitph8987
@markusmitph8987 5 ай бұрын
Thank you for the video and the detailed explanation :)
@AlexMandrakemaker
@AlexMandrakemaker 5 жыл бұрын
The explanation is good, clear, understand and comfortable this is = 1 subscriber more
@eugy2008
@eugy2008 3 жыл бұрын
Thank you! Very clear presentation. I am thinking of using this on a solar charger.
@petermccool9396
@petermccool9396 3 жыл бұрын
How did that go? I'm here due to the same requirements. I'm thinking to replace the V&I pots on an off the shelf DC-DC buck converter with these XDCPs.
@dcsymbols4450
@dcsymbols4450 Жыл бұрын
How would you incorporate this into a joystick instead of buttons?.
@ryzenryne8747
@ryzenryne8747 2 жыл бұрын
How do you make the digital potentiometer go to it's zero position (middle) quickly?
@rothenbergt
@rothenbergt 3 жыл бұрын
Fun video thanks for sharing
@anshbhatnagar557
@anshbhatnagar557 4 жыл бұрын
Thank I found issue in my circuit the value is storing in the nvram it just the issue of recalling and by the way I have change the 2 function you mention once again thank for helping
@neothehackerV2
@neothehackerV2 Жыл бұрын
I'd like to emulate a temperature sensor. Basically the Arduino pulls the temp from the internet and "codes" it to the wire w/the according resistance. The device that is supposed to have a temp sensor would show the temperature. Something like this possible?
@GadgetReboot
@GadgetReboot Жыл бұрын
it sounds possible but it’s a bunch of separate projects like one to go get the temperature from the Internet, then if you are saying you want to convert that temperature into a physical resistance value to emulate a sensor, does that mean the real sensor actually produces a certain resistance that varies with temperature? If so then as long as you have a digital pot that the resistance can be adjusted within the temperature range to match, you would just have a project that takes that temperature number and uses it to control the pot and so on but it’s all just vague concepts, like saying it’s possible to take an audio signal and put it through a circuit to boost the bass and cut the trouble. Lots of ways to do it.
@samuelebasso
@samuelebasso 3 жыл бұрын
Hi, nice video. I'm looking to use Arduino to transform a 800-1000 ohm potentiometer that I can't change into a 0-190 ohm variable resistance. It's possible in this way? Thank you
@timwzk1139
@timwzk1139 4 жыл бұрын
I'm so daft, looking at the screenshot of the data sheet in the vid, can I use the x9c and an Arduino to ”translate” one potentiometer to different values on the fly? Say, to turn my B25k expression pedal into a 100k?
@GadgetReboot
@GadgetReboot 4 жыл бұрын
as long as the voltage swing doesn’t exceed +/-5 V on the pot and the current through the wiper of the pot doesn’t exceed 4.4 mA, this digital pot can be used in a circuit where a regular pot is used. that assumes any nuances of the digital pot behaviour can be accepted in the circuit like while powering on, letting the wiper settle to a certain position, or while moving the wiper, momentary resistances may vary from the expected final wiper position so in an audio circuit volume or some other effect may temporarily be fluctuating depending how it’s all used. so experimenting would be needed to see if it’s even suitable for the application. if it is, if I want to use an Arduino to switch this pot in and out of circuit either in parallel or series with an existing pot, or to disconnect another physical pot and connect this one in on its own, I would probably use a digitally controlled switch like the CD4066. this has four built-in switches so I could use it to switch various terminals of multiple pots in and out of circuit as needed. Arduino would be controlling each switch with a single pin to open or close that switch. I did something similar using digital pots to control frequency of Tone generators and output volume of an audio circuit and used those digital switches to connect various features in and out from Arduino. kzbin.info/www/bejne/pXfXeIKFdpdoqqM
@timwzk1139
@timwzk1139 4 жыл бұрын
@@GadgetReboot Thanks for the detailed (and prompt) reply! I've been looking into ways to avoid having three different expression pedals to control non-midi capable guitar pedals that have expression inputs; B10k/B25k/B100k without necessarily having three seperate expression pedals. Already have an Arduino, and a passive trs 25K expression pedal. Wouldn't need to be all outputs at once, but that's a bonus. The devices typically take 9V DC inputs are typically 9V DC, but some claim to operate internally at 24V. If I understood correctly, I'm glad you reminded me to be mindful that these external devices would possibly/likely pass more than five volts through the chip. Thanks again.
@dwalden74
@dwalden74 4 жыл бұрын
A mechanical pot 100K can handle higher voltages. The x9c- series only supports 5v. How would I control a 20v or 30v circuit with a digital potentiometer and arduino?
@GadgetReboot
@GadgetReboot 4 жыл бұрын
without doing the math to double check, I wonder if the digital pot can handle the normal resistor divider of a buck or boost voltage regulator to set the output voltage, maybe with other resistors as part of the network and not just the digital pot alone. or maybe the digital pot could be used safely in conjunction with an op amp circuit and the output of the op amp ties in to the voltage regulator so instead of using a variable resistance to set the voltage we are directly setting the voltage with an op amp. Something along those lines. I’m sure there’s lots of Circuit ideas like that in all the app notes of all the silicon vendors where something could be put together.
@petermccool9396
@petermccool9396 3 жыл бұрын
@@GadgetReboot Did you ever dig deeper into that? I've got an off the shelf dc-dc converter coming for experimentation.
@redlightdrive5432
@redlightdrive5432 2 жыл бұрын
X9c103p is 10k, at sao it display 100k?
@user-cm6sj7uf5i
@user-cm6sj7uf5i 2 жыл бұрын
thanks for the explanation. do you have the wiring diagramm for this test in order to undrestand better the functions?thanks in advance
@jln5352
@jln5352 2 жыл бұрын
I need to put Vh=15V and Vl=13.75V. Any idea how to do that?
@jonnymartin8414
@jonnymartin8414 3 жыл бұрын
Does the chip itself store the last value without the arduino? The datasheet says "Wiper Position Stored in Nonvolatile Memory and Recalled on Power-Up" So does the arduino quickly turn the pot to one side and then turn it to the arduino memory on powerup?
@GadgetReboot
@GadgetReboot 3 жыл бұрын
the chip itself stores the position if requested by the control lines from arduino at some point, so when powered back on the chip itself moves the wiper where stored. I think it always starts at one end of the range and then moves to the setting.
@suhailanjumabdurraheemsayy7639
@suhailanjumabdurraheemsayy7639 5 жыл бұрын
Nice explanation sir. Can we use this pot to carry out IV measurements of solar cells? Please do reply.
@GadgetReboot
@GadgetReboot 5 жыл бұрын
It’s probably not practical because at least for this specific device there is a maximum voltage of 5 V and the maximum current through the wiper can only be just over 4 mA so if the voltage or current being presented to this part is going to be higher than that, it won’t work. If this part is not being used directly as a load and is just used for some other function that’s within those voltage and current ratings then that’s OK.
@suhailanjumabdurraheemsayy7639
@suhailanjumabdurraheemsayy7639 5 жыл бұрын
@@GadgetReboot Thank you sir. Can you please suggest a digital pot for IV measurements of a small solar cell having voltage below 5v and current below 500 mA?
@GadgetReboot
@GadgetReboot 5 жыл бұрын
I don’t know if a digital pot can directly handle that much current, I didn’t research fully but one I found is 25 mA like this one. www.mouser.ca/new/microchip/microchip-mcp41hvx1-potentiometers/ And maybe there’s limitations like it can only do 25 mA for short duration not continuous and things like that. There may be some other kind of circuits that can be added on to buffer the potentiometer though, so the potentiometer can be part of a low current circuit controlling a higher current path in some way that the desired result is still achievable. Maybe some sort of thing where the digital pot is connected to an op amp so that the digital pot changes the voltage control of the op amp and that controls a fet on the output like a variable resistor DC load so the solar cell would have a fet providing a load current safely controlled digitally by the digital pot. But at that point just a straightforward digital to analog converter chip can do the same thing so it comes down to the reason for using a digital pot in the first place.
@landyandy
@landyandy 4 жыл бұрын
Really a well done explanation. I wanted to know if this digital potentiometer can be applied as a continuous variable resistance. In a circuit based on a Hall sensor that makes me vary the resistance according to the magnetic flux. The magnetic flux varies tens of times per second and the resistance should vary in the same way. Bye
@GadgetReboot
@GadgetReboot 4 жыл бұрын
From the data sheet AC operation characteristics table on page 5 www.renesas.com/in/en/www/doc/datasheet/x9c102-103-104-503.pdf , where it shows the timing of the control signals and the response of the wiper, it looks like the wiper will change within 100 µs per step each time it is incremented so that could be considered fast for several times a second moving the full scale 100 steps if you have to go between minimum and maximum resistance continuously. And it is just switching in the different resistors electrically so it should be suitable for continuous operation. There is one note I saw in the data sheet that may need consideration, while changing the wiper, there may be a temporary change in resistance rather than just going to the next increment based on the way it works so the application may need to consider that and testing should be done. “The electronic switches on the device operate in a “make-before-break” mode when the wiper changes tap positions. If the wiper is moved several positions, multiple taps are connected to the wiper for tIW (INC to VW/RW change). The RTOTAL value for the device can temporarily be reduced by a significant amount if the wiper is moved several positions.”
@electronic7979
@electronic7979 6 жыл бұрын
Useful video
@leblancexplores
@leblancexplores 2 жыл бұрын
I am looking at using this XC9 in combination with a PWM fan controller (ultimately a 555 timer and some transistors) to control a 60W fan. If I want to be able to turn the fan off should I also consider a relay as well or would setting the resistance to it's highest (or maybe lowest?) be sufficient to ultimately get me a 0% duty cycle?
@GadgetReboot
@GadgetReboot 2 жыл бұрын
it would definitely be good to have a relay or some thing to do a complete shut off, I know the 555 cannot achieve 100% or 0% duty, or possibly both. So when you try to make it go completely flat either high or low, you might still get the little blip momentarily.
@wackerburg
@wackerburg 3 жыл бұрын
Are these digital resistors also available with a higher resolution aka more steps? Like 10 or 12 bits? Great video!!! :-) Thank you.
@GadgetReboot
@GadgetReboot 3 жыл бұрын
I've seen them with as many as 1024 steps like this one www.analog.com/media/en/technical-documentation/data-sheets/AD5174.pdf but of course all the features and limitations of each different digital pot need to be looked at to see if it fits the application. They're more like a specialized part where trade offs would need to be decided between number of steps vs voltage handling, or control interface method, ability to store wiper at power down etc
@bartdepauw1156
@bartdepauw1156 2 ай бұрын
Is it possible to use 2 of these in series, to have 200 steps ? Did someone tried this already ?
@GadgetReboot
@GadgetReboot 2 ай бұрын
I haven’t tried it but I think it makes sense if you’re only using the wiper and one terminal of each pot so you’re using it like a rheostat and then you put two of those in series where the wiper of 1 feeds in to the one end terminal of the second one, then you should be able to control the two sections to go from minimum resistance up to the value of two resistors in series.
@browaruspierogus2182
@browaruspierogus2182 6 жыл бұрын
What exactly is the difference between digital pot and voltage regulator? Aren't they almost the same? What exactly this can be used for?
@GadgetReboot
@GadgetReboot 6 жыл бұрын
I suppose a variable resistor like this could be used as a voltage reference but it won’t be able to deliver significant current to power something else. In order to maintain a regulated voltage and provide a certain load current, a voltage regulator is needed. If you use a pot as a voltage divider you will get a certain voltage out of the wiper but it’s only meant for measuring rather than powering circuits. The most obvious example usage for this would be a volume control where the audio input signal goes to one end of the pot, ground is on the other end of the pot, and the wiper is the output which goes into another audio section or a speaker. As the wiper is moved toward the ground the volume goes down because you have more ground than audio signal coming out of the wiper. As the wiper is moved toward the audio input, you get closer to having a direct short through the pot which is full volume.
@bijoyendrasharma4781
@bijoyendrasharma4781 5 жыл бұрын
I am having a problem with my digital pot, I cant figure out how to increase or decrease the resistance through the micro controller
@GadgetReboot
@GadgetReboot 5 жыл бұрын
Using Arduino or another platform? This video looks at the pot more generally for learning to use it: kzbin.info/www/bejne/i2SuXoOOmNtqi9E
@anshbhatnagar557
@anshbhatnagar557 4 жыл бұрын
Hi I try the same with the button I succeed in varying the resistance or voltage but not able to save thevalue I keep cs high while Inc signal is high so can you help me in this
@GadgetReboot
@GadgetReboot 4 жыл бұрын
One thing I recall is I found some issues in the X9C library I used, so I had to change two functions in the library code. I made a comment at the top of my sketches here github.com/GadgetReboot/Arduino/blob/master/Uno/X9C_Button_Test/X9C_Button_Test.ino and it looks like Deselect And Save is one of them, so I wonder if all you need to do is tweak the library like I had to. I forget exactly how I did it and if I talked about it in the video. Here's the info from one of the sketches, so if you find the X9C.cpp file in the library, you can search for these 2 functions and replace them with this code: Changes required to the original X9C.cpp file from the above GitHub library (as of Last commit Jun 8 2017) The following 2 functions should be replaced with this code: void X9C::_deselectAndSave(){ digitalWrite(_inc,LOW); //***********GADGET REBOOT CHANGED****************** delayMicroseconds(1); //***********GADGET REBOOT CHANGED****************** digitalWrite(_inc,HIGH); //***********GADGET REBOOT CHANGED****************** delayMicroseconds(1); //***********GADGET REBOOT CHANGED****************** digitalWrite(_cs,HIGH); // unselect chip and write current value to NVRAM } void X9C::_stepPot(uint8_t amt,uint8_t dir){ uint8_t cnt=(amt > X9C_MAX) ? X9C_MAX:amt-1; //***********GADGET REBOOT CHANGED****************** digitalWrite(_ud,dir); // set direction digitalWrite(_cs,LOW); // select chip delayMicroseconds(1); while(cnt--){ digitalWrite(_inc,LOW); // falling pulse triggers wiper change (xN = cnt) delayMicroseconds(1); digitalWrite(_inc,HIGH); delayMicroseconds(1); } delayMicroseconds(100); // let new value settle; (datasheet P7 tIW) }
@brandontroppens6326
@brandontroppens6326 3 жыл бұрын
Does the digital pot hold its previous value when power is off?
@GadgetReboot
@GadgetReboot 3 жыл бұрын
If the software procedure is followed to store it, yes. It re-loads the last stored value on power up but the wiper isn't immediately there, it has to move there during configuration so resistance will vary while it gets set up.
@francochiesadocampo3205
@francochiesadocampo3205 4 жыл бұрын
Where do you sense the output voltage resulting from the X9C?
@TheViperMan
@TheViperMan 4 жыл бұрын
On the wiper.
@syaduinotech3681
@syaduinotech3681 3 жыл бұрын
Thanks for the idea and explaination. I am new, and would like to ask, if we use the map function in arduino, what will happen sir? Any idea
@GadgetReboot
@GadgetReboot 3 жыл бұрын
In general or in something to do with the video (I can't remember what's in the video)? It maps one range of numbers to be within a different range, so it can take 0 to 10 and stretch it out to 70 to 500 if wanted, so 0 maps to 70 and 10 maps to 500 and everything in between is scaled.
@syaduinotech3681
@syaduinotech3681 3 жыл бұрын
@@GadgetReboot tq sir..
@kjur18
@kjur18 6 жыл бұрын
I have been wondering for some time now, why you have a piece of blue tape on that dmm?
@GadgetReboot
@GadgetReboot 6 жыл бұрын
It’s a conversation starter! The question came up in another video once upon a time. It’s there to cover a crack and a gouge in the plastic that kept spreading and one day I will get around to trying to fix it more permanently.
@kjur18
@kjur18 6 жыл бұрын
It seems that it performs well. As a conversation starter, I mean. It made me remember some stock photos where they remove brand names from dmm's in their photos, sometime they wipe it out in software, some other time they use a piece of tape:-)
@GadgetReboot
@GadgetReboot 6 жыл бұрын
I should share screen time with my other Fluke meter which I’ve owned about 10 years longer than this one. I just never think of it because the probes used to be broken but now I have eBay replacements. Someday I will need to measure voltage and current at the same time and then I’ll get it all going.
@steffan9415
@steffan9415 5 жыл бұрын
Can I use it on AC loads?
@angelcuba733
@angelcuba733 4 жыл бұрын
Do you have the circuit diagram?
@shokdj1
@shokdj1 Жыл бұрын
I’ve not used an arduino yet I feel like this is going to be a long project I want to do :sigh:
Digital Potentiometer and Rotary Encoder Direct Control X9C103
14:05
Цифровой потенциометр X9C103S
5:36
arduinoLab
Рет қаралды 59 М.
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 4,6 МЛН
Bony Just Wants To Take A Shower #animation
00:10
GREEN MAX
Рет қаралды 7 МЛН
Digital Potentiometer - X9C Practical Uses and Examples
20:32
Gadget Reboot
Рет қаралды 7 М.
477 Use the very attractive new ATTINY chips for your projects
14:34
Andreas Spiess
Рет қаралды 205 М.
Digital Potentiometer Control
8:17
0033mer
Рет қаралды 56 М.
NRF24 Frustration - Radio module doesn't work?
12:46
Electronoobs
Рет қаралды 89 М.
Building a MIDI Controller Using Arduino
15:41
Switch & Lever
Рет қаралды 631 М.
5 AMAZING Arduino project DIY
29:45
Daniele Tartaglia
Рет қаралды 1,8 МЛН