Skip to the content
PCBKitNew board
2 layers37 × 37 mmRp2040 servo, the printed circuit board in 3D

plug and play w/ virtualized hardware

Size
37 × 37 mm
Copper layers
2
Thickness
1.6 mm
Parts
10
Nets
22
Pads
45
Tracks, vias
45, 2
Pours
2
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
30 Nov 2022
Updated
20 Feb 2024

Overview

Rp2040 servo is an open-source printed circuit board by modular-things, from the modular-things/modular-things repository on GitHub, published under the MIT licence. It is a 2-layer board of 37 × 37 mm with 10 parts on 22 nets, routed with 45 tracks and 2 vias.

It is built around the R-78B5.0-2.0. Its parts include 3 connectors and 2 capacitors. It belongs with the robots and motor control boards and the RP2040 boards of this library.

Main components

1

README

README.md

Softening Hardware with Modular-Things

use virtualization to easily write programs that run across multiple hardware devices

The Modular-Things project is an approach to building modular hardware systems which can be composed in software. The underlying technology is a small networking library for packetizing and routing messages across devices (OSAP) and a web-based editor for composing that hardware into functional systems in software.

Stated simply our tools let you take hardware devices and add a library to them which allows you to plug that device into a browser-based editor where you can write programs that control it and other devices. Because it's JavaScript in the browser you can also write interfaces in HTML/CSS/JS and import various high-level libraries which interact with and control your physical computing system.

For a succinct introduction (3 min) check out our video for CHI2023 by clicking below.

xylophone_teaser

An example Modular Things construction kit can be seen below with circuits available here.

all-things

Project Background

Modular-Things is written by Quentin Bolsee, Leo McElroy and Jake Read based on ongoing work at the MIT Center for Bits and Atoms and Hack Club.

It is based on the surprising performance of modern USB, an insight that we picked up from the urumbu project (paper). Under the hood, it uses osap to route packets and serialize data. Also inspired by the virtual-machine architecture pioneered by Nadya Peek and Ilan Moyer, way back in the way back.

Installation and Usage

You can use the latest modular-things by navigating to https://modular-things.com/, or follow these instructions to run it locally:

  • install node.js - please use version 16.15.1 or above
  • clone this repo
  • run npm install within this repo
  • run npm run dev to startup a local server !

Loading Local Files

...modular-things/?file=yourFile.js&panel=devices&panelWidth=70

where file is at repo/examples/


Writing New Modular-Things

For embedded (arduino) codes, install the OSAP library, which you can download as a zip here: https://github.com/jakeread/osap-arduino, and should also be available via arduino's library manager.

Also, install the FlashStorage_SAMD library, via the library manager.

We use the ArduinoCore-fab-sam for these circuits, which you can install into Arduino via the notes in that repo. For the RP2040 XIAO boards, we use Earle F. Philhower, the Third's PICO build, and for D21 XIAOs, you can follow the XIAO docs.

Using the Automatic RPC

As of osap 0.5.0, we can use an improved design pattern to build devices. At this time, this will only work on RP2040 based devices (which use a more modern compiler), but it is possible to back port this to c++11 based devices (most Arduinos).

The basic pattern is pretty simple, we have a function:

cpp
// types include float, String, int, and boolean 
float someFunction(String oneArgument, int anotherArgument){
  // ... your function body 
}

And we include it as a method in the devices' software object with this one-liner, handing it the function poniter, and the names of the function and its arguments:

cpp
OSAP_Port_RPC<decltype(&someFunction)> rpcMuleTwo(&someFunction, "someFunction", "oneArgument, anotherArgument");

Once we do that, and compile and load the code, the module should appear automatically when it's plugged into modular-things.com/

Below is a full example of a device that uses these Automatic RPCs.

cpp
#include <osap.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>


// display setup, which is wired to the XIAO's labelled SCL/SDA pins 
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT);


// a potentiometer and a button 
// the pot is on XIAO D2/A2, which is GPIO num 28
// the button is on XIAO D3, which is GPIO num 29 (and will need a pullup)
#define PIN_POTENTIOMETER 28 
#define PIN_BUTTON 29 
#define PIN_LED_BLINK PIN_LED_R 
#define PIN_LED_WD PIN_LED_G 


// we instantiate an OSAP runtime, give it a serialport and a name: 
OSAP_Runtime osap;
OSAP_Gateway_USBSerial serLink(&Serial);

Aligning Two Tiny Programs

To explain how module authorship works, we've just tidied up the rgbb example, which you can find here (arduino) and here (javascript).

Basically: we have an Arduino code that we give a "typeName" - that is then discovered by OSAP via the Modular-Things client. Modular-Things then looks for a matching JS or TS constructor, and if it finds one, instantiates it and passes in the devices' unique name (a string identifier).

The constructed object can then use that string ID, as well as individual port string IDs, to route messages to its paired object.

The result is that the "virtual thing" (javascript) acts as a proxy for the arduino-thing, making for cleaner programming model when multiple things exist in the same system.

Arduino "RGBB Thing"

JavaScript "RGBB Thing"

cpp
#include <osap.h>

// -------------------------- Define Pins for R,G and B LEDs, and one Button

#define PIN_R 14
#define PIN_G 15
#define PIN_B 16
#define PIN_BUT 17

// -------------------------- Instantiate the OSAP Runtime, 

OSAP_Runtime osap;

// -------------------------- Instantiate a link layer, 
// handing OSAP the built-in Serial object to send packetized 
// data around the network 

OSAP_Gateway_USBSerial serLink(&Serial);

// -------------------------- Adding this software-defined port 
// allows remote services to find the type-name of this device (here "rgbb")
// and to give it a unique name, that will be stored after reset 

OSAP_Port_DeviceNames namePort("rgbb");
javascript
import Thing from "../../../src/lib/thing";

// the name given to us here is the "uniqueName" of the matched 
// device, we use this as a kind of address 
export default class RGBB extends Thing {
  // we can define methods that interact with the device, 
  // using the 'send' primitive, which writes data (bytes) and gets data (bytes) 
  async setRGB(r: number, g: number, b: number) {
    let datagram = new Uint8Array(3);
    datagram[0] = 255 - r * 255;
    datagram[1] = 255 - g * 255;
    datagram[2] = 255 - (b * 255) / 2;
    // to send data, we use 
    // `osap.send(name: string, targetPort: string, data: Uint8Array)`
    // ... and please use 'async' funcs with 'await' in front of 
    // network calls 
    // ... as you have probably figured out, "setRGB" here routes to 
    // the function defined around line 43 in the arduino example
    await this.send("setRGB", datagram);
  }

  async getButtonState() {
    // named-ports that return data resolve that data like-so:
    let res = await this.send("getButtonState", new Uint8Array([]));

At the time of writing, we mostly write modular-things using SAMD21 and RP2040 platforms. It is likely that OSAP will run on other microcontrollers, but there are funky-things that happen with Arduino's internal abstractions of i.e. Serial objects (which OSAP uses to button up link layers) and Flash-Storage libraries (to store names). Drop us a line if you have a favourite platform that you would like to see supported.

Parts

10
QtyValueFootprintReferences
2Conn_01x03fab:PinHeader_1x03_P2.54mm_Vertical_pinchJ1, J6
110uFfab:C_1206C1
11uFfab:C_1206C2
1Conn_02x04_Odd_Evenfab:PinHeader_2x04_P2.54mm_Vertical_pinchJ5
1Module_XIAO-RP2040fab:SeeedStudio_XIAO_RP2040_SMDM1
1R-78B5.0-2.0R-78B5.0-2.0:CONV_R-78B5.0-2.0PS2
1Val**fab:qr_programmerRef**
1Val**fab:cba_logoRef**

The 9 most common of 10 parts.

Questions

How big is the Rp2040 servo PCB?

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

What parts does the Rp2040 servo use?

10 parts, built around the R-78B5.0-2.0. 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 Rp2040 servo KiCad files?

From the modular-things/modular-things repository on GitHub, at the commit this page was made from: the board is things/servo-xiao/circuit/design/rp2040_servo.kicad_pcb and its schematic things/accel-LSM6DSO-xiao/circuit/design/rp2040_LSM6DSO.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Rp2040 servo design in my own project?

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

More from modular-things/modular-things

6
  • 2 layers37 × 37 mmRp2040 BNO08x, the printed circuit board in 3D

    Rp2040 BNO08x

    modular-things/modular-things

    plug and play w/ virtualized hardware

    13 parts81MIT
  • 2 layers37 × 37 mmRp2040 LSM6DSO, the printed circuit board in 3D

    Rp2040 LSM6DSO

    modular-things/modular-things

    plug and play w/ virtualized hardware

    10 parts81MIT
  • 2 layers37 × 37 mmRp2040 tof, the printed circuit board in 3D

    Rp2040 tof

    modular-things/modular-things

    plug and play w/ virtualized hardware

    9 parts81MIT
  • 2 layers37 × 37 mmRp2040 OLED, the printed circuit board in 3D

    Rp2040 OLED

    modular-things/modular-things

    plug and play w/ virtualized hardware

    8 parts81MIT
  • 2 layers37 × 37 mmRp2040 button, the printed circuit board in 3D

    Rp2040 button

    modular-things/modular-things

    plug and play w/ virtualized hardware

    7 parts81MIT
  • 2 layers37 × 37 mmRp2040 potentiometer, the printed circuit board in 3D

    Rp2040 potentiometer

    modular-things/modular-things

    plug and play w/ virtualized hardware

    6 parts81MIT

Similar boards

  • 4 layers239.4 × 165.7 mmMAXI030, the printed circuit board in 3D

    MAXI030

    aslak3/MAXI030

    MC68030 based expandable computer design

    222 parts38GPL-2.0
  • 2 layers178.3 × 100.1 mmGP1294-Teens4, the printed circuit board in 3D

    GP1294-Teens4

    mariosgit/VFD

    Drivers for a bunch of VFD displays, like the MN12832, ...

    106 parts27MIT
  • 4 layers97.8 × 69.8 mmICE40UPDevBoard, the printed circuit board in 3D

    ICE40UPDevBoard

    aslak3/ICE40UPDevBoard

    A development board for iCE40UP5K FPGAs

    96 parts10GPL-2.0
  • 4 layers58 × 61.1 mmPower supply, the printed circuit board in 3D

    Power supply

    matthieuvigne/MiAM_robotics

    Generic repo for robotic projects with the former MiAM Eurobot team !

    83 parts5GPL-3.0
  • 2 layers60 × 150 mmMainBoard-2023, the printed circuit board in 3D

    MainBoard-2023

    LesKaribous/Karibous-2023-Hardware

    Hardware du robot des Karibous pour la Coupe de Robotique (Eurobot) 2022

    90 parts3MIT
  • 4 layers41 × 52.4 mmJanus finalV, the printed circuit board in 3D

    Janus finalV

    CaptainJaja/Projet_CDF_PAMI_1A

    Voici le Github pour le Projet PAMI

    40 parts2
  • 4 layers140.7 × 128.5 mmPIC DEV BOARD, the printed circuit board in 3D

    PIC DEV BOARD

    anshukumar146/GitHub

    A compact, self-contained development board for the 8051 microcontroller family (AT89x51xxP), designed in KiCad — built to run 8051 firmware on the bench with nothing more than a barrel-jack power supply and a…

    102 parts1
  • 4 layers63.4 × 41.1 mmPCB projetV2, the printed circuit board in 3D

    PCB projetV2

    CaptainJaja/Projet_1A_S6

    Voici le projet de première année du deuxième semestre, pour le groupe Janus-Christophe-Raphaëlle

    51 parts1