
INA226 Power Monitor Library for Proteus Simulation

Hello friends, I hope you all are doing great. Today, I am going to share the new INA226 Power Monitor Library for Proteus Simulation. The INA226 measures three things at once - the voltage of a supply line, the current flowing through it and the power it delivers - and hands all of them to your Arduino over I2C, with a 16-bit converter, built-in averaging and an alert pin that can act faster than your sketch. With this library you can run a full Proteus simulation of the INA226 module in a real circuit, watch every register it holds and use its alert as a hardware fuse.
INA226 Power Monitor Library for Proteus
Latest version: V1.0 (December 2026, this tutorial)
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The demo is a 12 V electronic fuse and energy meter: a lamp and a heater run from a 12 V supply through the INA226, a 16x2 LCD shows volts, amps, watts and the energy used, and when the current passes 0.6 A the INA226's own alert switches the loads off.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the current sensor board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the INA226 Power Monitor Library for Proteus Simulation:
What Is the INA226 Power Monitor?
The INA226 is a current and power monitor chip. It sits next to a small resistor - the shunt - placed in the supply line, measures the tiny voltage the current makes across it, measures the line's voltage to ground, and from those two works out the current and the power. Everything happens inside the chip, and the results wait in registers that the Arduino reads over I2C. The common module carries a 0.1 ohm shunt marked R100, the INA226, two address pads, the I2C pull-ups and two LEDs.
| INA226 | |
|---|---|
| Shunt voltage | +-81.92 mV, 2.5 uV per bit (0.82 A with R100) |
| Bus voltage | 0 - 36 V, 1.25 mV per bit |
| Averaging | 1 - 1024 samples |
| Conversion time | 140 us - 8.244 ms each, shunt and bus |
| Interface | I2C 0x40 - 0x4F, 16-bit registers, MSB first |
| Alert pin | ALE: limits, conversion ready; latched or transparent |
| Pins (module) | VBS GND SCL SDA ALE VCC, IN+ IN- |
The Shunt and Its Range
Current through the shunt makes a voltage by Ohm's law: 0.42 A through 0.1 ohm is 42 mV. The INA226 reads that voltage in steps of 2.5 microvolts, up to 81.92 mV in either direction. With the module's R100 that is a range of plus or minus 0.82 A - perfect for small loads, sensors and battery gadgets. For bigger currents the shunt is replaced with a smaller one: 10 milliohms gives 8.2 A. The simulation has an RSHUNT property for exactly this, and its pop-up shows the range that follows.
The Calibration Register
The INA226 can also give the current and the power directly, but only after it knows the shunt. That is the job of the calibration register: CAL = 0.00512 / (Current_LSB x R_shunt), where Current_LSB is the value of one bit of the current register that you choose. With R100 and 0.1 mA per bit, CAL = 512. From then on the chip computes current = shunt x CAL / 2048 and power = current x bus / 20000, and the power register's bit is always 25 times the current's - 2.5 mW here. Until the calibration is written, both read zero; it is the most common reason a new INA226 sketch shows 0 A.
Averaging and Conversion Times
The configuration register sets how long each conversion takes (140 microseconds to 8.244 ms) and how many conversions are averaged (1 to 1024). The default is 1.1 ms each for the shunt and the bus with no averaging. More averaging means quieter readings but fewer of them: the demo averages 16 of each, so a new result arrives every 16 x (1.1 + 1.1) ms = 35.2 ms. Averaging also turns a PWM-driven load into its average current, which the demo shows when it dims the lamp.
The Alert Pin
The mask/enable register picks one alert function: shunt voltage over or under a limit, bus voltage over or under, power over, or simply "conversion ready". The limit goes in register 07h, in the units of the register being compared. When the condition is met, the ALE pin - an open-drain output - is pulled low (or released, for active-high). In latch mode it stays asserted until the host reads the mask/enable register, so a short overload cannot slip by unnoticed. That is what turns the INA226 into a fuse: the alert is checked in hardware at every conversion, whatever the sketch is doing.
Features of the INA226 Power Monitor Library for Proteus Simulation
- A real-looking module: the board at its real size with the R100 shunt, its copper, the address pads, and PWR and ALERT LEDs that light at Run.
- A real shunt: the shunt resistor is part of the circuit between IN+ and IN-, so the current you see is the current the loads draw.
- All the registers: configuration with averaging, conversion times, modes and reset, shunt and bus voltage, current and power from the calibration, mask/enable, alert limit and the IDs.
- Honest averaging: each result is the true average of the signal over its window, so PWM and inrush look exactly as an INA226 would see them.
- A working alert: all five alert functions and conversion ready, active low or high, latched or transparent, on an open-drain ALE pin.
- A pop-up: every register with its meaning in volts, amps and watts, the last writes and alerts, live voltage, current and power - graphs, an event log and a check page.
- A complete package: about 2.7 MB with the library, our I2C LCD, MOSFETs, bulb and power resistor, our Arduino UNO V4.0 and the demo, without the source code of the model.
The INA226 in Proteus
The device is INA226TEP in TEPINA226.LIB, under Modules > Sensors, with the prefix U and the model TEPINA226.DLL. Search INA226 or power monitor in Pick Devices. On the left is the header: VBS, GND, SCL, SDA, ALE and VCC; on the right the shunt's terminals IN+ and IN-. Two properties: ADDRESS (0x40 - 0x4F) and RSHUNT (0.1 ohm).
Download INA226 Power Monitor Library for Proteus Simulation
Click the button below to download INA226-Power-Monitor-Library-for-Proteus-v1.0.zip (about 2.7 MB, without the source code of the models):
INA226 Power Monitor Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPINA226.LIB,TEPI2CLCD16X2.LIB,TEPNMOS.LIB,TEPBULB.LIB,TEPPOWERRES.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPINA226.DLL,TEPLCD.DLL,TEPNMOS.DLL,TEPBULB.DLL,TEPPOWERRES.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch (Wire only).
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install INA226 Power Monitor Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPINA226.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for INA226.
Proteus Simulation of a 12 V Electronic Fuse
The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0. A +12V terminal feeds IN+ of the INA226 (U1); IN- feeds the loads, and VBS measures the voltage on that load side. The first load is a 12 V 5 W bulb from our Filament Bulb Library for Proteus (L1), switched and dimmed by an IRLZ44N from our N-MOSFET Library for Proteus (Q1) on D9. The second is a 39 ohm 10 W resistor from our Power Resistor Library for Proteus (R1) - the "heater" - switched by a second IRLZ44N (Q2) on D8. ALE goes to D2, the Arduino's interrupt pin, and a 16x2 LCD from our I2C LCD 16x2 Library for Proteus shows the readings. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open INA226-Electronic-Fuse-12V-ArduinoUnoV4.pdsprj.
The Sketch
The sketch needs only the Wire library. Every register is 16 bits, most significant byte first:
void inaWrite(byte reg, word v) { Wire.beginTransmission(INA); Wire.write(reg); Wire.write(highByte(v)); Wire.write(lowByte(v)); Wire.endTransmission(); }
The set-up is two writes - the configuration (averaging 16, 1.1 ms conversions, shunt and bus continuous) and the calibration for 0.1 mA per bit:
const word CONFIG = 0x4527; // AVG 16, VBUSCT 1.1 ms, VSHCT 1.1 ms, shunt + bus continuous
const word CAL = 512; // 0.00512 / (0.0001 A x 0.1 ohm): 0.1 mA per bit
The fuse uses the chip's own alert. The limit is 0.6 A expressed in shunt-register units - 60 mV is 24,000 steps of 2.5 microvolts - and the function is "shunt over limit", latched. The interrupt routine cuts both loads at once; the main loop reports afterwards:
void onAlert() { analogWrite(LAMP, 0); digitalWrite(HEATER, LOW); tripped = true; } // the fuse: cut the loads in the interrupt
A cold filament draws several times its running current for a moment, so the lamp is soft-started with a PWM ramp while the fuse is disarmed, and armed only once the lamp is warm.
INA226 Simulation Results
Open the project and press Run. The demo runs 4.8 simulated seconds and took about 2 minutes 9 seconds on our PC with the pop-up open and the pictures being taken. Click U1 for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
Start-Up
At power-on the INA226 starts with its default configuration, 4127h. The sketch reads the two ID registers - 5449h and 2260h - then writes its own configuration (4527h: averaging 16, shunt and bus continuous) and the calibration, 512. From now on a result arrives every 35.2 ms, and the pop-up's register table shows the calibration as "LSB 0.1 mA". The loads are off, the bus reads 12.000 V and the current 0.
The Lamp On
At 0.3 s the sketch soft-starts the lamp with a PWM ramp, fuse disarmed, then arms the alert: 07h = 24000, 06h = 8001h (shunt over limit, latched). By 1.2 s the lamp burns steadily and the registers read: bus 255Fh = 9,567 x 1.25 mV = 11.959 V, current 103Eh = 4,158 x 0.1 mA = 0.4158 A, power 07C4h = 1,988 x 2.5 mW = 4.97 W. The bus is 41.6 mV below 12 V - exactly the drop across the 0.1 ohm shunt, which is why VBS is wired to the load side. The LCD shows "11.96V 0.416A" and "4.97W"; the energy counter climbs by 0.28 mWh every 200 ms.
Dimming: the Average of a PWM Load
At 1.5 s the lamp is dimmed to 50 % PWM. The current through the shunt now switches between 0 and about 0.49 A at 490 Hz - the pop-up at 1.89 s catches it in an "on" moment at 0.4938 A - but each INA226 result averages 35.2 ms, about 17 PWM periods, so the current register holds about a quarter of an amp: 0990h = 2,448 x 0.1 mA = 0.2448 A, and the power register 0494h = 1,172 x 2.5 mW = 2.93 W. The monitor's three readings stay between 0.2441 A and 0.2493 A. A filament is not a resistor - it cools a little when dimmed - so half the duty gives a little more than half the current. At 2.3 s the lamp goes back to 100 %.
The Fuse Trips
At 3.0 s the sketch switches the heater on: another 0.31 A through 39 ohm. The first INA226 result after that averages a window that the heater was on for most of - 0.648 A, above the 0.6 A limit. The INA226 sets its alert flag and pulls ALE low; D2 falls, the interrupt switches both MOSFETs off at once, and the main loop prints "3.03 s FUSE TRIPPED at 0.648 A (limit 0.6 A) - loads off". It then reads the mask/enable register, which clears the latched alert, and the LCD shows "FUSE TRIPPED!". The pop-up at 3.30 s shows the result: the current and power registers at 0, the bus at 12.000 V, the event list with the alert at 3.093 s and the latch cleared a millisecond later. The alert reacted in hardware - the sketch only reported it.
The Restart
A second after the trip the sketch restarts the lamp alone, with the same soft start and the fuse armed again. At 4.4 s the monitor reads 0.4162 A and 4.975 W, and by 4.6 s the energy counter has reached 4.36 mWh - it stood still at 3.355 mWh while the loads were off. The heater stays off until someone resets it: an electronic fuse that cannot reset itself into the same fault.
The Graphs, the Event Log and the Check Page
The Graphs page plots the bus voltage, the current, the power and the alert - the PWM dimming shows as a fast-switching current, the trip as a sudden drop to zero. The Event log lists the configuration, the calibration, the alert set-up and the alert itself. The Check page sums up the run: The Check page sums the run up: the supply at 5.00 V with the I2C address 0x40 and the bus at 11.958 V; the calibration 512, so 0.1 mA and 2.5 mW per bit; no averaged result beyond the +-81.92 mV of the shunt input, although the largest instant reached 549 mV - the lamp's cold-filament inrush, too short to show in a 35.2 ms average; 218 results, 64 register reads and 9 writes; and the alert in amber, because the shunt-over function fired once. Below the list it repeats the rules that matter: write the calibration first, keep the shunt voltage inside +-81.92 mV, and read the mask/enable register to clear a latched alert.
The Arduino's built-in serial monitor prints a line every 200 ms - volts, amps, watts, the energy and "fuse armed" - and a line for each event: the soft start, the dimming, the heater, the trip and the restart.
High Side or Low Side?
The demo measures on the high side: the shunt is in the +12 V line, before the loads. That lets the INA226 see the load's real voltage on VBS and keeps the loads' ground solid. A low-side shunt (between the load and ground) is simpler with some chips but lifts the load's ground by the shunt's drop and cannot see a short from the load to ground. The INA226 handles up to 36 V of common-mode voltage on its inputs, so the high side is the natural choice for it.
INA226 or INA219?
Our INA219 Current Sensor Library for Proteus covers the INA219, the INA226's older relative. Both measure shunt and bus voltages over I2C. The INA226 has a finer 16-bit shunt reading (2.5 uV against 10 uV), a higher 36 V bus range, averaging up to 1024 samples and, above all, the ALE alert pin with programmable limits. For a battery gauge either works; for a fuse, a charger cut-off or anything that must react without waiting for the sketch, the INA226 is the one to choose.
Try It Yourself
- Remove the calibration write from the sketch: the current and power registers stay at zero while the shunt and bus registers still work.
- Change the averaging to 1: the results arrive every 2.2 ms and the dimmed lamp's current jumps between 0 and the full value.
- Raise the limit to 0.8 A: the heater runs with the lamp, close to the top of R100's range.
- Arm the fuse before the soft start: the lamp's inrush trips it at once.
- Set RSHUNT to 0.01 and the calibration to 5120: the same circuit now measures to 8.2 A.
Ideas to Extend the Demo
- A solar charger that counts the energy in and out of a battery.
- A USB power meter with an OLED display.
- Several INA226 modules at different addresses for each rail of a robot.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using a Real INA226 Module
- Range: R100 means about 0.82 A; fit a smaller shunt for more and change the calibration.
- Calibration: write it after every power-up - it is zero at power-on.
- Voltage: never more than 36 V on IN+, IN- or VBS.
- Ground: the module's GND must be the load's ground.
- Alert: ALE is open drain - it needs a pull-up (INPUT_PULLUP works).
Troubleshooting
- Current and power read 0: the calibration is not written.
- The current is off by a fixed factor: the sketch's Current_LSB does not match the calibration.
- The shunt reading stops at 81.92 mV: the current is beyond the shunt's range.
- ALE never falls: no alert function selected, the limit is in the wrong units, or there is no pull-up.
- The part is not simulated:
TEPINA226.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The registers, the averaging, the calibration arithmetic and the alert follow the INA226 datasheet; the module is our own drawing.
- Our own figures: each result is the exact average of the signal over its window, and the VBS input is 830 kohm.
- Not modelled: the converter's noise and offset, the high-speed I2C mode and the exact alert timing inside one conversion.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the chip's maker.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the INA226 Power Monitor Library for Proteus Simulation. I hope it helps you measure every milliamp your projects use - and protect them when something goes wrong. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!






















Comments
0