Browse Source

Added log info (cumulated distance, log button)

master
Youen 6 months ago
parent
commit
e974f1767c
  1. 4
      ESP32/src/DataLogger.cpp
  2. 6
      ESP32/src/DataLogger.h
  3. 2
      ESP32/src/utils.cpp
  4. 143
      ESP32/src/vehicle-monitor.cpp
  5. 65
      schema/MCU_board/MCU_board.kicad_pcb
  6. 2
      schema/MCU_board/MCU_board.kicad_prl
  7. 103
      schema/MCU_board/MCU_board.kicad_sch
  8. 57
      schema/library/vehicle-monitor.kicad_sym

4
ESP32/src/DataLogger.cpp

@ -54,7 +54,7 @@ void DataLogger::open(const char* currentDateTime)
char metadata[64]; char metadata[64];
sprintf(metadata, "start time: %s\n", currentDateTime == nullptr || currentDateTime[0] == 0 ? "NA" : currentDateTime); sprintf(metadata, "start time: %s\n", currentDateTime == nullptr || currentDateTime[0] == 0 ? "NA" : currentDateTime);
if(!file.print(metadata)) Serial.println("DataLogger: failed to write to file"); if(!file.print(metadata)) Serial.println("DataLogger: failed to write to file");
if(!file.print("time,speed,battery voltage,battery output current,temperature,altitude,latitude,longitude\n")) Serial.println("DataLogger: failed to write to file"); if(!file.print("time,distance,speed,battery voltage,battery output current,temperature,altitude,latitude,longitude, log button\n")) Serial.println("DataLogger: failed to write to file");
} }
void DataLogger::close() void DataLogger::close()
@ -81,7 +81,7 @@ void DataLogger::log(unsigned long timeMilliseconds, const Entry& entry)
{ {
sprintf(coords, "%.5f,%.5f", entry.latitude, entry.longitude); sprintf(coords, "%.5f,%.5f", entry.latitude, entry.longitude);
} }
sprintf(line, "%.3f,%.3f,%.3f,%.3f,%.1f,%.1f,%s\n", currentTime, entry.speed, entry.batteryVoltage, entry.batteryOutputCurrent, entry.temperature, entry.altitude, coords); sprintf(line, "%.3f,%d, %.3f,%.3f,%.3f,%.1f,%.1f,%s,%d\n", currentTime, (int)entry.cumulatedDistance, entry.speed, entry.batteryVoltage, entry.batteryOutputCurrent, entry.temperature, entry.altitude, coords, entry.logButtonPressed ? 1 : 0);
file.print(line); file.print(line);
if(currentTime >= lastFlushTime + 10.0f) if(currentTime >= lastFlushTime + 10.0f)

6
ESP32/src/DataLogger.h

@ -8,11 +8,13 @@ public:
{ {
float batteryVoltage = 0.0f; // V float batteryVoltage = 0.0f; // V
float batteryOutputCurrent = 0.0f; // A float batteryOutputCurrent = 0.0f; // A
uint32_t cumulatedDistance = 0; // mm
float speed = 0.0f; // m/s float speed = 0.0f; // m/s
float temperature = 0.0f; // in °C float temperature = 0.0f; // in °C
float altitude = 0.0f; // in m float altitude = 0.0f; // in m
float latitude = -1000.0f; float latitude = -1000.0f;
float longitude = -1000.0f; float longitude = -1000.0f;
bool logButtonPressed = false;
bool isDifferent(const Entry& other) bool isDifferent(const Entry& other)
{ {
@ -20,11 +22,13 @@ public:
return return
std::abs(batteryVoltage - other.batteryVoltage) > 0.1f * scale std::abs(batteryVoltage - other.batteryVoltage) > 0.1f * scale
|| std::abs(batteryOutputCurrent - other.batteryOutputCurrent) > 0.1f * scale || std::abs(batteryOutputCurrent - other.batteryOutputCurrent) > 0.1f * scale
|| std::abs((int32_t)cumulatedDistance - (int32_t)other.cumulatedDistance) > 4000 * (int)scale
|| std::abs(speed - other.speed) > 0.1f || std::abs(speed - other.speed) > 0.1f
|| std::abs(temperature - other.temperature) > 0.5f * scale || std::abs(temperature - other.temperature) > 0.5f * scale
|| std::abs(altitude - other.altitude) > 0.5f * scale || std::abs(altitude - other.altitude) > 0.5f * scale
|| std::abs(latitude - other.latitude) > 0.0001f || std::abs(latitude - other.latitude) > 0.0001f
|| std::abs(longitude - other.longitude) > 0.0001f; || std::abs(longitude - other.longitude) > 0.0001f
|| logButtonPressed != other.logButtonPressed;
} }
}; };

2
ESP32/src/utils.cpp

@ -61,5 +61,7 @@ namespace utils
nextSearchPos = p + searchStrLen; nextSearchPos = p + searchStrLen;
} }
*newPos = 0; // null terminate the final string
} }
} }

143
ESP32/src/vehicle-monitor.cpp

@ -32,6 +32,7 @@ ADC batterySensor(39);
//Adafruit_ADS1015 currentSensor2; //Adafruit_ADS1015 currentSensor2;
Adafruit_DPS310 pressureSensor; Adafruit_DPS310 pressureSensor;
const int8_t speedSensorPin = 13; const int8_t speedSensorPin = 13;
const int8_t logButtonPin = 12;
const int8_t debugLedPin = 2; const int8_t debugLedPin = 2;
const int8_t I2C_SDA = 15; const int8_t I2C_SDA = 15;
const int8_t I2C_SCL = 4; const int8_t I2C_SCL = 4;
@ -102,7 +103,15 @@ void IRAM_ATTR onSpeedSensorChange(bool newState)
} }
} }
volatile bool logButtonPressDetected = false;
void IRAM_ATTR onLogButtonChange(bool logButtonPressed)
{
if(logButtonPressed)
logButtonPressDetected = true;
}
void IRAM_ATTR onSpeedSensorChange() { onSpeedSensorChange(digitalRead(speedSensorPin) == HIGH); } void IRAM_ATTR onSpeedSensorChange() { onSpeedSensorChange(digitalRead(speedSensorPin) == HIGH); }
void IRAM_ATTR onLogButtonChange() { onLogButtonChange(digitalRead(logButtonPin) == LOW); }
float getSpeed() float getSpeed()
{ {
@ -168,6 +177,9 @@ void setup()
pinMode(speedSensorPin, INPUT_PULLUP); pinMode(speedSensorPin, INPUT_PULLUP);
attachInterrupt(speedSensorPin, &onSpeedSensorChange, CHANGE); attachInterrupt(speedSensorPin, &onSpeedSensorChange, CHANGE);
pinMode(logButtonPin, INPUT_PULLUP);
attachInterrupt(logButtonPin, &onLogButtonChange, CHANGE);
Serial.begin(115200); Serial.begin(115200);
if(!SPIFFS.begin(false)){ if(!SPIFFS.begin(false)){
@ -210,124 +222,6 @@ void setup()
WebServer.setInfoReceivedCallback(onInfoReceived); WebServer.setInfoReceivedCallback(onInfoReceived);
WebServer.begin(); WebServer.begin();
/*server.on("/api/debug/log", HTTP_GET, [](AsyncWebServerRequest *request){
AsyncResponseStream *response = request->beginResponseStream("text/plain");
int logPartIdx = 0;
while(true)
{
const char* text = DebugLog.get(logPartIdx);
if(text[0] == 0) break;
response->print(text);
++logPartIdx;
}
request->send(response);
});
server.on("/api/status", HTTP_GET, [](AsyncWebServerRequest *request){
int v = batteryVoltage;
int c = batteryOutputCurrent;
int s = (int)(getSpeed() * 1000.0f + 0.5f);
int temp = temperature;
int alt = altitude;
int td = tripDistance;
int ttt = tripTotalTime;
int tmt = tripMovingTime;
int tae = tripAscendingElevation / 100; // convert mm to dm
int tme = tripMotorEnergy / 360; // convert Joules to dWh (tenth of Wh)
const char* logFileName = DataLogger::get().currentLogFileName();
if(String(logFileName).startsWith("/log/")) logFileName += 5;
int totalSize = (int)(SPIFFS.totalBytes() / 1000);
int usedSize = (int)(SPIFFS.usedBytes() / 1000);
char json[256];
sprintf(json, "{\"v\":%d,\"c\":%d,\"s\":%d,\"td\":%d,\"ttt\":%d,\"tmt\":%d,\"tae\":%d,\"tme\":%d,\"temp\":%d,\"alt\":%d,\"log\":\"%s\",\"tot\":%d,\"used\":%d,\"lat\":%.5f,\"lng\":%.5f,\"d\":\"%s\"}", v, c, s, td, ttt, tmt, tae, tme, temp, alt, logFileName, totalSize, usedSize, latitude, longitude, realtime);
request->send(200, "text/json", json);
});
server.on("/api/info", HTTP_POST, [](AsyncWebServerRequest *request){
//DebugLog.println("/api/info");
AsyncWebParameter* latitudeParam = request->getParam("lat", true);
AsyncWebParameter* longitudeParam = request->getParam("lng", true);
AsyncWebParameter* altitudeParam = request->getParam("alt", true);
if(latitudeParam != nullptr && longitudeParam != nullptr)
{
char *ending = nullptr;
latitude = strtof(latitudeParam->value().c_str(), &ending);
if (*ending != 0)
latitude = -1000.0f;
longitude = strtof(longitudeParam->value().c_str(), &ending);
if (*ending != 0)
longitude = -1000.0f;
//DebugLog.print("lat="); DebugLog.print(latitude); DebugLog.print(" lng="); DebugLog.println(longitude);
if(altitudeParam != nullptr)
{
gpsAltitude = strtof(altitudeParam->value().c_str(), &ending);
if (*ending != 0)
gpsAltitude = -1000.0f;
//DebugLog.print("alt="); DebugLog.println(gpsAltitude);
}
}
AsyncWebParameter* timeParam = request->getParam("time", true);
if(timeParam != nullptr)
{
strcpy(realtime, timeParam->value().c_str());
//DebugLog.print("time="); DebugLog.println(realtime);
}
request->send(200);
});
server.on("/api/log/list", HTTP_GET, [](AsyncWebServerRequest *request){
String json;
json = "{\"files\":[";
auto logFolder = SPIFFS.open("/log");
auto file = logFolder.openNextFile();
bool first = true;
while(file)
{
if(!first) json += ",";
json += "{\"n\":\"/api";
json += file.name();
json += "\",\"s\":";
json += file.size();
json += "}";
first = false;
file = logFolder.openNextFile();
}
json += "]}";
request->send(200, "text/json", json.c_str());
});
// Special case to send index.html without caching
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){ request->send(SPIFFS, "/www/index.html", "text/html"); });
server.serveStatic("/index.html", SPIFFS, "/www/index.html");
server.on("/manifest.webmanifest", HTTP_GET, [](AsyncWebServerRequest *request){
AsyncWebServerResponse* response = request->beginResponse(SPIFFS, "/www/manifest.webmanifest", "application/manifest+json; charset=utf-8");
//response->addHeader("Content-Disposition", "inline");
request->send(response);
});
// Log files (not cached)
server.serveStatic("/api/log", SPIFFS, "/log/");
// Other static files are cached (index.html knows whether to ignore caching or not for each file)
server.serveStatic("/", SPIFFS, "/www/").setCacheControl("max-age=5184000");
server.begin();
DebugLog.println("HTTP server started");*/
digitalWrite(debugLedPin, LOW); digitalWrite(debugLedPin, LOW);
} }
@ -479,17 +373,25 @@ void loop()
unsigned long dt = utils::elapsed(lastLoopMillis, now); unsigned long dt = utils::elapsed(lastLoopMillis, now);
lastLoopMillis = now; lastLoopMillis = now;
bool logButtonPressed = logButtonPressDetected || (digitalRead(logButtonPin) == LOW);
logButtonPressDetected = false;
digitalWrite(debugLedPin, logButtonPressed);
static DataLogger::Entry entry; static DataLogger::Entry entry;
entry.batteryVoltage = (float)status.batteryVoltage / 1000.0f; entry.batteryVoltage = (float)status.batteryVoltage / 1000.0f;
entry.batteryOutputCurrent = (float)status.batteryOutputCurrent / 1000.0f; entry.batteryOutputCurrent = (float)status.batteryOutputCurrent / 1000.0f;
entry.cumulatedDistance = speedSensorDistance;
entry.speed = getSpeed(); entry.speed = getSpeed();
entry.temperature = (float)status.temperature / 10.0f; entry.temperature = (float)status.temperature / 10.0f;
entry.altitude = (float)status.altitude / 1000.0f; entry.altitude = (float)status.altitude / 1000.0f;
entry.latitude = status.latitude; entry.latitude = status.latitude;
entry.longitude = status.longitude; entry.longitude = status.longitude;
entry.logButtonPressed = logButtonPressed;
if(entry.speed > 0.0f) bool isMoving = entry.speed > 0.0f;
bool needLogging = isMoving || logButtonPressed;
if(needLogging)
{ {
stoppedSince = -1; stoppedSince = -1;
if(!DataLogger::get().isOpen()) if(!DataLogger::get().isOpen())
@ -521,7 +423,6 @@ void loop()
DataLogger::get().log(now, entry); DataLogger::get().log(now, entry);
bool isOnTrip = DataLogger::get().isOpen(); bool isOnTrip = DataLogger::get().isOpen();
bool isMoving = entry.speed > 0.0f;
static unsigned long cumulatedMillis = 0; static unsigned long cumulatedMillis = 0;
cumulatedMillis += dt; cumulatedMillis += dt;

65
schema/MCU_board/MCU_board.kicad_pcb

@ -39,6 +39,7 @@
(setup (setup
(pad_to_mask_clearance 0) (pad_to_mask_clearance 0)
(grid_origin 165.1 81.28)
(pcbplotparams (pcbplotparams
(layerselection 0x00010fc_ffffffff) (layerselection 0x00010fc_ffffffff)
(disableapertmacros false) (disableapertmacros false)
@ -95,7 +96,7 @@
(net 18 "unconnected-(U1-Pad9)") (net 18 "unconnected-(U1-Pad9)")
(net 19 "unconnected-(U1-Pad11)") (net 19 "unconnected-(U1-Pad11)")
(net 20 "unconnected-(U1-Pad19)") (net 20 "unconnected-(U1-Pad19)")
(net 21 "unconnected-(U1-Pad12)") (net 21 "Net-(U1-Pad12)")
(net 22 "unconnected-(U1-Pad26)") (net 22 "unconnected-(U1-Pad26)")
(net 23 "unconnected-(U1-Pad21)") (net 23 "unconnected-(U1-Pad21)")
(net 24 "unconnected-(U1-Pad22)") (net 24 "unconnected-(U1-Pad22)")
@ -456,7 +457,7 @@
(pad "11" thru_hole circle (at 0 25.4) (size 1.8 1.8) (drill 0.9) (layers *.Cu *.Mask) (pad "11" thru_hole circle (at 0 25.4) (size 1.8 1.8) (drill 0.9) (layers *.Cu *.Mask)
(net 19 "unconnected-(U1-Pad11)") (pinfunction "GPIO14") (pintype "bidirectional+no_connect") (tstamp 03262628-1cc5-491d-862f-0eb1bd93094e)) (net 19 "unconnected-(U1-Pad11)") (pinfunction "GPIO14") (pintype "bidirectional+no_connect") (tstamp 03262628-1cc5-491d-862f-0eb1bd93094e))
(pad "12" thru_hole circle (at 0 27.94) (size 1.8 1.8) (drill 0.9) (layers *.Cu *.Mask) (pad "12" thru_hole circle (at 0 27.94) (size 1.8 1.8) (drill 0.9) (layers *.Cu *.Mask)
(net 21 "unconnected-(U1-Pad12)") (pinfunction "GPIO12") (pintype "bidirectional+no_connect") (tstamp bd87c8ae-c0f8-478e-afa3-98b6cb999a88)) (net 21 "Net-(U1-Pad12)") (pinfunction "GPIO12") (pintype "bidirectional") (tstamp bd87c8ae-c0f8-478e-afa3-98b6cb999a88))
(pad "13" thru_hole circle (at 0 30.48) (size 1.8 1.8) (drill 0.9) (layers *.Cu *.Mask) (pad "13" thru_hole circle (at 0 30.48) (size 1.8 1.8) (drill 0.9) (layers *.Cu *.Mask)
(net 9 "Net-(J5-Pad2)") (pinfunction "GPIO13") (pintype "bidirectional") (tstamp dd9956f2-e1a3-43eb-b682-c9200e10a75b)) (net 9 "Net-(J5-Pad2)") (pinfunction "GPIO13") (pintype "bidirectional") (tstamp dd9956f2-e1a3-43eb-b682-c9200e10a75b))
(pad "14" thru_hole circle (at 0 33.02) (size 1.8 1.8) (drill 0.9) (layers *.Cu *.Mask) (pad "14" thru_hole circle (at 0 33.02) (size 1.8 1.8) (drill 0.9) (layers *.Cu *.Mask)
@ -548,6 +549,53 @@
) )
) )
(footprint "Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical" (layer "F.Cu")
(tedit 59FED5CC) (tstamp a0ff9bda-546c-4273-8a16-05a1b21c2961)
(at 175.26 48.26 90)
(descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row")
(tags "Through hole pin header THT 1x02 2.54mm single row")
(property "Sheetfile" "MCU_board.kicad_sch")
(property "Sheetname" "")
(path "/e942a202-c5f2-49da-972f-0c1c0aa2648f")
(attr through_hole)
(fp_text reference "J6" (at 0 -2.33 90) (layer "F.SilkS")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 8f2cacd4-0ac3-4e68-b38c-c895f1bb77e2)
)
(fp_text value "Conn_log_button" (at -2.54 2.54 180) (layer "F.Fab")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 05e23294-51fe-49c5-b313-b2c9095a0ac2)
)
(fp_text user "${REFERENCE}" (at 0 1.27) (layer "F.Fab")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp f17f788f-3df2-43f4-9291-174578ef4412)
)
(fp_line (start -1.33 1.27) (end -1.33 3.87) (layer "F.SilkS") (width 0.12) (tstamp 07704217-aa81-4adb-bd8b-d9a63a4ee2ab))
(fp_line (start 1.33 1.27) (end 1.33 3.87) (layer "F.SilkS") (width 0.12) (tstamp 0b50c638-79a2-4b7a-a83f-40ee07c2cd17))
(fp_line (start -1.33 1.27) (end 1.33 1.27) (layer "F.SilkS") (width 0.12) (tstamp 270cd341-f030-4faf-bb37-c099564fff22))
(fp_line (start -1.33 -1.33) (end 0 -1.33) (layer "F.SilkS") (width 0.12) (tstamp 8e18d333-e79d-463e-85b2-3727fd6d1d2d))
(fp_line (start -1.33 0) (end -1.33 -1.33) (layer "F.SilkS") (width 0.12) (tstamp d9a1ee40-3148-4a29-ab9f-406b7088fb57))
(fp_line (start -1.33 3.87) (end 1.33 3.87) (layer "F.SilkS") (width 0.12) (tstamp de11845a-f542-472f-abef-c52a30b6a62c))
(fp_line (start -1.8 -1.8) (end -1.8 4.35) (layer "F.CrtYd") (width 0.05) (tstamp 264ca61f-e53b-4a74-b778-6acea9461e59))
(fp_line (start -1.8 4.35) (end 1.8 4.35) (layer "F.CrtYd") (width 0.05) (tstamp a58c56b9-dc75-4b7f-9852-69c69778ab13))
(fp_line (start 1.8 4.35) (end 1.8 -1.8) (layer "F.CrtYd") (width 0.05) (tstamp b65c994a-b511-4c8d-8938-49529510c3c7))
(fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer "F.CrtYd") (width 0.05) (tstamp ef433dd5-20e6-4bc3-aa9b-c1efb10569de))
(fp_line (start -1.27 3.81) (end -1.27 -0.635) (layer "F.Fab") (width 0.1) (tstamp a35f7365-8549-4f21-b4ab-53926e6ae257))
(fp_line (start 1.27 3.81) (end -1.27 3.81) (layer "F.Fab") (width 0.1) (tstamp c4e0e18f-3225-4a5c-8207-09b541c651b3))
(fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer "F.Fab") (width 0.1) (tstamp d4b93d12-b4c6-4f52-b8a3-0b5fe378e6d9))
(fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer "F.Fab") (width 0.1) (tstamp e1894603-f51e-4d9b-8f56-6dfe6ab388f8))
(fp_line (start 1.27 -1.27) (end 1.27 3.81) (layer "F.Fab") (width 0.1) (tstamp e7480010-1d97-47ca-899a-58c863f067d3))
(pad "1" thru_hole rect (at 0 0 90) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)
(net 3 "Net-(J1-Pad2)") (pinfunction "C1") (pintype "passive") (tstamp 3af919c7-2cc0-4b81-82dc-68eb31acc25c))
(pad "2" thru_hole oval (at 0 2.54 90) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)
(net 21 "Net-(U1-Pad12)") (pinfunction "C2") (pintype "passive") (tstamp 0ef4faae-e63a-4e1f-a2a3-cee357318b9d))
(model "${KICAD6_3DMODEL_DIR}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x02_P2.54mm_Vertical.wrl"
(offset (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)
(footprint "Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical" (layer "F.Cu") (footprint "Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical" (layer "F.Cu")
(tedit 59FED5CC) (tstamp be3a8a3f-7fae-4c0b-934b-4361acb787a4) (tedit 59FED5CC) (tstamp be3a8a3f-7fae-4c0b-934b-4361acb787a4)
(at 144.78 50.8) (at 144.78 50.8)
@ -764,10 +812,13 @@
(segment (start 142.24 104.14) (end 144.78 104.14) (width 0.25) (layer "F.Cu") (net 2) (tstamp aedd3b50-30bf-42bc-a8e9-3298072ae91b)) (segment (start 142.24 104.14) (end 144.78 104.14) (width 0.25) (layer "F.Cu") (net 2) (tstamp aedd3b50-30bf-42bc-a8e9-3298072ae91b))
(segment (start 160.02 45.72) (end 160.02 48.26) (width 0.25) (layer "F.Cu") (net 3) (tstamp 3ed0041b-48be-427d-8cdf-667405c53983)) (segment (start 160.02 45.72) (end 160.02 48.26) (width 0.25) (layer "F.Cu") (net 3) (tstamp 3ed0041b-48be-427d-8cdf-667405c53983))
(segment (start 142.24 91.44) (end 149.7375 91.44) (width 0.25) (layer "F.Cu") (net 3) (tstamp 69aa9a5f-ac33-4bff-a4fe-ea232936c76d)) (segment (start 142.24 91.44) (end 149.7375 91.44) (width 0.25) (layer "F.Cu") (net 3) (tstamp 69aa9a5f-ac33-4bff-a4fe-ea232936c76d))
(segment (start 172.72 45.72) (end 165.1 45.72) (width 0.25) (layer "F.Cu") (net 3) (tstamp 86b1cf46-3657-4fc5-8247-05910579c9c6))
(segment (start 160.02 45.72) (end 165.1 45.72) (width 0.25) (layer "F.Cu") (net 3) (tstamp 915395ea-47ad-4802-8a12-a71c1248df39))
(segment (start 142.24 53.34) (end 142.24 45.72) (width 0.25) (layer "F.Cu") (net 3) (tstamp 9d0329ef-05c6-47e5-8ef7-8e218db685e3)) (segment (start 142.24 53.34) (end 142.24 45.72) (width 0.25) (layer "F.Cu") (net 3) (tstamp 9d0329ef-05c6-47e5-8ef7-8e218db685e3))
(segment (start 175.26 48.26) (end 172.72 45.72) (width 0.25) (layer "F.Cu") (net 3) (tstamp 9f51003a-5d9c-4e97-85db-76b127a19294))
(segment (start 142.24 45.72) (end 160.02 45.72) (width 0.25) (layer "F.Cu") (net 3) (tstamp a8a21ecc-ad8a-4cd7-bb90-f4a238c3160c)) (segment (start 142.24 45.72) (end 160.02 45.72) (width 0.25) (layer "F.Cu") (net 3) (tstamp a8a21ecc-ad8a-4cd7-bb90-f4a238c3160c))
(segment (start 160.02 48.26) (end 165.1 48.26) (width 0.25) (layer "F.Cu") (net 3) (tstamp ab57be61-3be2-49a1-b1a4-004ab8e0694b))
(segment (start 142.24 91.44) (end 142.24 68.58) (width 0.25) (layer "F.Cu") (net 3) (tstamp ac3b046c-2978-4d9a-839e-4f009b6edb92)) (segment (start 142.24 91.44) (end 142.24 68.58) (width 0.25) (layer "F.Cu") (net 3) (tstamp ac3b046c-2978-4d9a-839e-4f009b6edb92))
(segment (start 165.1 45.72) (end 165.1 48.26) (width 0.25) (layer "F.Cu") (net 3) (tstamp c8cefc8c-6471-43e8-8813-d76666691fd3))
(segment (start 142.24 101.6) (end 142.24 91.44) (width 0.25) (layer "F.Cu") (net 3) (tstamp f3c6f12c-d7a9-419e-944d-2f651ba46531)) (segment (start 142.24 101.6) (end 142.24 91.44) (width 0.25) (layer "F.Cu") (net 3) (tstamp f3c6f12c-d7a9-419e-944d-2f651ba46531))
(segment (start 142.24 68.58) (end 143.51 67.31) (width 0.25) (layer "F.Cu") (net 3) (tstamp fe601422-18d3-4f37-bb00-5caa5362248b)) (segment (start 142.24 68.58) (end 143.51 67.31) (width 0.25) (layer "F.Cu") (net 3) (tstamp fe601422-18d3-4f37-bb00-5caa5362248b))
(via (at 143.51 67.31) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 3) (tstamp 32062560-499b-44dc-9b07-a0809ef2ea64)) (via (at 143.51 67.31) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 3) (tstamp 32062560-499b-44dc-9b07-a0809ef2ea64))
@ -787,6 +838,14 @@
(segment (start 170.18 99.06) (end 170.18 83.82) (width 0.25) (layer "F.Cu") (net 10) (tstamp 45676199-bb82-4d58-98c1-b606deb355be)) (segment (start 170.18 99.06) (end 170.18 83.82) (width 0.25) (layer "F.Cu") (net 10) (tstamp 45676199-bb82-4d58-98c1-b606deb355be))
(segment (start 180.34 99.06) (end 170.18 99.06) (width 0.25) (layer "F.Cu") (net 10) (tstamp 55ac7ee1-f461-406b-8cf5-da47a7717180)) (segment (start 180.34 99.06) (end 170.18 99.06) (width 0.25) (layer "F.Cu") (net 10) (tstamp 55ac7ee1-f461-406b-8cf5-da47a7717180))
(segment (start 170.18 83.82) (end 175.1375 83.82) (width 0.25) (layer "F.Cu") (net 10) (tstamp b14aea3f-7e9b-4416-ac0e-1c7beb3cd27c)) (segment (start 170.18 83.82) (end 175.1375 83.82) (width 0.25) (layer "F.Cu") (net 10) (tstamp b14aea3f-7e9b-4416-ac0e-1c7beb3cd27c))
(segment (start 177.8 50.8) (end 177.8 48.26) (width 0.25) (layer "F.Cu") (net 21) (tstamp 10289dea-7cea-4d75-97a5-95e6a4703d25))
(segment (start 172.72 50.8) (end 177.8 50.8) (width 0.25) (layer "F.Cu") (net 21) (tstamp 319a10b3-3200-4f95-aca5-40d19ab94d07))
(segment (start 170.18 53.34) (end 172.72 50.8) (width 0.25) (layer "F.Cu") (net 21) (tstamp 75b53fe8-3600-4bd9-882f-ac32df25b80c))
(segment (start 165.1 53.34) (end 170.18 53.34) (width 0.25) (layer "F.Cu") (net 21) (tstamp bc1f54ac-ef7b-417f-be9a-82644fcd76a3))
(via (at 165.1 53.34) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 21) (tstamp 37e59d73-5993-4de2-8bc2-260d8e5a3678))
(segment (start 160.02 86.36) (end 165.1 81.28) (width 0.25) (layer "B.Cu") (net 21) (tstamp 4457fae0-4146-4202-ab87-7e9e4ac8542f))
(segment (start 165.1 81.28) (end 165.1 53.34) (width 0.25) (layer "B.Cu") (net 21) (tstamp 92f707a3-f138-4b82-a7c3-8bcb79f9d977))
(segment (start 149.7375 86.36) (end 160.02 86.36) (width 0.25) (layer "B.Cu") (net 21) (tstamp f5fb573d-7339-4c18-8bac-217da5f5f4c1))
(segment (start 154.94 60.96) (end 149.7375 60.96) (width 0.25) (layer "F.Cu") (net 32) (tstamp 61e763ec-1c1c-4f1e-a003-f55d7ad04f9f)) (segment (start 154.94 60.96) (end 149.7375 60.96) (width 0.25) (layer "F.Cu") (net 32) (tstamp 61e763ec-1c1c-4f1e-a003-f55d7ad04f9f))
(segment (start 154.94 48.26) (end 154.94 60.96) (width 0.25) (layer "F.Cu") (net 32) (tstamp e5c077a6-2e6e-4ddb-9cdd-7189d5453897)) (segment (start 154.94 48.26) (end 154.94 60.96) (width 0.25) (layer "F.Cu") (net 32) (tstamp e5c077a6-2e6e-4ddb-9cdd-7189d5453897))
(segment (start 144.78 63.5) (end 149.7375 63.5) (width 0.25) (layer "F.Cu") (net 33) (tstamp 30bfa64d-761b-4732-997d-bd4590e66c7b)) (segment (start 144.78 63.5) (end 149.7375 63.5) (width 0.25) (layer "F.Cu") (net 33) (tstamp 30bfa64d-761b-4732-997d-bd4590e66c7b))

2
schema/MCU_board/MCU_board.kicad_prl

@ -1,6 +1,6 @@
{ {
"board": { "board": {
"active_layer": 0, "active_layer": 37,
"active_layer_preset": "All Layers", "active_layer_preset": "All Layers",
"auto_track_width": true, "auto_track_width": true,
"hidden_nets": [], "hidden_nets": [],

103
schema/MCU_board/MCU_board.kicad_sch

@ -381,6 +381,63 @@
) )
) )
) )
(symbol "vehicle-monitor:Conn_log_button" (pin_names (offset 1.5)) (in_bom yes) (on_board yes)
(property "Reference" "J" (id 0) (at 0 2.54 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "Conn_log_button" (id 1) (at 0 -5.08 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (id 2) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "connector" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)" (id 5) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_fp_filters" "Connector*:*_1x??_*" (id 6) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "Conn_log_button_1_1"
(arc (start 0 -2.032) (mid -0.508 -2.54) (end 0 -3.048)
(stroke (width 0.1524) (type default) (color 0 0 0 0))
(fill (type none))
)
(polyline
(pts
(xy -1.27 -2.54)
(xy -0.508 -2.54)
)
(stroke (width 0.1524) (type default) (color 0 0 0 0))
(fill (type none))
)
(polyline
(pts
(xy -1.27 0)
(xy -0.508 0)
)
(stroke (width 0.1524) (type default) (color 0 0 0 0))
(fill (type none))
)
(arc (start 0 0.508) (mid -0.508 0) (end 0 -0.508)
(stroke (width 0.1524) (type default) (color 0 0 0 0))
(fill (type none))
)
(pin passive line (at -5.08 0 0) (length 3.81)
(name "C1" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin passive line (at -5.08 -2.54 0) (length 3.81)
(name "C2" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "vehicle-monitor:Conn_speed_sensor" (pin_names (offset 1.5)) (in_bom yes) (on_board yes) (symbol "vehicle-monitor:Conn_speed_sensor" (pin_names (offset 1.5)) (in_bom yes) (on_board yes)
(property "Reference" "J" (id 0) (at 0 2.54 0) (property "Reference" "J" (id 0) (at 0 2.54 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
@ -597,6 +654,9 @@
(junction (at 49.53 69.85) (diameter 0) (color 0 0 0 0) (junction (at 49.53 69.85) (diameter 0) (color 0 0 0 0)
(uuid 95ffd3f8-cc4e-49e8-a469-fe0ef795ac79) (uuid 95ffd3f8-cc4e-49e8-a469-fe0ef795ac79)
) )
(junction (at 49.53 83.82) (diameter 0) (color 0 0 0 0)
(uuid c03b33bf-762f-4c8b-ba9e-e14c985cc484)
)
(no_connect (at 104.14 95.25) (uuid 675b2a1e-1d1e-4f5b-91f1-23d348015a92)) (no_connect (at 104.14 95.25) (uuid 675b2a1e-1d1e-4f5b-91f1-23d348015a92))
(no_connect (at 104.14 90.17) (uuid 7a036c8b-424e-4cd3-9042-9dd09fe44aa7)) (no_connect (at 104.14 90.17) (uuid 7a036c8b-424e-4cd3-9042-9dd09fe44aa7))
@ -619,8 +679,11 @@
(no_connect (at 104.14 69.85) (uuid 8df7c71e-685c-43dd-af60-6f9cdc315f85)) (no_connect (at 104.14 69.85) (uuid 8df7c71e-685c-43dd-af60-6f9cdc315f85))
(no_connect (at 104.14 77.47) (uuid 8df7c71e-685c-43dd-af60-6f9cdc315f86)) (no_connect (at 104.14 77.47) (uuid 8df7c71e-685c-43dd-af60-6f9cdc315f86))
(no_connect (at 39.37 62.23) (uuid a6b973bf-3c82-4206-bae7-4f835d16d359)) (no_connect (at 39.37 62.23) (uuid a6b973bf-3c82-4206-bae7-4f835d16d359))
(no_connect (at 55.88 95.25) (uuid e8a669b7-c663-4fa5-9b1f-ce9eb01dc726))
(wire (pts (xy 38.1 81.28) (xy 52.07 81.28))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 0a5172fc-8f9b-4061-b472-b9112a1d20af)
)
(wire (pts (xy 52.07 48.26) (xy 52.07 72.39)) (wire (pts (xy 52.07 48.26) (xy 52.07 72.39))
(stroke (width 0) (type default) (color 0 0 0 0)) (stroke (width 0) (type default) (color 0 0 0 0))
(uuid 0a75f629-dc23-4df2-b397-19a4ff553330) (uuid 0a75f629-dc23-4df2-b397-19a4ff553330)
@ -673,7 +736,7 @@
(stroke (width 0) (type default) (color 0 0 0 0)) (stroke (width 0) (type default) (color 0 0 0 0))
(uuid 5bd7ff30-9744-4fbd-b2ab-98d6983e15df) (uuid 5bd7ff30-9744-4fbd-b2ab-98d6983e15df)
) )
(wire (pts (xy 49.53 69.85) (xy 49.53 93.98)) (wire (pts (xy 49.53 69.85) (xy 49.53 83.82))
(stroke (width 0) (type default) (color 0 0 0 0)) (stroke (width 0) (type default) (color 0 0 0 0))
(uuid 5f6cca41-50ca-4ee1-8224-0e6c495b17fd) (uuid 5f6cca41-50ca-4ee1-8224-0e6c495b17fd)
) )
@ -689,6 +752,10 @@
(stroke (width 0) (type default) (color 0 0 0 0)) (stroke (width 0) (type default) (color 0 0 0 0))
(uuid 7c612bdd-6a82-4fcf-baa9-8fdefcb06f1d) (uuid 7c612bdd-6a82-4fcf-baa9-8fdefcb06f1d)
) )
(wire (pts (xy 38.1 83.82) (xy 49.53 83.82))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 82e52677-e24e-4a2e-9ec8-8995f85bc512)
)
(wire (pts (xy 49.53 45.72) (xy 49.53 48.26)) (wire (pts (xy 49.53 45.72) (xy 49.53 48.26))
(stroke (width 0) (type default) (color 0 0 0 0)) (stroke (width 0) (type default) (color 0 0 0 0))
(uuid 8539a068-22ee-4a22-979e-1d2358b3111b) (uuid 8539a068-22ee-4a22-979e-1d2358b3111b)
@ -697,6 +764,14 @@
(stroke (width 0) (type default) (color 0 0 0 0)) (stroke (width 0) (type default) (color 0 0 0 0))
(uuid 854f4387-3ca1-4ede-a296-fb94988ed5ae) (uuid 854f4387-3ca1-4ede-a296-fb94988ed5ae)
) )
(wire (pts (xy 55.88 95.25) (xy 52.07 95.25))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 9383dc41-40ce-41ec-96cf-0f62049c1026)
)
(wire (pts (xy 49.53 83.82) (xy 49.53 93.98))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid 959186ab-676f-4e56-996c-2a8f9ab1664e)
)
(wire (pts (xy 55.88 97.79) (xy 46.99 97.79)) (wire (pts (xy 55.88 97.79) (xy 46.99 97.79))
(stroke (width 0) (type default) (color 0 0 0 0)) (stroke (width 0) (type default) (color 0 0 0 0))
(uuid 9751e2d6-d81e-44e0-b624-fc92d289c52a) (uuid 9751e2d6-d81e-44e0-b624-fc92d289c52a)
@ -761,6 +836,10 @@
(stroke (width 0) (type default) (color 0 0 0 0)) (stroke (width 0) (type default) (color 0 0 0 0))
(uuid e96cf019-071b-4fb9-85d0-e0a7999725eb) (uuid e96cf019-071b-4fb9-85d0-e0a7999725eb)
) )
(wire (pts (xy 52.07 95.25) (xy 52.07 81.28))
(stroke (width 0) (type default) (color 0 0 0 0))
(uuid f6ed5c76-3f19-4228-935e-0d7bcb58aa88)
)
(symbol (lib_id "vehicle-monitor:Conn_battery") (at 35.56 38.1 180) (unit 1) (symbol (lib_id "vehicle-monitor:Conn_battery") (at 35.56 38.1 180) (unit 1)
(in_bom yes) (on_board yes) (in_bom yes) (on_board yes)
@ -804,7 +883,7 @@
(symbol (lib_id "vehicle-monitor:Conn_speed_sensor") (at 33.02 93.98 180) (unit 1) (symbol (lib_id "vehicle-monitor:Conn_speed_sensor") (at 33.02 93.98 180) (unit 1)
(in_bom yes) (on_board yes) (in_bom yes) (on_board yes)
(uuid 5146355b-d187-42d7-bcfd-5946aeb905a6) (uuid 5146355b-d187-42d7-bcfd-5946aeb905a6)
(property "Reference" "J5" (id 0) (at 35.56 96.52 0) (property "Reference" "J5" (id 0) (at 27.94 92.71 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Value" "Conn_speed_sensor" (id 1) (at 36.83 88.9 0) (property "Value" "Conn_speed_sensor" (id 1) (at 36.83 88.9 0)
@ -952,6 +1031,21 @@
(pin "2" (uuid 2dc1044f-fd5f-478a-b0d6-8f565a3c76c3)) (pin "2" (uuid 2dc1044f-fd5f-478a-b0d6-8f565a3c76c3))
) )
(symbol (lib_id "vehicle-monitor:Conn_log_button") (at 33.02 83.82 180) (unit 1)
(in_bom yes) (on_board yes)
(uuid e942a202-c5f2-49da-972f-0c1c0aa2648f)
(property "Reference" "J6" (id 0) (at 26.67 82.55 0))
(property "Value" "Conn_log_button" (id 1) (at 33.655 78.74 0))
(property "Footprint" "Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical" (id 2) (at 33.02 83.82 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 33.02 83.82 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 8bb38651-f3ed-4d12-a4aa-40d9d89126eb))
(pin "2" (uuid 9ff05ef8-805a-4892-9914-0e11266286eb))
)
(sheet_instances (sheet_instances
(path "/" (page "1")) (path "/" (page "1"))
) )
@ -975,6 +1069,9 @@
(path "/5146355b-d187-42d7-bcfd-5946aeb905a6" (path "/5146355b-d187-42d7-bcfd-5946aeb905a6"
(reference "J5") (unit 1) (value "Conn_speed_sensor") (footprint "Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical") (reference "J5") (unit 1) (value "Conn_speed_sensor") (footprint "Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical")
) )
(path "/e942a202-c5f2-49da-972f-0c1c0aa2648f"
(reference "J6") (unit 1) (value "Conn_log_button") (footprint "Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical")
)
(path "/c41a6d44-f99d-4f53-b51c-3b7668c1e7af" (path "/c41a6d44-f99d-4f53-b51c-3b7668c1e7af"
(reference "R1") (unit 1) (value "180K") (footprint "Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal") (reference "R1") (unit 1) (value "180K") (footprint "Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal")
) )

57
schema/library/vehicle-monitor.kicad_sym

@ -364,6 +364,63 @@
) )
) )
) )
(symbol "Conn_log_button" (pin_names (offset 1.5)) (in_bom yes) (on_board yes)
(property "Reference" "J" (id 0) (at 0 2.54 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "Conn_log_button" (id 1) (at 0 -5.08 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (id 2) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "connector" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)" (id 5) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_fp_filters" "Connector*:*_1x??_*" (id 6) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "Conn_log_button_1_1"
(arc (start 0 -2.032) (mid -0.508 -2.54) (end 0 -3.048)
(stroke (width 0.1524) (type default) (color 0 0 0 0))
(fill (type none))
)
(polyline
(pts
(xy -1.27 -2.54)
(xy -0.508 -2.54)
)
(stroke (width 0.1524) (type default) (color 0 0 0 0))
(fill (type none))
)
(polyline
(pts
(xy -1.27 0)
(xy -0.508 0)
)
(stroke (width 0.1524) (type default) (color 0 0 0 0))
(fill (type none))
)
(arc (start 0 0.508) (mid -0.508 0) (end 0 -0.508)
(stroke (width 0.1524) (type default) (color 0 0 0 0))
(fill (type none))
)
(pin passive line (at -5.08 0 0) (length 3.81)
(name "C1" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin passive line (at -5.08 -2.54 0) (length 3.81)
(name "C2" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "Conn_speed_sensor" (pin_names (offset 1.5)) (in_bom yes) (on_board yes) (symbol "Conn_speed_sensor" (pin_names (offset 1.5)) (in_bom yes) (on_board yes)
(property "Reference" "J" (id 0) (at 0 2.54 0) (property "Reference" "J" (id 0) (at 0 2.54 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))

Loading…
Cancel
Save