My requirement is just to know when a cup/mug is empty. I searched for weight sensors but they are bulky and expensive for this simple task. Is there any cheap solution for this task? Using weight sensor is not necessary as long as requirement is met. The circuit will be under base of the cup. The liquid can be anything from water to black coffee.


I asked i wanted to detect whether a cup is empty or not. The bottom surface of cup is flat.
One cheap idea is to have a little transparent surface at bottom of mug like 1 cm by 1 cm. Put a photo transistor there to see what's in the mug. If the mug is empty, photo transistor will give a unique value as compared to any other liquid present regardless of its amount in mug.
Any other ideas are welcome.

  • \$\begingroup\$ my first thought was to take 2 wires and measure the conductivity, but not quite sure if coffee is that conductive anyway. \$\endgroup\$ Jul 4, 2015 at 21:27
  • \$\begingroup\$ I think this is a good reading for a start. They also have coffee on the list. \$\endgroup\$ Jul 4, 2015 at 21:57
  • \$\begingroup\$ Bence: the chips in the article use ultrasonic transducer. I think it will only add more cost and design complexity as i dont need accurate measurement. \$\endgroup\$ Jul 4, 2015 at 23:47
  • 2
    \$\begingroup\$ Weight sensors need not be expensive. You can buy electronic scales for $5 or less. Take one apart and you'll see the strain gauge and a couple of wires. The voltage/resistance change caused by the strain guage is tiny so feed it to a wheatstone bridge then feed that to an analog input of a microcontroller (or if you want to get fancy feed it to an opamp first). \$\endgroup\$
    – slebetman
    Jul 5, 2015 at 0:01
  • 2
    \$\begingroup\$ @MatzeStrawberrymaker The current you send through a conductive liquid can cause chemical reactions. The result can be both inflammable and toxic. \$\endgroup\$
    – kasperd
    Jul 5, 2015 at 9:07

5 Answers 5


I experimented with this round force sensitive resistor, and it can probably be used to determine whether the cup is empty or not. It is the opposite of bulky, so if it works you can get a very small form factor. The one caveat is that I had to place a small metal piece on the force resistor and balance the mug on it, to direct all force towards the material. It turns out that mugs are often curved at the bottom so that they don't touch the ground at all in the middle where the resistor would be placed. You might be able to work around this by getting a larger piece of force sensitive material since they are sold in all kinds of sizes (and can be much cheaper than the one I linked to).

These are the measurements I got when testing this with an Arduino (the analog signal on an Arduino varies between 0 and 5 volts):

Mathematica graphics

I repeatedly poured approximately four centiliters of water into the mug. As you can see from the red lines which indicate the points at which I did not pour water into the mug the response is not linear. However, the data sheet includes a resistance versus force curve, and you can do your own calibration.


I would think that a simple weight switch is the ideal solution. Other suggestions:

  • conductivity (two rods in the liquid)
  • capacity (two rods, or one is a foil outside the mug)
  • US distance (from somweher above the cup to the liquid level or the bottom)
  • IR distance (idem)
  • somehow measure the natural frequency (speaker + microphone?)
  • \$\begingroup\$ How will you avoid undesired chemical reactions inside the liquid if you measure conductivity or capacity? \$\endgroup\$
    – kasperd
    Jul 5, 2015 at 9:11
  • \$\begingroup\$ Use a very small level of power, inert electrodes (for conductivity), and AC. \$\endgroup\$ Jul 5, 2015 at 9:13
  • 2
    \$\begingroup\$ Those may very well slow the reaction down. But I don't think it will completely prevent the reaction from happening. \$\endgroup\$
    – kasperd
    Jul 5, 2015 at 9:20
  • 4
    \$\begingroup\$ Reactions happen all the time, just keep the amount insignificantly small. And a low-voltage high-frequency capacititvely coupled AC will just jiggle the ions about a bit instead of causing any redox reactions. (Remember: redox reactions have an activation level = a voltage below they will not occur.) At somewhat higher voltage AC redox reactions will occur, but cancel each other out due to the AC. \$\endgroup\$ Jul 5, 2015 at 11:16
  • 1
    \$\begingroup\$ +1 For suggesting measuring the natural resonance frequency of the mug and liquid. :-) \$\endgroup\$ Jul 8, 2015 at 1:13

You don't provide much details on the specific application (i.e. the context where this would be applied and the specifications you want to meet).

Anyway, assuming you don't need much sophistication, a base with an array of microswitches can be made cheaply. Then use some simple logic to detect when the cup is full, for example if 2 out of 3 switches are on then declare the mug full.

I suggest an array of microswitches because with just one microswitch you could end up requiring a more sophisticated balancing mechanism in the base to prevent a non-centered mug not to trigger the only switch. With 3-6 microswitch spread evenly in the base you don't need a very precise mechanics setup and you could implement all the detection logic in software with a microcontroller, for example.

Of course my suggestion is viable if the weight of the mug is something known in advance, i.e. the mugs are all the same weight and the base can be made not to press on the switches if an empty mug is placed on it.


Calle has a great answer for a weight sensor. The other main way would be to sense the liquid using a level sensor. These have the advantage that they don't give misleading results if the weight varies between cups, but would normally need to be put above the cup.

Wikipedia has some useful details on level sensors here.

There are three main ways to do this (beyond weight) that I know about:

  • Float sensors
  • Conductive sensors
  • Capacitive sensors
  • Optical sensors

Float sensors rely on a float rather like in a toilet cistern moving, and switching something (either mechanically, magnetically - i.e. a magnet moves - or occasionally optically). These would generally be too bulky.

Conductive sensors attempt to pass some current (often low voltage AC to prevent you electrolysing your coffee too much) through the liquid if it reaches a pair of electrodes. Provided your cup doesn't contain the purest distilled water, this should work. You can build one yourself (it's a couple of wires), or search for 'immersion electrode'.

Capacitative sensors are immersed in the liquid and measure the change in dielectric constant. These would work here, but something needs to be dipped in your coffee cup.

Optical level sensors (including laser optical level sensors) would remain above the liquid, but more often protrude into the liquid with a dome that is covered by the liquid, which changes the output of a phototransistor. These are often used in vending machines (though not normally in the coffee cup - that's normally done by weight or timing the amount of liquid put in). From Farnell (randomly selected UK supplier) these seem to start at about 18 UK pounds (approx $25).


I would use a low level microwave transmitter (below the cup), and a receiver (at top of cup). Calibrate it with an empty cup (strongest signal), and any reading less that this (liquid absorbs some radiation), would be the not empty cup signal.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.