Wokwi Analog value error

I assembled this simple circuit with a resistive divider with 2 equal resistors.
The value read by the Arduino should be ~=512, but it shows 1023.

Did I make a mistake or is it a problem with the Wokwi?

"AnalogRead - Wokwi ESP32, STM32, Arduino Simulator

I think I'm stuck in old age. :laughing: :laughing: :laughing: :laughing:

Tks for all.

It sounds like the resistor to ground is either open or a very high value in regards to the one connected to +5. If you are off a pin an powering with an external power supply about 12V you are connected to Vin not +5.

1 Like

I played with it a bit. Sure seems like a WokWe thing. If you remove the wire between the resistors the reading is 0. Connect back to voltage divider, 1023. I tried other inputs and resistor values, too, It's like the 1K to ground is not even there. And all the connections seem good.

The pot works fine.

1 Like

Yes, pot works fine.

Wokwi only simulates the digital signals.
For the simulation of a analog circuit, you can try Tinkercad.

There is a potentiometer and there are analog modules, but they use a trick. The analog value is send directly into the processor. A circuit with resistors can not do that.

A ESP32 in Wokwi can connect to the internet, to a server in the real world.
Wokwi also simulates the Raspberry Pi Pico and can use Mbed (Raspberry Pi Pico) and FreeRTOS (ESP32) and has different build environments, such a MicroPython and Rust.
But not those two resistors.

1 Like

Tks

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