diff --git a/ENG_DS_MS5611-01BA03_B3.pdf b/ENG_DS_MS5611-01BA03_B3.pdf new file mode 100644 index 0000000..4900b12 Binary files /dev/null and b/ENG_DS_MS5611-01BA03_B3.pdf differ diff --git a/XCTRACK_VARIO_MS5611.ino b/XCTRACK_VARIO_MS5611/XCTRACK_VARIO_MS5611.ino similarity index 66% rename from XCTRACK_VARIO_MS5611.ino rename to XCTRACK_VARIO_MS5611/XCTRACK_VARIO_MS5611.ino index 6eec2ff..1586fd4 100644 --- a/XCTRACK_VARIO_MS5611.ino +++ b/XCTRACK_VARIO_MS5611/XCTRACK_VARIO_MS5611.ino @@ -2,7 +2,6 @@ VARIO XCTRACK arduino nano sensor ms5611 -https://github.com/dvarrel/arduino-ms5xxx damien varrel 07/2020 @@ -10,45 +9,12 @@ Based on Arduino Vario by Benjamin PERRIN 2017 / Vari'Up Based on Arduino Vario by Jaros, 2012 and vario DFelix 2013 https://github.com/LK8000/LK8000/blob/master/Docs/LK8EX1.txt - $LK8EX1,pressure,altitude,vario,temperature,battery,*checksum -Field 0, raw pressure in hPascal: - hPA*100 (example for 1013.25 becomes 101325) - no padding (987.25 becomes 98725, NOT 098725) - If no pressure available, send 999999 (6 times 9) - If pressure is available, field 1 altitude will be ignored - -Field 1, altitude in meters, relative to QNH 1013.25 - If raw pressure is available, this value will be IGNORED (you can set it to 99999 - but not really needed)! - (if you want to use this value, set raw pressure to 999999) - This value is relative to sea level (QNE). We are assuming that - currently at 0m altitude pressure is standard 1013.25. - If you cannot send raw altitude, then send what you have but then - you must NOT adjust it from Basic Setting in LK. - Altitude can be negative - If altitude not available, and Pressure not available, set Altitude - to 99999 (5 times 9) - LK will say "Baro altitude available" if one of fields 0 and 1 is available. - -Field 2, vario in cm/s - If vario not available, send 9999 (4 times 9) - Value can also be negative - -Field 3, temperature in C , can be also negative - If not available, send 99 - -Field 4, battery voltage or charge percentage - Cannot be negative - If not available, send 999 (3 times 9) - Voltage is sent as float value like: 0.1 1.4 2.3 11.2 - To send percentage, add 1000. Example 0% = 1000 - 14% = 1014 . Do not send float values for percentages. -Percentage should be 0 to 100, with no decimals, added by 1000! +test sentence PRS, more shorter */ -//https://github.com/dvarrel/arduino-ms5xxx +//ms5611 library by Roman Schmitz #include #include #include @@ -63,6 +29,14 @@ SoftwareSerial BTserial(RX, TX); // RX not connected #define FREQUENCY 10 // freq output in Hz #define USB_MODE // uncomment for usb mode #define BLUETOOTH_MODE // uncomment for bluetooth mode +#define USE_LK8000 +/* + * sentences to choice : + * $LK8EX1,pressure,altitude,vario,temperature,battery,*checksum + * PRS pressure in pascal in hexadecimal format + * LK8000 : 32 chars to send PRS : 10 chars to send + * bluetooth in 9600bauds -> 1.25ms for a char +*/ const char compile_date[] = "XCTRACK VARIO " __DATE__; const char mess_check[] = "checking MS5611 sensor..."; @@ -75,6 +49,7 @@ void setup() { Serial.begin(USB_SPEED); Serial.println(compile_date); Serial.println(mess_check); + Serial.println(mess_check); #endif #ifdef BLUETOOTH_MODE BTserial.begin(BLUETOOTH_SPEED); // start communication with the HC-05 using 38400 @@ -93,7 +68,7 @@ void setup() { #endif delay(1200); //for watchdog timeout } - sensor.ReadProm(); //takes about 3ms + sensor.ReadProm(); //takes about 3ms } uint32_t get_time = millis(); @@ -116,6 +91,9 @@ void loop(void) { //$LK8EX1,pressure,altitude,vario,temperature,battery,*checksum //$LK8EX1,pressure,99999,9999,temp,999,*checksum + + #ifdef USE_LK8000 + String str_out = String("LK8EX1,") +String(Pressure) +String(",0,9999,") @@ -141,6 +119,17 @@ void loop(void) { BTserial.print("*"); BTserial.println(checksum_end, HEX); #endif - + + #else // use PRS sentence + String str_out = String("PRS ") + + String(Pressure, HEX); + #ifdef USB_MODE + Serial.println(str_out); + #endif + #ifdef BLUETOOTH_MODE + BTserial.println(str_out); + #endif + + #endif } } diff --git a/font_3Dprint/dessin.svg b/font_3Dprint/dessin.svg new file mode 100644 index 0000000..ec61123 --- /dev/null +++ b/font_3Dprint/dessin.svg @@ -0,0 +1,116 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/font_3Dprint/vyper.ttf b/font_3Dprint/vyper.ttf new file mode 100644 index 0000000..ef13e0f Binary files /dev/null and b/font_3Dprint/vyper.ttf differ diff --git a/font_3Dprint/vyper.txt b/font_3Dprint/vyper.txt new file mode 100644 index 0000000..44e3136 --- /dev/null +++ b/font_3Dprint/vyper.txt @@ -0,0 +1,11 @@ +Vyper Falcon Truetype Font for Windows + +2008 Iconian Fonts - Daniel Zadorozny + +http://www.iconian.com/ + +This font comes with the following 16 versions: Regular, Italic, Shadow, Shadow Italic, Pro, Pro Italic, Expanded, Expanded Italic, Bold, Bold Italic, Condensed, Condensed Italic, Expanded Bold, Expanded Bold Italic, Laser and Laser Italic. + +This font may be freely distributed and is free for all non-commercial uses. Use of the fonts are at your own risk. This font is e-mailware; that is, if you like it, please e-mail the author at: + +iconian@aol.com diff --git a/fritzing/vario_MS5611.fzz b/fritzing/vario_MS5611.fzz new file mode 100644 index 0000000..96a0145 Binary files /dev/null and b/fritzing/vario_MS5611.fzz differ diff --git a/fritzing/vario_MS5611_pro.fzz b/fritzing/vario_MS5611_pro.fzz new file mode 100644 index 0000000..868bf27 Binary files /dev/null and b/fritzing/vario_MS5611_pro.fzz differ diff --git a/img/calibrage_bmp180.png b/img/calibrage_bmp180.png new file mode 100644 index 0000000..8fe70d4 Binary files /dev/null and b/img/calibrage_bmp180.png differ diff --git a/img/calibrage_ms5611.jpg b/img/calibrage_ms5611.jpg new file mode 100644 index 0000000..161195c Binary files /dev/null and b/img/calibrage_ms5611.jpg differ diff --git a/img_soldered.jpg b/img/img_soldered.jpg similarity index 100% rename from img_soldered.jpg rename to img/img_soldered.jpg diff --git a/img_usb-c_soldered.jpg b/img/img_usb-c_soldered.jpg similarity index 100% rename from img_usb-c_soldered.jpg rename to img/img_usb-c_soldered.jpg diff --git a/img_usb-mini_bluetooth_soldered.jpg b/img/img_usb-mini_bluetooth_soldered.jpg similarity index 100% rename from img_usb-mini_bluetooth_soldered.jpg rename to img/img_usb-mini_bluetooth_soldered.jpg diff --git a/img_usb-mini_soldered.jpg b/img/img_usb-mini_soldered.jpg similarity index 100% rename from img_usb-mini_soldered.jpg rename to img/img_usb-mini_soldered.jpg diff --git a/img/img_xctrack.jpg b/img/img_xctrack.jpg new file mode 100644 index 0000000..93c09c0 Binary files /dev/null and b/img/img_xctrack.jpg differ diff --git a/img_xctrack512.jpg b/img/img_xctrack512.jpg similarity index 100% rename from img_xctrack512.jpg rename to img/img_xctrack512.jpg diff --git a/photo512.jpg b/img/photo512.jpg similarity index 100% rename from photo512.jpg rename to img/photo512.jpg diff --git a/img/powerbank_OTG.jpg b/img/powerbank_OTG.jpg new file mode 100644 index 0000000..0be34f4 Binary files /dev/null and b/img/powerbank_OTG.jpg differ diff --git a/vario_MS5611.png b/img/vario_MS5611.png similarity index 100% rename from vario_MS5611.png rename to img/vario_MS5611.png diff --git a/vario_MS5611_bluetooth.png b/img/vario_MS5611_bluetooth.png similarity index 100% rename from vario_MS5611_bluetooth.png rename to img/vario_MS5611_bluetooth.png diff --git a/test_MS5611/test_MS5611.ino b/test_MS5611/test_MS5611.ino new file mode 100644 index 0000000..2468120 --- /dev/null +++ b/test_MS5611/test_MS5611.ino @@ -0,0 +1,57 @@ +/* + MS5xxx.h - Library for accessing MS5xxx sensors via I2C + Copyright (c) 2012 Roman Schmitz + + This file is part of arduino-ms5xxx. + + arduino-ms5xxx is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + arduino-ms5xxx is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with arduino-ms5xxx. If not, see . + +*/ + +#include +#include + +MS5611 sensor(&Wire); + +void setup() { + Serial.begin(115200); + if(sensor.connect()>0) { + Serial.println("Error connecting..."); + delay(500); + setup(); + } +} + +void loop() { + sensor.ReadProm(); + sensor.Readout(); + Serial.print("Temperature [0.01 C]: "); + Serial.println(sensor.GetTemp()/100); + Serial.print("Pressure [Pa]: "); + Serial.println(round(sensor.GetPres())); + test_crc(); + Serial.println("---"); + delay(500); +} + +void test_crc() { + Serial.print("CRC=0x"); + Serial.print(sensor.Calc_CRC4(), HEX); + Serial.print(" (should be 0x"); + Serial.print(sensor.Read_CRC4(), HEX); + Serial.print(")\n"); + Serial.print("Test Code CRC=0x"); + Serial.print(sensor.CRCcodeTest(), HEX); + Serial.println(" (should be 0xB)"); +} diff --git a/test_bluetooth_config/test_bluetooth_config.ino b/test_bluetooth_config/test_bluetooth_config.ino new file mode 100644 index 0000000..0900c11 --- /dev/null +++ b/test_bluetooth_config/test_bluetooth_config.ino @@ -0,0 +1,44 @@ + /* +Programme de reception ou config Bluetooth + +AT : check the connection +AT+NAME: Change name. No space between name and command. +AT+BAUD: change baud rate, x is baud rate code, no space between command and code. +AT+PIN: change pin, xxxx is the pin, again, no space. +AT+VERSION + +HC03 HC05 LF+CR +HC04 HC06 no LF+CR +BLE CC2541 without crystal send with LF + CR +HM-10 (CC2541 with crystal) no LF+CR +AT+HELP list of command +http://www.jnhuamao.cn/bluetooth.asp?id=1 +*/ + +#define RX 11 //RX is MOSI (TX module bluetooth) +#define TX 12 //TX is MISO (RX module bluetooth) + +#include +SoftwareSerial BTserial(RX,TX); +byte serialA; // variable de reception de donnée via RX + +void setup() +{ + Serial.begin(9600); + while (!Serial) ; // Needed for native USB port only + Serial.println("Hello !"); + Serial.println("Enter AT commands:"); + // set the data rate for the SoftwareSerial port + BTserial.begin(9600); +} + +void loop() { + if (BTserial.available()) + { + serialA = BTserial.read(); + Serial.write(serialA); + } + if (Serial.available()) + BTserial.write(Serial.read()); + +} diff --git a/test_usb_bluetooth/test_usb_bluetooth.ino b/test_usb_bluetooth/test_usb_bluetooth.ino new file mode 100644 index 0000000..6cefc5b --- /dev/null +++ b/test_usb_bluetooth/test_usb_bluetooth.ino @@ -0,0 +1,57 @@ +#include + +#define RX 11 // not used (TX module bluetooth) +#define TX 12 // MISO on ISCP (RX module bluetooth) +SoftwareSerial BTserial(RX, TX); // RX not connected +// Connect the HC-05 TX to Arduino pin 11 RX (MOSI). +// Connect the HC-05 RX to Arduino pin 12 TX (MISO). +#define USB_SPEED 115200 //define serial transmision speed +#define BLUETOOTH_SPEED 9600 //bluetooth speed (9600 by default) +#define FREQUENCY 10 // freq output in Hz +#define USB_MODE // uncomment for usb mode +#define BLUETOOTH_MODE // uncomment for bluetooth mode + +void setup() // setup() function to setup all necessary parameters before we go to endless loop() function +{ + #ifdef USB_MODE + Serial.begin(USB_SPEED); // set up arduino serial port + #endif + #ifdef BLUETOOTH_MODE + BTserial.begin(BLUETOOTH_SPEED); // start communication with the HC-05 using 38400 + #endif +} + +uint32_t Pressure=91000; +uint32_t get_time = millis(); + +void loop(void) { + if (millis() >= (get_time + (1000/FREQUENCY))) + { + get_time = millis(); + Pressure -= 1; + if (Pressure<90000) Pressure = 91000; + String str_out = String("LK8EX1,") + +String(Pressure) + +String(",0,9999,0,999,"); + + unsigned int checksum_end, ai, bi; // Calculating checksum for data string + for (checksum_end = 0, ai = 0; ai < str_out.length(); ai++) + { + bi = (unsigned char)str_out[ai]; + checksum_end ^= bi; + } + #ifdef USB_MODE + Serial.print("$"); + Serial.print(str_out); + Serial.print("*"); + Serial.println(checksum_end, HEX); + #endif + #ifdef BLUETOOTH_MODE + BTserial.print("$"); //print first sign of NMEA protocol + BTserial.print(str_out); //print data string + BTserial.print("*"); //end of protocol string + BTserial.println(checksum_end, HEX); + #endif + + } +}