Browse Source

HT stopfen modifies. Some improvements in the firmare.

klaute 2 years ago
parent
commit
7be4fe23ab
4 changed files with 32 additions and 28 deletions
  1. 1
    0
      doc/links.md
  2. 2
    1
      firmware/config.h
  3. 5
    5
      firmware/firmware.ino
  4. 24
    22
      hardware/ht-dn50_stopfen.scad

+ 1
- 0
doc/links.md View File

@@ -1,2 +1,3 @@
1 1
 https://arduinodiy.wordpress.com/2017/01/02/reviewing-the-wemos-battery-shield/
2 2
 https://arduinodiy.wordpress.com/2016/12/25/monitoring-lipo-battery-voltage-with-wemos-d1-minibattery-shield-and-thingspeak/
3
+https://www.thingiverse.com/thing:3015533

+ 2
- 1
firmware/config.h View File

@@ -1,6 +1,7 @@
1 1
 
2
-#define DEBUG 1
2
+//#define DEBUG 1
3 3
 
4
+#define BATTERY_POWERED 1
4 5
 #define POWERSAVING 1
5 6
 
6 7
 #define SENSOR_TEMPERATURE    0

+ 5
- 5
firmware/firmware.ino View File

@@ -62,6 +62,8 @@ void setup() {
62 62
 
63 63
   digitalWrite(STATUS_LED_PIN, HIGH);
64 64
 
65
+  lowBatCheck(getBatteryVoltage());
66
+
65 67
   // Establish WiFi connection
66 68
   String wifiName = "oko-weather-" + String(ESP.getChipId());
67 69
 
@@ -111,7 +113,7 @@ void setup() {
111 113
 
112 114
   digitalWrite(STATUS_LED_PIN, LOW);
113 115
 
114
-  lowBatCheck();
116
+  lowBatCheck(currentSensorData[SENSOR_BAT_VOLTAGE]);
115 117
 
116 118
   WiFi.mode(WIFI_OFF);
117 119
   WiFi.forceSleepBegin();
@@ -126,9 +128,9 @@ void setup() {
126 128
 
127 129
 //*************************************************************************//
128 130
 
129
-void lowBatCheck()
131
+void lowBatCheck(float v)
130 132
 {
131
-  if (currentSensorData[SENSOR_BAT_VOLTAGE] <= BAT_LOW_VOLTAGE)
133
+  if (v <= BAT_LOW_VOLTAGE)
132 134
   {
133 135
 #ifdef DEBUG
134 136
     Serial.println("Low battery, going into deep sleep.");
@@ -140,8 +142,6 @@ void lowBatCheck()
140 142
 
141 143
 void loop() {
142 144
 
143
-  lowBatCheck();
144
-
145 145
 #ifdef POWERSAVING
146 146
   delay(50);
147 147
   return;

+ 24
- 22
hardware/ht-dn50_stopfen.scad View File

@@ -1,22 +1,24 @@
1
-
2
-
3
-union() {
4
-	difference() {
5
-		cylinder(h=30, r=25, $fn=300);
6
-		translate([0, 0, -5])
7
-            cylinder(h=40, r=23, $fn=300);
8
-	}
9
-    difference() {
10
-        union() {
11
-            translate([0, 0, 30])
12
-                cylinder(h=3, r=30, $fn=300);
13
-            color("green")
14
-                translate([-22, -12, 31])
15
-                    cube([44, 24, 5]);
16
-        }
17
-        color("red")
18
-            translate([-20, -10, 25])
19
-                cube([40, 20, 15]);
20
-    }
21
-}
22
-
1
+
2
+radius=25;
3
+height=30;
4
+
5
+union() {
6
+	difference() {
7
+		cylinder(h=height, r=radius, $fn=300);
8
+		translate([0, 0, -5])
9
+            cylinder(h=height+10, r=radius-2, $fn=300);
10
+	}
11
+    difference() {
12
+        union() {
13
+            translate([0, 0, height])
14
+                cylinder(h=3, r=radius+5, $fn=300);
15
+            color("green")
16
+                translate([-22, -12, 31])
17
+                    cube([44, 24, 5]);
18
+        }
19
+        color("red")
20
+            translate([-20, -10, 25])
21
+                cube([40, 20, 15]);
22
+    }
23
+}
24
+

Loading…
Cancel
Save