Using the CD74HC4067 16 Channel Multiplexer IC - 16 times the ADC pins

/media/uploads/melmon/img_1642.jpg

The Mbed platforms don't typically have that many ADC pins broken out, which for a number of IoT applications makes sensing lots of parameters tricky. Multiplexing is a nice way around that, and here is a working set of code and circuitry to get you started!

Import programMUX_test

A working demo code, to show the CD74HC4067 16 channel digital/analogue Multiplexer IC working. It takes 16 ADC readings and displays the value from each pin to a PC serial terminal.

Make sure you have the Signal Pin setup for ADC readings. The 10K pull down resistors on the binary counting pins are important. Apart from that, you are good to go!

/media/uploads/melmon/schematic.png

This is a really easy to use MUX chip, hugely increasing the number of sensor inputs you can have from the Mbed. Whilst it comes in a fairly inaccessible SMD package for hobby users, Sparkfun have a nice breakout which is fairly reasonable here. This will clip straight onto your breadboard and you are ready to go. The chip has a very low internal resistance and is fast switching, so will likely do for all your hobby needs. It runs on 2V - 6V, so can be driven straight from the Mbed. Do however, think about the ADC functionality, if you are running it at Logic Level, make sure that the potential divider with the sensors is at 5V (if Mbed is powered by USB). You can also use this as a Digital switch, allowing you to drive multiple relays for example. There are more details on the Sparkfun and Arduino communities - I just wanted to port the code over to Mbed.

/media/uploads/melmon/09056-01.jpg


2 comments on Using the CD74HC4067 16 Channel Multiplexer IC - 16 times the ADC pins:

09 Oct 2017

Hi George! Thank you for sharing this great project! I am still a beginner and I want to to use the same MUX chip and the same uC to control LEDS. iI have a working code on arduino as uC. I would be grateful if you can give us a code example for controlling LED on MBED using CD74HC4067 and LPC1768. Looking forward to hear back from you!Thank you

12 Jun 2018

Rania Oueslati wrote:

Hi George! Thank you for sharing this great project! I am still a beginner and I want to to use the same MUX chip and the same uC to control LEDS. iI have a working code on arduino as uC. I would be grateful if you can give us a code example for controlling LED on MBED using CD74HC4067 and LPC1768. Looking forward to hear back from you!Thank you

You only have to click on "import program", just below the first picture.

Please log in to post comments.