Do I need a real world pull up resistor in this situation?

Hi all,

Firstly, I'm very new to electronics so please don't assume I'm not an idiot. I am.

I'm trying to link one output from a "PacLED64" (LED controller) to an Arduino Uno input.

Both boards operate at 5 VDC.

The LED controller, when it is running an LED, has a +5V out to the LED and then three inputs back that "sink" the +5V when they come on (bringing on the Red/Green/Blue channels).

I thought I might be able to just link one of the LED channels to an Arduino input - set the Arduino input to be "pull up" (so it sits at 5V) and then when I activate the PacLED this will trigger the input at the Arduino.

See diagram....

I wrote some code to test if the input was on or not and, when I test fire the PacLED output, this setup works "of a fashion" but it seems to be floating a bit as the input switches on it's own.

Everything I've read is talking about pull up resistors. My input pin is set as

pinMode(3, INPUT_PULLUP);

but I wondered if I needed a "real world" pull up resistor? (see diagram below)...

If I do then what size does it need to be? I've read both 10K and 4.7K and a few other sizes?

So, my questions are:

  1. Do I need a "real world" pull up resistor in this situation, will it help?

  2. If I do need a resistor then what size should I go for?

  3. Is my idea of where to connect the resistor (in the diagram) correct?

Many thanks for any help you can give me and, if you need any more information then I'm more than happy to provide it.

You DO have the "PacLED64" GND connected to the UNO GND, right?
If the "PacLED64" output pin is drawing high current, it may not pull close enough to GND (not LOW enough) for the UNO to see it as LOW. Disable the INPUT_PULLUP and try it. What is the "PacLED64" output pin voltage when the LED is ON? (Measure from the "PacLED64" output pin to UNO GND pin).
EDIT: There may be current limit resistors on the "PacLED64" outputs, so the voltage will not be lower than 5V - the LED forward voltage (2V or higher).

  1. Do I need a "real world" pull up resistor in this situation, will it help?

I suggest you try it, what is stopping you?

  1. If I do need a resistor then what size should I go for?

The word is value, not size. Anything from 1k Ohms to 10k Ohms will be fine, exact value unimportant.

  1. Is my idea of where to connect the resistor (in the diagram) correct?

Yes

You are making an assumption that when the LEDs are on they are being fed with uninterrupted DC, they might be multiplexed or fed with PWM, either of which would give the symptoms your describe. Easy way to found out is with an oscilloscope.

JCA34F:
You DO have the "PacLED64" GND connected to the UNO GND, right?
If the "PacLED64" output pin is drawing high current, it may not pull close enough to GND (not LOW enough) for the UNO to see it as LOW. Disable the INPUT_PULLUP and try it. What is the "PacLED64" output pin voltage when the LED is ON? (Measure from the "PacLED64" output pin to UNO GND pin).
EDIT: There may be current limit resistors on the "PacLED64" outputs, so the voltage will not be lower than 5V - the LED forward voltage (2V or higher).

Thank you for your help, I appreciate you getting back to me.

Yes I've got the two GND pins connected together.

I did try and disable the INPUT_PULLUP and it didn't work I seem to recall - however, I will try it again.

The PacLED64 documentation says the current is "20mA constant".

I'll measure the output voltage but I believe that it's 5VDC when OFF and 0V when ON (but I'll check :-))

Thanks

Please also consider that we don't know what a PacLED64 is as you've provided no documentation or other information about it.

PerryBebbington:
I suggest you try it, what is stopping you?
The word is value, not size. Anything from 1k Ohms to 10k Ohms will be fine, exact value unimportant.
Yes

You are making an assumption that when the LEDs are on they are being fed with uninterrupted DC, they might be multiplexed or fed with PWM, either of which would give the symptoms your describe. Easy way to found out is with an oscilloscope.

I've updated my original post to embed the images now. Thank you for the link.

I didn't have any breadboard (which I ordered last night) so I was connecting straight from the PacLED board to the Uno. However, when I get the breadboard tomorrow I'll try connecting a resistor and try it (I even need to Google about breadboard as I've never used it so don't know how the pins link etc!! This will be my first time with it - that's how experienced I am! :slight_smile: )

Thanks for the correction - "value" it is from now on. I have a selection of resistors that I bought in a kit so it's good to know that the value isn't critical.

I know that the LEDs can be dimmed - I thought that was done by reducing the voltage - would that be done by using PWM? As you say, it could explain a lot. I don't have a scope but I will investigate this further.

Thanks again for all your help and great responses. Very much appreciated.

I know that the LEDs can be dimmed - I thought that was done by reducing the voltage - would that be done by using PWM?

It will almost certainly be done using PWM. That being the case the output is not permanently high or low but switching between the two, so sometimes you’ll read it high, sometimes low, which fits with your description of what is happening.

PerryBebbington:
Please also consider that we don't know what a PacLED64 is as you've provided no documentation or other information about it.

Yes, I was aware of that. I did try and make a post that was succinct but covered the essentials but that was a big missing. There isn't a lot of information about the board - only what's contained on the website (Output :: LED and Output Controllers :: PacLED64) but that doesn't have much technical info unfortunately.

I can contact the guy who sells the board and ask specific questions if needs be. Unfortunately, without your help i wouldn't even know what question I should be asking.

(Just read your reply - I'll get in touch with him and ask if the outputs are PWM just to confirm.)

Thanks :slight_smile:

(Just read your reply - I'll get in touch with him and ask if the outputs are PWM just to confirm.)

I'll be very surprised if it does not use PWM.

PerryBebbington:
I’ll be very surprised if it does not use PWM.

If it does use PWM - does that mean my set up will never work? Or would a pull up resistor still help?

Or maybe something else I could put into the circuit to help?

It means you have to change your approach, the external pull up resistor isn't needed, just the internal one. You need to arrange a timeout on the input so that it has be low or high for some minimum period before it counts as having changed. Look in the IDE under examples / 02. digital / debounce. You might get debounce code to do what you want or you might need to modify it. Search these fora for more discussion and examples of debouncing. I'm not sure if debouncing is exactly what you need, but it should get you started.

PerryBebbington:
It means you have to change your approach, the external pull up resistor isn't needed, just the internal one. You need to arrange a timeout on the input so that it has be low or high for some minimum period before it counts as having changed. Look in the IDE under examples / 02. digital / debounce. You might get debounce code to do what you want or you might need to modify it. Search these fora for more discussion and examples of debouncing. I'm not sure if debouncing is exactly what you need, but it should get you started.

Okay, that's great. Thanks.

I'm the same as you - not sure if it would work as it might 'debounce' the falling edge and not the rising edge etc. However, I'll have a think about it.

I wondered about putting a capacitor/resistor or something in there that would need to 'discharge' before the output switched (there is no need for speed in switching the output at all - as long as it switches within about 5 seconds it should work fine).

In the meantime I've emailed the guy who makes the PacLED board to ask about the LED outputs and I'll move forward based on what he gets back to me with.

Thanks again for all your help with this. You've been a brilliant help.

I wondered about putting a capacitor/resistor or something in there that would need to 'discharge' before the output switched

No because whatever you can do with a capacitor you can do in software, you'll just have to play around with the code. Good learning opportunity.

DON'T USE DELAY! (I hate delay!)