# ESP32 code generator that compiles and flashes from your browser

> Describe an ESP32 build. Soldr picks the board and parts, wires every pin, writes the sketch, compiles it and flashes the ESP32 from Chrome or Edge.

[HTML version](https://soldr.ai/esp32-code-generator)

[Soldr](https://soldr.ai/) / Tools

Soldr writes ESP32 code for the build you describe: it picks the board and parts, plans the pins (including the ESP32 pins that are unsafe at boot), writes the sketch, compiles it and flashes the ESP32 from Chrome or Edge.

[Start this build on Soldr](https://app.soldr.ai/?prompt=I%20want%20to%20build%20an%20ESP32%20weather%20display%20that%20shows%20temperature%20and%20humidity%20from%20a%20DHT22%20on%20a%200.96%20inch%20OLED)

## ESP32 pins are not all equal

On an ESP32 some pins decide how the chip boots, some are input-only, and some belong to the flash memory. A sketch that puts a relay on a boot pin can stop the board from starting. Soldr's pin plan skips those pins and keeps the I2C, SPI and serial pins for the parts that need them, and the code is written from that plan.

## From a description to a running sketch

- **Describe the build** at [app.soldr.ai](https://app.soldr.ai): what it senses, shows or switches, and any board you already own.
- **Soldr picks the board and parts** in stock, wires every pin and draws the schematic.
- **Generate code** writes the sketch for that wiring, with Wi-Fi when the build needs it.
- **Compile** checks it on our server for the ESP32 core.
- **Flash** it to the ESP32 over USB from Chrome or Edge.

## Flashing an ESP32 from the browser

Flashing runs from Chrome or Edge on a desktop or laptop. ESP32 boards, the Arduino Uno, Mega and Nano flash over USB through the browser (a Nano with the new bootloader may need the Arduino IDE). A Raspberry Pi Pico flashes from Chrome or Edge in two presses: the first restarts it into its bootloader, the second writes the file; in other browsers you get one file to drop onto the board. Boards that use a CP2102 or CH340 USB chip may need a one-time USB driver. For any other board, download the sketch and upload it from the Arduino IDE or PlatformIO.
Step by step: [an ESP32 build walked through end to end](https://compoden.com/blogs/guides/vibe-coding-hardware-esp32-project-one-sentence).

## Parts that exist

Every part Soldr picks is one Compoden stocks, shown In Stock with its price. Buy all puts every part in one Compoden cart, shipped across India; COD if checkout offers it for your order.
A common start: an [ESP32 DevKitC](https://compoden.com/products/esp32-devkitc-development-board-black-wifi-bluetooth-module), a [DHT22](https://compoden.com/products/dht22-temperature-humidity-sensor-module-accurate-readings) and a [0.96 inch OLED](https://compoden.com/products/0-96-inch-oled-display-128x64-i2c-white-ssd1306).

## What Soldr checks before it writes code

- **Free, safe pins:** no part on a pin the board needs to boot, on an input-only pin, or on a pin already in use. When the board runs out, it says which part has no pin.
- **Shared buses:** two I2C parts at the same address are told apart (an address pin tied high, for example).
- **Logic levels:** a 5 V part on a 3.3 V board gets a divider or a level shifter, or a note.
- **Power:** what every part draws against what the supply and the board's pins can give, including a servo's start-up peak; an adjustable converter comes with the voltage to set it to before you connect it.
- **Your own parts:** tell it what you already own and the build uses them instead of adding new ones.
The details are in [Wiring & pins](https://soldr.ai/docs/wiring-and-pins).

## What it costs

Questions are free. Generated code costs credits, priced by the size of what is written, and a compile costs 5 credits. Sign in and get 100 credits free.

## Questions

### Which ESP32 boards does it support?

Common ESP32 boards, including the DevKit, S3 and C3, flash straight from Chrome or Edge on a desktop. Soldr writes code for 674 board targets in total; others download for the Arduino IDE.

### Do I need to install anything to flash an ESP32?

No IDE. Flashing runs in Chrome or Edge. Boards with a CP2102 or CH340 USB chip may need a one-time USB driver.

### Does it write Wi-Fi code?

Yes, when the build needs it, for example a web dashboard or sending readings to your phone. The code is written for the parts and pins in your build.

### Is it free?

Questions are free; code and compiles cost credits. Sign in and get 100 credits free.
