# Other extensions — GCtronic wiki

> Other extension modules designed by GCtronic for both the e-puck and e-puck2 robots. 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

- Others Extensions (https://www.gctronic.com/doc/index.php?title=Others_Extensions)

---

# Others Extensions

Source: https://www.gctronic.com/doc/index.php?title=Others_Extensions
Last edited: 2026-04-22T12:47:53Z

# Range and bearing

Link: https://www.gctronic.com/doc/index.php?title=Others_Extensions#Range_and_bearing

![randb-1.jpg](https://www.gctronic.com/doc/images/e/e9/randb-1.jpg) ![randb-2.jpg](https://www.gctronic.com/doc/images/8/83/randb-2.jpg)
The board allows situated agents to communicate locally, obtaining at the same time both the range and the bearing of the emitter without the need of any centralized control or any external reference. Therefore, the board allows the robots to have an embodied, decentralized and scalable communication system. The system relies on infrared communications with frequency modulation and is composed of two interconnected modules for data and power measurement.

The documentation and hardware files are available in the following links:

- [Schematics (pdf)](https://projects.gctronic.com/randb/eRandB_Ed.D_Schematics.pdf)
- [Assembling (pdf)](https://projects.gctronic.com/randb/eRandB_Ed.D_Assembling.pdf)
- [Bill of Materials (xls)](https://projects.gctronic.com/randb/eRandB_Ed.D_BillOfMaterials.xls)
- [PCB (pdf)](https://projects.gctronic.com/randb/eRandB_Ed.D_PCB.pdf)
- [Hardware source files(zip)](https://projects.gctronic.com/randb/eRandB_Ed.D_HardwareSourceFiles.zip)
- [Fabrication: Gerber, pick and place, ... (zip)](https://projects.gctronic.com/randb/eRandB_Ed.D_Fabrication.zip)
- [e-RandB manual (pdf)](https://projects.gctronic.com/randb/eRandB_manual.pdf)
- [e-RandB firmware (zip)](https://projects.gctronic.com/randb/eRandB_firmware.zip)
- [e-puck software and examples (tgz)](https://projects.gctronic.com/randb/eRandB_software.tgz)

You can find more information about this board in the following links: <https://www.e-puck.org/index.php?option=com_content&view=article&id=35&Itemid=23>.

The following table lists the I2C the registers map:

> | Address | Read | Write |
> | --- | --- | --- |
> | 0 | 1 if data available, 0 otherwise | - |
> | 1 | data MSB | - |
> | 2 | data LSB | - |
> | 3 | bearing MSB | - |
> | 4 | bearing LSB: `double((MSB<<8)+LSB)*0.0001` to get angle in degrees | - |
> | 5 | range MSB | - |
> | 6 | range LSB | - |
> | 7 | max peak (adc reading) MSB | - |
> | 8 | max peak (adc reading) LSB | - |
> | 9 | sensor that received the data (between 0..11) | - |
> | 12 | - | Set transmission power (communication range): between 0 (max range) and 255 (min range) |
> | 13 | - | data MSB (prepare) |
> | 14 | - | data LSB (send `(MSB<<8)+LSB`) |
> | 16 | - | 0 store light conditions (calibration) |
> | 17 | - | 0=onboard calculation, 1=host calculation |

## Firmware source code

Link: https://www.gctronic.com/doc/index.php?title=Others_Extensions#Firmware_source_code

The firmware code of the range and bearing extension is open source and is available as a git repository. To download the source code you need to install git on your system:

- Windows: downlaod git from <https://gitforwindows.org/> and follow the installation instructions (default configuration is ok)
- Linux: issue the command `sudo apt-get install git`
- Mac: issue the command `brew install git`

The source code can downloaded with the command: `git clone https://github.com/gctronic/range_and_bearing_firmware.git`
The command must be issued in `Git bash` on Windows, or in a terminal on Linux / Mac.

You can download the pre-built firmware in the following link [range and bearing firmware (17.12.21)](https://projects.gctronic.com/randb/range_and_bearing_firmware_17.12.21_f928563.hex).

## e-puck 1

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

A simple [MPLAB project](https://projects.gctronic.com/randb/test-eRandB.zip) was created to let start using these modules. With the selector it's possible to choose whether the robot is an emitter (selector in position 0) or a receiver (selector in position 1). The receiver will send the information (data, bearing, distance, sensor) through Bluetooth.

## e-puck 2

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

The e-puck2 standard firmware contains examples usages of the range and bearing extension. When the selector is in position 4 then the robot is set to be a receiver or a transmitter (you can switch between roles using the small button on the back of the robot), when in position 5 then the robot is both transmitter and receiver at the same time. In both demos the information received (data received, bearing, distance and sensor id) will be printed via Bluetooth and USB.

It's important to notice that in both these demos the time of flight sensor is disabled in order to avoid (infrared) interference with the front sensors of the range and bearing extension; you can use it in your application if you want but you need to take in consideration this side effect.
Moreover also the proximity sensors of the robot interfere with the range and bearing communication, so you have some options to increase communication distance and throughput: first of all if you don't need the proximities you can simply disable them, otherwise you can set a slower proximity sampling frequency and disable the proximity sampling during transmission of a message. The latter option is implemented in the demo 5.

Beware that the only communication channel available between the robot and the range and bearing extension is the I2C bus, the UART channel is not available with e-puck 2.

# Ground sensors

Link: https://www.gctronic.com/doc/index.php?title=Others_Extensions#Ground_sensors

![E-puck-groundsensors.jpg](https://www.gctronic.com/doc/images/3/31/E-puck-groundsensors.jpg)

The factory firmware of both the e-puck1 and e-puck2 supports the ground sensors extension: for e-puck1 refer to the section [Standard firmware](https://www.gctronic.com/doc/index.php?title=E-Puck#Standard_firmware), for e-puck2 refer to section [Factory firmware](https://www.gctronic.com/doc/index.php?title=e-puck2#Factory_firmware).

Once the robot is programmed with its factory firmware, you can get the values from the ground sensors through Bluetooth by putting the selector in position 3 and issueing the command `m` that will return 5 values, the first 3 values are related to the ground sensors (left, center, right), the last 2 values are related to the cliff extension (if available).
For more information about the Bluetooth connection refer to section [Getting started](https://www.gctronic.com/doc/index.php?title=E-Puck#Getting_started) (e-puck1) or [Connecting to the Bluetooth](https://www.gctronic.com/doc/index.php?title=e-puck2_PC_side_development#Connecting_to_the_Bluetooth) (e-puck2).
For more information about the Bluetooth protocol refer to section [Advanced sercom protocol](https://www.gctronic.com/doc/index.php?title=Advanced_sercom_protocol).

If you couple the e-puck extension for Gumstix Overo with the ground sensor refer to the section <https://www.gctronic.com/doc/index.php/Overo_Extension#Ground_sensor> to have an example on how to read the sensor values.

You can find more information about the ground sensors extension module in the following link <https://www.e-puck.org/index.php?option=com_content&view=article&id=17&Itemid=18>.

## Assembly for e-puck2

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

| [1] | [2] | [3.1] | [3.2] | [3.3] | [3.4] |
| --- | --- | --- | --- | --- | --- |
| ground-assembly-1.png | ground-assembly-2.png | ground-assembly-3.1.png | ground-assembly-3.2.png | ground-assembly-3.3.jpegground-assembly-3.4.jpeg | ground-assembly-3.5.png |
| [4] | [5.1] | [5.2] | [5.3] | [5.4] | [6] |
| ground-assembly-4.png | ground-assembly-5.1.png | ground-assembly-5.2.png | ground-assembly-5.3.png | ground-assembly-5.4.png | ground-assembly-6.png |

1. Unscrew the 3 spacers and remove the battery.
2. Remove the top side from the case body gently.
3. Detach the plastic camera adapter from the camera with the help of pliers; be careful to not stress the camera flex cable. Then you need to cut off the two protruding pieces (see 3.2) on the back of the plastic adapter; for this operation you can use nippers (see 3.3). Take the adapter (now is flat on the back as shown in 3.4) and insert it as before.
4. Plug the ground module into its connector on the e-puck2; make the cable pass through the battery contact.
5. First push the ground module within its slot in the body case, then slide in also the top side of the robot paying attention to the motors wires position: the back battery contact must remain between the body and motors wires and make sure the wires aren't stuck in the springs. Both the ground cable and camera flex cable must bend forming an "S" shape.
6. Push the top all way down, then remount the spacers and plug in the battery. You're done.

# Cliff sensor

Link: https://www.gctronic.com/doc/index.php?title=Others_Extensions#Cliff_sensor

The cliff module extends the capability of the groundsensor with two additional sensors placed in front of the wheels. One possible application is that the e-puck can now detect the end of a table and react accordingly. Moreover this module can be coupled with the automatic charger for the e-puck, that could let the robot autonomously charge itself when needed. The two spring contacts adapt only to the cliff module.

## Assembly

Link: https://www.gctronic.com/doc/index.php?title=Others_Extensions#Assembly

| [1] | [2] | [3] | [4.1] | [4.2] |
| --- | --- | --- | --- | --- |
| cliff-mounting-1.jpg | cliff-mounting-2.jpg | cliff-mounting-3.jpg | cliff-mounting-4-1.jpg | cliff-mounting-4-2.jpg |
| [5.1] | [5.2] | [6] | [7] | [8] |
| cliff-mounting-5-1.jpg | cliff-mounting-5-2.jpg | cliff-mounting-6.jpg | cliff-mounting-7.jpg | cliff-mounting-8.jpg |

1. Unscrew the 3 screws, unmount the e-jumper (top piece where there is the speaker) and unscrew the 3 spacers
2. Remove the pcb from the case body gently
3. Detach the two parts, cliff and ground pcb
4. Plug the ground module into its connector on the e-puck
5. Attach the cliff module to the ground module being careful to leave the battery contact in the middle
6. Push the ground module within its slot in the body case, the cliff module will remain external
7. Once both the modules are aligned, push them down
8. The modules will remain really close to the case bottom; once the modules are fitted remount the spacers, the e-jumper and the screws

## Electrical schema

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

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

## Software

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

### e-puck firmware

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

Refers to the section [E-Puck Standard firmware](https://www.gctronic.com/doc/index.php/E-Puck#Standard_firmware) for the firmware that need to be uploaded to the robot.
Essentially the standard *asercom* demo (selector 3) released with the e-puck robot is extended in order to request and visualize 5 sensors values instead of 3 when issueing the *m* command; the sequence is: ground left, ground center, ground right, cliff right, cliff left. In order to enable the cliff sensors you need to *define CLIFF_SENSORS* in the *asercom.c* file in order to build the code parts related to this module.

### e-puck demos

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

To demonstrate the capabilities of the cliff sensors module here is an MPLAB project [Demo-cliff-autocharge.zip](https://projects.gctronic.com/cliff-sensor/Demo-cliff-autocharge.zip) that contains two demos:

- selector 0: in this demo the robot is eventually piloted to the charger station autonomously after moving around for some time aovoiding obstacles; the demo is shown in the [video section](https://www.gctronic.com/doc/index.php/Others_Extensions#Videos).
- selector 1: this is a cliff avoidance demo in which the robot is moved forward until it detects the end of the table and tries to avoid it moving back and rotating; the demo is shown in the [video section](https://www.gctronic.com/doc/index.php/Others_Extensions#Videos).

### Extension firmware

Link: https://www.gctronic.com/doc/index.php?title=Others_Extensions#Extension_firmware

The ground sensor fimrware developed at EPFL (can be downloaded at the <https://www.e-puck.org> site from [this page](https://www.e-puck.org/index.php?option=com_phocadownload&view=category&id=9:ground-sensors&Itemid=38)) was extended to interact with the additional two sensors. The source code can be downloaded from [cliff-firmware](https://projects.gctronic.com/cliff-sensor/pic18_floor_sensor_c18-cliff.zip); it is an MPLAB project and the MPLAB C Compiler for PIC18 MCUs is needed to build the project.
The communication between the e-puck and the module is handled through I2C (address 0xC0) and the following registers are defined:

- 0x00: reflected light, left IR sensor - high byte
- 0x01: reflected light, left IR sensor - low byte
- 0x02: reflected light, center IR sensor - high byte
- 0x03: reflected light, center IR sensor - low byte
- 0x04: reflected light, right IR sensor - high byte
- 0x05: reflected light, right IR sensor - low byte
- 0x06: ambient light, left IR sensor - high byte
- 0x07: ambient light, left IR sensor - low byte
- 0x08: ambient light, center IR sensor - high byte
- 0x09: ambient light, center IR sensor - low byte
- 0x0A: ambient light, right IR sensor - high byte
- 0x0B: ambient light, right IR sensor - low byte
- 0x0C: software revision number
- 0x0D: reflected light, right cliff sensor - high byte
- 0x0E: reflected light, right cliff sensor - low byte
- 0x0F: reflected light, left cliff sensor - high byte
- 0x10: reflected light, left cliff sensor - low byte
- 0x11: ambient light, right cliff sensor - high byte
- 0x12: ambient light, right cliff sensor - low byte
- 0x13: ambient light, left cliff sensor - high byte
- 0x14: ambient light, left cliff sensor - low byte

### e-puck2 demos

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

The same demo developed for the e-puck1 that let the robot autonomously reach the charging station and charge itself is available also for the e-puck2. You can find the source code in the following repository <https://github.com/e-puck2/e-puck2_cliff_autocharge>.

## Images

Link: https://www.gctronic.com/doc/index.php?title=Others_Extensions#Images

Robot equipped with the cliff sensor:
![Cliff+charger.jpg](https://www.gctronic.com/doc/images/9/90/Cliff%2Bcharger.jpg)

The robot can be easily moved to the charging station as shown in the following figure:
![Cliff-charging.jpg](https://www.gctronic.com/doc/images/3/38/Cliff-charging.jpg)

The following figure shows the two additional sensors (near the wheels) mounted on the cliff module and the three frontal sensors of the ground module:
![Cliff-zoom.jpg](https://www.gctronic.com/doc/images/7/7a/Cliff-zoom.jpg)

## Videos

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

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

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