Extension board · Controls and displays

RGB LED board

Four bright RGB LEDs that all show the same colour, mixed from three controller PWM pins. Use it as a coloured machine status light or workspace accent.

Top view of the RGB LED board: a ten-contact socket on the left and right edges and four square RGB LEDs.
Top view, drawn from the board’s design files. This is a drawing, not a photograph.
4 RGB LEDsInolux IN-P55TATRGB
3 PWM inputsred, green, blue on contacts 7, 8, 9
14 to 18 mAper LED colour, simulated
< 0.25 Aall on, from 5 V
2 socketstype P input and chain
80 × 80millimetres, four M3 holes
Do not look directly into the LEDs at full power for long.

Tech specs

PurposeA coloured status or accent light. Not a safety indicator
LEDsFour Inolux IN-P55TATRGB, one resistor per colour per LED
Control3.3 V PWM, high is on; 100 kΩ pull-downs keep the lights off
Supply5 V from the socket; JP20 cuts LED power
SocketsTwo 10-contact Gadgeteer type P sockets (Samtec SHF-105, 1.27 mm): input and chain
Size80 × 80 mm, four M3 holes on a 70 × 70 mm pattern
Works withSmoothieboard V2 Prime header GD (PWM1_2, PWM1_3, PWM1_4)
LicenceOpen hardware, CERN-OHL-S-2.0

Every figure with its basis is in the electrical specifications appendix; hole positions are in the mounting dimensions appendix.

Board tour

The numbers on the drawing match the list below it. The board is shown from the component side.

  1. 1
    Input socket P IN (J1) — Red on contact 7, green on 8, blue on 9; 5 V on 2.
  2. 2
    Chain socket CHAIN (J2) — Next board.
  3. 3
    RGB LEDs (D1 to D4) — All four are driven together.
  4. 4
    Colour switches (Q1 to Q3) — One MOSFET per colour.
  5. 5
    Gate resistors (R1 to R6) — Series resistors and pull-downs.
  6. 6
    LED resistors (R10 to R21) — 180 Ω for red, 120 Ω for green and blue.
  7. 7
    Supply capacitor (C1) — 10 µF on the LED supply.
  8. 8
    LED power link (JP20) — Closed as delivered; open it to cut power to the LEDs.
  9. 9
    Chain links (JP7 to JP9) — Open as delivered.
  10. 10
    Mounting hole — One of four M3 holes.
Point at a number, or tap it, to read what the part is; the same text is in the list. On a small screen, scroll the drawing sideways.

Pinout

Check contact numbering with the power removed before wiring by hand.

J1: input socket (P IN)

ContactSignalUsePrime header GD
13.3 VPassed to the chain3.3 V
25 VLED supply5 V
3 to 6Passed throughNot usedPE7, PD8, PB11, PE9
7REDHigh = red onPE11 (PWM1_2)
8GREENHigh = green onPE13 (PWM1_3)
9BLUEHigh = blue onPE14 (PWM1_4)
10GNDGroundGND

What you need

Three PWM pinsPrime header GD contacts 7 to 9.
A ten-way cable1.27 mm Gadgeteer ribbon cable.
5 V budgetUp to a quarter of an ampere for this board.

Get started

Minimum wiring: contact 2 to contact 2, 5 V; PE11, contact 7 to contact 7, red; PE13, contact 8 to contact 8, green; PE14, contact 9 to contact 9, blue; contact 10 to contact 10, ground. Prime header GD (J35) RGB board J1 contact 2contact 25 V PE11, contact 7contact 7red PE13, contact 8contact 8green PE14, contact 9contact 9blue contact 10contact 10ground
Five connections.
  1. Mount the board

    Face the LEDs where the colour should be seen.

  2. Connect with the power off

    Plug J1 into header GD.

  3. Add the configuration

    Use the entry below and restart.

    By design the LEDs stay off at start.

  4. Set a colour

    Send M824 S50, then M826 S20, then M825.

    Red should light at half, green should add a little, then red should go out.

Configuration

You wantModuleExample
Set each colour by commandSwitch with hardware PWMThe entry below
Change colour with machine stateNoneSend the commands from your own macros

Add this to config.ini:

[pwm1]
frequency = 1000

[switch]
red.enable = true
red.output_pin = PWM1_2
red.output_type = hwpwm
red.default_on_value = 100
red.input_on_command = M824
red.input_off_command = M825

green.enable = true
green.output_pin = PWM1_3
green.output_type = hwpwm
green.default_on_value = 100
green.input_on_command = M826
green.input_off_command = M827

blue.enable = true
blue.output_pin = PWM1_4
blue.output_type = hwpwm
blue.default_on_value = 100
blue.input_on_command = M828
blue.input_off_command = M829

The S value is the duty cycle in percent. The frequency applies to every output on PWM timer 1; if your file already has a [pwm1] section, keep a frequency that suits all its users. Choose other command numbers if these are in use. See the switch module.

How it works

Each PWM pin switches one colour of all four LEDs through a transistor. J1 contacts 7 to 9PWM Q1 to Q3one per colour D1 to D4mixed light 5 V, JP20LED supply 12 resistorsone per die D1 to D4to transistors
Control above, power below.

Each LED holds a red, a green and a blue die. A separate resistor for every die gives even brightness. Varying the duty cycle of the three signals mixes the colour. The pins only drive transistor gates, so they carry almost no current.

Solder links

Closing JP7 to JP9 lets a second board of the same kind follow the same colour; check that the 5 V supply can feed both.

Solder links as delivered: JP7 open; JP8 open; JP9 open; JP20 closed. JP7 · openchain contact 7 JP8 · openchain contact 8 JP9 · openchain contact 9 JP20 · closedLED power
The links as delivered. Close one with a small blob of solder across both pads; open it by removing the solder or cutting the copper between the pads.
LinkWhat it doesAs delivered
JP7Joins contact 7 to the chain socketOpen
JP8Joins contact 8 to the chain socketOpen
JP9Joins contact 9 to the chain socketOpen
JP20Supplies the LEDs from 5 VClosed

Chaining

Contacts 3 to 6 are free for a further board.

The controller's ribbon cable goes to the connector P IN of the RGB LED board. Inside the board each of the ten pins runs through a solder link to the connector CHAIN, where a second ribbon cable continues to the next board. A closed link passes its pin on, an open link stops it. Controller one ten-pin port RGB LED board P IN CHAIN pin 7, red stops here pin 8, green stops here pin 9, blue stops here one solder link per pin Next board sees what is passed on
Chaining: one port of the controller serves two boards. Pin 1 of P IN leads to pin 1 of CHAIN, pin 2 to pin 2, and so on, each through its own solder link. The three lines stand for the ten pins and show the links as delivered. Two boards must never drive the same pin, and a pin that one board uses for a signal is not free for the next. The colour signals stop here until you close their links.
ContactSignalOn CHAIN
1, 2, 10Power and groundPassed on
3 to 6FreePassed on
7 to 9ColoursStopped by open links

Troubleshooting

SymptomLikely causeWhat to check
Nothing lightsNo 5 V, JP20 open, or configuration not loadedTest point 5 V, JP20, startup messages
One colour missingWrong pin or PWM nameMeasure test points SW_R, SW_G, SW_B (low when on)
Colours exchangedPins crossed in the configurationRed PWM1_2, green PWM1_3, blue PWM1_4
Visible flickerPWM frequency too lowRaise the [pwm1] frequency
Light Meaning
D1 to D4 Colour requested on contacts 7 to 9

Still stuck? Read how to ask for help or see the general troubleshooting guide.

Downloads

FileWhat it is
Schematic (PDF)The circuit diagram
Parts list (CSV)Every component with its value, footprint and part number where one is chosen
Board drawing (PNG)The top view used on this page
3D view, top (PNG)Rendered from the design files; the LED bodies are approximate models
3D view, angled (PNG)Rendered from the design files; the LED bodies are approximate models

Appendix: mounting dimensions

For drilling a mounting plate or designing an enclosure. Positions are hole centres, in millimetres, measured from the top-left corner with the board seen from the component side.

Mounting drawing of the RGB LED board, component side: outline 80 by 80 millimetres with 4 mounting holes. Hole positions are listed in the table below. COMPONENT SIDE · millimetres 80 80 0, 0 X Y 1 5.00, 5.00 2 75.00, 5.00 3 5.00, 75.00 4 75.00, 75.00 Numbered rings are mounting holes. Positions are hole centres, X then Y, from the marked corner.
Board outline 80 × 80 mm, corners rounded to a 1 mm radius, board thickness 1.6 mm. Drawn from the design files, component side up, in the same orientation as the board tour.
HoleX (mm)Y (mm)DiameterUse
15.005.003.2 mm, not platedMounting, M3 screw
275.005.003.2 mm, not platedMounting, M3 screw
35.0075.003.2 mm, not platedMounting, M3 screw
475.0075.003.2 mm, not platedMounting, M3 screw

Appendix: electrical specifications

Every figure is a design value, a calculated or simulated value, or a manufacturer’s data sheet value, as the last column says. A dash means no figure is given.

ParameterApplies toLowerNominalUpperBasis
Supply5 V—5 V—Design
Red current per LEDEach die10 mA16.1 mA22 mASimulated; limits used for the check
Green or blue current per LEDEach die10 mA16.4 mA22 mASimulated; limits used for the check
Total, all channels on5 V—0.196 A0.25 ASimulated

Component stress limits

PartLimitUse on this board
5 V supplyShared host regulatorUp to 0.25 A for this board
Capacitor10 V5 V

Appendix: simulation

The LED currents were simulated with ngspice with all channels fully on.

Each simulated value (yellow mark) against its allowed range (green band). Red current per LED16.1 mA Green or blue current per LED16.4 mA All channels fully on196 mA
Simulated value (yellow) against the limit used for it (green). Each bar has its own scale.
ResultSimulated valueLimitOutcome
Red current per LED16.1 mA10 mA to 22 mAWithin
Green or blue current per LED16.4 mA10 mA to 22 mAWithin
All channels fully on196 mAat most 250 mAWithin

Not simulated: brightness, colour and temperature rise.

Appendix: datasheet

The first page of each manufacturer data sheet. Click a page to open the PDF.

First page of the IN-P55TATRGB RGB LED datasheet
IN-P55TATRGB RGB LED — Inolux, 14 pages.
First page of the AO3400A N-channel MOSFET datasheet
AO3400A N-channel MOSFET — Alpha and Omega Semiconductor, 5 pages.

See all boards on the extension boards page.

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.