Virtual Online Arduino and ESP32 Simulator - Wokwi Arduino Simulator features

Link: Wokwi - Online Arduino and ESP32 Simulator

Topic: There are already a lot of Arduino and ESP32 simulators online. Unfortunately, most of them have been last updated several years before. A few are available but not for free. Here I have tried almost all Arduino Simulators and common problems are below

  1. No support of external libraries
  2. No support for assembly programming
  3. runs on an outdated Arduino IDE
  4. Very slow

I have been working with the wokwi Arduino simulator for some time, and I would like to share my experience of why it is a valid and workable solution presently for simulation needs.

many people have created applications based on the open-source AVR8js engine

I would request you to share your constructive criticism. This helps a lot to make this Free Arduino simulator, a practical tool too in the future

Updates:

  1. Wokwi now supports Internet of things simulation too
  2. Raspberry Pi Pico SDK support added (example 1, Example 2)
  3. More embedded systems boards are in pipeline now

Hello all,

I would like to introduce a free Arduino simulator and an ESP32 simulator for all those people who are looking for a

  • faster Arduino simulator

  • simulator with lots of examples

  • Arduino simulator with the support team

  • The simulator can run flawlessly on Windows, macOS, and on mobiles as well

  • Free ESP32 Simulator to learn ESP32 programming

free Arduino simulator by Wokwi
free ESP32 simulator by Wokwi

This Arduino simulator can be used by students to learn Arduino programming and ESP32 programming faster

It is very easy to share the project (just one click) with others. This enables easy code sharing as well. This also helps the teachers to create partial projects which students can take to complete.

All the interfaces are made free. There is no limitation (irritation) of limited simulation time or limited simulated parts. Hence, especially during the situation we all are in, hence Wokwi Arduino and ESP32 simulator is a very good solution for schools, universities and remote classes.

Other benefits of the free Arduino ESP32 simulator

  • Free

  • faster simulations

  • multi-file projects are supported

  • Supports UNO, Mega, Nano, ATTiny85 as well

  • Supports a lot of peripherals and sensors

  • very easy to add third-party libraries and work with them

  • The projects are stored on the server. hence, they can be accessed anywhere, anytime via any device

  • Coding can be done on any PC with a browser. Many people are coding on their mobiles and tablets too,

  • No installations or downloads are necessary!

  • ESP32 Simulator supports MicroPython as well


Example projects

ARDUINO and PUSH BUTTON projects

Simon Game - A memory game with 4 push buttons

Diatonic Piano - A 8-note piano, use keys 1-8 to press the buttons and play the notes.

Bounce vs non-bounce - a good example of showing how a bounce in mechanical switches can create multiple ON-OFF conditions due to a single user press.

ARDUINO and LED projects

Blink - Arduino's standard Blink sketch

ARDUINO and LCD1602, LCD2004 projects

LiquidCrystal Hello World

LiquidCrystal I2C Hello World

LiquidCystal Custom characters

Electronic Safe

DS1307 Clock

LCD2004 Tiny Pacman on Wokwi

ARDUINO and MEMBRANE-KEYPAD projects

Basic Keypad example

Arduino Calculator

Electronic Safe

Arduino SERVO MOTOR examples

Sweep

Knob

ATTiny85 examples

ATtiny85 Blink

ATtiny85 Simon Game

ATtiny85 FastLED Matrix

ATtiny85 Charlieplexing

ATtiny85 SSD1306 + DHT

ESP32 Arduino Simulator Examples#

ESP32 MicroPython Simulator Examples#

ESP32 Simulator ESP-IDF Examples#

The following examples use the ESP-IDF functions. They are compiled using Arduino ESP32 Core:

You can find a lot of Arduino library examples as well.


Got a suggestion? Need a hand?

People here on Discord for support
Join the Facebook group to share your projects and ask questions as well!

Please support this free Arduino simulator and ESP32 simulator platform by testing, tinkering with other projects and also by giving feedback!

Thanks a lot. Please DM or reply with comments and let us know what you think!

firefox_86Okfcjcju

2021-01-17_12h00_45.png

2021-03-02_23h16_35.png

2021-03-06_11h11_24.png

2021-03-06_11h14_08.png

2021-04-03_20h57_03.png

Comparing Tinkercad to Wokwi by Koepel
Updated at 23 August 2021

Tinkercad Wokwi
Open source No The simulation in the browser is on Github βœ“
Drag and drop circuit Yes βœ“ Yes βœ“
Cheatsheet needed to build circuit No βœ“ Sometimes
Simulation of analog circuit Yes βœ“ No
Boards Uno, ATtiny, micro:bit Uno, Nano, Mega, ATtiny85, Raspberry Pi Pico (Arduino and CircuitPython), ESP32 in development βœ“
Use any library No Yes, any library from the Library Manager of the Arduino IDE. Other libraries can be added by adding the *.h and *.cpp files as local files βœ“
Two Arduino boards at the same time Yes βœ“ No
Showing the simulation speed No Yes βœ“
Debug Simple βœ“ I could not make it work
Simulated Logic Analyzer No Yes βœ“
Ledstrip Limited Both NeoPixel and FastLED support for any kind of ledstrip or led-matrix βœ“
Be able to edit the text of the circuit layout No Yes βœ“
Be able to misalign a connection Yes No βœ“
Visualy Okay βœ“ Okay βœ“
Report a bug I don't know Yes, multiple ways and someone will look into it βœ“
Website Demanding website
(slow on slow computer)
Fast website, but slow file access and file update
UTF-8 Not full support in the Serial Monitor Yes βœ“
Code speed 15% slower Same as the current Arduino IDE βœ“
Simulation speed on slow computer Firefox 7% :snail:
Chrome 16% :snail:
Firefox 38% βœ“ :racehorse:
Chrome 79% βœ“ :racehorse:
Get a public permanent link to a project Yes, but very hard to find Yes, very easy βœ“
Code in multiple tabs No Yes βœ“
Programming in "Blocks" Yes βœ“ No
Development Very little Developing all the time βœ“
Is it behaving as expected Yes βœ“ Yes βœ“
Fun factor A misalignment is bad There are many fun things to explore βœ“βœ“βœ“

The Simulation speed was tested with math (calculating pi) and compared with a real Arduino Uno board with Arduino IDE 2.0.0-beta.5. The simulation was done in Windows 10 with Firefox 88 and Chrome 90 and I used my slowest computer for the test.

The Code speed was tested with millis() to measure calculating pi on a slow computer. Even if the computer could not run the simulation at full speed the resulting millis() value was the same in Wokwi as the real Uno board. Tinkercad was slower, perhaps because of other compiler options.

Tinkercad can misalign connections between components or on a breadboard which can not be seen, but they do not make contact. In the Arduino forum (Problem with second shift register 74hc595) there is a link to a Tinkercad project (Circuit design Ardu midi keyboard | Tinkercad) which had most of the diodes misaligned. Such misalignments can be hard to find. Wokwi forces to use wires, which will only be successful when the connection is made.

Tinkercad has a bug. It can not always use the delete operator in a normal way. Sometimes it can be fixed with: delete[]. If a pointer to a object is used and there is a destructor defined, then there is no solution to delete the object via the pointer. Sometimes the delete operator is generated by the compiler which will fail in Tinkercad.

Tinkercad has another bug when converting a integer to a String object, see here.

Wokwi is still in development and does not simulate everything of the Arduino Uno yet.

In August 2021, Wokwi is no longer just a simulator, because it has a Logic Analyzer and can connect to a external Serial Port.
The Logic Analyzer can capture signals from the simulation which can be analyzed on the computer (outside Wokwi).
The external Serial Port uses the Serial API of the Chrome browser. It can be used to communicate to the real world, for example a real Arduino board.

Conclusion: On 3 May 2021 the drag and drop was introduced. At that moment it became useful for beginners. In July 2021 Wokwi is a very useful tool and has passed Tinkercad with flying speed.
Tinkercad has two advantages: It can simulate a analog circuit and it can simulate a circuit with multiple Arduino boards running at the same time.

Eight months later, on 27 April 2022, the first tests were done with a custom part that is able to connect to analog inputs. That enables many posibilities.

5 Likes

Are you planning to integrate ESP8266 boards?
Sounds interesting :grinning:

Thank you

Yes definitely. ESP32 on priority. I will message again. Please keep an eye on Wokwi group for updates!

Hi all,

Here is a short post with the links to the Arduino simulator for Arduino UNO, Mega, Nano and more.

Arduino UNO

Arduino Mega

Arduino Nano

ATTiny85 MCU

Raspberry Pi Pico

MicroPython on Pi-Pico

Circuit Python on Pi Pico

Franzininho Board

Arduino Nano RP2040 Connect

ESP32

ESP32 tiny Pico Board

MicroPython on ESP32

Hi, thx, great work,
Gave it a try,

Could not find the ESP32 from the original website, had to use Google to find one, (someone's personal custom made?),

Loaded code, created libraries.txt and added libraries to the list (just the name with no .h of the allegedly unsupported libraries),
Still did not compile

Did not try further,
I AM MOST LIKELY THE ISSUE but this is my feedback

Cheers

Hi @frenchydude08 both Wokwi and the ESP32 are in development, but the ESP32 simulation supports already many things. In the post above yours, you would find a link to the ESP32.

When you are logged in at Wokwi, then you can store your project and get a link to it. You can share that link, so we can help with the libraries.
Because the ESP32 is not an official Arduino board, some specific libraries are not included in the Arduino Library Manager.

You could have started with a Arduino Uno and a few leds :wink:

1 Like

Hi Koepel,

Thanks for the follow up,

Is the ESP32 not linked on the Wokwi main page because it is still being developped ?
Why not have a link to β€˜boards under developement’ ?

I think a Uno and a few leds is not much of a test, unless running a primary school workshop..

Don’t get me wrong, I think it’s a great project and work !

I thought the libraries.txt would be some automated way of trying to recover the libraries from git or the net..

By the way, once added, I could not find a way to remove the libraries tab.

PS. I joined the Discord, great link :+1:

1 Like

After using and testing other simulators, I really like Wokwi. My enthusiasm is when comparing Wokwi to other simulators. When you try to simulate a real project with a ESP32 which is still in early development, then you are asking too much.

Correct.
Even the Arduino Uno is not 100% simulated. I found a few things, and they were fixed. I made an Issue for the internal temperature sensor, and you can see how fast it was fixed.

It is indeed a great tool for schools. Have you seen the FastLED examples ? Some things are are easier in Wokwi then with real hardware.

No. I don't know if it changes in the future, but at the moment Wokwi is able to use the libraries that are also in the Library Manager of the Arduino IDE. For unknown libraries, you have to copy all the *.h and *.cpp files to your project.

Yeah, sometimes I also have trouble with a delay and update and delete files and projects myself. Once I can pinpoint the problem, I could make a Issue at Github.

1 Like

Agreed, it's looks good, friendly, and no installation is required.
There is also a great amount of ready to use samples!

I can only imagine the amount work done, and ahead!

Ideal for schools,

Keep it up! :+1: :hugs: :star_struck:

1 Like

Hi please explain how I can include for example #include <CapacitorLite.h> found here

It would be great to simulate other libraries not found in your standard list

Hi, you can get in contact with the Wokwi creator and other makers at Discord: https://wokwi.com/discord

Since Wokwi allows multiple files in separate tabs, you can create new files and copy the contents of the library files in it. Maybe a #include has to change from '<' and '>' to double quotes, maybe some other includes have to be commented out.

For example the BigNumber library is not in the Arduino IDE library files.
So I copied to files to my project: https://wokwi.com/arduino/projects/300119524249698825
By sharing my project, others can copy my project and use the BigNumber as well.

There was some mention about uploading a zip-file. I don't know the current status of that.

hi Jpmulder,

Wokwi Arduino simulator supports very limited Analog simulation. If you would love to, you can add a GitHub request.

Is there a current simple simulator/emulator for PC that anyone can recommend? The link to Wokwi does not lead to anything I recognise.

As far as I can tell, it is either Wokwi or Tinkercad. All the others are disappointing in one way or the other.

If you go to: https://wokwi.com/
Then click on the Arduino Uno board.
Then you can write your sketch on the left side of the screen, and start the simulation with the start button.

afbeelding

There are many examples in the "Docs" section.
This is the documentation for the LCD display: https://docs.wokwi.com/parts/wokwi-lcd1602
At the bottom of that page are the examples, click on a example and start the simulation.

If you want to change things and store your Wokwi project, then you have to log in.

1 Like

Speed test with double precision floating point numbers in Wokwi

The test is done with three boards:

  1. ESP32 (Wokwi project here).
  2. Raspberry Pi Pico in the official Arduino mode on top of Mbed (Wokwi project here).
  3. Raspberry Pi Pico in community mode.

I used two browsers:

  1. Firefox 95 in linux
  2. Chromium 97 in linux

With 100k iterations to calculate Pi. The numbers are for my computer (1 year old fast computer).
The table contains: the browser, the board in Wokwi, the speed shown by Wokwi; the time it would take with real hardware; and the time it took in the browser.

Browser Board speed time (hardware) time in browser
Firefox ESP32 50% 3.11 seconds 6.40 seconds
Firefox Pico + Mbed 10% 1.06 seconds 11.36 seconds
Firefox Pico (community) 8% 0.47 seconds 6.27 seconds
Chromium ESP32 57% 3.11 seconds 3.72 seconds
Chromium Pico + Mbed 25% 1.06 seconds 5.56 seconds
Chromium Pico (community) 16% 0.47 seconds 3.82 seconds

[EDIT]
The numbers are now in a table.
TinkerCad does not have a double precision board for C++, so it is not a part of this test.

[UPDATE]
The numbers for the ESP32 in the table were updated at 1 February 2022, because then the ESP32 was optimized and that benefited the Firefox browser in a remarkable way.
The old numbers were:

  • Firefox | ESP32 | 6% | 3.11 seconds | 50.20 seconds
  • Chromium | ESP32 | 22% | 3.11 seconds | 15.32 seconds
1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.