Oh Sit! is an Internet of Things project designed to track how long a user sits in their chair. It integrates hardware and software, utilizing a Raspberry Pi and a force-sensitive resistor to detect when pressure is applied. The system records the duration of each session, sending the data to a Node server and storing it in a PostgreSQL database. A notification is also sent to their phone, detailing how long they were seated.
How Does It Work?
Detection (Raspberry Pi + Resistor):
A force-sensitive resistor connected to a Raspberry Pi detects when pressure is applied (i.e., when someone sits).
The Raspberry Pi tracks how long the resistor is pressed.
Data Transmission (Raspberry Pi to Server):
When the sitting session ends (when the user stands up), the Raspberry Pi sends the recorded duration to a Node server via a POST request to /api/v1/times.
Storage (Server + Database):
The server saves the session data in a PostgreSQL database for tracking and analysis.
Notification (Server to Mobile App):
After the user stands up, the server sends a notification to the user's mobile app, summarizing how long they were seated.
Figure 1: Diagram showcasing the system architecture
Figure 2: Diagram showcasing the circuit
Code
Checkout the code below used on the Raspberry Pi:
Tech Stack
Frontend (Mobile App)
Ecosystem for building the mobile app.
Framework for building the mobile app.
Backend (Node Server)
Language used to build the server.
JavaScript runtime for handling data from IoT devices.
Used to set up a server for handling data from Raspberry Pi.
Database ORM for storing and retrieving data from PostgreSQL.
Database
Relational database for storing sitting session data.
Hardware (Raspberry Pi)
Computer to collect sensor data and communicate with the server.
Used to interact with the Raspberry Pi and send data to the server.
Gallery
Figure 3: Close up on pin board
Figure 4: Image of circuit
Figure 5: Video of the project
Figure 6: Mobile App Home Page
Figure 7: Mobile App Stats Page
Figure 8: Mobile App Notification
Contact
Please feel free to reach out to me on my socials!