Live robotics updates
Simulation vs. digital twin: A strategic lens on virtual manufacturingThe Robot ReportRobot.com turns autonomous robots into mobile advertising network with launch of R-ads platformRobotics & Automation NewsSortera uses physical AI to double capacity in a Tennessee sorting facilityThe Robot ReportHow Settlement Amounts Vary in Motorcycle Accident CasesRobotics & Automation NewsThe future of physical AI isn’t humanoid; it’s task-specific and cost-efficientThe Robot ReportExploring PLC and robot integration with YRG Robotics’ Chris ElstonThe Robot ReportRobotics Summit keynote to present open foundation for AI-powered robotsThe Robot ReportKawasaki launches Silicon Valley hub to accelerate deployment of physical AIRobotics & Automation NewsStellantis expands Qualcomm partnership for AI-powered vehicle platformsRobotics & Automation NewsVideo Friday: Atlas Versus a FridgeIEEE Spectrum RoboticsSimulation vs. digital twin: A strategic lens on virtual manufacturingThe Robot ReportRobot.com turns autonomous robots into mobile advertising network with launch of R-ads platformRobotics & Automation NewsSortera uses physical AI to double capacity in a Tennessee sorting facilityThe Robot ReportHow Settlement Amounts Vary in Motorcycle Accident CasesRobotics & Automation NewsThe future of physical AI isn’t humanoid; it’s task-specific and cost-efficientThe Robot ReportExploring PLC and robot integration with YRG Robotics’ Chris ElstonThe Robot ReportRobotics Summit keynote to present open foundation for AI-powered robotsThe Robot ReportKawasaki launches Silicon Valley hub to accelerate deployment of physical AIRobotics & Automation NewsStellantis expands Qualcomm partnership for AI-powered vehicle platformsRobotics & Automation NewsVideo Friday: Atlas Versus a FridgeIEEE Spectrum Robotics
View all
Back
Arduino sample guide

roboda-sample-0024 - Roboda Cloud State 01

Print a JSON-style robot state payload for telemetry ingestion.

Step-by-step build

Package robot state as JSON for Roboda Cloud telemetry ingestion.

1

Connect the telemetry signal to the listed analog pin.

2

Read the value in loop().

3

Print valid key/value fields over Serial.

4

Send similar payloads to Roboda Cloud from a network-capable gateway.

Important code parts

These are the sections learners should understand before changing the sketch.

Serial.print JSON fields

Builds a compact robot state payload.

battery

Example analog field for dashboard monitoring.

signal online

Marks the robot as actively reporting.

Pin mapping for this sample

Use this first table for the exact sample wiring, then use the board-family table when moving the sketch to another Arduino board.

Code nameSample pinModeConnect toNote
batteryPinA0analog inputBattery divider or analog telemetry signalUse a resistor divider so the analog pin never exceeds board voltage.

Arduino board pin reference

The code names stay the same; only the physical board pins may change by family. Always confirm with the board silkscreen when using clones or special variants.

Board familyDigitalPWMAnalogI2CSPIInterrupt
Uno / Nano / Pro MiniDefault target for these samples.D0-D13D3, D5, D6, D9, D10, D11A0-A5A4 SDA, A5 SCLD10 SS, D11 MOSI, D12 MISO, D13 SCK / ICSPD2, D3
Mega 2560Best for many sensors or multiple serial ports.D0-D53D2-D13, D44-D46A0-A15D20 SDA, D21 SCLD50 MISO, D51 MOSI, D52 SCK, D53 SS / ICSPD2, D3, D18, D19, D20, D21
Leonardo / MicroUSB serial can behave differently because the main MCU handles USB.D0-D13D3, D5, D6, D9, D10, D11, D13A0-A5 plus extra analog-capable pins by boardD2 SDA, D3 SCLICSP headerD0, D1, D2, D3, D7
Nano Every / Uno WiFi Rev2Check the board package pinout for exact PWM labels.D0-D13PWM-marked digital pinsA0-A7 on Nano Every, A0-A5 on Uno WiFi Rev2SDA/SCL marked pinsICSP/SPI marked pinsUse pins supported by digitalPinToInterrupt()
Uno R4 Minima / Uno R4 WiFi5V logic board; still confirm shield/library compatibility.D0-D13PWM-marked digital pinsA0-A5SDA/SCL marked pinsICSP/SPI marked pinsUse digitalPinToInterrupt(pin)
Due3.3V logic only; protect pins from 5V sensors.D0-D53PWM-marked digital pinsA0-A11SDA/SCL and SDA1/SCL1SPI headerUse digitalPinToInterrupt(pin)
MKR / Nano 33 family3.3V logic. Some AVR-only libraries may need alternatives.Board-marked digital pinsPWM-marked pinsBoard-marked analog pinsSDA/SCL marked pinsSPI marked pinsUse digitalPinToInterrupt(pin)

Full sample code

/*
  Roboda verified Arduino sample 0024
  Feature: Roboda Cloud State
  Generated for online build, classroom practice, and hardware upload testing.
*/

const byte batteryPin = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int battery = analogRead(batteryPin);
  Serial.print("{\"sample\":");
  Serial.print(24);
  Serial.print(",\"battery\":");
  Serial.print(battery);
  Serial.println(",\"signal\":\"online\"}");
  delay(80);
}

Teacher notes

  • Compile the sample before changing wiring or constants.
  • When changing boards, keep the code names the same and update only the pin number constants.
  • For 3.3V boards, level-shift 5V sensors and modules before connecting signal pins.
  • Use the first compiler error and the Roboda diagnostic suggestion before fixing later warnings.
Roboda support Leave a message

New messages appear in the Finite LiveChat Ops Android app.