Reading three inverted 12v PWM values

Hello friends!
So I recently bought a new PC and the case (Phanteks Eclipse P300) comes preinstalled with RGB LED's and a cable to connect additional LED's or LED strips. On the cable it strictly says to only connect Phantek branded strips, but yeah...

My friends had a leftover piece of a NeoPixel LED strip (NeoPixel) which they kindly gave to me for this purpose. The strip contains individually addressable LED's and has three pins (+5V, DATA, GND) and is supposed to be controlled with an Arduino. However the cable in the case has four pins (+12,R,G,B). The RGB pins are used with inverted PWM to control the LED color. Because of this I cannot plug my strip directly in to the case to sync it with the other LED's and the button cycling between modes/colors. In conclusion, I wish to sync and use the built in 12V four pin RGB LED's and a button together with a 5V three pin LED strip which is then controlled by an Arduino.

I have tried experimenting with my problem and so far I have realized that I cannot hijack the built in LED's and button to control everything using an Arduino. Not being able to do this I decided to try reading the PWM signal using pulseIn() on my Arduino and then forward the color value to the LED strip. The problem here is reading reading 12V PWM signal with the Arduino. I have looked around but I have not found any answers and the closest I could come was this.

According to that post a simple voltage divider should do the work, but I have my doubts since when the PWM pin is +12V the potential at my desired reading point would as well be +12V and that is what I am trying to avoid. If you have any ideas or solutions feel free to share!

Thank you!

A (correct) voltage divider will give you 5V PWM. If the 12V is not regulated it would be a good idea to add an [u]over-voltage protection diode[/u].

If it was me, I'd add a capacitor to the voltage divider output to convert the PWM to filtered-variable DC, then read it with an analog input. I'd start with a [u]time constant[/u] around 1/10th of a second.

...Actually if it was me I'd get the "correct" LED strip so I could skip all of this extra hardware & software. :wink:

Haha, I know I am making this unnecessarily hard but that is how I like to learn :stuck_out_tongue:

What do you mean with a "correct" voltage divider? I still wonder how a voltage divider can give me 5V if the 12V PWM is high and there is no current?

What do you mean with a "correct" voltage divider?

One with the correct ratio and the correct absolute values.

I still wonder how a voltage divider can give me 5V if the 12V PWM is high and there is no current?

If you have a voltage and load it with a resistor, you have current. That is ohms law.

A voltage divider is one of the most widely used configuration of resistors.

Or less formally
https://learn.sparkfun.com/tutorials/voltage-dividers

Grumpy_Mike:
One with the correct ratio and the correct absolute values.
If you have a voltage and load it with a resistor, you have current. That is ohms law.

A voltage divider is one of the most widely used configuration of resistors.

Voltage divider - Wikipedia

Or less formally
Voltage Dividers - SparkFun Learn

But since I have three PWM pins and one +12V where should I connect the other side of the voltage divider? To a common GND shared with the Arduino and the built in controller board (Which I would guess is using my PSU GND?)? I completely understand how a voltage divider works and functions so I do not need an explanation of that! I just wonder how I should wire it, maybe you could provide a drawing? If I understand somewhat correctly I should connect a voltage divider in between each PWM pin and a common GND and not wire anything to the +12V pin? If so I need to find the GND of the controller board, correct?

EDIT: Something lik this x3?

Something lik this x3

Exactly like that.

Grumpy_Mike:
Exactly like that.

So I should try to find the common GND of the built in RGB controller and share it with the Arduino and use it as GND for the voltage divider as well?

Hilleskog:
So I should try to find the common GND of the built in RGB controller and share it with the Arduino and use it as GND for the voltage divider as well?

Yes that is how it must be done.

Ok, so I have now managed to read the values I want and successfully been able to use them but I have now encountered another problem.

I have 2 built in LED's (technically 3) in the pc chassi wich are controlled by a PCB and a button. I then try to read the signal from an extra cable (R,G,B,12V) for additional RGB LED's or strips using a voltage divider connected to the PSU GND and the Arduino GND. But when I connect my Arduino to read the values, one of the case LED's light becomes more and more "distorted".

To make it more clear, the case LED's glows magenta, and I have nothing connected to the cable. I then connect one Arduino pin to the cable and ONE of the case LED's becomes slightly less magenta. I connect the second Arduino pin and the LED becomes even less magenta. Connecting the third pin makes the LED go more or less white.

Note that this only happens for one of the built in LED's, the other keeps its colour and is not affected at all. But if I disconnect the affected LED the other previously unaffected LED gets the same distorted color, and returns to normal when the other LED is connected again which gets distorted.

The things I have tried to resolve my issue:

  • Increasing and reducing the resistor values of my voltage divider - no effect
  • Checked the current in the GND wire - didn't notice anything weird, no high currents

decreasinf

Reducing

Is this troublesome LED different from the others? That is could it be that it is a common anode rather than a common cathode.

Otherwise you need to look at the signal on the LED with an oscilloscope to see what is happening to it when you connect the Arduino.

Grumpy_Mike:
Reducing

Is this troublesome LED different from the others? That is could it be that it is a common anode rather than a common cathode.

Otherwise you need to look at the signal on the LED with an oscilloscope to see what is happening to it when you connect the Arduino.

Which LED do you refer to? The ones in the case are common anode 12V RGB, and the strip I am trying to install is 5V 3-pin RGB.

I will try to check with my DSO-138 oscilloscope but I am still learning how to use it :stuck_out_tongue:

Which LED do you refer to

The one that gives the odd behaviour.

Grumpy_Mike:
The one that gives the odd behaviour.

Those LED's are 12V common anode!

Those LED's are 12V common anode!

So can you post a schematic of how you have wired everything including the LEDs.
It looks like the pull down resistor in the voltage divider is causing an issue with holding the LED on slightly.
You could always up the resistor values by times ten so the ratio remains the same.

This is how we post images here
image guide

So here is the schematic, assume R1-R6 are the correct values to divide 12V to 5V! There are also 2 more LED's built into the chassi but they are SMD and I guess they work the same way as the one in the picture!

Thanks.
I wonder if their is some form of constant current going on with that controller, and when you remove the LEDs that messes things up. Have you tried still leaving in the LEDs on the controller and wiring your potential divider to the LED's cathodes?

Grumpy_Mike:
Thanks.
I wonder if their is some form of constant current going on with that controller, and when you remove the LEDs that messes things up. Have you tried still leaving in the LEDs on the controller and wiring your potential divider to the LED's cathodes?

No I have not (if I understand what you mean correctly). But would that work? The LED would not be able to light up then?

But would that work?

Who knows? We are dealing with an unknown box of electronics so depending what is inside it the answer is yes or no.

The LED would not be able to light up then?

Again it depends what is in the box.

Grumpy_Mike:
Who knows? We are dealing with an unknown box of electronics so depending what is inside it the answer is yes or no.
Again it depends what is in the box.

Haha true! I will try this when I have the time!