Problems with analog Demultiplexing (BU4052BC). Need a helping hand.

Hi there,

I recently found some old ICs in various old Messure-Devices, so soldered them out and tried to make some of them work. Same goes for the BU4052BC witch is a Dual 4-Chan analog Demux. So that looked nice to be able to control some LEDs seperatly. I hooked it up on my breadboard and it worked out fine when I added the first LED. It seemed to work out nicely. That single LED was perfectly fading from off to full brightness. So I added more LEDs, and it turned out that the more LEDs I connect the more all of them would be flickering. So I checked where to find the problem. First I checked the Frequency my Arduino nano could provide on my PWM out - no Problems here. Then I checked the frequency the IC should be able to deliver witch is hard to read out of the Datasheet, but all Values I found would be in nS, so I assumed that could'nt be the problem neither. So I looked at power consumption - I used some leftover LED-Strips witch i wired up through transistors and supplied it with an external 12v source. No changes at all. The more colors from the Strip i add the more it started to flicker.

Here's the corresponding Datasheet:

Datasheet

My scematic is attatched.

And finally some testcode:

// like ic 4051 (1x 8-Chan), 4052 (2x 4-Chan)
// smaresh


int icA = 6; //difine control pin A
int icB = 7; //difine control pin B
int comY = 10; //difine analog Output Pin = Common Y on IC


void setup() {
  Serial.begin(9600);
  pinMode(icA, OUTPUT);
  pinMode(icB, OUTPUT);
  pinMode(comY, OUTPUT);
}

void loop() {
  for (int i = 0; i <= 255; i++) {
    digitalWrite(icA, LOW);
    digitalWrite(icB, LOW);
    analogWrite(comY, i);


    digitalWrite(icA, HIGH);
    digitalWrite(icB, LOW);
    analogWrite(comY, i);


    digitalWrite(icA, LOW);
    digitalWrite(icB, HIGH);
    analogWrite(comY, i);


    digitalWrite(icA, HIGH);
    digitalWrite(icB, HIGH);
    analogWrite(comY, i);
  }
  Serial.println("new cicle");
}

Thanks in advance.

  1. You have no decoupling capacitors across the BU4052BC chip power lines.
  2. Your loop runs at an arbitrary speed without any clearly defined absolute timings so what you see is what you get.

It is quite possible that the analogWrite() frequency is beating with your demultiplexing frequency (controlled by the loop execution time), giving rise to the flicker you are experiencing. Maybe do one analogWrite(), hold it for a few tens or hundreds of mS, and during that time, distribute it over the 4 leds and repeat with a new value of analogWrite().

First of all, thanks for your hints.

Sadly I'm not familiar with decoupling capacitors, so it'll need some time to read about it.

You are absoloutly correct with

Your loop runs at an arbitrary speed without any clearly defined absolute timings so what you see is what you get.

. I had some delay in the loop for testing. I played a bit with the values of delay like u mentioned. it seems to work perfectly when i put a delay of exactly 2mS after each analogWrite. When i vary like giving the first output like a couple of tens or hundreds, this LED works and the other flicker. Even when I vary all with the same delay they start to flicker. My goal would be to control my 4 chanels seperatly in different speed. I'm not sure if this IC could achieve it, or if therefor I'll need an other type of component.

Decoupling capacitors: 100nF across the power rails GND/Vdd as close to the chip as possible. Your schematic does not show pin BU4052BC/pin 8 connected but it should go to ground.

If the goal is to have 4 separately conrolled leds, each with their own brightness, you could possibly achieve it with that chip because it can run really fast (up to 20MHz) but then you have to forget analogWrite() which runs at say 500 or 1000 Hz.

You'd simply keep the common high and manipulate A and B either in the loop, or in a ISR function controlled by a timer, to ensure that the desired LEDs 0..3 are on are on for the desired time during the cycle. Of course, there may be better ways of achieving the same thing but at least you then get to understand a de/multiplexer chip.

That old chip is also quite interesting in that it is specified for up to 20 volts. I'm currently working with similar series chips (still in production) to drive a vacuum fluorescent display which needs 20 volts.

thank you for your hints.

I looked up the speed analogWrite() could prevent, and it turns out that my nano can provide on pins 3, 5, 6, 9, 10, 11 pwm on 490 Hz but only on pins 5 und 6 980 Hz. So i adjusted my pwm pin from 10 to 6 and the flickering started bit later (when I used >8 mS for each analogWrite())

You'd simply keep the common high and manipulate A and B either in the loop, or in a ISR function controlled by a timer, to ensure that the desired LEDs 0..3 are on are on for the desired time during the cycle.

So I would be using the analog demultiplexer as an digital only modulating the analog outbut by setting the corressponding frequencies on my icA and icB pin. Correct?
That kind of feels like not using this IC porpuse. But anyway. Lets say I would like to control a larger amout of lets say non addressable LED-strips. My aproach would be use standard didigtal demultiplexer with 2-x addressable pins?

That old chip is also quite interesting in that it is specified for up to 20 volts. I'm currently working with similar series chips (still in production) to drive a vacuum fluorescent display which needs 20 volts.

Glad to maybe you''ll get something for your project, by helping me out :slight_smile:

smaresh:
. . .
So I would be using the analog demultiplexer as an digital only modulating the analog outbut by setting the corressponding frequencies on my icA and icB pin. Correct?
That kind of feels like not using this IC porpuse.
. . .

Correct. You'd be using the demultiplexer simply as a line decoder say this SN74LVC1G139 which does use its full potential.

smaresh:
But anyway. Lets say I would like to control a larger amout of lets say non addressable LED-strips. My aproach would be use standard didigtal demultiplexer with 2-x addressable pins?
Glad to maybe you''ll get something for your project, by helping me out :slight_smile:

I just want to go back to your original problem in an attempt to answer this.

The demultiplexer (or at least one side of it) allows you to select one of 4 output channels, at any one time, and apply an analog signal / voltage to the common which is transferred to the selected output channel.

If you selected a single channel, say Y0, then went through a full fade up and fade down process, then switched the channel to the next one, Y1, and repeated the fade up, fade down, and continued that cycle with Y2 and Y3, the chip would be working as designed and without the problems you have described.

Your problems are starting because you are attempting to use the chip to "distribute" at a particular frequency, a PWM signal across a number of channels pseudo simultaneously. Even if you didn't have the problems resulting from mixing the beating of the two frequencies, you'd still have the problem that the led display would be at a quarter of its normal brightness because, at any one time, a maximum of only one of the four leds could be lit.

If you can tolerate that, then you have to ensure that relative speed of the of the demultiplexer channel switching frequency was high compared with the frequency of the analog signal (pwm) you are switching. (but not so high that switching losses (the off period between switching from one channel to another) become significant.

One way of doing that is to use direct port manipulation (instead of digitalWrite)to speed up the switching between the output channels and carefully regulate for how long a channel remains on. Another is to use a timer to create a lower frequency PWM yourself or use an existing library. Maybe https://forum.arduino.cc/index.php/topic,19451.0.html . But you may then get flicker if this is too low.

So, in conclusion, if I have correctly understood what you want to do, I don't believe this chip is ideal.

alrighty, I achieved everyhting i wanted. Better understanding when to use de-/multiplexer. Thanks for that.

This thread can be closed.