Article

Learning Embedded Rust with Knurling-rs

Published on 4 min read
Knurling icon
Knurling
A tool set to develop embedded applications faster.
❤️ Sponsor

    Having a good set of tooling is only half of the story in making it easier to develop and debug Rust software for embedded systems. The other half is knowledge and documentation. This is where Knurling Books and Knurling Sessions are brought into the play.

    Knurling Books are written guides that teach general concepts of embedded systems and Rust. We explain different protocols, provide walk-throughs on how to implement them in Rust to set up the communication between two devices. We'll give general debugging advice. The goal is to build a huge base of sample code and guides for making different parts work, be it smaller things like LEDs, potentiometers, buzzers or more complex ones like different sensors or motors. Knurling Books can be used as a starting point for your individual project, even if you're not using the exact same part but something similar, because we provide a guide on how to set things up.

    Knurling Sessions are quarterly embedded projects that explore specific projects using generally available hardware, building full systems and components using microcontrollers, sensors, and actuators. While the focus in Knurling Books is on explaining single concepts, Knurling Sessions bring parts and concepts together to build something more complex. Content for Knurling Sessions includes written guides as part of Knurling Books, Screencasts, Video tutorials, as well as guest contributions around each quarterly project.

    What's the first project?

    The first project will cover building a CO2 measuring device. Over the course of three months, we will show how to start an embedded program from scratch, how to write a driver for the sensor, and how to read the sensor output in a terminal. We will build a visual indicator for air quality and an acoustic alarm. In the last part, we will add an ePaper display to the setup and talk bit about the embedded-graphics crate.

    When can we have this?

    Knurling Sessions and Knurling Books will be launched in October. In a first step it will be available exclusively as a preview to all knurling-rs sponsors. In a second step, all material will be released four months after it has been made available to the sponsors.

    Which hardware do we need?

    Everything will be based on the nrf52840-DK.

    Each month we will add a new set of hardware to our setup. We provide a list of parts for each of these blocks, so you don't have to own everything from the beginning. Hardware in parenthesis - "()", are alternative parts that we don't officially support, but might work for the project if you have them around already!

    The list of parts for the first project:

    Note: We provide links to specific parts in order to make it easier to purchase the necessary parts. These parts can often be ordered from multiple different suppliers, and for most components, substitutions can be made if the linked parts are not available.

    Have any questions about what hardware to buy? Send us an email!

    Block 1: Getting started with embedded Rust

    nrf52840-dk

    • 1x nrf52840-DK (or other nrf52XXX boards)
    • 1x RGB-LED (or single colored LED(s) and/or on-board LEDs)
    • 3x 220 Ohm Resistors
    • 1x Potentiometer
    • 1x Breadboard
    • 1x Jumper wires (40 wires) - Pin to Pin
    • 1x Jumper wires (40 wires) - Pin to Receptacle
    • 1x Jumper wires (40 wires) - Receptacle to Receptacle

    Block 2: Adding the CO2 Sensor

    scd30

    Note: Soldering is required for this step to connect the headers of the Sensirion gas sensor. Alternatively, you may be able to use "Hook Probes", such as the ones offered by Adafruit, instead of soldering. These are also often available in bulk from websites such as Aliexpress.

    • 1x Sensirion SCD30 CO2 Sensor (or other air quality sensor)
    • 1x Pin Headers (40 piece)
    • 1x Piezo buzzer

    Block 3: Embedded Graphics

    waveshare display

    Note: Soldering is required for this step to connect the headers of the Waveshare display. Alternatively, you may be able to use "Hook Probes", such as the ones offered by Adafruit, instead of soldering. These are also often available in bulk from websites such as Aliexpress.

    • 1x Waveshare 4.2 inch b&w ePaper Display

    Sponsor this work

    Knurling Sessions are a Knurling project and can be funded through GitHub sponsors. Sponsors get early access to Knurling Sessions and other tools we are building. Thank you to all of the people already sponsoring our work through the Knurling project!