Toks Fifo

Student. Builder.

Output Devices/Interface Programming

Overview

Creating a Python interface for data output.

output

Motivation

I originally wanted to use an LCD for the primary on-board output device for my water bottle. It could display stats such as how much more water you need to drink to reach your daily goal. However, mid circuit design, I discovered that the lab was out of Attiny44s (a microcontroller with more pins than the Attiny45) and I couldn't sacrifice the time to acquire one.

I decided to use the Python interface as the output for the device. It can display everything I wanted on the LCD, and more. The most critical output from my device will the the water level.

lcd

Raw Data

Here is the data outputed from hello.load.45.py. As you can see, I don't see large changes in output unless the two plates are in contact with each other. However, you can observe small changes even without contact, and this is what I hope to exploit.

Parsing Data

I started parsing the data and modified the code so that I could focus on just one output.

lcd

Parsing Data Cont'd

I kept programming, and decided to create a water bottle shaped object using Tkinter in Python. It wasn't hard to pick up, particularly since hello.load.45.py had a good basic framework.

board

Output

Here is the basic Python output from my smart water bottle. The data needs to be parsed better so as I can get more accurate results, but I like the look and responsiveness so far.

I've been mathematically calculating what the water level output should be based on the capacitance. I'm basing this on the fact that capacitance is inversely related to the distance between the plates. However, I realized that a linear equation might not work so well since the flexures I made don't necessarily compress linearly.

Mapping

I figured it might make more sense to map the capacitance to some weight, rather than try to derive it mathematically. Here is the table I got via testing. The data output is noisy and there is overlap between each water level.

table

Output Cont'd

The table resulted in more accurate sensing, although there is still plenty of room for improvement. I've now built a framework for the water level output using Python.