Ask Hackaday: Wiping Your Bum With An Arduino?


Over or under? Standing or sitting? Truly, toilet paper has been the focus of the most irreconcilable arguments ever. The folks on the Arduino Stack Exchange have a far more important question: how do you trigger an alarm when your TP supply is low?

[user706837] asked the Internet this question in response to his kids never replacing an empty roll. This eliminates the most obvious means of notifying someone of an empty roll – looking at it before you sit down – and brings up a few interesting engineering challenges.

Most of the initial ideas deal with weight or some sort of light sensor that can differentiate between the white TP and the brown roll. A much, much more interesting solution puts a radioactive source in the TP holder’s spring-loaded rod and uses a sensor to detect how much TP is left. A quick back-of-the-wolfram calculation suggests this might be possible, and amazingly, not too dangerous.

We’re turning this one over to you, Hackaday readers. How would you design an empty toilet paper alarm? Bonus points awarded for ingenuity and cat resistance.

Image source, and also one of the longest and most absurd Wikipedia articles ever.

83 thoughts on “Ask Hackaday: Wiping Your Bum With An Arduino?

  1. I’ve thought about this on my times sitting down on the toilet. A much simpler solution would be a “lever-like” rod sitting on top of the roll. As the tissue roll gets slimmer (as it gets used up) the lever lowers. This can then be connected to another lever-like mechanism, like an analog gauge, to notify you of how much tissue paper is left.

    1. Everyone measures when the roll is EMPTY. One last block of TP on a roll will fail most tests here, and thus you will flush your Arduino down the toilet out of frustration. I like the rod-lever idea. Like one of these ( with a very weak spring to pull it closer and then take that to the ADC. Then you can set your personal PANIC level. Some might panic at half a roll while others can hold out until the last block

      1. No need for an ADC, or an arduino, just a pot on the lever and another inline with a panel meter to set the empty point.

        For more noticeable effect, you could use an op-amp as an inverting comparator to turn on a light when the roll is empty. Maybe a buzzer for that extra insistance, or perhaps a vibrator on the toilet roll holder, even a siren, or a large bell, a smoke machine? Strobe light? Water Cannon? Doomsday machine?

        1. People really do want to complicate things, don’t they? A simple 2 lever mechanism with a weak spring, and a single pulley will do the job. In addition, we could use a steam-punk style gauge for aesthetics.

  2. Simple led/photodiode pair on opposite sides of the roll holder, so that contact is made when the roll drops below a particular radius. (Obviously with a very long hysteresis period, so that using the roll doesn’t set it off transiently.) The precision of that approach is low, though.

  3. Alternative idea: ultrasonic transceiver. Not for delay-based rangefinding, but attenuation: The toilet paper would muffle the sound more effectively than the roll would. This could conceivably get you some pretty precise results near the end of the roll, depending on the acoustic properties of toilet paper (and you just KNOW someone out there has done the math on that).

    1. Might work, but could be tough to calibrate. I never tried with toilet paper, but I found out that teabag or coffee filter-like material is pretty much acoustically transparent to ultrasonics when I tried to use a US film edge detector on an industrial film unwinder. Visible light optical sensing works better.
      Typically on these machines I calculate the remaining film (aka toilet paper) by measuring (and averaging) the unwind speed with a tach or prox switch. To do this, I need to know how big the inner film core (aka toilet paper tube) is, film thickness, and of course how much film was pulled. Sounds like we need a toilet paper unwinding system with pinch rollers, encoders, dancer arms, etc… I can rarely get my kids to replace the empty roll, let alone re-thread a system like that.
      Not very practical, but I like it!

  4. Or: use a color-patterned toilet paper, and a short-focus camera pointed at the roll, and just use optical flow analysis to determine how much toilet paper has gone by so far. If you didn’t know the length of the roll, you could also couple that with an optical encoder on the inside of the roll to count rotations, and use the two readings to monitor the radius of the roll.

    1. You could sense a change of colour instead, typically the paper is white (-ish) and the inner roll is darker, often brown. Colour change = end of roll.

      The actual colours wouldn’t matter, the paper colour would be reset when the roll is changed.

      Counting rotations is difficult as it depends on paper size, number of sheets, thickness etc and you have to do calculations to measure a spiral.

  5. The debate about “over or under” is a clear sign of “issues” or a profound surplus of time to think about such things (or both). Neither is good in the long run.

    That said, I have obviated the first argument by installing a *vertical* TP holder (such as this: ) thus converting the argument to a “clockwise v. counterclockwise” one and making its absurd nature the punch line. It’s also highly cat-resistant.

    An “empty” state indicator might be achieved by one of several means:

    Color sensor – the “natural” colored core is different than the paper (and bonus points if you lived in the long-ago UK when the varnished paper was that color and had a 100-grit texture). As the color changes, so a signal will be sent. Until someone decides you need a different color of toilet paper in your absence or popular opinion weighs in favor of overpriced “natural” color paper from Whole Foods.

    Acoustic sensor – senses the high-pitched squalling of someone stranded on the pot and sends a tweet to Facebook while posting a sound clip to Pinterest and updating their blog.

    Olfactory/trace organics sensor. No description needed.

    Thermal sensor – the hot, grasping hands of the desperate person trying to eke another pillowy square out of an unyielding, empty roll sends a signal that interferes with the house’s WiFi and sets off a global howl of disgust.

    I digress….

      1. Your Arduino can count how many you have stored by multiple ultrasonic transceivers in the top of the bin, so when your “bulk” gets low, you get a blinking led somewhere that no one except the cat will see

      2. Lol. This is our technique, at least until somebody mounts the last roll and doesn’t replenish the stack from the zombie apocalypse store. Similar problem, but much trickier; soap in the shower.

  6. Use a pair of opposing cantilevered pins that insert under the tissue roll above the cardboard tube. You squeeze the pins inward as you slide a new roll onto the spool. As the roll get’s used, tension on the pins is decreased. Alarm is triggered.

  7. Why so complicated? It’s very simple.
    Simply pace a microphone in the stall that senses sort of “Arrrgh” or “not again”. When this’s detected, it seems to be possible that there’s no more paper. With some FFT analysis it should be possible to decide wether the noise comes from behind or as a verbal expression.
    When all conditions are met, a tweet’s done to inform everyone else that some refill is needed.

  8. My bathroom has a “low toilet paper” warning that was implemented by accident. The builders mounted the toilet paper holder so that the door would bang into it. If there’s plenty of paper on the roll, the impact is cushioned and nothing really happens. Once the paper is almost out (about 1/8 roll remaining), the door bangs on the metal holder and makes quite a bit of noise.

  9. It seems like the important problem is tracking the number of rolls. In my house we keep a small number on “hot standby” in each bathroom, and a centralized “cold storage” in the basement. Cold storage gets replenished very rarely.

    It seems like you could point a camera at each hot standby staging location and use a vision recognition system to count the number of rolls. A barcode scanner in the basement would let you quickly scan the incoming supply. Every time new rolls are detected in a bathroom, the number is decremented from the number in cold storage. You could have a display in each bathroom with statistics and send out warning emails (or even automatically order new TP online).

    Now the only problem is explaining to guests why you have a high resolution video camera pointed at every toilet in the house.

  10. 2 ways come to mind: as TacticalNinja mentions, a lever resting on top of the roll that activates a switch & alarm (this method is how many public toilets dispense new rolls, falling from above)

    Or a reflective sensor; all the rolls I see or use where I am are white tissue on a brown cardboard tube. These will reflect differently – but assumes someone will use every last square.

    Personally I would go the sensing lever route as more of a “very low” warning to bring a roll with you.
    Neither method requires any sort of uC!

  11. What about removing the inner tube and replacing it with something conductive (copper rod for example) and a weight connected to a wire. Tada, switch made, no arduino necessary, just hook it up in series with an LED and a power source.

  12. Does this really need a tech solution? Even my 4 year old knew enough to check for TP and yell out “we’re out of toilet paper” if she didn’t find any. It’s really REALLY not that hard to do a quick visual sweep first.

  13. Not sure if troll or actually serious….You could always wipe w/ the HaDuino, good scraper and then power up an LED w/ a fart blowing a fan spinning magnets around coils. You know..useful projects like that.

  14. Need a “square counter” contraption in our house. Some bugger always uses three squares when it is clearly stated two squares per visit. Screws with the algorithm computed via the toilet seat pressure sensor.

    1. Two squares per visit!? Are you a family of anorexic pygmies!? I eat man sized meals and take man sized dumps so I need a good wad of paper to clean out the old bunghole!

      1. Maybe he is just a cheapskape and also serves meals to fit his 2-square maximum. Personally I would screw with his algorithm regardles of my actual requirements – but im an arsehole ;-).

  15. Every Roll gets a RFID-Tag after purcasing and in every toilet stall and place where the rolls are stored, is a RFID-Reader. So it’s easy to keep track of every roll in the house. Every place has it’s minimum limit of paper rolls, so when there’s less, there’ll be an alarm triggered.

  16. Oh, the problems that don’t exist…

    It behooves manufacturers of TP to put on very specific, controlled amounts of paper on each roll I’m guessing. So why not having something that is turns based? Changes if you use a double-roll of TP, but a lot of methods fail if you change the amount that’s on the roll.

    Also, a lot of the solutions here may or may not take into account that a roll is typically on a slender shaft. Thus, it bounces around and wobbles on the holder. For the counter to work it’d have to be a full sized holder that spins along with every revolution.

    This gives the benefit that you could easily have a percentage full measurement. Integrate a microswitch into the holder and you have an automatic reset whenever the roll is removed and replaced.

    Now, if you *really* wanted to get some attention, make the roll system automatic, e.g. the roll gets replaced automatically when it’s out, and there’s a large stockpile in a hidden area.

    Or just do what everyone else does, keep spare rolls under the sink within reach.

    But what would the fun in that be?

  17. So, there you are. Fancy Arduino contraption in place and as you are emptying your bowels and reading up on the latest tweets there’s this one message notifying you about the current bathroom status ….

  18. Have a double-chambered holder (one roll each) like in some public restrooms. When the person using the toilet tries to get paper and fails, they switch to the other chamber. This puts the dispenser into a trouble state that requires resetting, which would be done after installing a new roll into the now empty chamber.

    1. So far, yours is the only workable solution, modify the holders, not the TP rolls (assuming you buy into the premise that there’s actually a problem that needs solving)..

  19. The real question is, why put the paper on a roll dispenser at all? Really, they are kind of dumb,and I am not sure why nobody has pointed it out before. They are a pain to load, with the spring-loaded fiddly plastic core, and they don’t save any time at all. You still have to use two hands to tear off a sheet, one to tear and one to stop the roll from spinning. They only hold one roll so they have to be reloaded constantly. I ripped the toilet paper holder out of my bathroom years ago and replaced it with a shelf big enough to hold 10 – 20 rolls.

    1. Some people don’t like to use a roll that others have handled and sat down on dirty surfaces. I would like to swab (for bacteria) the inside of that toilet roll that everyone has to stick their fingers into. This is at the heart of over instead of under. The end is accessible with one hand. Pull and snap it off sideways with one hand. The rest of the roll has not been touched by anyone. What happened to those cute things that hide a spare on the tank ready to take over. Make one out of old circuit boards! Or repurpose an old ATX case with dual optical drives reeling out redundant paper feeds.
      Best hack: hand sensing motor fed roller like a printer, untouchable roll feeds as long as you need not preset length. Tear off is easy with one hand. Roller feed would be the easiest way measure use, given amount on roll.

  20. Guys, guys! I have a radical idea! Why not have a raspberry pi running open CV trigger a water jet that targets the brown bulls eye? We could store different user profiles, maybe even a dual jet for our female friends! Water jets not your thing? Why not have raspberry pi automatically order toilet paper in bulk from amazon when supply gets low? All you need is a genetic algorithm to measure mass, usage, frequency, user preference, and shipping speed!

  21. Just forego the toilet paper and keep a bottle of antibacterial hand soap at the bathroom sink. If the soap runs out, just remember to buy some next trip to the store.

  22. The simplest solution is a rod attached to a microswitch. Use an on delay timer to avoid false alarms and then hook the thing up to a siren and a flashing light outside the room.

    This way there is fair warning that you will need to take the almanac in to the john with you. A mute alarm button to use in the case of

    If you catch someone on the way out of room with the siren blaring you can accuse them of unfrugality with the TP.

  23. He doesn’t know how to use the three seashells!
    Honestly, I’d just count roll rotations with an optoencoder. The data collected can be used elsewhere “15 miles of TP consumed in this bathroom last year… conserve, reuse, recycle”

  24. Like I mentioned on stack exchange, paper and air have different dielectric constants. One can detect a hand between two wires several inches apart with no more circuitry than the two wires into the arduino. So I’m sure capsense paper detection couldn’t be too hard.

  25. Let a roller rest on the TP and count lenght of used TP. Then input the lenght of the TP-roll and set an alarm just before it runs out. Could be done with a simple analog distance meter, och scaled up to lasers, or twitter if needed.

  26. Think not only about the problem, but the whole process.

    the simplest solutions, is not to have the alarm on the toilet roll holder but on the toilet roll stand or rack. so there is at least one full roll ready to go while you are wait for it to be topped up.

    that way the toilet paper alarm can never be tricked by have only a few left on the roll but not enough for a session on the loo / dunny / sh*ta

    this project can use almost any off the shelf toilet roll stand that will match the decor of your bathroom. With a simple spring leaver switch, you can almost any type of alert system you can dream up to finish it off

    My 2c

  27. What about a rotary wheel encoder which detects the exact revolution of the roll which is stuck on a encoded cylinder?
    This requires the first roll of a charge for calibration. I think the accuracy could be quite high. You could even log the consumption per session for usage optimization.

  28. Easy, a step motor with encoder inside the roll, or on the side, you have to be sure that the roll moves de motor.

    You measure the lenght of one roll one time to calibrate the processor unit, and you know everytime you want what distance of tp you’ve spent, and what’s left in there.

    Plus, you can do some interesting things with it, you can do statistics and find how many tp you waste a day, or a week, in what days of the week you spent more, you can do profiling, and you can even try to guess who is in the toilet, just from the amout of paper the person spent at a time..

    And you are also able to get some charts and show them on facebook.

  29. I would use a spring weighted balance board to measure the friction of the roll. As the brown hard paper surface would have a huge difference in friction on the two surfaces. This could be implemented using a load cell, a small metal block and grained surface paper. Then an ADC to quantizes the difference.and an micro to do the calculation. Further more a LED, LCD, Twitter, Facebook, GSM? would be a nice touch. Also add lasers for keeping the cat busy. Always add lasers

  30. Mr. NSA agent suggests:

    Use a webcam plus a cellular data module to send images of your bathroom stall to a desktop. There you can write a script which uses opencv to determine the amount of toilet paper remaining. Just make sure to use all RSA recomendations when securing your image feed so that nobody can watch you!

  31. Whoa.

    Back when I was writing for Hack a Day, I kept meaning to write an April 1st joke piece about “Turduino” — basically this exact thing. Plan was for it to be rife with immature potty jokes about hex dumps, brownout detection, rotating the logs and having to wipe and reinstall. Y’know, classy intellectual stuff like that.

    And every April 2nd I’d kick myself for having forgotten about it. Well…reality caught up. Truth really IS stranger than fiction!

  32. no one is over thinking this enough. you need to print your own paper with an rifd circuit imbedded into it at say 10% remaining and at 1%. when the roll is low, you get a warning when that circuit is flushed, and then when the 1% is gone you know it’s empty. if you tag everyone in the house, you can see who was in the room when it went empty, and twit, facebook, email and text them a message reminding them to replace the roll and instagram the arduino a picture that will be verified by fotoforensics and it’s new tags recorded to monitor for the next potential outage. it can also tell how many complete (or partial) rolls are in the vicinity.

    or you could talk to your family and maybe interact with your kids in person, ideally teaching them personal responsibility and a sense of community.

  33. James May and Simi tackled this on ManLab. Video link below for your amusement.

    Simple and silly. Perfect balance between the truth which James states very simply: “You never think to look” and more complicated solutions which would inevitably lead to: “HELP! There’s TP here, but I don’t have DRM permissions to use any of it!”

  34. When I was in highschool, we were taken on an excursion to a paper factory. The radioactive source method was used in the factory – with a source and a detector scanning back and forth as large continuous streams of paper flowed past onto spools to check that the thickness of the paper was consistent.

  35. I have an easy and precise solution.
    Just insert a metal ring inside the tube and have it stick out 1/8″ on the side then put an low voltage electrified spring lever that is 1″ wide on top of the roll, sticks out 1/8″ on the side and has a little step at the end that accounts for the thickness of the tube. When the paper is done the lever will touch the ring closing the circuit and voila’ you get an empty roll signal.
    By the way the lever doesn’t even have to be on a spring it could be just the entire toilet roll cover on a hinge and it will just go down with gravity.
    You could even put two electrified rings on both sides of the tube and just use the lid to close the circuit so that the lid doesn’t even need to be electrified (this will give you a low voltage jolt when you lift it but it will motivate you never to let a roll go empty …lol) (obviously you can isolate a contact rod under the lid to avoid this.

  36. I guess if you had a plastic holder, with a stop at one end to stop roll sliding off, you could fit an IR LED at one end and a receiver at the other, and then just measure the light level received.. Combine perhaps with a similar sensor on the spare rolls holder? So you’d have “current roll low” and “backup roll not found” states :)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.