# RGB Panel — GCtronic wiki

> RGB panel extension, compatible with both e-puck and e-puck2. Check which robot a statement refers to.
>
> Generated 2026-10-08 13:11 UTC from https://www.gctronic.com/doc/index.php. Pages in this file: 1.
>
> When answering questions from this file, use only its content, cite the page and section you rely on together with its direct link (the "Link:" line under each section heading), and say explicitly when the answer is not here.

## Contents

- RGB Panel (https://www.gctronic.com/doc/index.php?title=RGB_Panel)

---

# RGB Panel

Source: https://www.gctronic.com/doc/index.php?title=RGB_Panel
Last edited: 2026-04-22T12:08:03Z

# Overview

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#Overview

The RGB panel is a new module designed to be suitable for the e-puck robot. It is comprised of:

- 9 RGB LEDs
- 8 infrareds
- [PIC18F6722 microcontroller](https://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010316) ([datasheet](https://ww1.microchip.com/downloads/en/DeviceDoc/39646c.pdf))

Every LED is independent from each other, so it's possible to turn on the LEDs with different colors in the RGB color space (additive color mixing), as shown in the following figures.
![RGBpanel1.png](https://www.gctronic.com/doc/images/b/be/RGBpanel1.png) ![RGBpanel2.png](https://www.gctronic.com/doc/images/5/5a/RGBpanel2.png) ![Rgb-panel1.jpg](https://www.gctronic.com/doc/images/8/8c/Rgb-panel1.jpg) ![Rgb-panel2.jpg](https://www.gctronic.com/doc/images/1/13/Rgb-panel2.jpg)

The infrareds are thought as identification sensors, this means that the robots can be recognized by an external device such as a camera observing their combination of infrareds turned on and off; for instance using 8 IRs it's possible to identify 256 different robots.

The communication between the e-puck and the module is via the I2C bus. Color commands are sent from the robot to the RGB panel (nothing is sent in the opposite way); this let us, for example, program the robot with a pre-fixed sequence of commands to send to the panel, resulting in a color animation. Other more elaborate demos could be implemented, reacting for example to the environment and nearby robots.
Another possibility is to develop a demo running on a computer and connecting the computer to the e-puck through Bluetooth (the e-puck and the module are connected through I2C as before); in practice the robot receives commands from the PC and forwards them to the RGB panel. This forwarding is implemented in the e-puck firmware, presented afterwards.

# Electrical schema

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#Electrical_schema

The circuit diagram of the rgb panel e-puck extension is available to the community on the following link [electrical schema](https://projects.gctronic.com/rgb-panel/rgb-ext-electrical-schema.pdf).

# Software

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#Software

## E-puck firmware

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#E-puck_firmware

In order to play with the RGB extension for the e-puck robot you need to load the official e-puck firmware and set the selector on position 3 (advanced sercom protocol), refer to section [E-Puck Standard firmware](https://www.gctronic.com/doc/index.php/E-Puck#Standard_firmware). Basically the firmware contains a command to setup the color of each led and the state of each infrared sensor; in particular there are two commands (binary mode): 'W' and 'w'; the first one is used to set a single led or infrared sensor, the second is used to set all actuators at once.

## RGB panel firmware

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#RGB_panel_firmware

Also the module requires a firmware running on it in order to handle the I2C communication and interpret the commands needed to turn on and off the sensors and color leds. The firmware can be downloaded from the following links ([panel-MPLAB](https://projects.gctronic.com/rgb-panel/panel-firmware.zip), [panel-hex](https://projects.gctronic.com/rgb-panel/panel-firmware.hex)).

## Demo - PC side

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#Demo_-_PC_side

A basic demo running on a computer was developed to control manually all the LEDs color and IRs state through a Bluetooth connection. The application is implemented with [Qt](https://www.qt.io/download). A snapshot of this demo is shown hereafter:
![LEDTurretDemo.png](https://www.gctronic.com/doc/images/a/a4/LEDTurretDemo.png)

[Download RGB Panel Basic Demo (Multiplatform)](https://www.gctronic.com/doc/images/LEDsTurret1.7.zip), built with Qt-5.10.1.

## e-puck2

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#e-puck2

To play with the e-puck2 robot and RGB extension you can run the same [PC side application](https://www.gctronic.com/doc/index.php?title=RGB_Panel#Demo_-_PC_side) that is used with the e-puck1. In this case the e-puck2 robot must be programmed with the [factory firmware](https://www.gctronic.com/doc/index.php?title=e-puck2#Factory_firmware) and the selector must be placed in position 3.
A Python example is also available in the following link [set_rgb_panel.py](https://projects.gctronic.com/epuck2/set_rgb_panel.py) in order to control the RGB panel from the computer via Bluetooth.

Beware that in order to change the selector postion, **both the e-puck2 and RGB panel must have the selector in the same position**, this means that if you want the position 3 selected, then both the selector of the robot and the selector of the RGB panel must be placed in position 3.

If you want to control the RGB extension directly from the e-puck2, then you can do it by using the I2C bus (see chapter [Registers](https://www.gctronic.com/doc/index.php?title=RGB_Panel#Registers)). An example is provided to help you getting started, have a look at the following repository <https://github.com/e-puck2/e-puck2_rgb_panel>.

# Programming

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#Programming

## Registers

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#Registers

The LEDs and IRs are controlled by writing appropriate registers; the value within the registers represents the duty cycle that a LED/IR will reach, that is its brightness. The following table shows the registers used to configure the various LEDs and IRs.

> | X | RedX | BlueX | GreenX | IRX |
> | --- | --- | --- | --- | --- |
> *Parameter registers*
>
> | 0 | 0x00 | 0x08 | 0x10 | 0xA4 |
> | --- | --- | --- | --- | --- |
> | 1 | 0x01 | 0x09 | 0x11 | 0xA5 |
> | 2 | 0x02 | 0x0A | 0x12 | 0xA6 |
> | 3 | 0x03 | 0x0B | 0x13 | 0xA7 |
> | 4 | 0x04 | 0x0C | 0x14 | 0xA8 |
> | 5 | 0x05 | 0x0D | 0x15 | 0xA9 |
> | 6 | 0x06 | 0x0E | 0x16 | 0xAA |
> | 7 | 0x07 | 0x0F | 0x17 | 0xAB |
> | 8 | 0x92 | 0x93 | 0x94 | - |

## Example

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#Example

The RGB panel can be controlled through either ASCII or binary commands. The following example illustrates the sequence of commands that must be
issued to turn on the LED0 at maximum brightness (all 3 R,G and B at maximum) using a terminal and the e-puck programmed with the standard firmware:

```
W, 176, 0, 128   [set red led0 max]
W, 176, 8, 128   [set blue led0 max ]
W, 176, 16, 128  [set green led0 max]
W, 176, 145, 1   [set command register (command terminator)]
```

where in the first line *W* is the command (I2C write), *176* is the I2C address of the RGB panel (fixed), *0* is the register address and *128* the brightness value. The last line contains a special command that is sent to the module when it's required to update the LEDs and IRs with the new values; this means that even if the first command is sent to the RGB panel, nothing will change until the last command is sent.

The binary version (a bit faster), using the *-w* command, of the previous sequence is:

```
... init communication ...

sprintf(buffer, 5, "%c%c%c%c",-‘W’, 176, 0, 128);
sprintf(&buffer[5], 5, "%c%c%c%c",-‘W’, 176, 8, 128);
sprintf(&buffer[10], 5, "%c%c%c%c",-‘W’, 176, 16, 128);
sprintf(&buffer[15], 5, "%c%c%c%c",-‘W’, 176, 145, 1);

... send buffer ...
```

# Videos

Link: https://www.gctronic.com/doc/index.php?title=RGB_Panel#Videos

[Video](https://www.youtube.com/howyoutubeworks/user-settings/privacy/)

The robot changes color basing itself on what his small camera sees, just like a real chameloen. This system is based on the standard e-puck on the bottom, the new 3x3 RGB display on top and a proper demo.
You can download the source code of this demo in the following link [epuck-demo-chamaleon](https://projects.gctronic.com/rgb-panel/epuck-demo4.zip).

[Video](https://www.youtube.com/howyoutubeworks/user-settings/privacy/)

Artistic pattern formation with multiple robots.
