Hacking a Fairphone

...or how to build an extension module, that can enhance your abilities with your phone.

Similar projects worth following
In this project I`m building modules for the extansion port of the modular smartphone "Fairphone". I will start with a relatively easy one, that will give three capa. buttons to your mobile phone on the back.

1. Building a prototype:

   The first step was to designe a small PCB with capacitive buttons on it and to mill it with my othermill, to check out how easy or hard it would get to read out the buttons with an atmega32u4 aka an arduino pro micro aka an arduino leonardo board.

This first test was quite successfull and I was able to controll the volume of my laptop very easyly.

2. Test the test-circuit with an phone:

Because I bought the Fairphone recently and it didn`t arrive jet, I had to test it with an other mobile phone (with usb otg). This worked also quite well and so ...

3. The real PCB for the Fairphone:

I designed this small circuit around the atmega32u4 and also added some interface-connectors for I2C, ISP and some analog pins for later hacking purpose or for tinkering around with this board as basicboard.

Tada and this is the PCB. It`s not completely finished but I think definitly on a good way!! If you notice some issues or have some ideas about this project please tell me  !!

4. Soldering the PCB

I grapped some unused old pcbs which I had laying around (same height as FP2-pcb) and secured them together in a rectangle.In the next step I attached the stencil to the PCB with some clear tape to keep it in Palace when the solder paste is spread with a scoop. Then I placed all parts according to the board-designe and soldered it with my TS100 and a small tip.

This is the result and I'm pretty happy with it:

5. Making a fitting case for the pcb

After hours of tinkering and searching for 3D-files of other cases made for the FP2, the company released it`s 3D-files of their cases. This boosted the hole thing immediatly and I was able to do some productive constructions. The result is....

6. The good feeling

I printed the case in flexible filament and it went quite nice :)

Here is the result of my work:

7. Next step 

I´m really happy with the good result I achieved. The next big step will be to develop something like a proto-shield, where you can tinker savely and fast.

This PCB will have all kinds of interfaceports like I2C and so on. And I also plan to have a pinhole-grid. So you can say, this will be pretty much like the Arduino-setting.

8. Designes have to be made

Here is the result of a few hours of tinkering!! :)

I ordered those boards. Can´t wait to get them :)

Features of my new PCB: 

-> tinkering-area

-> more LEDs

-> interface ports

-> temperature Sensor

-> WS2812B

-> castellated pinholes for interfaces, analog pins and charging port

-> thickness of the PCB around 0.8 mm 

-> Atmega32U4 => HID

-> new smaller crystal-package

9. New designed case

I ordered this one on Shapeways and it also will be offered on my shop. 

Let´s hope SLS is the way of success!

 I hope you like it !!!

And before I forget it, those two github-pages and the people behind those were a big help to gather some informations:


GCODE of the lower part of the cover for the tinkering area (for normal and special cover of the DIY-shield)

gcode - 681.57 kB - 03/19/2018 at 18:25



GCODE of the upper part of the cover for the tinkering area (for normal and special cover of the DIY-shield)

gcode - 93.52 kB - 03/19/2018 at 18:25



STL-file of the cover for the tinkering area (for normal and special cover of the DIY-shield)

Standard Tesselated Geometry - 99.01 kB - 03/19/2018 at 18:25



PDF of the circuit (eagle) for the DIY-shield (Rev.1)

Adobe Portable Document Format - 79.23 kB - 03/13/2018 at 16:15



special version of the case for the DIY-shield (FP2) with a window ( + the right cover for this slot )

step - 2.81 MB - 03/13/2018 at 16:15


View all 13 files

  • New milled cover for the tinkering area of the DIY-shield

    Kirschner Christoph5 days ago 0 comments

  • Hallo World (DIY extension)

    Kirschner Christoph02/19/2018 at 18:53 0 comments

     Name:		Hallo_World_DIY_Extension_FP2.ino
     Created:	07.01.2018 13:13:43
     Author:	Kirschner Christoph
    #include <Adafruit_NeoPixel.h>
    int LEDs[8]{ 8,9,10,11,12,13,14,15 };
    // Pin connected to the Neopixel 
    #define PIN            17
    // How many NeoPixels are attached 
    #define NUMPIXELS      1
    // Definition of the Neopixel
    Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
    void setup() {
    // Setting the pinmode of the GPIOs for the LEDs
    	for (int i = 0; i < 8; i++) {
    		pinMode(LEDs[i], OUTPUT);
    // Starting the Neopixel
    	pinMode(17, OUTPUT);
    void loop() {
    // LEDs are blinking in a row 
    	for (int i = 0; i < 8; i++) {
    		digitalWrite(LEDs[i], HIGH);
    		if (i > 0) {
    			digitalWrite(LEDs[i - 1], LOW);
    	for (int i = 8; i >= 0; i--) {
    		digitalWrite(LEDs[i], HIGH);
    		digitalWrite(LEDs[i + 1], LOW);
    	for (int i = 0; i<256; i++) {		
    		// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    		pixels.setPixelColor(0, pixels.Color(0, i, 0)); // Moderately bright green color.; // This sends the updated pixel color to the hardware.
    		delay(5); // Delay for a period of time (in milliseconds).
    	for (int i = 255; i>0; i--) {	
    		// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    		pixels.setPixelColor(0, pixels.Color(0, i, 0)); // Moderately bright green color.; // This sends the updated pixel color to the hardware.
    		delay(5); // Delay for a period of time (in milliseconds).
    	pixels.setPixelColor(0, pixels.Color(0, 0, 0)); // Neopixel: off; // This sends the updated pixel color to the hardware.

  • DIY extension -> "Hello World"

    Kirschner Christoph01/07/2018 at 12:02 0 comments

  • Programming adapter

    Kirschner Christoph01/01/2018 at 21:23 0 comments

    This makes programming a lot easier!! :)

  • Last PCB ~ you better be fast

    Kirschner Christoph12/15/2017 at 15:01 0 comments

    I sold all other pcbs of the cap. buttons and now one is still here :) 

    Any Fairphoners out there who want one :) 

    I also can solder everything up for you if you want that :) 

    Text me if there's interest !!! :) 

    Edit: sold !! 

  • New PCB

    Kirschner Christoph12/10/2017 at 12:54 0 comments

    I designed and ordered a new PCB for the Fairphone 2. 

    It`s much like those prototyping-shields you have for your Arduino. And the purpose is to start tinkering and building things in combination with the PF2. This can not only extand your possiblities you have with your phone but also gives you the full control of the additional hardware you want.

    Feel free to ask whatever is on your mind :)

  • Code to get basic functions

    Kirschner Christoph12/03/2017 at 17:16 0 comments

     Name:		Touch_Extension_FP2.ino
     Created:	03.12.2017 15:03:18
     Author:	Kirschner Christoph
    #include <HID.h>
    #include <HID-Settings.h>
    #include <HID-Project.h>
    #include <CapacitiveSensor.h>
    * CapitiveSense Library Demo Sketch
    * Paul Badger 2008
    * Uses a high value resistor e.g. 10M between send pin and receive pin
    * Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values.
    * Receive pin is the sensor pin - try different amounts of foil/metal on this pin
    const int led1 = 6;
    const int led2 = 8;
    const int led3 = 9;
    bool buttonPressed1 = false; // volume up
    bool buttonPressed2 = false; // wake screen/ sleep screen
    bool buttonPressed3 = false; // volume down
    int firstPress1 = 0; // first press of button 1 aka volume up
    int firstPress2 = 0; // first press of button 2 aka wake screen/ sleep screen
    int firstPress3 = 0; // first press of button 3 aka volume down
    bool screenCase = true;
    CapacitiveSensor   cs_13_A0 = CapacitiveSensor(13, A0);        // 1.1M resistor between pins 13 & A0, pin A0 is sensor pin, add a wire and or foil if desired
    CapacitiveSensor   cs_5_A1 = CapacitiveSensor(5, A1);        // 1.1M resistor between pins 5 & A1, pin A1 is sensor pin, add a wire and or foil
    CapacitiveSensor   cs_10_A2 = CapacitiveSensor(10, A2);        // 1.1M resistor between pins 10 & A2, pin A2 is sensor pin, add a wire and or foil
    void setup()
    	pinMode(13, OUTPUT);
    	pinMode(10, OUTPUT);
    	pinMode(5, OUTPUT);
    	pinMode(A0, INPUT);
    	pinMode(A1, INPUT);
    	pinMode(A2, INPUT);
    void loop()
    	long start = millis();
    	long total1 = cs_13_A0.capacitiveSensor(30); // touch output in numbers
    	long total2 = cs_5_A1.capacitiveSensor(30);
    	long total3 = cs_10_A2.capacitiveSensor(30);
    	if (total1 > 100) { digitalWrite(led1, HIGH); } // lighting up the right leds
    	else { digitalWrite(led3, LOW); }
    	if (total2 > 100) { digitalWrite(led2, HIGH); }
    	else { digitalWrite(led2, LOW); }
    	if (total3 > 100) { digitalWrite(led3, HIGH); }
    	else { digitalWrite(led1, LOW); }
    	/*	Serial.print("Total1");
    	Serial.println(total3); */
    	int time = millis();
    	if (total3 > 100 && buttonPressed1 == false) {
    		firstPress1 = millis();
    		buttonPressed1 = true;
    	if (total3 < 50 && buttonPressed1 == true) {
    		if (time - firstPress1 > 50) {
    			Consumer.write(MEDIA_VOL_UP); // HID code for volume up
    			//Serial.println("vol up");
    		buttonPressed1 = false;
    	time = millis();
    	if (total2 > 100 && buttonPressed2 == false) {
    		firstPress2 = millis();
    		buttonPressed2 = true;
    	if (total2 < 50 && buttonPressed2 == true) {
    		if (time - firstPress2 > 50) {
    			if (screenCase == true) {
    				screenCase = false;
    			} else if (screenCase == false) {
    				Keyboard.write(CONSUMER_POWER); //HID code for waking phone/set phone to sleep
    				screenCase = true;	
    			//Serial.println("power on/off");
    		buttonPressed2 = false;
    	time = millis();
    	if (total1 > 100 && buttonPressed3 == false) {
    		firstPress3 = millis();
    		buttonPressed3 = true;
    	if (total1 < 50 && buttonPressed3 == true) {
    		if (time - firstPress3 > 50) {
    			Consumer.write(MEDIA_VOL_DOWN); // HID code for volume down
    			//Serial.println("vol down");
    		buttonPressed3 = false;

  • FP-Forum

    Kirschner Christoph11/27/2017 at 20:37 0 comments

    This is the forum-page in the FP-forum:

    I'm trying to blog frequently :)

  • First try for a case

    Kirschner Christoph11/23/2017 at 16:58 0 comments

    I grapped the 3d-files keesj had in his github repositorie, tinkered a little bit around with it, did some measurements and now I´m goining to print it with some flexible kind of material. 

    Wish me luck!!

  • Happy evening with eagle

    Kirschner Christoph11/16/2017 at 21:15 0 comments

    Layout is finished and now Aisler please do your thing well !! :P

View all 11 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates