This lesson uses: Arduino UNO R3 board, TinkerBlock TK95 Extreme Bright Dual LEDs module, jumper wires (or breadboard). Use PWM to control warm white (3000K) and cool white (6500K) separately; outcome: show warm white, then cool white, then mixed light, each about 2 s, repeat.
1. Wiring
Connect TK95 Extreme Bright Dual LEDs to Arduino (each LED on a PWM pin):
- GND → Arduino GND
- VCC → Arduino 5V (it powers both LEDs; without it nothing lights)
- 3000K → Arduino D5 (PWM, warm white)
- 6500K → Arduino D3 (PWM, cool white)

The drawing shows the warm wire on D2. D2 has no PWM on an Uno, so it can only switch the LED fully on or off: use D5.
2. New sketch
- Arduino IDE: File → New (or Ctrl/Cmd + N) to create a blank sketch
- Confirm board and port are selected (same as Lesson 01)
- Type the code below into the default
setup()andloop()yourself
3. Program structure
Same as last lesson: two fixed blocks setup() and loop().
setup(): Tell the board “D5, D3 for LEDs (PWM)”, both LOW to start; start serial; runs once.loop(): Keep repeating “warm on → cool on → both on (mixed) → repeat”.
Two PWM channels, one per LED; you’ll see warm, then cool, then both for mixed color temperature.
4. Code to write
Type the code below into setup() and loop() (do not copy-paste; typing it yourself helps you remember):
// Dual LEDs: warm D5, cool D3; PWM each; mix ratio = color temperature
// VCC -> 5V. D2 cannot do PWM on an Uno, so warm is on D5.
#define WARM_PIN 5 // 3000K warm white
#define COLD_PIN 3 // 6500K cool white
// On 5V an LED held fully on runs past its rating: stop at 170.
#define FULL 170
void setup() {
pinMode(WARM_PIN, OUTPUT); // D5 warm PWM
digitalWrite(WARM_PIN, LOW);
pinMode(COLD_PIN, OUTPUT); // D3 cool PWM
digitalWrite(COLD_PIN, LOW);
Serial.begin(9600);
Serial.println("Extreme bright dual LED program started");
}
void loop() {
analogWrite(WARM_PIN, FULL); // Warm only
analogWrite(COLD_PIN, 0);
Serial.println("Warm white");
delay(2000);
analogWrite(WARM_PIN, 0); // Cool only
analogWrite(COLD_PIN, FULL);
Serial.println("Cool white");
delay(2000);
analogWrite(WARM_PIN, FULL / 2); // Both half; mixed
analogWrite(COLD_PIN, FULL / 2);
Serial.println("Mixed");
delay(2000);
}Program notes
Overall idea: Two LEDs on PWM pins; use analogWrite 0–255 for each. On 5V the sketch stops at 170 (FULL): held fully on at 255, these LEDs run a little past their rating. One channel at FULL = pure warm or pure cool; both on = mix; different ratios give different color temperature (more warm = yellower, more cool = bluer).
| Code | In this lesson |
|---|---|
analogWrite(WARM_PIN, FULL) | Warm at 170 of 255; 0 = off |
analogWrite(COLD_PIN, FULL / 2) | Cool at half; with warm = mixed |
| Color temperature | Ratio of the two channels sets perceived color; try different values |
5. Hands-on
- After entering the code, click Verify (✓) to compile
- Click Upload (→) to upload to the board
- Watch TK95: warm white, then cool white, then mixed, then repeat
- Try yourself: change the two brightness values to get different color temperatures
Expected result: As in the figure.
Proceed to Lesson 38.
Edit this page — content/guides/tinkerblock-workshop/37-extreme-bright-dual-leds.mdx
Questions about this product
See what other owners have asked, and read their solutions.
Dual Bright LEDs
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.