SparkFun Forums 

Where electronics enthusiasts find answers.

Questions relating to designing PCBs
By mmatrix
#185099
This is potentially (probably?) a really dumb question, but I am a software engineer who is working with electronics for the first time so my apologies in advance. Hopefully someone will take pity on a noob.

Unnecessary Background: This is a Raspberry Pi project using Cat6 Cabling to link a PCB that has the CD74HC4067 multiplexor breakout. Eventually I will have up to 16 contact switches connected to the 16 channels on the MUX. The setup works well, my switches work well and provide +3.3V to a channel when closed. I can read from any channel just fine.

Here is my question:

I want to light up an LED when the mux is reading an individual channel, but I cannot seem to get it to work. I have the LED in series with a channel (any of the 16), along with a 200 OHM resistor. I can still read the channel when power is applied, but the LED never lights. I have tried 9 different LED colors in 3 different sizes and powers, but nothing changes. I test each of the LEDs individually buy connecting it to ground (but still past the resistor) when +3.3V is supplied and all of them light up, to different brightness. Hook the same lead of the LED to the MUX channel and no light, but the channel does show high (power applied) when read, and I get 3.2V if I test with a multimeter from the signal pin to ground.

This should be a very simple circuit, the multiplexer is supposed to be passing whatever the supply voltage and current are. within its specs which are much wider than I am providing. Does the chip drop current so much that the LED can't light but can still pass power?

I have tested with three different identical mux breakouts (Sparkfun rocks!), each of them soldered to pins which are soldered to RJ45 Breakouts, with the channel I am testing soldered at both ends (mux side and LED side). All three mux boards do exactly the same thing.

If I place an identical LED (same size color and even batch) to the one I am testing between the SIGnal pin and ground it will light, which should mean that there is enough power coming through the switch, right?

Am I overlooking something obvious? I am sure I am but for the life of me I can't figure out what! Too bad I can't debug this the same way I can with the python code that drives it. :(

Thank you in advance for any insight you can provide.

-M Matrix.
By Valen
#185103
What are you doing with the enable pin of the (de-)multiplexer? If it isn't low then the in-/outputs are not connected through to the common input. You may read a voltage, but there may not be enough current flowing through the multiplexer to make it light up. As the led is in series. So, if the voltage difference between common and individual in-/output is negative then the LED is reversed biased and will not light up at all. It is important to know if any pin of the multiplexer is pulled down or up to explain this behavior.

Please provide a drawing or schematic of what you have hooked up. (as it is, not an example of how it should be) Textual descriptions can contain so many chances of mis-interpretations or omission. A picture says more than words could. Please be mindful of the polarity of the leds (anode vs cathode lead)
By mmatrix
#185110
Here is a very simple schematic of what I am trying to make work. When each channel becomes active, by changing the values of the selection pins, supply power should flow through that channel and light the LED. I have removed the 200 Ohm resistor and I am using the internal pull-down of the GPIO pin wired to the SIG pin on the mux.
multiplexer_schematic.png
You do not have the required permissions to view the files attached to this post.
By Valen
#185125
I don't fully know how Raspberry Pi GPIO pins are configured in code, but could the GPIO pin connected to the common pin still be configured as a high impedance state? Then little to no current will flow into it preventing the led to light. ... I'm thinking this, because in your first post you say multiple times that you are ""reading a channel". That suggests you are using a pin as an input actually.
By mmatrix
#185128
By "reading a channel" I mean reading the state of the "SIG" pin on the mux board. When you set the S0-S3 pins it tells the mux to select one of 16 "channels" to read from. I have tried using the RPi's internal pull-up and pull-down GPIO settings, what I have found is that if I set the pin to pull-down I can get the LED to light dimly, but the SIG pin always reads LOW. If I pull-up the SIG pin it always reads HIGH, and no LED light.
By Valen
#185135
mmatrix wrote:By "reading a channel" I mean reading the state of the "SIG" pin on the mux board.
Then you are using the RPi pin it is connected to as an input. It will have a high input resistance so that will not be a path to ground. It is not acting as an output-low.
When you set the S0-S3 pins it tells the mux to select one of 16 "channels" to read from. I have tried using the RPi's internal pull-up and pull-down GPIO settings, what I have found is that if I set the pin to pull-down I can get the LED to light dimly, but the SIG pin always reads LOW. If I pull-up the SIG pin it always reads HIGH, and no LED light.
It lights up dimly because the built-in (on the Rpi chip) pull-up/down resistor only conducts a little (usually multiple 10kOhm). If you configure the RPi pin connected to the SIG pin as an output then the majority of the current flows through the GPIO output circuit to ground, and only a bit through the pull-down to ground. Then a lot more current should flow through the LED making it light up properly. But I don't know how much. So a limiting resistor in series with the LED would be prudent to have there. The multiplexer channels have a bit of resistance of their own (multiple tens of Ohms to a few hundreds) but that may not be enough to prevent burning the GPIO pin circuitry.

Once you use the pull-up resistor on the GPIO pin then there is not enough of a voltage difference (almost none) between Vcc and the GPIO pin to raise above the forward voltage drop of the led. And it will not light up at all.
By mmatrix
#185188
Thank you for that information! It makes perfect sense in hind-sight. I ended up using a second multiplexer to handle lighting an LED for the channel being read. I wired the S0-S3 pins from the first mux to the same pins on the second, but I keep SIG at supply 3.3v so that it is always outputting power. When the first mux reads from a channel the second is lighting a light for it. It works exactly the way I intended, indicating the channel that is in use.

Thanks again!