40

I would suspect that it is a voltage drop in the power rails caused by the current draw. Probably cheap construction with copper tracks that are just too thin and so have too high a resistance. To combat it you will need to inject power into the strip at various points along it. Initially to prove the theory you can try connecting the power to both ends of ...


5

Majenko's answer is correct, and you could also verify it with the test performed. Since it is an issue I encountered myself in the past in a similar case, I want to share some measurements I took on the LED strip I have, in case it can be useful for you or other people. Premise: the tests were done with a 5m 60 leds/m RGBW strip (SK6812, natural white). ...


4

The Wemos D1 Mini is a 3.3V device. With a 1k base resistor, the most base current you're going to get is (3.3V / 1k ohm) = 3.3mA. Looking at the datasheet, the current gain (h_FE) for the TIP31 transistor is no more than 50. So the maximum current you will pass from collector to emitter is 50*3.3mA = 165mA. Your base resistor is too large and is limiting ...


4

The LEDs are "addressed" in series; if you address the first LED then you address all connected first LEDs. So yes, you must connect the Data Out of the previous LED/strip to the Data In of the next in order to address all of them individually.


4

You could use chainable RGB drivers like these: They are based on the P9813 chip and can be used with the FastLED library. You can find them on Aliexpress or eBay, if you search for "STM32 rgb". Wiring: Example code: #include <FastLED.h> #define NUM_LEDS 10 #define DATA_PIN 3 #define CLOCK_PIN 2 CRGB leds[NUM_LEDS]; void setup() { FastLED....


4

100 Meters of 5050 SMD strip LEDs will require roughly 120-200 amps. However, you cannot drive a 100 meter strip from a single power supply. The thin copper traces in the LED strip can only handle so many amps before they become too hot (your LED strip would melt like ice cream on a hot summer day). This is why led strips are usually limited to 5 meters (~5A)...


4

C(++) does not natively let you "add" arrays like that. Your code looks like maybe Python. There are several ways to do what you want to do. You could make your code which writes the pattern to the array accept an offset - so rather than always starting at position 0, you could tell it where to start. You could write a function to "concatenate" arrays, ...


4

As Majenko already mention, use a separate power supply. Use that power to power the LED strip(s). Use the MCU to control the data and clock lines. Connect grounds together.


3

I think it is not a good idea to power the LED strip via USB. Normally USB delivers a maximum of mA (see below). Assuming you have 30 LEDs (minimum for a normal LED strip), and each LED gives 40 mA (maximum), this is already more than what most USB ports can deliver. This can ruin your USB port. For the Arduino Nano you can use the 5 V, and you should ...


3

Consider the sequence of values of "fadeIn". It starts at 8 and in incremented by 16. So: 8, 24, ... 248, 264, ... . It is never exactly 255. So you never break out of your "for" loop. There is only 1 delay in your example code. It is difficult to associate the described behavior in your question and the location of the delay. Arduino programming is ...


3

Your Serial receive code is not correct in some ways: You should only read from Serial, if there is really something to read. For the first read, that is not the problem, since you checked against the return value being -1 (which is the return code for "there is no new data in the buffer). But after that, you read without ever checking, if there is ...


3

Managing your power budget is a normal part of electronics projects. You can only draw about 500 mA total from the USB port, and less than that from the 5V line if your Arduino is powered from USB. If you drive your Arduino with ≈7V into the barrel connector you might be able to pull a full amp from the 5V rail, but it depends on how hot the voltage ...


3

40 amps is a LOT of current. 24 AWG wire can't handle anywhere near 20A of current, nevermind 40A. (After a little googling, it looks like 24 AWG wire is limited to about 3.5A.) Think about it. In the US, 15 amp branch circuits require 14 AWG wire. 20 amp circuits require 12 AWG wire. It looks like 40 amps requires 8 AWG, from the googling I did. (...


3

You have two issues going on - noise pickup, and a potentiometer with imprecise stops at one or both ends. The pot is the easiest to fix: What are the lowest low reading and highest high reading you can reliably get when you turn it to its stops? Use those in place of '0' and '1023' in your map() function. Improving the noise is only slightly more involved....


2

The pin with a + is the anode of one colour. The three next to it are also anodes. Each anode is connected to one LED. The cathode of that LED is connected to the pin directly opposite the anode.


2

Brand Name: LEDGUHON Model Number:JH-4RGBW14G


2

The WS2812 chip requires highly timing dependent pulses to work, as I describe on my page about Neopixels. We are talking about pulse widths of 350 ns. I suggest it would be impossible to add another strip "if I can add one more output pin to this". It's not a question of adding pins, it's being able to output pulses that fast. You can't do it, at least not ...


2

analogWrite only works on pins that support PWM. Those are the pins with the ~ next to it. On no-PWM pins, analogWrite will set the pin to LOW, for all values lower than 128, and HIGH for all the higher values. Which is what you are experiencing.


2

Normally you should be able to switch LEDs off, make a measurement and switch LEDs back on without a noticeable delay. Brightness variation is noticeable below 100Hz, which translates to 10ms period. What you need is a photodiode with fast response time (under 0,1ms or so, though there are devices responding in nanosecond range). Phototransistors and LDRs ...


2

The RGB LED strip has a common anode (V+). When you put 12 V on R, G or B, the LEDs have 12 V on both sides, so there is no voltage across it and no current. And if you put 0 V, they have 12 V across it and light up. To fix it, just invert the PWM value in your code: analogWrite(255-pinR, R); analogWrite(255-pinG, G); analogWrite(255-pinB, B);


2

In your code colors is declared as rgb_color colors[ledCount]; This means that the very first iteration of this cycle in shiftLED for (uint16_t i = ledCount; i > 0; i--) { // access colors[i] } will access ledCount[ledCount] which is obviously out of bounds (and will actually write into that location!). The behavior is undefined after that. Using ...


2

This is doing an assignment, not the comparison you are expecting if (led = 144 Need == for the comparison


2

So am I right in this assumption? Yep. and If so, what can I do to increase the amount of pixels I can power at full range? Simple: don't power it from the Arduino. Add a proper external power supply that is capable of providing the current you require.


2

The problem lies in your for cycle. If (state == 1) you are switching the red colour ON. If (state == 2) you are switching the blue colour is ON. So at this moment, you have red AND blue colour on, not only blue. I assume the output colour is purple-ish. If (state == 3), you activate red (which is already ON), blue (which is also already ON) and also ...


2

In your lines: if (state==1) { leds[i].red = 100;Serial.println("Red"); } if (state==2) { leds[i].blue = 100;Serial.println("Blue"); } if (state==3) { leds[i].red = 100; leds[i].blue = 100; leds[i].green = 100;Serial.println("White");} The LEDs are set on, but are never turned off. Sequence is: 1: Red leds ...


2

On an Arduino Uno, or other AVR-based Arduino, reading a byte from RAM takes 2 CPU cycles. Reading it from flash takes 3 cycles. So flash vs. RAM is not such a high overhead. However, if you store a LUT in flash, and the color indexes in RAM, then each pixel would require: 2 cycles for reading the color index from RAM 3 × 3 cycles for reading the RGB values ...


2

There are many ways to remove noise, below are some ways: Only change the value when it differs enough. Assume the range is 0-1023. Than only change the value if the input value differs more than a constant value (like 5 or 10, experiment with this to find a good value for your pot meter). Another way is to use the average of the last x readings, You can ...


2

For completeness, I want to include an RGB circuit simulation I made a while ago, along with some data. It's for analog RGB strips, but the concept regarding voltage drop is the same. I've since added a few more LEDs to show the effect of voltage drop across the length, and added the ability to switch the power connection as well. The simulation shows the ...


2

It is important to connect the Arduino digital pin to the correct end of the LED strip. LED strips have a unidirectional data line. The power and ground connections can be made from either end, but the data IN is at one end and data OUT is at the other end. That arrangement is for the purpose of daisychaining the LED strips. The LEDs themselves also have ...


2

You forgot to ask a question. So I will assume the intended question is “Why does this code always show level 1?” and I will try to answer that. The variable level is defined here: int level = 1; Its initial value is 1. Then it is updated here: if (level >= 10) { level++; } else { level = 1; } The first time this section of code runs, level has its ...


Only top voted, non community-wiki answers of a minimum length are eligible