MCU Simulator Robotic and Embedded System Laboratory
← Open the simulator
Documentation

Parts and wiring

Adding parts, connecting their pins and power, changing sensor values, and the wiring checks.

Parts are the things wired to the board: LEDs, buttons, sensors, displays, motors and modules. They are listed under Parts in the board panel, and drawn in the Diagram and the Schematic.

Adding a part

  1. Choose a part in the list next to Parts (grouped as Output, Input, Sensor, Display and so on).
  2. Choose how it is wired:
    • Auto-wire: its pins go to free GPIOs that suit them (an analog sensor to an ADC pin, an LED to an output-capable pin), its VCC and GND to the usual power pins, and an I2C part gets a free address;
    • Manual wiring: it starts unconnected, and you wire it yourself, like on a breadboard.
  3. Press + Add. The part gets a reference such as D1, SW2 or U3, shown on its card, in the Diagram and in the Schematic.

Your choice of Auto-wire or Manual wiring is remembered in this browser.

The part card

  • Pins: a dropdown for each signal pin, listing the GPIOs; pins that cannot be used (no ADC, input only) are greyed out, pins used by another part say so. — not connected — leaves a pin loose.
  • Bus lines of I2C parts (SDA, SCL) and SPI parts (SCK, MOSI, MISO) go only to the board's bus pins; choose connected or not. An I2C part has an address choice instead of pins.
  • Power: VCC to 3V3 or VIN (5 V), GND to GND. A part without power does nothing, like a real module.
  • Values: sliders and switches for what a sensor measures (temperature, distance, light, gas, weight, …), buttons to press, options such as the LED colour or relay polarity. They can be changed while the sketch runs.
  • Live state: an LED lit with its brightness, a relay on or off, a servo angle, a display's picture.
  • ✕ removes the part.

Clicking a card (not on its controls) selects the part in the Diagram and the Schematic too.

Three ways to wire

The same wiring can be changed in three places; all of them update together:

  • the dropdowns of the part card;
  • the Diagram: drag from a part's pin to a board pin;
  • the Schematic: drag from a pin end to another pin end.

Wiring checks

Like a lab assistant looking over your breadboard, the parts list checks the wiring after every change. A chip next to Parts counts the problems; the card lists them, and the Diagram and Schematic mark the part with ⚠.

LevelExamples
Erroran output on an input-only pin, an analog sensor on a pin without ADC, a GPIO the board does not have, two I2C parts at the same address, GPIO 12 pulled HIGH at boot
WarningVCC or GND not connected, a pin not connected, one GPIO used by two parts, a 3.3 V part on 5 V, a 5 V part (HC-SR04, servo, relay, PIR) on 3.3 V, an ADC2 pin while the sketch uses Wi-Fi, a part on an I2C or SPI bus pin
Notea boot (strapping) pin

Displays, storage and camera

  • Displays (LCD 16×2 / 20×4, OLED SSD1306, TFT ST7735 / ILI9341, 7-segment TM1637) show what the sketch draws, on the card and in the Diagram.
  • microSD module: files written by the sketch are listed on the card and can be downloaded; Empty card deletes them.
  • RFID RC522: choose one of three cards, or press Tap to hold the card on the reader for a second.
  • Camera: on the ESP32-CAM board itself, see Boards.

Every part, with its pins and power, is in the Parts reference.