#88 Digital Potentiometer aka Volume Control - Easy (X9C103)

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ย. 2024

ความคิดเห็น • 171

  • @flashcorp76
    @flashcorp76 ปีที่แล้ว

    Hello Ralph😊Been researching these beasts, you vid was pointed to me after watching ´GreatScott’ Chanel about the same topic….but your’s precedes his by 4 YEARS ! And I must say🤫🤐I preferred yours😊, Complete and concise and ´What I was looking for’ !! Thanx👍🏻

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว +1

      Glad it was helpful! Always ahead of the curve, that's me! 😉

  • @ronalddhs3726
    @ronalddhs3726 7 ปีที่แล้ว +1

    Hi Ralph, nice seeing your channel growing; this was a very good and thorough tut. Thanks for the videos.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      Hey there, 'Ray', nice to hear from you again, and yes the channel is slowly growing. I wish I had more time to devote to it as I like making the videos and sharing the knowledge too. I'm about to switch video editing software so I hope I don't crash and burn trying it out on my next video! Thanks for posting.

  • @danljohnston
    @danljohnston 7 ปีที่แล้ว

    If Benny don't slow down on these projects, I'll never catch up! Never mind Ralph, keep'em coming!

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      Don't worry Danny, they will slow down soon as I'm off to foreign lands for a long vacation (if you are not in the UK then I know I'm already in a foreign land, but it will be even more foreign and exotic and where they serve cocktails at 3pm, yum). During that time Benny has refused to do the vidoes single-handedly (no thumbs, difficult to type) so there may be a temporary break in transmission!

    • @danljohnston
      @danljohnston 7 ปีที่แล้ว +1

      We are "cat sitting" a 3 leg rescue cat, Bentley, he LOVES Benny's videos. We will be ready when you return. Safe travels!

  • @MyBigThing2010
    @MyBigThing2010 7 ปีที่แล้ว

    well after watching this one...I'm SUBBED and now I have allot of catching up to do...I hope all you're vids are detailed like this...even the simplest broken down explanation is beneficial to new people like me...I'd rather watch a long, all inclusive video than fifteen, 2 min vids and still have not a clue....hope your channel grows like a bean stalk...if it's all like this one it deserves to. thanks for taking the time to put it together. a zoomed view of code screens would be great for us mobile users. thanks Shaun

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว +1

      And glad to have you aboard, MyBigThing2010! Most of my videos contain details aimed at a beginner (which is why they're "too long") as, like you, I don't want a trailer-style video I want the full monty! I'll certainly try and zoom in more on the code (I had no idea people were actually watching on a mobile, live and learn, hey?) Thanks for posting and do watch the other videos too!

    • @MyBigThing2010
      @MyBigThing2010 7 ปีที่แล้ว +1

      Ralph S Bacon I will watch em...I'm interested in the attiny85 usb 6 gpio vid immediately...cuz I've had one in my box of magic potential for like 3 months but have no idea how to use it for anything and I wanna get my $1's worth out of it haha.
      "too long" = NO such thing when it comes to tech stuff that's new to me. I will spend the hour happily watching if its not blabber about stuff that's not related or too fast paced that I'm not getting it ....I even rewatch long interesting videos because I often find that I retain more and pick up missed info from the first watch on the second time the around. *It's always better the second time around, ya know ;)
      any who, at just a brief glance I've seen a lot of videos of yours that I'm interested in checking out n I'm looking forward to you teaching an old dog some new tricks.
      yea, I watch a lot on mobile. I don't have an ISP that will service my address (rural) so I'm stuck with entertainment/info gathering on my mobile device..n often I have to watch it in 360p cuz my signal sucks or I'm being throttled by my mobile carrier....even when I have web access I still watch a lot on mobile... while driving, I listen in and even if I'm doing other stuff I'll play videos and listen to them while I'm coding, soldering, building, electrocuting myself, cleaning, setting fires, mowing the lawn, releasing the smoke monster, searching for where the smoke monster came from cooking etc HAHA ....no seriously though, I listen in with my Bluetooth speakers/headset and then watch again when I have time to look at the screen. I'd love to find some 2-3 hour full featured, start to finish, beginner to complete functional project videos....that would be great. so length isn't an issue unless you're talking about your cat's birthday for twenty minutes or talking really fast in clingon about coding language...then I'm gone. THANKS AGAIN for taking the time to make these for schmucks like me. btw, I "click thru" ads on channels I like so they get paid more...so I got your back on that front.

  • @hectorruiz2080
    @hectorruiz2080 9 หลายเดือนก่อน

    Hello! Your sketches are one of the cleanest and most elegant source codes that I've seen. I was a programming teacher and dev professional for 1.5 decades. I stopped doing that for the same period, now I have to "go back". I'm using Digital Pot for Cruise Control in my converted EV. Sometimes the chip does not respond to "up and down" buttons and some times the Nano does not obey to anything. If I "reflash" (upload) the compiled code to the Nano, it all works again. Why is that? I'm using the same pot chip, but another code.

    • @RalphBacon
      @RalphBacon  9 หลายเดือนก่อน

      I would put a couple of Serial.print statements in the pin handler ISR (only and purely for debugging. Just send out "U" or "D" so you can tell they are working or not).
      The other thing to do is to ensure the Watchdog timer is implemented. That way, if the Nano stops, the watchdog will jump in and reset everything.

  • @WagonLoads
    @WagonLoads หลายเดือนก่อน

    I have 2 of the following units. I plan to build a dual output power supply
    where the outputs are floating in respect to each other so they could be
    used separately or in series...
    I have a 20A, 1.2v to 36v 300W Buck converter with separate pots
    for adjusting volts and amps..
    The control chip has it's label sanded off, but I found info that
    the chip might be a LM5116, if that datasheet would help. But the
    datasheet does not give an example of this type of supply.
    The board uses 20 turn screw adjust pots on the PCB.
    The picture shows 104 pots, but the unit came with 503 pots.
    I do not know what volts are applied to the pots,
    but assume it is within their limits.
    So if I want 2 supplies to be floating and controlled by i2c from
    the same esp32, that means I need each digital pot to be opto-isolated,
    to control them using i2c.
    I plan to control it with a esp32 that fetches values from json.
    Then it measures the output volts with an ADC to ensure output
    matches requested value..
    Is there a digital pot that fits my use case?
    Or would the voltages at the POTs be able to be PWM controlled,
    eliminating the need for a digital pot?
    Could I replace the original pots with a opto-isolator that
    I can send PWM control into to adjust volts and amps?
    This seems like the simplest solution if it works at all..

    • @RalphBacon
      @RalphBacon  หลายเดือนก่อน

      Remember that a digital pot like the one here has almost no power rating at all, perhaps 0.1W at best. So any digital pot that you use can only be used for signalling purposes - other than that this one is fine, or you can get different values, 50K, 100K and so on. So a 503 is a 50KΩ resistor.

    • @WagonLoads
      @WagonLoads หลายเดือนก่อน

      @@RalphBacon Here is a simplified description: These pots are used like the pot going between circuit GND and the GND pin of a LM7805, so that you can adjust the output V. Add to that, a pot between the output pins of the 7805 for current adjust. The 2 pots are at different potential.. Now if I had 2 of those circuits powered by separate transformer windings so they float, then I could connect the outputs in series...
      If I replaced those pots with i2c controlled digital pots, the i2c side needs to be opto-isolated from the pot side, so that potential differences between pots don't make magic smoke..
      That is what I am trying to solve, but the buck converter is much more complicated than a 7805.
      I want to power each buck converter from separate windings, so I can connect the output any way imaginable.
      If the pots are not opto-isolated, then I need to use i2c opto-isolator at each pot input...
      That would also require isolated power rails for the pots.
      I hope you understand my concerns...

  • @luthfiajjabbar7870
    @luthfiajjabbar7870 4 ปีที่แล้ว +1

    Hi ralph, can the adder circuit use a variable resistor to replace the existing potter in the adder circuit??

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      If you are asking whether this digital pot can replace an existing pot in an audio circuit the answer is: MAYBE. It must only be used for signals (not current). Measure the current going into the existing pot before swapping out, is my recommendation.

  • @WagonLoads
    @WagonLoads 24 วันที่ผ่านมา

    The problem with digital pots is limits on voltage levels and
    if you want to control 2 devices that could have a potential difference
    of 100's or 1000's of volts between unit 1 and unit 2..
    There are a ton of videos on how to control a servo with a pot,
    but what if you want to turn a pot with a servo?
    I don't know what kind of link to get..
    Are there servo to (1/4 inch pot round shaft) adapters?
    My only thought is to use a continuous rotation servo to turn a 10 turn pot.

    • @RalphBacon
      @RalphBacon  10 วันที่ผ่านมา

      Using a mechanical servo or motor to turn a pot is well established. I did a video on a motorised volume control and that works well, but it's mechanical (nothing wrong with that) not digital.
      A stepper motor would probably work best.

  • @alanknight2204
    @alanknight2204 7 ปีที่แล้ว

    I have just ordered 10 of the 8 pin DIL version for £4-45 from Ebay . I used them many many
    years ago , perhaps when they first became available ( when I expect they cost a lot more ).

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      Wow! 10 of them Alan, I'd be interested in any projects that you're going to use them in. That price makes them very cheap (cheaper than a real potentiometer) and dust proof too!

  • @hansdegroot652
    @hansdegroot652 4 ปีที่แล้ว

    About he changing of volume all the time. With this digital pot meter driving and amplifier and a microphone measuring the average decibels it should be possible to sort of keep the volume sort of the same (normalized) automatically? It would be great for those noisy you tube adds. Thinking about that, If it were that easy we would have normalizing audio drivers in windows there days I guess.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      You shouldn't need a mic - it could all be done internally.

  • @hummusdude
    @hummusdude 4 ปีที่แล้ว

    I tried using a Dpot on the output of a waveform generator project I did for a college class last year to make the output amplitude adjustable. Strangely, I found that the version that is sold on the board with the caps was frequency sensitive. When the output sine wave frequency increased the the amplitude decreased. I assumed it had something to do with the presence of the caps ( perhaps a low pass filter effect?) because I repeated the setup with a stand alone X9C103 that I inserted into the circuit and there was no attenuation with change in frequency.
    So now I'm building an audio power amp for fun and I want to put a volume control on it so it doesn't turn on crazy loud if the input happens to be high. I can use an old school audio pot no problem but I'm thinking about a Dpot again because 1) this is a portfolio builder project and 2) Great Scott has a video where he demos how to hack a hard drive to create a rotary encoder. The amp is built and works great. I'm in the process of building a case for the components and now is the time to figure out the volume control. I'm thinking nano to interpret the encoder and to drive a Dpot but I'm a little worried about the frequency sensitivity thing I encountered last year. I'm encouraged that you are recommending these for audio applications. I'm wondering what is the purpose of the caps on the X9C103 board?

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Short answer: I don't know what the caps are for other than as decoupling capacitors between VCC and GND on the chip. But you would not need 4 caps for that. The datasheet does not mention them either, as a requirement. Why not remove them and see what happens, or draw out the circuit diagram from the PCB to see where they are placed? Leave any VCC/GND pairs and remove the others.

    • @hummusdude
      @hummusdude 4 ปีที่แล้ว

      @@RalphBacon That's brilliant! I see I jumped to conclusions about what the possibilities of using the dpot are. thanks for you reply and for this video!!

  • @thepvporg
    @thepvporg 7 ปีที่แล้ว

    I just bought 5 of these for that same price but its the IC's and surface mounts too, looking forward to having a play.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      Have a play indeed, Mark, but do bear in mind the following caveats: these are meant for signal processing not high voltage/current control, so watch what you're trying to do with them. Also ensure that no voltage exceeds 5v on any of the pins. I've used them successfully to control volume on an amp (briefly just whilst testing, which is possibly their primary intended purpose?) and to update the analog value on an Arduino's analog input pin. All worked just fine. Good luck and do post back any success you have!

    • @thepvporg
      @thepvporg 7 ปีที่แล้ว +1

      I have yet to decide on any particular project, I am being side tracked too much but have ordered an array of Arduinos and various bits of kit to add to the small number of items I already have.

  • @Friendroid
    @Friendroid 7 ปีที่แล้ว

    always a pleasure to watch your videos. I had these ICs in my ebay wishlist and now i'll take the plunge.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว +1

      That's great news, Friendroid, I'll certainly find a use for one or two here too! Thanks for posting.

  • @theplaidgamer1653
    @theplaidgamer1653 ปีที่แล้ว

    Hello i need some help with this module. I want to use it as a volume control by connectung the potentiometer to an audio amplifier and using 2 pysh buttons to control the potentiometer value (up and down button). Is that possible with this? How could i go about doing that?

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      This is the exact use for which this device was made. There is surely an example sketch on the manufacturer's website that shows this use case?

  • @ElmerFuddGun
    @ElmerFuddGun 7 ปีที่แล้ว

    Keep in mind for an audio volume control you normally use logarithmic taper potentiometers. As such using this 100 position linear digital pot will be limiting in usefulness. Remapping and jumping in logarithmic steps will help but you won't end up with many steps or much range. A higher resolution digital pot is recommended.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      This was mentioned in an article I read about this device, #ElmerFuddGunn, and they reckoned by mapping to a more logarithmic movement (by the Arduino) it worked pretty well. 100 steps is not a huge number but the last few will make the speakers rattle (or distort) so maybe the very high end could be skipped giving more steps for 'normal' listening levels? Good point you made there though, thanks for posting.

    • @boblewis5558
      @boblewis5558 6 ปีที่แล้ว

      There is a way to approach both log, antilog and log/antilog results (left/right balance) by using a normal higher value r
      resistor in parallel to high side or low side or both.
      This is a technique I learned over 40 years ago from a very smart Danish engineer, with whom I worked when I was a student doing one of my electrical and electronic engineering degree sandwich course industrial placements.
      I discovered this article that describes the situation very well and by suitable choice of ratios a pretty close approximation can be achieved to a normal log curve. Remember, a normal log pot ISN'T anyway, it's a twin (or more) straight line approximation which is usually good enough to fool our ears..
      To understand this is easy provided you understand parallel resistance calculations (Google if not 👍😁)
      This article describes the problem in some detail. BEWARE the warning about too low an overall resistance at the high end of travel. Oops! Forgot the link!
      e2e.ti.com/blogs_/archives/b/thesignal/archive/2012/10/22/logarithmic-potentiometers

  • @minravex2326
    @minravex2326 ปีที่แล้ว

    Hi ...Buddy....can u help with a video ....I want to use to reply rotary potentiometer on amplifier.....possible?

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      Yes, this device can act as an electronic volume control. Signal and ground to the outside connections, output (to the main amp) via the slider.
      Failing that, this also works well:
      Video #183 th-cam.com/video/XhNiR7XvUVo/w-d-xo.html

  • @NeonblueIndustries
    @NeonblueIndustries 5 ปีที่แล้ว +1

    SO, if you choose not to store the resistance value with the CS pin HIGH, What value does the Chips wiper reset to each time? VL (0), half way or VH +5V?

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว +1

      All the datasheet says is: "When the device is powered-down, the last wiper position
      stored will be maintained in the non-volatile memory. When
      power is restored, the contents of the memory are recalled
      and the wiper is reset to the value last stored."
      I'm guessing that from the factory the last value stored would be zero. Nothing else would make sense, really.

    • @nobody2254
      @nobody2254 5 ปีที่แล้ว

      Greetings; Thank you both for your replies. So the value is never stored if I don't touch the csPin. Superb.
      My doubt was mostly because whenever I took power out of the x9c pot, it would always restore the last position. Then I began wondering where the saving was performed. If it is the csPin, it's just fine. This because of a for loop that is in my code. I really wouldn't want to save 100 times each time that method (subroutine) is called.
      Really appreciate your prompt replies. Thank you

  • @agaelema
    @agaelema 7 ปีที่แล้ว +5

    Hi Ralph,
    Whats IDE are you using? Eclipse for Arduino? looks better then the tradicional IDE.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว +4

      Yes, agaelema, it's Eclipse v4 and generally works well (but it does give compiler errors on some libraries that don't adhere to strict C++ standards, so you have to be prepared to fix them). If you just want a step up form the standard Arduino IDE try the Sublime Text Editor (I did a video on this #69). Nice to hear from you.

    • @agaelema
      @agaelema 7 ปีที่แล้ว

      Thanks for the answer Ralph.
      I'm using Arduino for some tests but I like the MSP430 line and the CCS IDE with lots of functions. It's a little frustrating to use the native Arduino IDE.
      After your video I started to search about others IDE for arduino and found the eclipse version. Some videos use the plugins available in the Eclipse market. Have you tried the Sloeber?
      I like your videos, they are very interesting.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      Glad you like the videos, agaelema! The Sloeber you refer to is the Eclipse V4 with the Arduino add-in all bundled up (with a nag screen). I'm thinking of trying out the Atmel Studio, but that's for another day...

  • @mahlonkarpaiya252
    @mahlonkarpaiya252 ปีที่แล้ว

    Im a new subscriber due to you detailed vids.
    I have a question, i have a 8 ch amplifire and wanted to use digi pots like the one you just tought me about. Could i use 1 arduino to control 8 of these modules. Thanks

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      Welcome! Yes, you just need 8 free GPIO pins, one for each X9C103 module. I would suggest trying it out with just one first (eg Master Volume) to make sure it all works as expected.

  • @RalphBacon
    @RalphBacon  7 ปีที่แล้ว

    @Maurits I can't reply to your comment (I've tried a dozen times now) and TH-cam says no! What I tried to post was: Yes, there is Maurits, just keep the INC line LOW whilst you bring the CS line HIGH. This brings the device into standby mode but doesn't write back the current value to non-volatile RAM. Sounds like an interesting project you have in mind there!

    • @mdijkens
      @mdijkens 7 ปีที่แล้ว

      Thanks for clearing that out Ralph. Love your videos btw.
      Yep, I'm trying to control a cheap buck/boost based on max output power measured by INA219 and controlled by an ESP-12E. Therefore the easiest would be to replace the standard 10-turn trimpot on the buck/boost by this digital pot

    • @ElmerFuddGun
      @ElmerFuddGun 7 ปีที่แล้ว

      Maurits Dijkens - Don't forget to consider how much range and resolution you need. Is 100 steps enough resolution to replace that 10 turn pot? That's only 10 steps per equivalent turn on that pot but maybe you don't need that entire range? Also, take a good look at the schematic for the buck boost converter to make sure it doesn't exceed +/- 5V on any of the pot's pins. It might work.

  • @m0gga
    @m0gga 7 ปีที่แล้ว +1

    Hi Ralph, once again another great tutorial on a subject which may be of use in a project I am working on.
    I have just upgraded the volts and amps analogue meters on one of my bench power supplies to seven segment LED display modules which have a five digit accuracy but I can not take advantage of this accuracy because of the coarse voltage and current limiting potentiometers.
    I wanted to fit ten turn potentiometers but this is not possible because of the space restriction between the PSU fascia panel and the circuit board. Could digital potentiometers take the place of the existing potentiometers, and could the interface be via rotary encoders by modifying the code? What are your thoughts on this? I am not sure what the current draw is on the existing potentiometers.
    The PSU is 0 to 30 volts at 2.5 amps, there is plenty of room inside the case to accommodate the Arduino and associated electronics, and rotary encoders would be an elegant solution!
    Thanks.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      That's a good proposal Fred, just make sure that there is no more than +5v and -5v on the ends of the potentiometer pins or that magic smoke may escape. And a max 4mA current draw too.
      Rotary encoders could definitely work here (there was a query whether it could work with *just* a rotary encoder and no Arduino but I haven't figured out how that would work yet). I've done a video on Rotary Encoders BTW. I would start by (carefully) measuring the voltage on your existing pots, and if within range then measure the current down the wiper.

  • @speedoshopmmx
    @speedoshopmmx ปีที่แล้ว

    Hello I try to use a x9c102 to control a gauge but I can’t this gauge works with a signal from the gauge and I use a potenciometer fon 0 to 160 Homs but I can’t control from this resistance can you help me pls

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      Your best approach is to follow either my example or the manufacturers example, so that you know how to get it working. Then you can try it with your own code to control a gauge.

    • @speedoshopmmx
      @speedoshopmmx ปีที่แล้ว

      @@RalphBacon
      I repair clusters and some modules of cars bu I don’t have experience in this, I want to use like a tool for my work and you video loos amazing, or you can sell me a code pls?

  • @snnwstt
    @snnwstt 6 ปีที่แล้ว

    I initially though to use two of them to implement a "precise" timing for a 555 in astable mode (well, more precise than with analog potentiometer), but given the low amperage they can drive, so extra elements needed to add, I will probably go with a crystal and digital counters for a much better precision.
    They can probably be used with a shunt voltage regulator (such as the TL431), since they will be in parallel to the main current, their limitation will be less of a problem there, and then I could easily obtain a "relatively precise" (digitally controllable and stable) voltage output.

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว

      Yes, you do have to be careful of the current limitations of these devices, snnwstt; they are not designed to sink current, rather to potentially divide! Using a shunt should work but I haven't tried it, perhaps you will be the first? If so, let us know how you get on!

    • @snnwstt
      @snnwstt 6 ปีที่แล้ว

      Sorry for the delay.
      Not really the best performance (mostly when the variable resistance is at its minimum), but doable within the specs, see: th-cam.com/video/YmL5R00cPk4/w-d-xo.html
      Not recommended, though, if you don't STRICTLY need a CONSTANT voltage, since PWM would be more economic in performance of power used. I also suspect that the suggestion made by Xicor about using an OpAmp could be more versatile in possible ranges of voltage output. But the TL431 is much cheaper (it is also known as a LM431, I don't know why, even Texas Instrument use both names), and interesting.
      Design:
      R1 is limited by the 4.4mA limit that will have to pass through the X9C. and since the voltage at R1 is known to be 2.5V, R1> 2.5/4.4E-3. We also know that we cannot have more that 5V through the active pins VH/RH - VL/RL of the X9C, so R2

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว

      A bit of a disappointment then, by the sounds of it. I certainly intend doing something with this device (other than a demo) once I have new premises and can find all my components again. Maybe then it will be time for an update, incorporating your findings too. I shall also look at the LM431/TL431 to see how it compares - and as you say it's actually cheaper it might be a better all-round choice. I wonder if this device is just designed as a volume control and not much more? Thanks for the update, though, snnwstt.

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว

      Found this comparison, might be interesting in knowing which device to select: e2e.ti.com/support/power_management/etc_power/f/216/p/552603/2022611

  • @miftahq1
    @miftahq1 ปีที่แล้ว

    Possible for add rtc for schedule setting potentiometer

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      Yes, or use an ESP32 (or other Wi-Fi enabled microcontroller) so you have access to an NTP so you can get the time and change the setting at particular times, for example.

  • @hansdegroot652
    @hansdegroot652 4 ปีที่แล้ว

    I was thinking to use this digital potentiometer to replace the small pot meter on those cheap ali ex mppt solar controllers (cost about 4.6 euro). They use a pot meter for tracking but you have to do it manually. So I thought to add an arduino to control a digital pot so I do have automatic power point tracking. But Since those small blue pot meters take many many turns and thus are very precise I fear having 100 steps would be very crude for this. But so far I have not been able to find better ones. Any suggestions?

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I don't know of any other digital pots, I'm afraid. You should try it out to find out if it is not enough resolution with 100 steps.

  • @ShopperPlug
    @ShopperPlug 3 ปีที่แล้ว

    What kind of power this digital potentiometer handle? 1/4th watt?

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      Probably less than that. It's not designed to dissipate any power, it's more a signal potentiometer, so use it like that.

  • @sickvic3909
    @sickvic3909 7 ปีที่แล้ว

    Benny said if u show us how to use tabs to combine, edit libraries or examples or code whatever, we wouldn't have to pull remaining hair out and he would stop shedding. I've never figured out how to add code 2 code. Not many follicles left. I had a Benny named Penis, used to hide and jump on my chest when I came out of the shower, never a scratch, total trust. He knew a joke and enjoyed making me laugh. More human than same.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      TH-cam took exception to your email which is why is didn't appear here for ages! I wonder why? I'll do my best to include some hints on how to use tabs and combine code and whatnot, but as you know my videos are already too long so I don't want to extend them even further. But I'll do my best for you Vic. Nice to hear about your cat, not sure about his name though, poor thing.

  • @maxximumb
    @maxximumb 7 ปีที่แล้ว

    nice video. It's given me an idea for a mod for my DIY bench power supply.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      Not just you Maxx, see the post from Fred Morris here too. And now that everyone has mentioned it... hmm, yet another thing to add to the to-do list! Good to hear from you Maxx.

  • @NeonblueIndustries
    @NeonblueIndustries 5 ปีที่แล้ว

    To connect this up to vary a stereo line signal, would you use this digital Pot to control the base current of the right transistor? I'm keen to see the volume control setup you implemented.

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว

      No, you can't use this to power anything (not even base current). However, I did pass the audio through this to the base of a suitable (amplifier) transistor. I seem to recall that I used this with the MP3 player module and it all worked as expected. This one is only 10K resistance, the 50K or 100K might be better for some applications. It's been a while since I did this video, though!

  • @Mr06lh
    @Mr06lh 5 ปีที่แล้ว

    could you use this style of setup for controlling a Desk and and making it a wireless controllable fan
    i get the code and stuff like that might be diffrent but as for the basics ie the chips and so on could that be repurposed to control the fan or would that be to much power for such a little switch
    if it is to much any other options that could work?

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว

      To control motors, Lukas, we never use any kind of resistance. A resistor (even a big, wirewound one) would get hot but more importantly, the voltage supplied to the motor gets very small and the motor has no power left.
      So what we do to control motors is use something called Pulse Width Modulation (PWM) which sounds technical but is actually as easy as pie. And an Arduino already has the facility built in! We electronically switch the motor on and off thousands of times a second (that's the pulse), at full power but for varying length pulses (that the pulse width).
      I've done a few videos on this ( *see videos #14-#15 and also video #72* ). My desktop 5v USB fan is controlled by an Arduino doing this. Does this help?

  • @gangstergeek8910
    @gangstergeek8910 5 ปีที่แล้ว

    Hi Ralph, firstly i would just like to say excellent videos and thank you for your work.
    I am currently working on a little project that i seem to have hit a wall with and as wondering if you could offer any advice in the direction i should be looking.
    I am trying to get my cars steering wheel radio controls working with my aftermarket head unit. The problem i am currently facing is that the aftermarket stereo i have purchased uses two wires and looks for a resistance change across them to detect a button pressed ( these values can be mapped within the stereo the resistance value isn't important ) the two wires are GND and Key1 (3.3v). Unfortunately my car uses iBus to send messages to the original stereo so its not a simple swap over but i have purchased a can-bus module so i can process these messages and the aim was to use the arduino to control the resistance across the two wires GND and Key1 so i went and purchased a couple of the modules used in this video with the hope i could use them for this purpose. i have not been successful so far and was wondering if you could offer any advice. The main problem i am having is that i need the resistance value to be set across the two wires instantly and not incremented and this will set off a button press every time the value is changed. Any help you could offer would be greatly appreciated.
    Once again thanks for all your hard work and excellent videos.

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว

      Thanks for your kind words about my videos, glad you find them useful.
      Regarding the issue you have, the series of events is:
      1. Steering wheel key pressed
      2. Signal routed via original iBUS to new CAN-bus module connected to Arduino
      3. Arduino successfully identifies that a particular button has been pressed
      4. You now need to present an instantaneous fixed resistance to the new head unit using two wires so it knows a button has been pressed?
      One of the two wires is not GND by any chance? Thought not. That would be too easy.
      Have you thought about a reed switch with a series resistor? Works for burglar alarms, could work here too. Your Arduino would switch that open or closed (a bit like a relay but a reed switch is a much lighter implementation).
      Let me know that one of the two wires going into the new head unit is not GND (you could then use a MOSFET). If you find my email address in the About tab of my channel (use a PC or Mac not your phone) we can continue this off line.

  • @nobody2254
    @nobody2254 5 ปีที่แล้ว

    Greetings;
    I'm trying to understand if the POT always Writes to EEPROM; or if there's a way to use it without Storing Values. My intention is to control a 1602 LCD Luminosity According to Environment Light.
    I don't really need to store values to EEPROM (unless I'm forced to).
    My issue so far is understanding which PIN enables the Store function? Is it "CS_PIN" or the "INC_PIN"?
    In this project we have a method to store the value. In my project; I'm not using this method; yet the POT still stores last state / previous value. Does this mean, it will always store the value independent if power is off? If so; why does Ralph has a storing method?
    I'm a little bit confused. Can anyone help me out figuring the best solution? Tips or Advice will be highly appreciated.

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว +1

      In one of the demo sketches I show how to write to EEPROM only _once_ per session, so if you are changing the values in an LED dimming function it doesn't write each value away each time, just at the end of the adjustment. So maybe you can just not do it at all..? I can't be more specific as I did this video a while ago but I know there was some method of controlling this.

  • @elmergloo3259
    @elmergloo3259 5 ปีที่แล้ว

    Are there any amplifier boards that already have digital controls for an Arduino or ESP8266? I have searched online for months and I can find digital pots, but don’t want to how to modify existing boards to work with it.

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว

      I've not found any as such, but then again if that feature is not specifically advertised then we would never know. Could you not have the amplifier's pot turned up to full but put a digital pot in front of the input?

    • @elmergloo3259
      @elmergloo3259 5 ปีที่แล้ว

      Ralph S Bacon yeah... I could. I guess I’m just lazy lol

    • @elmergloo3259
      @elmergloo3259 5 ปีที่แล้ว

      @@RalphBacon Actually after considering a digital pot again I realized why I had issues before. The amplifier boards that I want to use it with have this potentiometer on it. www.ebay.com/itm/NEW-B50K-50k-ohm-6-pin-Linear-Rotary-Potentiometer-for-power-amplifier-/130709955378
      It is a 6 pin potentiometer and I can't find the manufacturer data sheet for it. I can't tell what each pin is doing. At first I thought they were just two potentiometers controlled with one knob, but the pins and resistances aren't the same. Even if I figure this out I'm worried that I will need two digital pots just to control one knob. When the system I am trying to control has two of these potentiometers that I want to digitally control which could potentially require 4 digital pots. This is why I have been looking for an easier solution. If an amplifier board already existed with digital volume controls I would buy it right now to avoid the hassle.

  • @jakob.schall
    @jakob.schall 6 ปีที่แล้ว

    I noticed when you used the buttons to increment and decrement the LEDs, they didn’t change until you released the button. Would there be a way to change the code to have it update the stored value after each change to have more responsive feedback? If I were adjusting volume by just listening, having it as it currently is would be hard to do accurately. Thank you

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว +1

      Um, not sure that I fully understand your question, Jakob. The "update" you referred to was only updating the NVM (non-volatile memory); the actual volume was still being updated in real-time. Once you release your finger the current volume setting is stored in the NVM of the device so that the volume is restored after a power down. Does this clarify things for you? Thanks for your question, it will help others too.

    • @jakob.schall
      @jakob.schall 6 ปีที่แล้ว

      Ralph S Bacon yes thank you, that makes sense. I was just curious as to why the LEDs that were illuminated didn’t change until you had released the button switch

  • @aarondavis4699
    @aarondavis4699 5 ปีที่แล้ว

    Is it possible to send a value using serial monitor? and then the digital pot changing to that value?

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว

      I suppose you could do that programmatically, Aaron. Read the serial port and set the value on the pot, as long as the value is in range, of course.

  • @jpcme2002
    @jpcme2002 4 ปีที่แล้ว

    Dear Ralph can we do the opposite ? I mean having a code that decide the value of the step , send to the chip with Analog write and get the equivalent resistance value?

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I don't think there is a function to tell you what the current step is (but I may b wrong). The datasheet will tell you whether you can interrogate. Of course, if you do what I did and store the latest value in EEPROM you could read that instead (not quite the same thing, I know).

  • @grahamwise5719
    @grahamwise5719 7 ปีที่แล้ว

    Is possible just use a rotary encoder to do the up down and the push switch to do the cs signal to save the pot position? No Arduino at all, just this chip and the encoder?

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      Interesting idea, Graham. The rotary encoder gives you two signals, and depending on the rotational direction one of them will be high (or low) when the other one goes high. Not sure, I'd have to draw this out. You couldn't use the push switch to store the value as this requires the INC / CS lines to be high at the same time (the INC before the CS). Needless to say all this could be done using a rotary encoder WITH an Arduino but I'll see whether I can figure out the logic of whether it will work all by its lonesome.

  • @DarthMaul41
    @DarthMaul41 3 ปีที่แล้ว

    I am looking forward to use digipots in my project. Is it really necessary to complicate that with an arduino? I suppose these digipots should be controlled by digital signals so a simple signal generator should do the job, right?

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      These need to be controlled by something; I would have thought an Arduino is simpler (and more precise) than trying to generate signals by a "simple" signal generator. But I'm sure it could be done (you need two signals if you tie CS to GND and don't want to store the new value in EEPROM) and the timing doesn't seem to be critical. You could probably do it with a couple of buttons!

    • @DarthMaul41
      @DarthMaul41 3 ปีที่แล้ว +1

      @@RalphBacon Thank you for the response! I basically just need an up/down set of buttons, nothing fancy. Will try to build something :)

  • @sweetleaf7751
    @sweetleaf7751 5 ปีที่แล้ว

    i would like to make an IR digitally volume receiver without Arduino.for a sound bar that can not be controlled with remote,by adding it inline.perhaps sending pulses to a potentiometer. to raise volume up and down but I find no schematics online

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว +1

      So if you don't want to use an Arduino what's going to process the received signal from the remote control? A potentiometer knows nothing about pulses. Perhaps you should look at motorised pots (with supporting electronics) from somewhere like AliExpress, Banggood or even eBay to see what they can offer you, they are not rare.

    • @sweetleaf7751
      @sweetleaf7751 5 ปีที่แล้ว

      @@RalphBacon Yes Thank You i may look into that as a possibility for Motorized Pots.

  • @agustemygunawanbloem7398
    @agustemygunawanbloem7398 5 ปีที่แล้ว

    if possible the tutorial is applied directly with separate power amplifiers, stereo 2 input (left-right) and left-right. using arduino uno r3, 2x16 type 2016 lcd + i2c, small amplifire power, my media player using cd music , thank you, hopefully it will be useful for all audio music fans. thanks Mr Ralph

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว

      You are most welcome AGUS TEMY GUNAWAN Bloem, I'm glad you like the video. Nice to hear from you.

  • @danztech1934
    @danztech1934 3 ปีที่แล้ว

    I like this project

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      I'm happy you like it!

  • @rajeebarch
    @rajeebarch 5 ปีที่แล้ว

    Plz can u help me how I can control my PC speaker volume with IR remote.....as the volume nob has damaged...so I directly connected the speaker subwoofer with male to male 3.5 mm jack....

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว

      This video is about a digital volume control not the infra red control of it, sorry. If your volume control has got damaged why not just replace it?

    • @rajeebarch
      @rajeebarch 5 ปีที่แล้ว

      @@RalphBacon thanks for your reply...but the thing is that analogue potentiometer got damaged quickly...so I want to make something which I can control from a distance; like TV remote...and will have no moving parts....if possible can you guide me anyway... I'll appreciate it greatly.

  • @Taran72
    @Taran72 4 ปีที่แล้ว

    Thank you for the video! I bought these already but I don't think I can use them for my project. I want to control a power supply with the arduino: I want to program the output of the power supply according to a pre-programmed sequence that I would code into the Arduino. ....I'll work on it a little more. Just wanted to say thanks. :)

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      It's nice of you to thank me, even if this is not quite the answer you were looking for.

    • @Taran72
      @Taran72 4 ปีที่แล้ว

      @@RalphBacon , of course: you explain things well. Usually your videos help me a lot.

  • @justinrutherford4116
    @justinrutherford4116 5 ปีที่แล้ว

    Is their a dual gang version of the pot your using in the video specifically a 50kohm version?

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว

      I'm afraid not, JUstin, but there's no reason why you can't run two of these in parallel (with separate connections to your Arduino, though). It sounds a bit clompy but it should work.

  • @nickkavanagh8094
    @nickkavanagh8094 4 ปีที่แล้ว

    Can anyone point me to resources to integrate the x9c103 with alexa voice control using esp8266? I want to be able to say Alexa, volume (variable # between 0 and 100), to control stereo volume (in place of analog pot).

    • @nickkavanagh8094
      @nickkavanagh8094 4 ปีที่แล้ว

      I'm using fauxmoESP arduino library and the device name is "volume". Ideally "Alexa volume up" would increment one position, while "Alexa volume 15" would set the wiper to position 15.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I'm answering this question in your other post - double posting is not a good idea Nick.

  • @christopherjustice9405
    @christopherjustice9405 6 ปีที่แล้ว

    Is there any nonvolatile digipot that required no programming?
    I want it to be like ad5220 using up/down pins....yet remember last wiper position at next power off.
    Any one?

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว

      I don't know of one, Christopher, but you could do what you want *very* easily with a cheap Arduino Nano and that AD5220 chip, using the Nano's on-board EEPROM to remember its last value. Look at videos #26 & #27 to see how easy it is to store a value in the EEPROM (these videos deal with a light- level value but it's all the same logic).
      Maybe not the answer you want though (ie it does involve a *small* amount of programming) so we shall see if others suggest other approaches.

  • @aldogonzalezc
    @aldogonzalezc 4 ปีที่แล้ว

    Great video!

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Glad you enjoyed it!

    • @aldogonzalezc
      @aldogonzalezc 4 ปีที่แล้ว

      @@RalphBacon I want to replace the analog potentiometer in my speakers so I can remotely control the volume with an arduino board. Do I need to exactly match the resistence of the analog potentiometer? I have only a 10k digital potentiometer. Could you please show your project so I can minimize mistakes? I don't want to fry the motherboard of my speakers.
      Thank you

  • @Mr_Wh1
    @Mr_Wh1 6 ปีที่แล้ว

    Would this work with a pga2311 chip?

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว +1

      You can use a PGA2311 with an Arduino, Dan, see github.com/AuteurAudio/arduino-volume-control but I must admit I haven't used that device, only the X9C103 used in this demo - but they probably work on the same principle.

    • @Mr_Wh1
      @Mr_Wh1 6 ปีที่แล้ว +1

      Ralph S Bacon Thank you, for the reply. The chip is usually used for audio related functions.

  • @judck
    @judck 6 ปีที่แล้ว

    Can it be used to control a PAM8603 volume?

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว +1

      I think these are designed as volume controls for amps, but until you try it you won't be absolutely sure. Look at the datasheet first before committing.

    • @judck
      @judck 6 ปีที่แล้ว

      Ok, I ordered some. Thanks!

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว

      Good luck with your project, judck and thanks for posting.

  • @lahirupamodya6188
    @lahirupamodya6188 6 ปีที่แล้ว

    sir, what is the IDE you are using?

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว +1

      I'm using Eclipse IDE with the Arduino add-in, see eclipse.baeyens.it/
      Good Luck!

    • @lahirupamodya6188
      @lahirupamodya6188 6 ปีที่แล้ว

      thank you, sir.

  • @jpcme2002
    @jpcme2002 4 ปีที่แล้ว

    you can feed with a outside power source but you need to have a common GND ;)

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว +1

      Indeed, common ground is neccesity.

  • @markopinteric
    @markopinteric 3 ปีที่แล้ว

    I am a RPi guy, but reading your program it seems you read potentiometer value by reading voltage on the potentiometer output? Quite a silly chip concerning you cannot digitally read its actual state.

    • @RalphBacon
      @RalphBacon  3 ปีที่แล้ว +1

      Very silly indeed.

  • @Enigma758
    @Enigma758 4 ปีที่แล้ว

    Due to the limited current capacity I think their application is limited compared to a traditional pot.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      Yes it is definitely more signal based than anything else. But this could control a MOSFET using PWM to drive much larger currents, easy to do by reading the analog value of this pot.

    • @ianrose6475
      @ianrose6475 2 ปีที่แล้ว

      Hi Ralph. Do you have a circuit diagram for this set up? Thanks

  • @plgmgua
    @plgmgua 7 ปีที่แล้ว

    Hello Ralph, excellent tutorial.
    I wonder if it can be connected to a ESP8266 to be able to control it from a network device.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      Could you elaborate a bit on this, Peter? For instance, would you see yourself turning up the volume of a hi-fi over the Internet? (Not a Real World example, I'm sure). Do tell!

    • @chrish7927
      @chrish7927 6 ปีที่แล้ว

      I see no reason why not. I might try doing this myself for two cheap amplifiers I purchased that only have manual volume control.

    • @chrish7927
      @chrish7927 6 ปีที่แล้ว

      So, for anyone wondering the answer is, yes you can. I just did this the other day for a project. Though I've since moved on to using the FM62429 since it's meant to be used for volume control and I need something that can increase in a logarithmic fashion.

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว

      Excellent! Thanks for confirming that. And now I will just have to investigate the FM62429, won't I? Thanks for posting.

  • @das250250
    @das250250 4 ปีที่แล้ว

    I like the idea of these chips but their write limitation seems a weakness because you can't update the lights as you decrement or increment and if you do you lose lifetime.

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      What I do in my sketch is only store the value once the adjustment has been made. So when moving from (say) 60 to 30, I only update at the 30 point, not every point in between. Works well.

  • @ismzaxxon
    @ismzaxxon 7 ปีที่แล้ว

    Is the output isolated from the control power ?

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว

      Yes, it is, Terry. The only (internal) connection, if you can call it that, is where the individual resistors are switched in and out but there should be no actual connection between the variable resistor connections and the parts of this chip. You got ideas for this chip too?

    • @ismzaxxon
      @ismzaxxon 7 ปีที่แล้ว

      Ralph S Bacon I need to change the resistance on a circuit which has it's own isolated power supply. I was going to use opto isolators switching resistors in and out, but these look like they are a better option. I live on a boat. All i have is 12 volt power. my main system control has its own power supply which is all isolated (even an ebay USB isolator) incase something goes wrong in the field. I was making NMEA instruments, which connect together. Thanks to you, i am now converting them all to MQTT. i can lose one instrument while sailing, but to lose them all at once means going back to paper charts without notice.

    • @RalphBacon
      @RalphBacon  7 ปีที่แล้ว +1

      Sounds interesting. Just make sure that the voltage on the variable resistor pins does not exceed +/- 5v (10 volts in total but that does NOT mean +10v and 0v!). And if I hear of a boat drifting aimlessly around the sea in the next few months I'll just check that "Terry" was not the captain !

    • @ismzaxxon
      @ismzaxxon 7 ปีที่แล้ว +1

      Ralph S Bacon most boats have all thier eggs in one basket. One failure means ALL stop working. By rolling my own, i can make a repair, swap out a board, download firmware and i am back on the air. The resistor is for fine tuning. coarse tuning is done with fixed resistors. i have to assume power up could be min or max. I will send the data using esp8266 wifi network.

  • @MrPatrickRey
    @MrPatrickRey 5 ปีที่แล้ว

    Hi, I'm trying to use a Digital POT to replace and analog one to automate a light fading up and down, on and off. 100% fade to full over 3 seconds, Hold for 1 sec, then 100% fade to zero over 3 seconds. Can someone help a first timer? Thanks!

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว +1

      The 'digital pot' you describe, sounds a lot like a simple, automated fade down and back up again without manual intervention. You can certainly do this with Pulse Width Modulation (PWM) on a small µController (eg Nano) connected to a MOSFET transistor, but what are the lights? Are they household voltage (mains voltage)? Still very doable, but mains voltage is dangerous, especially for beginners and I can't afford to lose viewers! Can you explain a bit more please, Patrick?

    • @MrPatrickRey
      @MrPatrickRey 5 ปีที่แล้ว

      @@RalphBacon Thank you VERY much for responding! You are correct in understanding what I am trying to do. I am trying to swap an analog 10ka pot with a X9C103S to automate fade up and fade down. I am working in a museum and we are building a 'peppers ghost' case so that a necklace appears and disappears every few seconds. The original lighting has its own 5v 6a power supply and 10ka pots for manual dimming adjustments. I assumed the Arduino may not supply enough power for the LED I am using so I was trying to simply replace the original analog potentiometer in the system by moving the VH VW VL wires to the X9C103S. I am now looking for the appropriate code to allow me to adjust the fade up/down times and on/off times. For example, fade from 0% to 60% over a 3 second period. Remain on for 2 seconds. Fade from 60% to zero over a 3 second duration. Thanks again!

    • @MrPatrickRey
      @MrPatrickRey 5 ปีที่แล้ว

      Thanks so much for offering to assist me with this project. After some more tinkering, I was able to get the LED to operate directly from the board without the potentiometer.
      The only issue I now have is that I need to add a delay to the 0 and the 255 levels of the fade. I’d like to hols at full and hold at zero for 1 second or so.
      I tried to add:
      If (brightness ==255
      delay(1000);
      Obviously my syntax is off. The code below is perfect if I can just create a delay at the 0 and 255 brightness levels.
      Have a great weekend!
      int led = 9; // the PWM pin the LED is attached to
      int brightness = 0; // how bright the LED is
      int fadeAmount = 2; // how many points to fade the LED by
      // the setup routine runs once when you press reset:
      void setup() {
      // declare pin 9 to be an output:
      pinMode(led, OUTPUT);
      }
      // the loop routine runs over and over again forever:
      void loop() {
      // set the brightness of pin 9:
      analogWrite(led, brightness);
      // change the brightness for next time through the loop:
      brightness = brightness + fadeAmount;
      // reverse the direction of the fading at the ends of the fade:
      if (brightness == 0 || brightness ==254
      ) {
      fadeAmount = -fadeAmount;
      }
      // wait for 30 milliseconds to see the dimming effect
      delay(35);
      }

    • @MrPatrickRey
      @MrPatrickRey 5 ปีที่แล้ว

      Thanks for your help everyone! Problem solved!

  • @stephencampbell9384
    @stephencampbell9384 4 ปีที่แล้ว

    I'm new to arduino and am loving your videos.
    But this one is giving me a sore head........do you only own one button?
    Why on Earth would you make such a convoluted choice?>

    • @RalphBacon
      @RalphBacon  4 ปีที่แล้ว

      I'm missing the point here, Steve, what do you mean by "just one button"? And what's the "convoluted choice" I made?

    • @stephencampbell9384
      @stephencampbell9384 4 ปีที่แล้ว

      @@RalphBacon OK, it's been a couple of days since I watched this......but aren't you doing a kind of one thing switches the next thing which switches the thing you want to switch thing?
      Just seemed odd.
      Still loving the vids :D

  • @huynhphat8831
    @huynhphat8831 6 ปีที่แล้ว

    how to reset the value?

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว

      In what respect, Huynh? "Reset" the current value? I'm sorry I don't understand the question, can you please elaborate for me?

    • @huynhphat8831
      @huynhphat8831 6 ปีที่แล้ว

      sorry, my English is not good. For example, R(m)~ R(h). How to reset R(m) to R(l) just one time(not 100 timers). Thank you so much.

    • @RalphBacon
      @RalphBacon  6 ปีที่แล้ว

      Let me see if I understand your query: you want to set a particular arbitrary value rather than in/decrement the value many times until it reaches that value?
      I'm afraid I don't know of a way of doing that. I don't think the chip supports it. But remember, you can execute many up/down pulses per second (read the datasheet to see what the limit frequency might be). www.intersil.com/content/dam/intersil/documents/x9c1/x9c102-103-104-503.pdf
      Once you have reached your required value then, and only then, will you store the value into the non-volatile memory. In this way you could, for example, quickly mute a signal to zero (in a for loop) in about 1/4 of a second I estimate.
      I hope this helps!

    • @huynhphat8831
      @huynhphat8831 6 ปีที่แล้ว +1

      Ralph S Bacon thank you!

  • @landyandy
    @landyandy 5 ปีที่แล้ว

    Really a well done explanation. But I have a doubt. In an analogue potentiometer, I can hear the incremental variations of the sound instead with this potentiometer I understand that the sound remains unchanged until the button is released. So how can I tell if I'm increasing the volume to maximum?
    Can I prevent the amplifier from destroying my eardrums and give me a heart attack? :-) Bye

    • @RalphBacon
      @RalphBacon  5 ปีที่แล้ว +1

      That's just the way I wrote the sketch, I suspect. You can always force the update at each turn. What you don't want to do is update the EEPROM with the new value until you have finished adjusting it.

  • @basiceducation1131
    @basiceducation1131 ปีที่แล้ว

    Please share a circuit fake engine sound for my home made real electric car

    • @RalphBacon
      @RalphBacon  ปีที่แล้ว

      Sorry, that's not how this channel works! You need to research that sort of thing yourself.