element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum X9C503 works with ESP32?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 17 replies
  • Answers 1 answer
  • Subscribers 385 subscribers
  • Views 2168 views
  • Users 0 members are here
Related

X9C503 works with ESP32?

Ricodora
Ricodora over 1 year ago

I can't get X9C503 to work with ESP32 but it can with Arduino Mega.

What do I need --> To be able to operate the X9C503 to lower the volume of an audio line input. I don't want to use common manual potentiometers.

X9C503 Scheme:

INC__| o o | VCC
U/D__| o o | CS
RH___| o o | RL
GND__| o o | Rwiper

In my case:
INC------| o o | VCC (5v)
U/D------| o o | GND
Audio in | o o | GND
GND------| o o | Salida

On Arduino Mega I connect everything directly to the board and the operation is correct.

In ESP32 if I connect it to the board it doesn't work, so I have used the 2N3904 diode for the 'INC', 'U/D' pins (I have also tried with 'CS' but Arduino Mega does it well being grounded), and It works but it doesn't do it well, I describe the problem:

You have to enter values between 0 and 99, and in general it does it well, for low values the volume goes down and for high values the volume goes up. I detected the problem by always entering the same value.

In this case it was '91', if I enter it several times in a row I get different results, normally the volume remains constant but sometimes it goes up, other times it goes down and even total silence occurs

With Arduino Mega I enter the '91' 500 times and the
The volume never changes, it is constant and its operation is always correct.

What could be the problem?
What other component can I use?

As an alternative, I have tried the FM62429, with ESP32 it works correctly, but it has the amplification function that does not suit me. For the line input I already use 22kΩ resistors, then the potentiometer and finally the MSGEQ7, it doesn't make much sense to change a potentiometer to lower the voltage and replace it with a component that can amplify. I can limit the FM62429 by code, for example, to 60% and only use it to lower the volume, although I don't think it is a very elegant solution.

Audio Line In -> 22kΩ resistors -> X9C503 -> MSGEQ7
Audio Line In -> 22kΩ resistors -> FM62429 -> MSGEQ7

Any ideas or suggestions?

[code]#include "X9C10X.h"
#define CSPIN 33
#define INCPIN 14
#define UDPIN 27
X9C503 pot;

void setup() {
Serial.begin(9600);
pot.begin(INCPIN, UDPIN, CSPIN); // pulse, direction, select
Serial.println("Introduce un valor entre 1 y 99");
}
void loop() {
if(Serial.available() != 0){
int value = Serial.parseInt();
if (value != 0) {
pot.setPosition(value, true);
delay(30);
Serial.print("Valor introducido: ");
Serial.println(value);
}
}
delay(100);
}[/code]
  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett over 1 year ago in reply to Ricodora +1
    Try adding resistors from the emitters of each of the 2 transistors to ground. There is nothing in your circuit to pull them down to 0V when the bases are pulled low except leakage current. If the…
  • michaelkellett
    michaelkellett over 1 year ago in reply to michaelkellett +1
    There is actually no need for the transistors at all, I would connect the control pins to the processor via a 10k resistor. MK
  • Ricodora
    Ricodora over 1 year ago in reply to michaelkellett +1 suggested
    I said the 4k7 resistor didn't work when I first assembled it wrong. Now that you've pointed out my mistake......IT HAS WORKED!!! What a great relief! mk you got it right, now if I enter the same value…
Parents
  • Ricodora
    0 Ricodora over 1 year ago

    image

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 1 year ago in reply to Ricodora

    The Arduino Mega uses 5V logic levels, whereas the ESP32 uses 3.3V levels, so there's a chance that the digital potentiometer isn't functioning with 3.3V levels. Did you remove the transistors when it was working with the Arduino Mega?

    If it's a genuine X9C503 then 3.3V logic levels ought to work. However the X9C503 in the photo doesn't look normal (the left side looks like it has chipped just below the top corner). It's normal for a lot of AliExpress chips to be fakes (with a sanded surface, remarked) so the chances of getting a genuine X9C503 from there might be low. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Ricodora
    0 Ricodora over 1 year ago in reply to shabaz

    In Arduino Mega I don't use transistors. And in ESP32 I have to use transistors for it to work (without transistors it does nothing)

    I have always thought that it works at 5V, but... and if so... Why doesn't it work with transistors? I don't have much experience but for the rest of the ICs that work at 5V I use them with transistors and they work.

    It's from AliExpress, I think it won't be original, but another thing is that it doesn't work. In fact it works on Mega.

    Because of your words I am going to buy right now in an electronics store. This IC is causing too many problems.

    Right now I'm going to buy in an electronics store in my country, but for the future... is there a global, reliable and economical store for electronics?

    Now I have new doubts and fears. I have bought many components on AliExpress such as resistors, cables, ceramic and electrolytic transistors, diodes, manual potentiometers... are these basic components reliable or should I also buy them in an electronics store?

    For example, the transistors I am using are extremely cheap, I know they are not original, but they are doing their job well.

    In my project I use few ICs:

    X9C503 -> Works with Mega but not with ESP32
    M62429 -> Works on ESP32
    MSGEQ7 -> Can't buy on AliExpress, never works.
    74HC4051N -> Works with ESP32

    Right now in the AliExpress shopping cart I have 74HC4051N x 100 = less than 9 euros. Should I buy them? Am I making a rookie mistake? To save money, should I use those AliExpress components that work for me?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 1 year ago in reply to Ricodora

    Glad it's working, this demonstrated that the product you have isn't an original/genuine part, because if it were, then it would have worked with 3.3V logic levels. You were forced to use the transistors as a result. The circuit would not have needed the transistors if the part was genuine.

    Regarding purchasing from AliExpress, you're OK with parts like capacitors, resistors, potentiometers etc. They may not be the best quality but should function electrically. With transistors and diodes, you will might obtain completely different parts, but often a jellybean part is OK. If you're doing something critical, if the part is used in a more sophisticated or high-performance way, then it wouldn't be worth trusting the AliExpress purchase. For ICs, I think it's more likely than not to obtain a fake/clone, so ICs are best avoided from AliExpress, unless you really know what you're doing.

    If it were me, I would definitely not buy 100 x 74HC4051N from there. You might get lucky, but each time a circuit doesn't work, you'll be unsure if a few or many of those ICs are faulty. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Ricodora
    0 Ricodora over 1 year ago in reply to shabaz

    I love AliExpress, I enjoy buying hundreds of cheap components, it gives me the opportunity to try many components that I would not buy originals...

    But I can't ignore the quality, the comfort and the good way. I don't want the quality of my work to be bad to save a little money. I will use only original ICs.

    I guess I had to have this problem with the X9C503 and this conversation with you to get on the right path.

    Great! Thank you

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Ricodora
    0 Ricodora over 1 year ago in reply to shabaz

    I love AliExpress, I enjoy buying hundreds of cheap components, it gives me the opportunity to try many components that I would not buy originals...

    But I can't ignore the quality, the comfort and the good way. I don't want the quality of my work to be bad to save a little money. I will use only original ICs.

    I guess I had to have this problem with the X9C503 and this conversation with you to get on the right path.

    Great! Thank you

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube