
Float Switch Library for Proteus Simulation

Hello friends, I hope you all are doing great. Today, I am going to share the new Float Switch Library for Proteus Simulation. The float switch is the simplest water level sensor there is: a plastic float on a stem, a magnet in the float and a reed contact in the stem. When the water lifts the float past the reed, the contact closes. Sump pumps, aquarium top-up systems, water tanks on roofs, coffee machines and boilers all use one. With this library you can run a full Proteus simulation of the float switch, with the water and the float moving on the sheet as the level changes.
Float Switch 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
This is the last part of our list of fifty new modules. The demo is a sump pump: two float switches in one tank make a level band, an Arduino UNO V4.0 reads them, and our relay module switches our submersible pump.
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 switch board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the Float Switch Library for Proteus Simulation:
What Is a Float Switch?
A float switch is a level switch with no electronics at all. The common vertical type has a hollow polypropylene float that slides on a sealed stem. Inside the stem sits a reed switch: two thin ferromagnetic blades in a glass tube that touch when a magnetic field crosses them. Inside the float is a ring magnet. When the water lifts the float up the stem, the magnet comes level with the reed and the blades close; when the water drops, the float follows it down and the blades spring apart. A clip at the bottom of the stem and a collar near the top limit the float's travel, so it can only move a couple of centimetres.
| Vertical PP float switch | |
|---|---|
| Stem | about 52 mm, M10 thread at the top |
| Float | about 22 mm, polypropylene, with a ring magnet |
| Contact | a reed: NO or NC (turn the float over) |
| Rating | typically 0.5 A, 100 V, 10 W |
| Closed resistance | well under 1 ohm |
| Hysteresis | a millimetre or two of float travel |
| Wires | two, no polarity |
NO or NC: Turn the Float Over
The same switch can be normally open or normally closed, and you choose by how you put the float on. Mounted the usual way, the magnet sits at the reed only when the float is lifted: the contact is open in an empty tank and closes when the water rises - "closed when full". Pull the clip off, turn the float upside down and put the clip back, and the magnet now sits at the reed when the float rests on the clip: the contact is closed in an empty tank and opens when the water rises - "closed when empty". In the simulation that is the CONTACT property: NO or NC.
Hysteresis Without a Single Component
A comparator needs two resistors to get hysteresis. A float switch gets it free from its mechanics: the reed closes when the magnet's field passes a threshold, and it opens again only when the field has dropped further than that, so the float has to travel a little past the switching point in each direction. The model gives the float about 1.6 mm of travel between closing and opening. That is small, and it is why a single float switch on a pump makes the pump hunt: a wave or a few drops near the switching point and the contact chatters. The cure is in the demo: two switches and a band.
Why a Reed Contact Must Not Switch the Pump
The reed's blades are tiny. A typical rating is 0.5 A at most and 10 W at most. A small pump draws more than that when it starts, and a motor's inductance makes an arc each time the contact opens. Wired straight into a pump's supply, a float switch works for a while and then welds shut, and the tank overflows. So the float switch only signals, and a relay or a MOSFET carries the pump current. The pop-up of the simulation watches the current through the contact and warns above 0.5 A.
Features of the Float Switch Library for Proteus Simulation
- A real-looking switch: the vertical float switch at its real size, side view, mounted through a tank lid with its nuts, thread and wires, and a section of the tank behind it.
- The water and the float move on the sheet: at Run the water rises and falls in the tank section and the float rides on it between the clip and the collar.
- A real contact: a reed between pins 1 and 2, 0.5 ohm closed, NO or NC, with the float travel as hysteresis.
- A tank to test with: PROFILE DEMO fills and empties the tank on its own - the same curve for every float switch, so several switches in one tank agree; PROFILE STEADY holds a level that the pop-up's chips move up and down.
- A pop-up: the whole tank with the water, the switch and the float, the last 8 seconds of the level and the contact, and tiles for every number - graphs, an event log and a check page.
- A complete package: about 1.9 MB with the library, our relay module and submersible pump, our Arduino UNO V4.0 and the demo, without the source code of the model.
The Float Switch in Proteus
The device is FLOATSWITCHTEP in TEPFLOAT.LIB, under Switches and Relays > Switches, with the prefix S and the model TEPFLOAT.DLL. Search FLOAT in Pick Devices. Its two pins, 1 (the red wire) and 2 (the black wire), are at the top, where the wires leave the switch above the lid. Five properties set it up: HEIGHT (where the switch sits, in mm above the tank bottom), CONTACT (NO or NC), PROFILE (DEMO or STEADY), LEVEL (the water for STEADY) and TANK (the depth drawn in the pop-up).
Download Float Switch Library for Proteus Simulation
Click the button below to download Float-Switch-Library-for-Proteus-v1.0.zip (about 1.9 MB, without the source code of the models):
Float Switch Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPFLOAT.LIB,TEPRELAY.LIB,TEPSUBPUMP.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPFLOAT.DLL,TEPRELAY.DLL,TEPSUBPUMP.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch (no extra libraries).
- 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 Float Switch 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
TEPFLOAT.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for FLOAT.
Proteus Simulation of a Sump Pump with Two Float Switches
The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0 and two float switches on the same DEMO tank. S1 is the LOW switch at 60 mm, wired from D2 to GND; S2 is the HIGH switch at 220 mm, wired from D3 to GND. Both are NO, so each reads LOW when the water is above it. A relay module from our Relay Module Library for Proteus takes its signal from D7; its contact switches a pump from our Mini Submersible Water Pump Library for Proteus. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open Float-Switch-Sump-Pump-ArduinoUnoV4.pdsprj.
The Sketch
A float switch is wired like a push button, so the sketch reads it like one: the input's internal pull-up holds it HIGH while the contact is open, and the closed contact pulls it LOW:
pinMode(FLOAT_LOW, INPUT_PULLUP);
pinMode(FLOAT_HIGH, INPUT_PULLUP);
The control rule is the level band. The pump starts when the HIGH float rises and stops only when the LOW float drops; between the two it keeps doing what it was doing. That one rule turns two simple switches into a controller that runs the pump in long, clean cycles:
if (highWet && !pump) { pump = true; pumpSince = millis(); Serial.println(F(" -> pump ON (emptying)")); }
if (!lowWet && pump) { pump = false; Serial.print(F(" -> pump OFF after ")); Serial.print(millis() - pumpSince); Serial.println(F(" ms")); }
Every half second the sketch also prints the state of both floats and the pump, so the monitor reads like a log of the tank.
Float Switch Simulation Results
Open the project and press Run. The demo runs 5.6 simulated seconds and took about 2 minutes 15 seconds on our PC with the pop-ups open and the pictures being taken. Click S1 or S2 for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
The Tank Fills
The DEMO tank starts at 80 mm and fills at 60 mm/s. S1 sits at 60 mm, so it is under water from the first moment: its float rises against the stop collar, the contact closes in the first step and the sketch reads "LOW wet". S2 at 220 mm is still dry. At 1.48 s the water stands at 169 mm. The LOW switch's pop-up shows the tank with the water far above the orange switch line, the float up (16 mm up the stem, as far as the collar lets it go), the contact CLOSED and 0.05 mA through it: that is the Arduino's internal pull-up, about 100 kohm from 5 V, the only current a float switch should ever carry. On the sheet, the water in both tank sections rises and the floats ride on it.
The HIGH Float Starts the Pump
The Arduino stamps every change with millis(), which starts about 65 ms after the simulation. At 2,308 ms the water passes 222 mm, S2's float lifts its magnet past the reed and the contact closes: the monitor prints "HIGH float up (water above 220 mm)" and, on the next line, "pump ON (emptying)". D7 goes high, the relay module pulls in and its contact feeds the pump. The running picture is taken at 2.59 s: the water at 235 mm, both floats up with their green dots on, the relay on and the pump running.
Inside the Band
The HIGH switch's pop-up at that moment shows the same from the switch's side: the water above its 220 mm line, the float up and the contact CLOSED. The tank tops out at 240 mm and starts to empty at 90 mm/s. At 2,813 ms the HIGH float drops back past its reed - "HIGH float down" - but the pump keeps running, because the rule only stops it at the LOW float. That is the band at work: between 220 and 60 mm the pump does whatever it was doing. At 3.99 s the water is at 121 mm, halfway down, the HIGH switch open and the pump still on.
The LOW Float Stops the Pump
At 4,592 ms the water drops under the LOW switch and S1 opens: "LOW float down (water under 60 mm)", then "pump OFF after 2284 ms". The pump ran for 2.28 s and emptied the whole band in one go. The LOW switch's pop-up at 4.89 s shows the water at 49 mm under its 60 mm line: the float resting on its clip (0.0 mm up), the contact OPEN with 5.00 V across it and no current, and the last change "opened at 61 mm, 4.66 s" - a millimetre past the switching level, the float's travel at work.
The tank bottoms out at 45 mm and fills again. At 5,057 ms the LOW float rises once more - "LOW float up (water above 60 mm)" - and the pump stays off, because only the HIGH float may start it; the next cycle would begin at about 7.8 s, when the water reaches 222 mm again. Over the 5.6 seconds the LOW switch changed three times (closed at the start, opened, closed again) and the HIGH switch twice.
The Graphs, the Event Log and the Check Page
The Graphs page plots the water level, the contact, the float's position on the stem and the current through the contact. The Event log lists every change of the contact with the water level at that moment. The Check page sums up the run: Water green with the level and the DEMO tank, Contact green with three changes over the run, and Current green: "0.0 mA at most" - the 0.05 mA of the pull-up rounds down - against the reed's 500 mA. With the pump on a relay, the float switch never carries more than a signal current.
The Arduino's built-in serial monitor reads like the log of the tank: the state of both floats and the pump twice a second, and a time-stamped line for every float change and every pump start and stop.
Why Two Floats and Not One
With one float switch the only possible rule is "pump on while wet, off while dry". The pump then starts the moment the water reaches the switch, lowers the level by a millimetre or two, stops, and starts again as the next trickle comes in. A pump that starts ten times a minute wears out its motor and its relay quickly. With two switches the pump empties the whole band between them in one go: the number of starts depends on the band's height and the inflow, and you choose the band. In the demo the band is 160 mm; in a real sump pit it is usually 20 to 30 cm.
NO or NC for Safety
Which contact type to use is a safety question. With NO switches, a broken wire looks like "dry": for the LOW switch that is safe (the pump stops), for the HIGH switch it is not (the pump never starts and the pit overflows). Many installers use an NC switch, or a third float above the HIGH one wired as an alarm, so that a broken wire raises the alarm instead of hiding the problem. In the simulation you can try both: set S2's CONTACT to NC and invert its test in the sketch.
A Float Switch and a Limit Switch
Electrically, a float switch is the same thing as a mechanical limit switch: a dry contact that says "something reached this position". The difference is only what moves it - the water instead of a machine part. So everything you know about reading a micro limit switch applies here: a pull-up, a LOW when active, and a little debounce if the signal bounces.
Try It Yourself
- Click S2 while the simulation runs and use the pop-up's chips: Water -20 mm and Water +20 mm move that switch's water by hand (the switch leaves the DEMO tank), and the sketch reacts at once.
- Delete S1 and change the sketch to stop the pump when the HIGH float drops: watch how often the pump starts now.
- Set S2's CONTACT to NC: the logic is reversed, the pump runs in an empty tank - then fix the sketch.
- Wire the pump straight through S2 instead of the relay: the Check page turns red with the current over the reed's 0.5 A rating.
- Move S1 to HEIGHT 120: a narrower band, more pump starts.
Ideas to Extend the Demo
- A third float above the HIGH one as an overflow alarm with a buzzer.
- A water tank on a roof: an NC float at the top stops the filling pump, an NO float at the bottom protects the pump from running dry.
- A run timer: if the pump runs much longer than usual, the inflow is too high or the pump is failing - print a warning.
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 Float Switch
- Rating: the reed carries about 0.5 A and 10 W - switch the pump with a relay or a MOSFET.
- Mounting: keep the stem vertical; on a tilted stem the float sticks.
- NO / NC: turning the float over changes the contact - check which way your switch is mounted.
- Pull-up: use INPUT_PULLUP or a 10 kohm resistor to VCC; the switch only connects pin 1 to pin 2.
- Long wires: in a pit tens of metres away, add a small capacitor and a little debounce in the sketch.
Troubleshooting
- The input never changes: pin 1 has no pull-up - use INPUT_PULLUP.
- The logic is upside down: NO reads LOW when wet - set CONTACT NC or invert the test.
- The pump hunts: one switch at one level - use two switches and a band.
- The Check page warns about the current: the load is wired through the float switch - use a relay.
- The part is not simulated:
TEPFLOAT.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The reed contact, NO and NC, the float riding between its clip and collar and its travel as hysteresis follow the common vertical float switch; the drawing is our own.
- Our own figures: the DEMO tank fills at 60 mm/s and empties at 90 mm/s between 45 and 240 mm - fast on purpose, so a whole pump cycle fits in a few simulated seconds.
- Not modelled: waves and turbulence, the contact bounce, and the water being moved by the pump (the DEMO tank follows its own curve).
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or any float switch maker.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the Float Switch Library for Proteus Simulation, the last of our fifty new modules. I hope it helps you build pumps and tanks that never overflow. 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