Motivation
8-hours in the office is not a short time. Depends on the type of jobs, you may be messed up with your water drinking pattern. For example, I often forgot to frequently drink water due to work and usually ended up with drinking 2 glasses of water whenever I feel too thirsty. It is hard to prove that drinking water in small amount every hour is better than drinking the whole water bottle every 3-4 hour, however, I do notice that the later only makes me to go to the restroom right after that (seriously!). So to re-shape my drinking habit to the former, I decided to make a small device, the office coaster, to monitor and remind me to drink water more often.
How it works
A custom Cypress Analog Coprocessor Kit (i.e. you will need to do some soldering on the original pioneer kit) is connected to a load-cell (like the YZC-133 @ ~3.5aud on ebay). To minimise all the hardware work (which might scare some of you), the whole circuitry was built around the pioneer kit itself (i.e. no extra component is needed). The software will reconfigure the 4 built-in opamp of the PSOC to amplify signals from the PIR and load-cell sensor. A simple, linear program (not even use timer) is provided so that you can customise it the way you want it to be. In short, what you really need is some basic C programming skills to modify the code as you like.
Instruction
- remove R134 (P2.4) and R81 (P1.1)
- solder the load cell wires as: black (ground), red (vcc), white (P1.5), green (P1.7)
- print the top and bottom part of the casing
- using 4 screws (M4x2 and M5x2) to secure the load-cell to the case
- you can also use 4 small screws to secure the pioneer pcb to the case if your 3d printer resolution is not so good
- this is what you will end up with
- install PSOC Creator and load the provided project.
- read through the code and remember to re-sync the RTC component to the current time and date if you have plan to record your water intake before compiling and programming to the kit.
Explanation
The software is written in a linear way i.e. sequence programming (no interrupt was used) so that anybody with basic C programming skill can read and modify. The running sequences are:
[1] Turn on >> wait for an empty cup/glass to be placed on top >> done calibration
[2] read load-cell and RTC and do the following
>> new day >> reset the water intake to 0 (new day!)
>> user do not drink for more than 1 hour >> turn on the alertFlag
>> user drink water >> record the drinking amount >> record the time + reset the alertFlag
[3] read PIR sensor >> if detect people and alertFlag is set >> turn on the red LED to remind the user
The following graph illustrates the above process:
A few notes on the project
- the project is NOT a product, use it at your own risk
- the aim of the project is to see how far an PSOC can be used as a sensor hub without additional dedicated analog ICs. In other words, there are better ways of implementing this office coaster idea, however, I chose to limit myself with just the PSOC peripheral.
- the current design requires power (from USB) to operate. It is a good idea to make it portable by porting this design on the PSOC BLE. It can be a neat design: very little additional components, low power (i.e. portable) and BLE!!!
- there are many constants in the program. You may need to change those values to suit the weight of your office cup/glass.
Comments