Simulator

A LoRa simulator: two SX1278 radios and two Arduinos

Mokxi is a free online LoRa module simulator that runs in your browser, with nothing to install and no account needed. Two Arduino Unos, each with an SX1278 LoRa radio on its SPI pins, running the sender and receiver sketches of the Arduino LoRa library. One sends a numbered hello every two seconds; the other prints it, with no wire between the two radios.

  • 505parts on the bench
  • 45boards running now
  • 1.00xreal time, on every board
Two Arduino Unos talking over LoRalive0.000 s 0.00x
Click to open it in the editor
Click the circuit to open it in the editor and open both boards’ serial monitors: “Sending packet” on one, “Received packet” on the other.

What you can do here

In the circuit above, or in the editor it opens.

  • Send packets between two boards with the Arduino LoRa library
  • Wire an SX1278 the standard way: NSS 10, RST 9, DIO0 2 and the SPI pins
  • Read each packet and its RSSI on the receiver
  • See how long a packet spends on the air
  • Change the frequency in one sketch and watch the link go silent
  • Write and test both ends of a link before you buy two modules

What the running circuit shows

A sender, a receiver and 46 milliseconds of air.

Each radio takes seven wires: 3.3 V and ground, NSS on pin 10, reset on pin 9, DIO0 on pin 2, and the SPI clock and data lines on 13, 12 and 11. The left board prints “Sending packet: 0”, then 1, then 2, one every two seconds. The right board prints “Received packet ‘hello 0’ with RSSI -45”, and so on, as each arrives.

The sender also times itself: “on the air for 46 ms”, sometimes 47. That is long for seven bytes. LoRa spreads each bit across a wide chirp so that a receiver can dig it out from under the noise, and airtime is the price. It is the trade at the heart of LoRa, range for speed, and it is why a LoRa link suits a sensor reading every minute and not a video stream.

How the SX1278 is modeled

The registers and the timing, with a perfect sky.

The radio answers the library over SPI as the chip does, and packets take the airtime their settings give them. Every radio on the canvas shares the same air, and two radios hear each other only if their settings match: the frequency, the spreading factor, the bandwidth and the sync word. Change the frequency in one board’s sketch and the receiver prints nothing, the commonest reason a real LoRa pair stays silent.

What it leaves out is distance. Every packet arrives, and the RSSI is always -45; there are no walls, no range limit, no interference and no collisions between senders. LoRaWAN, the network layer with gateways and keys, is not part of this: the circuit is plain radio to radio. On hardware the SX1278 is a 3.3 V part and must never be powered without its antenna.

How it works

Three steps from a blank tab to a running circuit.

  1. Open the editor

    It runs in your browser tab. Nothing to install, and you need no account to start.

    Your first project
  2. Wire it and write the code

    Drag parts onto a breadboard, run each wire from pin to pin, and write the sketch beside it.

    Wiring
  3. Press Run

    Your sketch compiles in the tab and runs on a model of the chip, with the Serial Monitor beside it.

    Run and serial
Reviews

What makers say about Mokxi.

“The AI checker helps check and correct my circuits, and it has way more components than Tinkercad. As a student I really appreciate the tool.”

ChloeEngineering student

“I’d been looking for a real online electronic simulator that was intuitive and complete when I found Mokxi. I was able to quickly import a Fritzing file and my Arduino sketch and start testing. Mokxi has all of the makings for the best online Arduino simulator I have been able to find!”

JayModel builderFeatured in his DioramaOS post

“I’m using Mokxi to develop and simulate an STM32-based four-wheel-drive robot car before building the actual hardware. It allows me to experiment with DC motor control, PWM, RPM measurement using photointerrupters, and different acceleration, braking, and reversing strategies, helping me understand and refine the system before implementing it in real life.”

NusretRobot car builder, Hamburg

Share your story

FAQ

Questions, answered.

Is it free?

Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.

Do I need an account?

No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.

Can I simulate LoRa communication between two Arduinos?

Yes. That is the circuit above: two Unos, two SX1278 radios and the Arduino LoRa library’s sender and receiver, with no wire between the radios. Range and interference are not simulated; every packet arrives.

Why is my LoRa receiver not getting packets?

Most often the two radios’ settings differ: the frequency, the spreading factor, the bandwidth or the sync word. Next most often it is wiring, NSS, reset or DIO0 on a pin other than the one the sketch names. Change the frequency in one sketch here to see the first case.

Is this a LoRaWAN simulator?

No. It simulates the LoRa radio itself, point to point between modules. LoRaWAN gateways, network servers and device keys are not modeled.

More simulators

Each one opens on a circuit that is already running.

Send a packet

Open the circuit and watch the hello arrive on the other board. Nothing to install, and no account needed.