Filodrammatica ViVa di Vigolo Vattaro - Altopiano della Vigolana (Trento) - Italia

Menu  Menu
Notizie
Attivitą
Tabella attivitą
Rassegne
Spettacoli
Scritti
Notizie dall'interno
Guide
Software/Hardware libero
Miei progetti
Mappa sito
Foto
Download
Mio curriculum
Dove siamo

Vedi anche  Vedi anche
 Medusa 4 Personal
 OpenScad
 Owncloud
 Guida a Openoffice.org
 Velocizza il tuo vecchio pc
 Arduino
 LaserOpenSource
 Display 16 segmenti con Arduino e TLC5940
 Impedire aggiornamento Windows 10
 Telegram con ESP-12E
 WeMos D1
 Ridurre uso memoria in Arduino
 Installare Flatcam su Ubuntu 20.04
 Colora le strisce led RGB

Guide » Colora le strisce led RGB

Colora con il colore che desideri le strisce led RGB

Give the color you want to the RGB led strips

 

Prima di farvi degli esempi di colorazione delle strisce led RGB (io ho utilizzato quelle a 5V ma il metodo funziona allo stesso modo anche con quelle a 12V) vediamo un po' di teoria sulla luce.

Before giving you some examples of coloring the RGB led strips (I used the 5V ones but the method works the same way even with the 12V ones) let's see some theory on light.

Da wikipedia.it:

RGB è un modello di colori le cui specifiche sono state descritte nel 1936 dalla CIE (Commission internationale de l'éclairage).
RGB is a color model whose specifications were described in 1936 by the CIE (Commission internationale de l'éclairage).

Esso è un modello di colori di tipo additivo: come somma dei tre colori Rosso (Red), Verde (Green) e Blu (Blue), da cui appunto l'acronimo RGB, da non confondere con i colori primari sottrattivi Giallo, Ciano e Magenta. Altri 5 colori notevoli di questo tipo di modello sono il Giallo (Rosso + Verde), il Magenta (Rosso + Blu) e il Ciano (Verde + Blu), inoltre la somma dei tre colori costituisce il Bianco, e la loro totale assenza il Nero, come rappresentato dall'immagine seguente.
It is an additive color model: as the sum of the three colors Red (Red), Green (Green) and Blue (Blue), hence the acronym RGB, not to be confused with the subtractive primary colors Yellow, Cyan and Magenta. Other 5 notable colors of this type of model are Yellow (Red + Green), Magenta (Red + Blue) and Cyan (Green + Blue), moreover the sum of the three colors constitutes White, and their total absence makes Black, as represented by the following image.

 
 
Per le sue caratteristiche, è un modello particolarmente adatto nella rappresentazione e visualizzazione di immagini in dispositivi elettronici. Difatti, la maggior parte dei dispositivi, normalmente, usa combinazioni di Rosso, Verde e Blu per visualizzare i pixel di un'immagine, tuttavia ciò fa anche sì che lo stesso sia particolarmente dipendente dal dispositivo in sé: la stessa immagine potrebbe essere visualizzata in maniera diversa, se visualizzata su due dispositivi differenti, in quanto i materiali usati per realizzare gli schermi variano in base al produttore. Inoltre si possono notare differenze nel corso del tempo anche nello stesso dispositivo, per via del naturale deterioramento dello stesso.
Due to its characteristics, it is a particularly suitable model for the representation and display of images in electronic devices. In fact, most devices normally use combinations of Red, Green and Blue to display the pixels of an image, however this also makes it particularly dependent on the device itself: the same image could be displayed in different way, if displayed on two different devices, as the materials used to make the screens vary according to the manufacturer. Furthermore, differences can be noted over time even in the same device, due to the natural deterioration of the same.
 
Ora, per prima, cosa misuriamo la corrente assorbita da ogni singolo colore di 10 led RGB.
Now, first, what we measure the current absorbed by each single color of 10 RGB LEDs.
 
  
 
Imposto la tensione in uscita dell'alimentatore su 5V. Collego il filo rosso (+) dell'alimentatore al +5V al  e il filo nero (-) al colore verde (G).
I set the output voltage of the power supply to 5V. I connect the red wire (+) of the power supply to the +5V and the black wire (-) to the green color (G).
 
 
 
 
Il valore misurato, come mi aspettavo (un led singolo consuma 20mA e i led sono 10), è di 0,2A (200mA).
The measured value, as I expected (a single LED consumes 20mA and there are 10 LEDs), is 0.2A (200mA).
 
Faccio le misure anche per gli altri due colori Rosso (R) e Blu (B).
I also measure for the other two colors Red (R) and Blue (B).


 
 
 
 
Vediamo che i valori non si scostano molto dal valore misurato precedentemente. 0,19A per il rosso (R) e 0,18A per il blu (B).
We see that the values do not differ much from the previously measured value. 0.19A for red (R) and 0.18A for blue (B).
 
Ora vediamo cosa succede alimentando contemporaneamente il verde e il rosso e  (G + R), rosso e blu (R + B) e il verde e il blu (G + B).
Now let's see what happens by feeding green and  red (G + R), red and blue (R + B) and green and blue (G + B) at the same time.
 
 
 
 
Purtroppo la foto non mostra bene il colore reale ma è giallo, infatti, rosso + verde = giallo. Il consumo è la somma di 0,2A + 0,19A = 0,39 A.
Unfortunately the photo does not show the real color well but it is yellow, in fact, red + green = yellow. Consumption is the sum of 0.2A + 0.19A = 0.39A.
 
 
 
Anche in questo caso la foto non rende molto il colore reale. rosso + blu = magenta. Il consumo è 0,38A.
Again the photo doesn't make the color very real. red + blue = magenta. Consumption is 0.38A.
 
 
 
Verde + blu = ciano (chiamato anche turchese o azzurro). Il consumo è 0,39A.
Green + blue = cyan (also called turquoise or light blue). Consumption is 0.39A.
 
Ora proviamo l'ultima combinazione quella in cui alimentiamo tutti e tre i colori verde, rosso e blu.
 
 
 
Il bianco che ne risulta è abbastanza puro e il consumo è di 0,58A.
The resulting white is quite pure and the consumption is 0.58A.
 
Se vogliamo però ottenere un colore diverso come ad esempio l'arancio dobbiamo miscelare il rosso (al massimo) con il verde a metà della potenza. Vediamo la tabella RGB con questi valori (da 0 a 255: per ogni colore ci sono 256 livelli - R 255 G 128 B 0):
However, if we want to get a different color such as orange we have to mix red (at most) with green at half the power. Let's see the RGB table with these values (from 0 to 255: for each color there are 256 levels - R 255 G 128 B 0):
 
  

However, if we want to get a different color such as orange we have to mix red (at most) with green about half the power. The official table shows the orange color as R255, G165, B0 on 256 levels R100, G65, B0 as a percentage.
 
Per abbasare la luminosità del verde dobbiamo mettere in serie al pin G una resistenza di valore adeguato. Come calcoliamo il valore? Possiamo andare per tentativi provando con vari valori di resistenza. Il metodo migliore è però quello di usare un alimentatore separato per dare corrente al colore verde e diminuire la tensione di alimentazione dai 5V fino a quando il colore è quello giusto.
To lower the brightness of the green we have to put a resistor of adequate value in series with pin G. How do we calculate the value? We can go to use different resistance values. The best method, however, is to use a separate power supply to power the green color and decrease the supply voltage from 5V until the color is the right one.
 
 
 
La tensione ottimale del verde è risultata di 2,8V con una corrente ridotta notevolmente a 0,02A. Per calcolare il valore della resistenza da mettere in serie al G per ottenere 2,8 V usiamo la legge di Ohm R = V / I. V è la caduta di tensione che deve provocare la resistenza quindi  V = 5V - 2,8V = 2,2V. R = 2,2 / 0,02 = 110ohm.
The optimal voltage of the green turned out to be 2.8V with a current significantly reduced to 0.02A. To calculate the value of the resistance to be put in series to G to obtain 2.8 V we use Ohm's law R = V / I. V is the voltage drop that must cause the resistance therefore V = 5V - 2.8V = 2, 2V. R = 2.2 / 0.02 = 110ohm.
 
Usiamo una resistenza da 100ohm 1/4W. I colori delle strisce su di essa sono marrone(1) nero(0) marrone(1 zero) 100. Va collegata fra il filo nero e il pin G della striscia led. 
We use a 100ohm 1 / 4W resistor. The colors of the strips on it are brown (1) black (0) brown (1 zero) 100. It must be connected between the black wire and pin G of the led strip.
 
 
 
Ora, usando una e due resistenze da 100ohm, proviamo tutte le combinazioni possibili:
Now, using two 100ohm resistors, let's try all possible combinations:
 
Rosso (R) 100% e Blu (B) 50%.
Red (R) 100% and Blue (B) 50%.
 
Lasciamo il rosso (R) alimentato e spostiamo la resistenza sul blu (B).
We leave the red (R) powered and move the resistor to blue (B).
 

 

Verde (G) 100% e Rosso (R) 50%.
Green (G) 100% and Red (R) 50%.

 
 
Verde (G) 100% e Blu (B) 50%.
Green (G) 100% and Blue (B) 50%.
 
 
 
 
 
Blu (B) 100% e Rosso (R) 50%.
Blue (B) 100% and Red (R) 50%.
 
 
 
 
Blu (B) 100% e Verde (G) 50%.
Blue (B) 100% and Green (G) 50%.
 
 
 
 
Ora passiamo ad usare due resistenze.
Now let's move on to using two resistors.
 
Rosso (R) 100%, Verde (G) 50% e Blu (B) 50%.
Red (R) 100%, Green (G) 50% and Blue (B) 50%.
 
 
 
 
Verde (G) 100%, Rosso (R) 50% e Blu (B) 50%.
Green (G) 100%, Red (R) 50% and Blue (B) 50%.
 
 
 
 
Blu (B) 100%, Rosso (R) 50% e Verde (G) 50%.
Blue (B) 100%, Red (R) 50% and Green (G) 50%.
 
 
 
 
Abbiamo ottenuto 16 combinazioni di colore, ma se non fossero sufficenti basta variare il valore di una o tutte e due, ma anche, introducendone una terza e si potranno creare altri colori. I valori delle resistenze si possono dedurre dalla tabella RGB del colore che si desidera ottenere. 
We obtained 16 color combinations, but if they weren't enough, just vary the value of one or both, but also, by introducing a third one, and other colors can be created. The values of the resistances can be deduced from the RGB table of the desired color.
 
Ho fatto una prova per ottenere il colore marrone che non è semplice da ottenere con le strisce led.
I did a test to get the brown color which is not easy to get with the led strips.
 
 
La soluzione che più si avvicina al risultato è quella con una resistenza da 100ohm (marrone nero marrone) in serie al rosso (R), da 4700ohm (4,7Kohm)  (giallo viola rosso) in serie al verde (G) e una da 1000ohm (1Kohm) (nero marrone rosso) inserie al blu (B).
The solution that comes closest to the result is the one with a resistance of 100ohm (brown black brown) in series with the red (R), of 4700ohm (4.7Kohm) (yellow violet red) in series with the green (G) and one of 1000ohm (1Kohm) (black brown red) insert to blue (B).
 
 
 
 
Ma ora vi farete una domanda. Cosa facciamo se i led non sono 10? Il valore della resistenza è inversamente proporzionale al numero dei led usati. Se usiamo 7 led al posto dei 10 la resistenza, invece che da 110ohm (Quella calcolata non quella usata che è 100), sarà Rnuova = Rcon10led x 10 / Nled = 110ohm x 10 / 7 = 157ohm. Per 14 led: Rnuova = Rcon10led x 10 / Nled = 110ohm x 10 / 14 = 78 ohm.
But now you will ask yourself a question. What do we do if the LEDs are not 10? The resistance value is inversely proportional to the number of LEDs used. If we use 7 LEDs instead of 10 the resistance, instead of 110ohm (The one calculated not the one used which is 100), will be Rnew = Rwith10led x 10  /  Nled = 110ohm x 10/7 = 157ohm. For 14 leds: Rnew = Rwith10led x 10 / Nled = 110ohm x 10 / 14 = 78 ohm.
 
Spero di essere stato sufficentemente chiaro. Grazie per l'attenzione.
I hope I have been clear enough. Thanks for the attention. 
 
Giuseppe
print
Calendario  Calendario
Aprile 2023
L M M G V S D
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Data: 01/04/2023
Ora: 05:31
Accadde Oggi:
* 1934 - La coppia di banditi Bonnie e Clyde uccide due giovani agenti di polizia vicino a Grapevine, Texas

Santi Cattolici:
* Sant'Ugo di Grenoble, vescovo

Meteo  Meteo
Meteo Vigolo