A pressure (vacuum) sensor could do this. You could measure the vacuum and estimate the height of the liquid in the straw from it if you wanted to do a fancy animation of some sort. Difficulty: keeping the sensor port clean.
hacktastical
- 58.6k
- 2
- 54
- 166