user
c436ea0e60
|
4 years ago | |
---|---|---|
Makefile | 4 years ago | |
README.md | 4 years ago | |
arduino.ino | 4 years ago | |
image.jpg | 4 years ago | |
main.c | 4 years ago |
README.md
Temperature Logger
This is a little program I wrote to talk to an Arduino over USB serial to read temperature and relative humidity values using a DHT11 sensor, and put then in a SQLite database.
main.c
is the PC program that does the logging (printing to stdout).
It just reads printed messages from the serial port USB0
, and writes them back
into a SQLite3 database. It automatically creates the database and tables
if they don't exist (making it do that was 90% of the work).
arduino.ino
is the Arduino IDE project that reads from the hardware using the
Adafruit sensors library.
The arduino code is very arduino which isn't too nice since sine its such a tiny project pulling a lot of dependencies but I guess that's fine. Re-writing the DHT11 library would probably be interesting to do.
Compiling
For main.c
run make
For the arduino.ino
track down the Adafruit DHT11/DHT22 library, import it and build the project in the Arduino IDE.