Browse Source

read measurements via adafruit library

Fabian Peter Hammerle 3 years ago
commit
c224d33449
8 changed files with 99 additions and 0 deletions
  1. 3 0
      .gitignore
  2. 6 0
      .gitmodules
  3. 6 0
      Makefile
  4. 17 0
      arduino-sketch.ino
  5. 62 0
      circuit.sch
  6. 1 0
      libraries/Adafruit-MLX90614-Library
  7. 3 0
      sym-lib-table
  8. 1 0
      symbols

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+/build-*
+/circuit-cache.lib
+/circuit.pro

+ 6 - 0
.gitmodules

@@ -0,0 +1,6 @@
+[submodule "Adafruit-MLX90614-Library"]
+	path = libraries/Adafruit-MLX90614-Library
+	url = https://github.com/adafruit/Adafruit-MLX90614-Library
+[submodule "symbols"]
+	path = symbols
+	url = git@git.hammerle.me:fphammerle/kicad-symbols.git

+ 6 - 0
Makefile

@@ -0,0 +1,6 @@
+# https://github.com/sudar/Arduino-Makefile
+USER_LIB_PATH = ./libraries
+# TODO replace with automatic detection:
+ARDUINO_LIBS = Wire Adafruit-MLX90614-Library
+BOARD_TAG = uno
+include /usr/share/arduino/Arduino.mk

+ 17 - 0
arduino-sketch.ino

@@ -0,0 +1,17 @@
+#include <Adafruit_MLX90614.h>
+
+Adafruit_MLX90614 sensor = Adafruit_MLX90614();
+
+void setup() {
+    Serial.begin(9600);
+    Serial.println("GY-906 test");
+    sensor.begin();
+}
+
+void loop() {
+    Serial.print(sensor.readAmbientTempC());
+    Serial.print("°C\t");
+    Serial.print(sensor.readObjectTempC());
+    Serial.println("°C");
+    delay(500);
+}

+ 62 - 0
circuit.sch

@@ -0,0 +1,62 @@
+EESchema Schematic File Version 4
+EELAYER 30 0
+EELAYER END
+$Descr A4 11693 8268
+encoding utf-8
+Sheet 1 1
+Title ""
+Date ""
+Rev ""
+Comp ""
+Comment1 ""
+Comment2 ""
+Comment3 ""
+Comment4 ""
+$EndDescr
+$Comp
+L MCU_Module:Arduino_UNO_R3 A?
+U 1 1 5FEB1206
+P 4550 3000
+F 0 "A?" H 4550 4181 50  0001 C CNN
+F 1 "Arduino_UNO_R3" H 4550 4093 50  0000 C CNN
+F 2 "Module:Arduino_UNO_R3" H 4550 3000 50  0001 C CIN
+F 3 "https://www.arduino.cc/en/Main/arduinoBoardUno" H 4550 3000 50  0001 C CNN
+	1    4550 3000
+	1    0    0    -1  
+$EndComp
+$Comp
+L custom-sensor-temperature:GY-906 U?
+U 1 1 5FEB2892
+P 5700 2400
+F 0 "U?" H 5700 2400 50  0001 C CNN
+F 1 "GY-906" H 5928 1967 50  0000 L CNN
+F 2 "" H 5700 2400 50  0001 C CNN
+F 3 "" H 5700 2400 50  0001 C CNN
+	1    5700 2400
+	1    0    0    -1  
+$EndComp
+Wire Wire Line
+	5050 3400 5850 3400
+Wire Wire Line
+	5850 3400 5850 3200
+Wire Wire Line
+	5750 3200 5750 3500
+Wire Wire Line
+	5750 3500 5050 3500
+Wire Wire Line
+	5650 3200 5650 4150
+Wire Wire Line
+	5650 4150 4650 4150
+Wire Wire Line
+	4650 4150 4650 4100
+Wire Wire Line
+	4650 2000 4650 1950
+Wire Wire Line
+	4650 1950 5350 1950
+Wire Wire Line
+	5350 1950 5350 3250
+Wire Wire Line
+	5350 3250 5550 3250
+Wire Wire Line
+	5550 3250 5550 3200
+$EndSCHEMATC

+ 1 - 0
libraries/Adafruit-MLX90614-Library

@@ -0,0 +1 @@
+Subproject commit 06b30a8f5663ca899685519face14f80381e1689

+ 3 - 0
sym-lib-table

@@ -0,0 +1,3 @@
+(sym_lib_table
+  (lib (name custom-sensor-temperature)(type Legacy)(uri ${KIPRJMOD}/symbols/sensor-temperature.lib)(options "")(descr ""))
+)

+ 1 - 0
symbols

@@ -0,0 +1 @@
+Subproject commit 83593ff685ab64316f5763ecae3899c7fc188dfb