Random numbers have a lot of uses in computer programming. These can be for fun things like picking a random song, drawing to a random location, etc. On the more serious side, they are useful in the realm of cryptography. For the later, security is a primary concern, so the actual randomness of the random number becomes increasingly important. This is where using a True Random Number Generator (TRNG) is very beneficial.

Don't have a TRNG? No worries. In this guide we'll show how to easily create a TRNG by coupling an Adafruit Trinkey QT2040 with an Infineon Trust M breakout. The two boards can be mounted together using M2.5 screws (kit here) or similar. Further, by connecting the boards using the STEMMA QT connector and cable - no soldering is required. Simply connect everything, load the provided code, plug into your PC's USB port, and connect to the serial port to receive all the true random goodness you may need.


Here is a list of the hardware items used in this project:

Video of Trinkey RP2040 plugged into a laptop. An OLED display is connected and shows a graphic keyboard cat animation.
It's half USB Key, half Adafruit QT Py, and a lotta RP2040...it's Trinkey QT2040, the circuit board with an RP2040 heart and Stemma QT legs....
In Stock
Adafruit Infineon Trust M Breakout Board
This is a STEMMA I2C breakout for the
In Stock
Angled shot of a USB key-shaped PCB with a sensor board stacked on top via black nylon screws.
 Here is the perfect hardware kit to make a RP2040 QT Trinkey into any kind of USB-connected smart sensor with a...
In Stock
Angled of of JST SH 4-Pin Cable.
This 4-wire cable is 50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but...
In Stock

This guide was first published on Dec 09, 2021. It was last updated on Jun 22, 2024.

This page (Overview) was last updated on Mar 08, 2024.

Text editor powered by tinymce.