This project, Learnware, is intended to be an electrical circuit simulator in Python, designed to teach electronics interactively to those who want to work more with hardware, focusing on explaining the why of things, not just showing results.
The ultimate goal is to have an area where you drag and drop components (batteries, LEDs, resistors, buttons, capacitors, motors, Arduino/ESP32, etc.), connect them with wires, and the program calculates everything in real time. There will also be a “Learn” mode with lessons, and later, connection to real hardware (ESP32/Arduino).
So far I’ve created classes for the components (Battery, Resistor, LED) using dataclasses, a SeriesCircuit that connects battery + resistor + LED and calculates voltage, current and power, and the part I found most interesting is that, instead of just giving an “error” when the circuit is poorly assembled (e.g., LED connected without a resistor), the program explains the problem and suggests the correct resistor to use, such as:
⚠️ Excessive current
This LED does not have a resistor to limit the current.
In a real circuit, this can damage the LED.
💡 Try adding a 350 Ω resistor.
And when the circuit is correct, it shows:
Voltage: 9 V
Current: 7.0 mA
LED Power: 0.01 W
Status: 🟢 Functional circuit
(In the initial development phases, everything will be written in Portuguese from Portugal, but I plan to add support for more languages in future updates)
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.