Go Down

Topic: Dynamically determine length of WS2812B LED strands (Read 20403 times) previous topic - next topic

V1x0r

That is an excellent point!  and an astute yet very simple thing to do!  simply "pin 4" would be used as a check pin gathering use information.   I haven't searched this up yet to test...any ideas on monitoring current draw via arduino?  I'll go search this after I send this out too.  :)

fungus


Well if you could monitor the presence / absence of current draw, you could send a single lit LED along the row and when the current drops to zero you know you have shifted it off the end. This could be one on start up so fast that you would not see it flicker.


I think you'd notice that...can somebody watch the LEDs very carefully on power up and report back? (especially the last LED in the strip)

With the controllers in those photos there's really only one way they can be doing it - measure the current.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus


any ideas on monitoring current draw via arduino?


You could put a resistor in the circuit and measure voltage drop across it while you search for the end.

When you're happy you've found it, bypass the resistor with a MOSFET.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

jasmine2501



how do they do this!!  >_<


Well if you could monitor the presence / absence of current draw, you could send a single lit LED along the row and when the current drops to zero you know you have shifted it off the end. This could be one on start up so fast that you would not see it flicker.


Yeah that's why I basically suggested to do that same thing but 'backwards' starting beyond the end of the string and lighting up one light at the end until see some current flow. That way you would only see one LED blink real fast on the end. Starting at the beginning, I think you would see all the LEDs blink, so that's why I'm wondering if there's any flickering or anything right after startup. I agree that with three wires that's probably the only way. With four wires, that fourth wire could be either a data line returning from the end, or it could be a current sensor, and that would give a way to measure the string. I don't think there's any other way really.

Grumpy_Mike

Quote
any ideas on monitoring current draw via arduino?

A small resistor in the ground with an analogue input on the other side. You are only looking for a few mV so the resistor can be very small indeed. In normal operation you would not notice it.

jasmine2501


Quote
any ideas on monitoring current draw via arduino?

A small resistor in the ground with an analogue input on the other side. You are only looking for a few mV so the resistor can be very small indeed. In normal operation you would not notice it.


Wouldn't that measure the current used by the Arduino? Doesn't that fluctuate a lot?

Grumpy_Mike

Quote
Wouldn't that measure the current used by the Arduino?

No you misunderstand.
The ground return from the LED strip has a 2R2 ( or so ) resistor before it get to the arduino ground, Then you measure on the LED side of this resistor.

V1x0r

So, i can't see under the chip for what pin goes where and I'm not at home to test points...but it appears as though they are using multiple pins...granted, three of them would have to be devoted to push pin.  it does look like the pins are devoted to the blatantly obvious components.  Unless they are treating the din pin as both input and output.  (possible?)  if it is an input then the current draw check would be logical from there.  anyway...It would be cool to pull current draw.  :)

the rf version has dual grounds...I should look at that closer again and see if that second ground goes elsewhere.  on the small adapter it has a large ground connection so maybe that is going to a resistor on one of the input pins.  Great idea to check!  I did post the images for both boards...but a better image is of the small one (which is the one mostly in question)   it does have three resistors

V1x0r

I don't have a fast enough camera to catch if a pixel illuminates  or not.  mind you, some of the leds will also flicker once power is applied to the strip anyway.

jasmine2501


So, i can't see under the chip for what pin goes where and I'm not at home to test points...but it appears as though they are using multiple pins...granted, three of them would have to be devoted to push pin.  it does look like the pins are devoted to the blatantly obvious components.  Unless they are treating the din pin as both input and output.  (possible?)  if it is an input then the current draw check would be logical from there.  anyway...It would be cool to pull current draw.  :)


No it's not possible to use that pin as any kind of output. The chip just doesn't have that function. It would be documented in the data sheet, and there would be some method of triggering the function to output data, and there's nothing like that.

I think you would need to measure current draw on the power pins, not the signal line, because that's just carrying binary data, that you are sending, so anything you measure there would be a result of what you sent, not what's happening on the light string, and that's if reading the current of a data line was meaningful anyway. It would be interesting to know if the resistors are connected to some kind of current sensor. Can you take a high quality photo of the boards? I couldn't really tell anything from the previous photos.

fungus

#40
Dec 19, 2013, 10:56 am Last Edit: Dec 19, 2013, 11:01 am by fungus Reason: 1

Quote
any ideas on monitoring current draw via arduino?

A small resistor in the ground with an analogue input on the other side. You are only looking for a few mV so the resistor can be very small indeed. In normal operation you would not notice it.


You have to be very careful with that. Those strips can draw a LOT of amps - a 5m strip with 60 LEDs/m and all the LEDs turned on needs over 18 amps. That's why I suggested including a MOSFET to bypass the resistor when you finish measuring.


The ground return from the LED strip has a 2R2 ( or so ) resistor before it get to the arduino ground, Then you measure on the LED side of this resistor.


A 2R2 resistor at 18 amps will drop 40 volts... :-)

(Or catch fire in the attempt)
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Grumpy_Mike

@fungus
Please keep things in perspective.

Quote
those strips can draw a LOT of amps - a 5m strip with 60 LEDs/m and all the LEDs turned on needs over 18 amps.

Well durr! My grandmother can suck eggs as well. Well are discussing the techniques by which this can be done we are not talking about a universal solution. Why stop at 18A?

Quote
A 2R2 resistor at 18 amps will drop 40 volts

You know what, I can do ohms law as well.

fungus

#42
Dec 19, 2013, 04:26 pm Last Edit: Dec 19, 2013, 04:29 pm by fungus Reason: 1

Why stop at 18A?


They usually sell these strips in 5m lengths, OP mentioned 5m strips in message #4 of this thread.

It seemed like a number that will happen in real life.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus


Well are discussing the techniques by which this can be done we are not talking about a universal solution.


If we stick with the 18A figure and limit ourselves to 1/2W power dissipation over the sensing resistor, the voltage drop at that power will be 0.027V.

Plug that value into Ohm's law we get a 1.5 milliohm resistor.

Assuming we can find one of those, the voltage drop across it for each LED you light up would be 0.00009V - far too small for an Arduino to measure directly.

Workable technique...?

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Grumpy_Mike

Hey lets all make up stupid figures and have a bigger argument.

Go Up