Moteino M0

The MoteinoM0 (release notes) is a SAMD21 Cortex M0+ based Moteino featuring these general specifications:

  • ATSAMD21G18A microcontroller (48pin LQFP) running at 48Mhz, 3.3V core
  • Input voltage: 3.6-6V
  • Digital pins: 23 (11 PWM)
  • Analog ADC pins: 6 (12bit)
  • Analog DAC pins: 1 (10bit)
  • Flash Program memory: 256KB (8KB used by bootloader)
  • SRAM: 32KB
  • Transceivers: RFM69HCW, RFM95, RFM96
  • Low power: ~8uA in standby mode (FLASH and transceiver in deep sleep)

Memory & Bootloader

The MoteinoM0 runs the standard Arduino bootloader (compatible with Arduino/Genuino Zero). The bootloader is enhanced to allow flashing the memory from the external FLASH-MEM memory. This is compatible with Dualoptiboot and OTA/Wireless programming. The booloader is located in the first 8KB of internal flash memory and is protected by the NVM user byte fuse.

There is no dedicated EEPROM on the SAMD21 microcontroller but EEPROM can be emulated up to 16kb and the Arduino EEPROM library can be used to access this emulated EEPROM.

Pin reference


Hardware / Driver install

To use MoteinoM0 with ArduinoIDE you will need to install the latest Arduino SAMD Boards package and then also the Moteino SAMD Boards package by LowPowerLab:

If you’re on MAC or Linux you should not need any drivers. Also Windows 10 will probably detect the board as a virtual serial port and assign it a COM port by default without the need of installing a driver. Older Windows versions are likely going to fail to install a driver when MoteinoM0 is first plugged in. Click below to get the USB driver and unzip it to your Desktop or another folder. The ZIP file contains a screenshot walkthrough of how to install the driver.

Using with the ArduinoIDE

It’s important to understand how the board operates and how to enter the bootloader to ensure you can program it regardless what state the board is in. The bootloader behaves identically to the Arduino Zero samba bootloader, so if you’re familiar with that board, you should be all set.

If you load a low power sketch, or turn off the USB-Device (serial port) in your sketch, or even using certain sketches will cause the board to appear unresponsive to an Upload command while it’s in sleep mode or if it’s caught up doing other things. In such cases an Upload will fail from the IDE, and it’s necessary to do a fast double-tap on the RST button to put the board in bootloader mode. In some even more precarious situations where the board does to sleep immediately after boot, you might need to first do a single tap, then shortly after do the double-tap. You know you have entered the bootloader when the onboard LED is in a breathing pattern and a new serial port appears. Once there, select the new serial port, and try an Upload. There will be a delay until the board receives the sketch, or if you’re in a hurry you can jump start the upload by doing another double-tap. It’s only confusing until you manage to do this a few times!

Example sleep sketch

The sketch below illustrates how to put the MoteinoM0 to standby sleep (lowest power sleep), and optionally wake it from an external interrupt (active low on digital pin 0). It also puts the FLASH-MEM and transceiver (if any) to sleep.

//Standby sleep example for MoteinoM0 with external interrupt wakeup
//expected current in standby sleep: 7.5uA
const int pin = 0; //pin to use as interrupt (can be any digital pin)

//#define WITHRFM69  //comment this out if you don't have a radio installed on your MoteinoM0

#ifdef WITHRFM69
  #include     //get it here:
  #define NODEID        2   //must be unique for each node on same network (range up to 254, 255 is used for broadcast)
  #define NETWORKID     100  //the same on all nodes that talk to each other (range up to 255)
  #define GATEWAYID     1
  #define FREQUENCY     RF69_915MHZ
  #define IS_RFM69HW    //uncomment only for RFM69HW! Leave out if you have RFM69W!
  RFM69 radio;

#include        //get it here:
SPIFlash flash(SS_FLASHMEM, 0xEF30); //EF30 for 4mbit  Windbond chip (W25X40CL)

//replace Serial with SerialUSB
#if defined (MOTEINO_M0)
    #define Serial SERIAL_PORT_USBVIRTUAL // Required for Serial on Zero based boards

void setup()
  pinMode(0, INPUT_PULLUP); //using internal pullup, makes pin 0 active low

  //Uses internal pullup eliminates the need for external resistor and makes interupt pin active low
  //If you need active high, then attach to HIGH and declare pin as INPUT without PULLUP, then use external resistor from GND to pin to keep it from floating
  attachInterrupt(pin, wakeupISR, LOW); //note: RISING and FALLING do not seem to work, use LOW or HIGH instead

  if (flash.initialize())
    Serial.println("flash.init() OK, sleeping it...");
  else Serial.println("flash.init() FAIL");

#ifdef WITHRFM69
  if (!radio.initialize(FREQUENCY,NODEID,NETWORKID))
    Serial.println("radio.init() FAIL");
    Serial.println("radio.init() SUCCESS");
  #ifdef IS_RFM69HW
    radio.setHighPower(); //uncomment only for RFM69HW!

  for (byte count=0; count < 3; count++)
  Serial.println("Entering standby sleep mode...");

void loop() 

  //interrupt happened: WAKE UP and blink the LED!

void blink(int ms) {
  digitalWrite(LED_BUILTIN, HIGH);
  digitalWrite(LED_BUILTIN, LOW);

byte toggle=true;
void wakeupISR(void)
  //nothing here, just a placeholder

void standbySleep() {
  //Disable USB (optional)

  //Standby - lowest power sleep mode
  __WFI(); // Wait For Interrupt call

  //Sleep until woken by interrupt...

  //Enable USB