Skip to the content
PCBKitNew board
2 layers54.6 × 68 mmRng pcb, the printed circuit board in 3D

A hardware random number generator that uses avalanche noise. Based on the Trinket M0.

Size
54.6 × 68 mm
Copper layers
2
Thickness
1.6 mm
Parts
46
Nets
44
Pads
153
Tracks, vias
169, 26
Pours
4
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
17 Nov 2019
Updated
5 Sep 2022

Overview

Rng pcb is an open-source printed circuit board by mitsake, from the mitsake/rng-pcb repository on GitHub, published under the CC-BY-SA-4.0 licence. It is a 2-layer board of 54.6 × 68 mm with 46 parts on 44 nets, routed with 169 tracks and 26 vias.

It is built around the ATSAMD21E18A-AF, AP2112K-3.3 and MMBT3904. Its parts include 10 capacitors, 6 resistors, 6 connectors, 3 ICs and 3 transistors. It belongs with the SAM D and SAM boards of this library.

Main components

3

README

readme.md

CircuitPython Random Number Generator

This is my contribution to the Boldport Club's community run Board Swap Project, a hardware random number generator that uses avalanche noise to make patterns and roll dice. Apart from being part of the community project, my other motivations were interest in randomness and the processes that can be used to generate it, along with the idea of using PCBs to build an enclosure.

Please note that I made this for fun - if you need random numbers for anything important, this isn't the project you're looking for.

Operation

A ST662 charge pump produces the 12 V required to reverse-bias Q1, which produces the actual randomness. When electrons travel through this junction, Q2 allows current to flow to ground. This signal is amplified by Q3, run through a voltage divider, and fed into the ADC of an ATSAMD21E18 microcontroller, which has been flashed with the Adafruit Trinket M0 bootloader to allow programming with CircuitPython.

Electronic schematic showing three transistors connected in a way that produces random noise

The display is an inexpensive 128 × 32 SSD1306-based OLED, and the in-built capacitive touch that's on the Trinket M0 hardware is routed to the top left (pin A3) and right (A4) corners of the top PCB to allow for input. If you don't have KiCad, you can use the PDF schematic - it's all pretty simple.

Making your own

You can use the KiCad files in the 'hardware' directory to generate gerbers and get them made at your favourite PCB fab. I had my prototypes made at OSH Park (who accept the .kicad_pcb file directly), and once I'd finished the final design, got a 'protopack' made at Dirty PCBs. The gerbers are available in a zip file which should be accepted by most fabs, and assembly instructions can be found here. Make sure the PCB thickness is 1.6 mm - Dirty PCBs default to 1.2 mm, which will cause clearance issues.

Credits

This project was only possible thanks to the electrical designs, libraries, and articles written by others. Many thanks to the people below whose work was used to build this project, and to the Boldport Club Discord for the inspiration to build something and the help and support they're always happy to provide.

  • Adafruit's Trinket M0 schematic, which I shamelessly copied for the microcontroller and its supporting components. I've also used Adafruit's bootloader (and consequently their USB VID and PID), so this project is strictly a DIY build. Please don't distribute finished versions of this project with the Adafruit bootloader installed.
  • Aaron Logue's Hardware Random Number Generator started me on the path towards making the project, and gave the basic circuit.
  • Giorgio Vazzana's amazing writeup of his experiments with this design, including precise measurements of transistor breakdown voltages, analogue and digital output circuits, and rigorous testing of the output.
  • Walter Anderson's Google Sites page has a lot of really interesting information on entropy, both from this design and others.
  • Rob Seward's Arduino Uno design feeds the output from the noise circuit into an ADC and uses software to produce the actual random bits, an approach I mostly copied.
  • The pattern on the top PCB (triangle_pattern.kicad_mod) is made with Quinn Rohlf's Trianglify library.
  • The mouse-bite-2mm-slot.kicad_mod footprint comes from this repository by madworm.

Parts

46
QtyValueFootprintReferences
6VAL**rng-pcb:mouse-bite-2mm-slotmouse-bite-2mm-slot, mouse-bite-2mm-slot, mouse-bite-2mm-slot, mouse-bite-2mm-slot, mouse-bite-2mm-slot, mouse-bite-2mm-slot
40.1uCapacitors_SMD:C_0603C4, C5, C8, C10
44k7Resistors_SMD:R_0603R1, R2, R3, R5
4Conn_01x01_Malerng-pcb:TH_PadJ3, J4, J5, J6
3MMBT3904Package_TO_SOT_SMD:SOT-416Q1, Q2, Q3
20.22uCapacitors_SMD:C_0603C2, C3
210uCapacitors_SMD:C_0603C1, C7
21uCapacitors_SMD:C_0603C6, C9
2TestPointConnectors_TestPoints:Test_Point_Pad_d1.0mmTP1, TP2
11MResistors_SMD:R_0603R4
11k5Resistors_SMD:R_0603R6
1AP2112K-3.3TO_SOT_Packages_SMD:TSOT-23-5U1
1ATSAMD21E18AHousings_QFP:TQFP-32_7x7mm_Pitch0.8mmU3
1LOGOrng-pcb:triangle_patternG***
1OLEDConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2
1ST662AHousings_SOIC:SOIC-8_3.9x4.9mm_Pitch1.27mmU2
1SW_Pushrng-pcb:Wurth-434331013822SW1
1USB_B_Microrng-pcb:Molex-476420001J1

The 38 most common of 46 parts.

Questions

How big is the Rng pcb PCB?

It measures 54.6 × 68 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Rng pcb use?

46 parts, built around the ATSAMD21E18A-AF, AP2112K-3.3 and MMBT3904. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Rng pcb KiCad files?

From the mitsake/rng-pcb repository on GitHub, at the commit this page was made from: the board is hardware/rng-pcb.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Rng pcb design in my own project?

Its repository publishes it under the CC-BY-SA-4.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 4 layers44.5 × 34.9 mmEclair, the printed circuit board in 3D

    Eclair

    upbeatcarri/eclair

    Pocket device for taking quick notes, acting as a USB keyboard for PC sync etc., with custom apps samd21, tinygo

    56 parts25
  • 2 layers36.6 × 36.4 mmShirtty, the printed circuit board in 3D

    Shirtty

    sarfata/shirtty-addon

    Badge addon with infrared receive/transmit

    26 parts7
  • 2 layers12 × 30 mmElectric greetings, the printed circuit board in 3D

    Electric greetings

    electricui/electricui-helloboard

    Cute arduino compatible development board for introducing people to Electric UI

    19 parts1
  • 2 layers33.5 × 46 mmBbqueue, the printed circuit board in 3D

    Bbqueue

    minor-industries/hardware

    Minor Industries' PCBs

    31 parts
  • 4 layers37.6 × 30.6 mmBias generator LT8362, the printed circuit board in 3D

    Bias generator LT8362

    OpenSiPM/sipm-bias-control

    Single channel silicon photomultipliers for high-speed fluorescence imaging

    61 parts44
  • 4 layers100 × 100 mmPi TX 35W PA V2, the printed circuit board in 3D

    Pi TX 35W PA V2

    M0LTE/pi-transceiver

    An attempt to build a complete ham radio transceiver around a Raspberry Pi

    185 parts15