CD 4051 (MUX / DEMUX) circuit

Status
Not open for further replies.

RetiredHAL

New Member
While I am waiting on parts and trying to solve another problem with power supply switchover in a clock project see https://www.electro-tech-online.com/threads/xtal-frequency-accuracy.134608/ I decided to see if I could cut down on wiring and I thought that the CD4051 (8X1, 1X8, mux/demux analog) would do the trick. As there are 4 digits to display and there are 7 segments in each display there are 28 segments to display per 1 display pass. To create a persistent display I thought 25 to 30 display passes per second would be adequate, which is roughly a 1 mSec sample per segment . And a variable 555 pulse to vary the segment display time.
Whilst this cct works with the 7 segment display (being an analog device) it will not allow data pulses to be multiplexed/demultiplexed as the chopping up of the signal cannot be used as a single clock pulse. So I will probably use this method to power a 4 number 7 segment display board using a 8 or 12 bit ribbon instead of a 32 bit wide bus.
I would be happy to look at other ideas to cut down on wiring, however I want to stay away from pics or similar.

I found there was very little on the internet to adequately explain how these 4051's works. So I include this cct as an example of how these ics work. Perhaps someone can use it to get a better understanding of how the chip works in its simplest form.

Note the pulse trains are representative. (very difficult to draw)
Note because of the solid segment at the 4026 is chopped there is no need to include resistors at the remote display as the display is lit by pulses and relies on persistence to show a non flickered display. I guess that the demuxed output could be manipulated with a capacitor to form a solid pulse again but this was not my aim here.
Note that this cct was created to show only how the 4051 mux/demux would be applied in my case. It may not suit your application, nor is this a definitive example. There are probably many more ways to use this chip.
 

Attachments

  • mux tryout1.png
    29.9 KB · Views: 2,340
Last edited:
I recall the CD4051 has a pretty weedy current output. Is this a real time clock i.e. HH.MM.SS
I've never seen a 555 (not accurate, will drift) used in a clock, you need a crystal or AC timebase.
 

To be fair, it's not a very good example - it's a pretty poor use for the chips, and nothing like they are designed for - it's simply an analogue multiway switch, I suspect you were perhaps confused by the 'multiplex' part in the name?.

A very common use for these chips is input switching on amps, or for multiple inputs to an A2D.
 
I am sure you are right and I did think that multiplexing was a way to distribute the data over an economical databus. I never intended this to be an example of the many uses of this chip (as I explained in my writings )
There are probably many more ways to use this chip.
. I agree with your example of amp input switching. I was merely looking at another way of utilising this chip.
I was looking for a way to minimise wire/solder usage. I would be delighted if you can point me in the right direction to mux/demux digital pulses from one board to another board. Keep in mind that I am a novice in this field and ideally I would like to stick with CMOS 4000 technology
 

You should probably be looking at logic parallel to serial/serial to parallel chips, essentially just sending serial data between boards.
 
I found that confusing, but that might be me, are you using the 4000 switch to switch a single led on the 7seg?
As allready pointed out 4000 series switches might struggle switching a led, a bc547 and a 10k would give you a buffer, but that multiplies your soldered joints.
For this application personally I think an unmultiplexed display would be the easiest and quickest.
If you really want to multiplex then you'd be better with something like a 74ls244 buffer and a 4017, the 4017 switching data from each digit 4026 through to the display via the '244, at the same time through a tranny switching the common to the 7 seg.
Yes a 555 is naff for timekeeping, look on google for a circuit that uses a watch crystal and a 4060, I've built a few cloks with pics using a watch xtal, timekeeping is spot on, and it'll probably be just as good with cmos.
There are some russian ic's on ebay that perform a digital clock function, with a built in mux, all on the same chip.
 
I do apologise if my post was thought to be an authoritative use of this CD 4051 chip. I discount it as a solution to parallel / serial / parallel digital data transfer. I included the cct only to demonstrate the possible use of the chip (mux/demux) for others who are thinking of using this chip. Personally. I had a lot of problems understanding / implementing the PDF data sheet. Although I have a more than basic understanding of electronics, cmos and associated technology are not my strong points. Therefore before I implement a cct , I like to build it before I use it. As such I had to use the 2 555's and 4026 to set up a "real" transfer scenario (mux/demux) environment. The only useful parts of the cct are the 4051 to 4051 connections and the node selections.
I do thank you for your replies.
Cheers RetiredHal
 
Hi Blueroom , yes I am trying to build a clock, Everyone wants to build a clock!! I am just hung up at the moment trying to figure out a foolproof way of switching between mains and battery backup. (See the link in my first post in this topic) I am thinking of an ICL7673 chip or else a permanent battery system (continually topped up) I am also waiting on other parts so in the mean time I thought I could investigate some ways to transfer data between boards. Whilst cmos is economical in real estate and still allows soldering of individual pins, (basically the limit of my eyesight and soldering skills) I will run out of board space and was going to stack boards, hence the need for economy in board to board wiring and soldering connections. I selected the 4051 chip because it sounded promising but it is not suitable for this application.
 
Look into these ICs.
CD4511 or SN7441

Don't bother muxing for a 4 digit clock, you're just adding complexity. As for battery backup just use diodes and blank the displays when the powers off. You'll also need a crystal and dump the 555's.

Of course now might be a good time to learn about microcontrollers. A PIC 16F886 or 18F2525 would be an excellent candidate and can be driven by a 32,768kHz watch crystal for the timebase. I used the 4022 as it was an educational kit, I could have simply used more I/O pins and reduced the parts count.
 
Hi Blueroom, I think that blanking the display will stop battery drain but will not stop the counters from being corrupted during a noisy power drop or spike. My problem with Pics is that I would need to learn how to use them and program them and this was not on my agenda. The project is gaining in complexity with each stage. I had hoped it would be the oither way around
Cheers
 
Programming microcontrollers especially PICs or AVRs are not tough, there are so many examples out there and hundreds of clock designs.
The DS1307 is a very popular real time clock with battery backup. But you need a microcontroller to talk to it.
A handy kit is the PICkit2 or 3, unless you need the latest and greatest the PICkit2 is a better value than the 3 as it includes a UART tool & handy logic tool.
Here's my clock kit instructions. You could add a DS1307 via the SDA & SCL pins on connector CON3.
https://www.electro-tech-online.com...y-digital-display-assembly-instructions-1.pdf

Assembly isn't the easiest to learn but it shows you the inner workings. Swordfish BASIC is very easy and the free SE version has plenty to offer. XC8 is Microchips C compiler, I'm learning it now and I'm not young. I do like it as it's easier than assembly but harder than BASIC.
 

It would be FAR easier (and cheaper) to learn to program a PIC, than build a clock from discrete antique chips.

Your existing 'project' is gaining in complexity because you've gone about in a completely wrong way, choosing totally unsuitable components which require great complexity to 'bodge' them to work.

As Bill said, battery mains is absolutely trivial, two diodes is all you need - or two diodes and a resistor if it's a rechargeable battery.
 
I have built a few clocks with pic's, I'd be happy to give you some direction.
Learning to program for some people is easy, others hard you need a logical mind, even if you know just a little about programming on just about any chip taking to pics is easy.
 
Ok guys , you have convinced me, I shall purchase the recommended pic if I can and start playing and learning.
Thank you all for your support and advice.
 
Which PIC? What language do you want to learn ASM, C or BASIC?

I would recommend a 18F4620 + 18F2525 + PICkit 2 (tough call as the 3 supports more PICs but the 2 offers more features such as a logic tool).

XC8 + MPLAB (C is the standard language, learn that and the world is your oyster)
AND/OR
Swordfish BASIC (the free SE version is very easy but is nowhere near as popular as it should be, you can have a program running in no time)

The 18F4620 has lots of I/O 35.5 to be exact (the .5 is an input only). That's plenty for a clock, and if you don't like wires an LCD clock (very few wires and extra parts e.g. connector, 10K pot & 0.1µF cap)

OP PM me your mailing address, I'll ship you off a couple of bare PCBs from my old kits to get you started.
 
Last edited:
Which PIC? What language do you want to learn ASM, C or BASIC?

I still have my gwbasic reference book from my DOS days and I have a C++ how to program book by Deitel but I have never got interested in C , so I guess I'll stick to basic. In reality I really dont know which is the best and I will be basically starting from scratch again. Unless there is a clear advantage with one language , I will stick with basic . I assume that basic will be akin to gwbasic.My other concern is burning the program into the chip. I have not looked or researched much into this topic. Anyway please suggest a reasonably chip for a clock cct run from a mains average adjusted, with a watch crystal backup and a DS1307 . Thank You
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…