Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
180 lines (95 sloc) 8.98 KB

Crackberry Pi hardware


The plan

The idea is to develop a complete and usable handheld system based on the Raspberry Pi. For this purpose we plan to create a PCB that will provide a small touch screen, a tiny keyboard and some other features. Together with a custom enclosure and a Lithium Ion battery this would form a complete handheld system.

basic sketch


####Up and running:

RTC -- code

Random generator -- Lots of noise, lots of 1s and 0s

IR RX -- Using LIRC able to record IR

####Tested but does not work:

Screen -- some wiring issues

Touch controller -- does not show up in i2cdetect


####Not yet tested

Keyboard controller


Battery power and charging


Hardware functionality


3.5" 480x320 resistive touch screen. A number of parties sell boards to interface such screens to the Rasberry Pi already. The screens are generally more or less exactly the same size as the Raspberry Pi.

The preliminary candidate is the CFAF320480C4-035T-TS.

touchscreen TFT

The screen has an integrated Himax HX8357-B microcontroller. It is capable of handling DPI, MIPI and SPI interfaces. The latter we will use, connected directly to the RPi headers.

The resistive touchscreen requires an additional driver IC, for which we will use the TSC2007, which runs on I2C leaving the entire SPI bus for the screen.

LED backlight can be dimmed using pulse width modulation.

screen circuitry

The screen's reset pin is wired to GPIO6. This pin should be pulsed low after bootup and then be kept high for normal operation.

The chip select pin CE0 is wired to GPIO8.

Chip select input
 Controller chip is selected. Communications with host is possible.
 Controller chip is not selected. Host interface signals are ignored by the controller.


Looks like we'll go for the same technology (and designer :) ) as TOHKBD, with the difference that the Crackberry Pi's keyboard will be narrower. The following is a preliminary key layout:

         !     @     #     $     %     ^     &     *     (     )     Del
  ESC   1     2     3     4     5     6     7     8     9     0     BS

         F11   F12   {     }     [     ]     _     -     +     =
  TAB     Q     W     E     R     T     Y     U     I     O     P     CR

                                         ;     :     '     " 
  Caps      A     S     D     F     G     H     J     K     L     CR  CR

             ~     `                       <     >     ? ,   PgUp  Ins \
  Shift       Z     X     C     V     B     N     M     .     Up    /

                                                       Home  PgDn  End
  Sym   Ctrl  Alt              Spacebar                 Left  Down  Right

This keyboard is a combination of a metal frame, a silicon mat, plastic keys and a dome-sticker. Here's a picture:

keyboard tech

The keyboard is controlled by the TCA8424


Real Time Clock

Our circuit provide a Real Time Clock (RTC) to the Raspberry Pi. Plenty of ICs that do this. Will probably need its own miniature battery of some sort.

RTC ic: MCP7940N

Crystal: CM200C

Battery holder: CR1216

Header: 20x2 8.5mm

Display connector: ZIF 50

rtc circuit

RTC setup

Hardware random circuit

Serious cryptographic applications on embedded hardware invariably suffer from a lack of proper sources of random entropy. We're not simply trusting the Pi SoC chip for this, but we're providing an additional noise with two NPN transistors:

random circuit

This needs to be powered by an 18V stepup circuit, powered by a NCP1406:

18V stepup

Quiescent current of circuit needs to investigated and if significant the Pi should be able to turn this on and off as random entropy will only be needed at boot time.

Power, Lithium Ion Battery and charging circuit

Our system should optimally include a hardware on/off switch so that even security-conscious users can be certain the system is actually off when they think it is off.

This means adding an extra micro-usb port on our PCB, which is intended for charging the battery. The RPi will in turn be powered through the appropriate pin on the connector, with a switch in between. This allows the battery to charge while all other components are turned off.

Current best battery we can find is this one from Adafruit, which fits rather perfectly and at 3.7V * 4.4 Ah would give us 16.28 Wh which at 5W gives us somewhat over 3 hrs of operation.


For the charging circuit we will use the BQ24297. This charging IC uses USB input power to charge the battery, has a step-up circuit supplying 5V@1.5A and a complete powerpath management for switching between battery usage and usb input with charging.

Charging circuit

FM transmitter

A Si4713 controlled over I2C steals the audio from the top of the 3.5jack. An antenna wire needs to be soldered on the PCB to transfer the signal.

FM transmitter

IR rx/tx


HAT standard

HATs are Raspberry Pi expansion boards that conform to the standard set by the Raspberry Pi foundation. This involves a small I2C EEPROM filled with manufacturer information as well as size constraints (which we will not meet if we include a keyboard). We should nevertheless try to comply with this standard to the extent possible. This will also cause the Pi bootloader and standard software distributions to know about our GPIO pins, meaning less chance to break something.


This needs to be a CAT24C32 (32kbit, 4kbyte, same package and pin-out). By default the EEPROM is write-protected. By soldering the solder-jumper of shorting the testpads the write-protect is disabled. This will reduce the risk of accidental EEPROM resetting and breaking HAT-'compliance', but still give full freedom to the user.

Check here for further details on EEPROM programming.

RPi GPIO usage


Extended header

Additionally to the functionality inside, the possibility to still fiddle around will be kept intact by extending 18 pins on a 2x9 male header to the side.

gpio out


All development documentation, CAD drawings, driver source code that we develop ourselves is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License unless specified otherwise. Please talk to us is you have commercial plans with any of this: we'll probably work something out.

CC license image

You can’t perform that action at this time.