Jump to content

Supply switches at DIn with LEDs


dominik
 Share

Recommended Posts

Hello!

A question from someone who does not knwo much about electronics...

I supplied each switch of my MidiBox LC with its own LED. Unfortunately, there are not enough DOut pins available to control them by MIOS.

For those, that otherwise would be always off, I would like to  have the LED on when the button is pressed. Am I right that this is simple to realise, if I just replace the resistors on the DIn board by 220 (like in DOut) and put the LED between ground and the DIn connection? Or do I oversee something?

Best regards

Dominik

Link to comment
Share on other sites

For those, that otherwise would be always off, I would like to  have the LED on when the button is pressed. Am I right that this is simple to realise, if I just replace the resistors on the DIn board by 220 (like in DOut) and put the LED between ground and the DIn connection?

NO! The resistors on the DIN are so-called Pull Ups, they´re needed to keep the inputs on a logic High by supplying a "symbolic" connection to +5V as long as the button is not pressed (10k is a very high resistance, so no real current will flow). If you replace the 10k resistors by 220, the DIN probably won´t detect the on/off state of the buttons anymore and it could also be that the inputs will be damaged (not sure).

Best solution would be to have switches with dual function. So you could leave the DIN alone and put the second "switch" between a separate line (+5)-(220)-(switch)-(ground).

seppoman

Link to comment
Share on other sites

Thanks for the immediate reply. Although I do not understand you completely...

If I am right:

1. The input pins of the shift registers have high impedance. That means, there will flow nearly no current through the IC. It only measures the potential difference. This will be 5 V if the switch is not closed - independent of the resistor value.

2. A pull-up resistor is only needed to prevent a shortcut between Vss and Vdd if the switch is closed. As an alternative to use a resistor with high impedance I could also employ an LED with a suitable 220 resistor, can't I?

May be I forgot something

Best regards

Dominik ???

Link to comment
Share on other sites

NO.

a pull up resistor is something different.

the input pins of the IC have to be in a defined state.

So they are on a logical high, when the button is pressed ) and a logical Low when no button is pressed.

The pull up resistor is needed to give the Pin of the IC a defined state, when no button is pressed.

Whith the pin hanging in the air, you don't know (and either the IC) if the logical state of the pin is High or Low...

am i right?

Link to comment
Share on other sites

I'm no electronics genius either, but you could always add a little electronic switch with a transistor and some resistors that switches on, on 0 volt level. These transistor types are called PNP.

Here is a link that explains it for you http://www.kpsec.freeuk.com/trancirc.htm#pnp

This is exactly the way how I would do it :)

Best Regards, Thorsten.

Link to comment
Share on other sites

Thanks for all the suggestions.

I guess, what you mean is shown by the following diagram:

switchWithLed.jpg

Is this correct? Is there an easier way to do it? What transistor is suitable?

I guess, the main problem with my proposal (sketched below), is that the voltage dropage of the LED is not sufficient for detecting a logical "0"?

Am I correct or is there another problem in my diagram?

resReplacement.jpg

Thanks for your patience with an electronic newbie...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...