Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Corpze

Members
  • Posts

    316
  • Joined

  • Last visited

Everything posted by Corpze

  1. I have been reading a bit bout cloud detecting to fine tune the settings. The IR Sensor There is several different FOV for the MLX90614 sensor, this effects how many avg_delta_celsius we have to take to be sure that there are cloud present, and not just a quick cirrus residue making the Cloud sensor trigger a "Not Safe" command. Here is the PDF for the Malexis 90614 family. Download DataSheet Now For now, we have set the avg_delta_celsius value to be calculated from 300 delta_celsius values, or about 10 minutes (one reading every 2 seconds) This might be a good number if you have a very narrow FOV (the version with the smallest FOV is 5 degrees.) Note that the sensor itself calculates an average over the entire FOV. If we use a FOV that is very large (the version with the biggest FOV is 90 degrees) maybe there is no need to make an average of 300 values, but maybe 100 (total 200 seconds in time) Here are the different sensor and their FOV: Cloud Detection Ok, so what we are doing is taking a temperature reading of the sky, if there is no cloud that is. If there is cloud present, we are taking a temp reading of that cloud. I have spent hours trying to find any good scientific papers regarding cloud vs sky temp but haven't found anything... The delta 21-25 degree came up when i searched about ir cloud sensor. If anyone know more about this or have stumbled upon some papers about this, feel free to post the links I have found a sky temp chart, illustrating the sky temp vs altitude and it is fairly linear, thats good, easy to work with / Daniel
  2. Yea i think so too. All seems to work pretty good, except one thing, if i choose the right driver and sets the right properties, press ok, it runs good. But if i open up the "choose ascot driver" dialog and choose CloudSensorEvoPlus - properties, it is as it can't read the values. But if i close down the dialog box, it seems that my sequence program keeps on getting "SafeMon: OK".
  3. I most certenly will. Right now, i have all sensors loose on my desk, i have ordered a waterproof enclosure, so i won't be able to test it under the sky in a couple of weeks. I am also wondering of how it will handle negative celsius reading, for instance -50C cloud temp and -20C ambiant. /Daniel
  4. Hooray, it works... I will now fiddle a bit with fine tuning the parameters and reading a bit more of cloud formation to fine tune the parameters Best regards/ Daniel
  5. I have tried the new fw and it works better, no microsoft.net error at all but it is still UnSafe, despite a delta temp of 30 degrees, well above 21 I hope i got the code right-ish ; /*** This sketch reads three sensors:* DS18B20 - Connected to D10* MLX90614 - Connected to SCL-A5, SDA-A4* Rain sensor conected to A0* It calculates the temperatures (DS18B20 and MLX90614)* DS18B20: http://playground.arduino.cc/Learning/OneWire* MLX90614: http://bildr.org/2011/02/mlx90614-arduino/*/#define DEBUG_MODE_OFF#ifdef DEBUG_MODE_OFF//get it here: http://www.pjrc.com/teensy/td_libs_OneWire.html#include <OneWire.h>#include <i2cmaster.h>#include <SPI.h>#endif// lowest and highest rain sensor readings:const int sensorMin = 0; // sensor minimumconst int sensorMax = 1024; // sensor maximum// misc#define FirmwareName "CloudSensorEvoPlus"#define FirmwareNumber "0.1"#define invalid -999#define CHKSUM0_OFF// last rain sensor readingint rainSensorReading = invalid;// last cloud sensor readingfloat ds18b20_celsius = invalid;float MLX90614_celsius = invalid;float delta_celsius = invalid;#ifdef DEBUG_MODE_OFFOneWire ds(10); // DS18B20 on Arduino pin 10#endifbyte ds18b20_addr[8];void setup(void) { Serial.begin(9600); init_DS18B20(); init_MLX90614();}void init_DS18B20(){// Serial.println("Initializing DS18B20 sensor...");#ifdef DEBUG_MODE_OFF while( !ds.search(ds18b20_addr)) { ds.reset_search(); delay(250); }#endif}void init_MLX90614(){// Serial.println("Initializing MLX90614 sensor...");#ifdef DEBUG_MODE_OFF i2c_init(); //Initialise the i2c bus#endif // PORTC = (1 << PORTC4) | (1 << PORTC5);//enable pullups if you use 5V sensors and don't have external pullups in the circuit}long last = 0;void loop(void) { long now=millis(); // gather data from sensors once a second if ((now%1000==0) && (last!=now)) { last=now; // blocks calling more than once during the same ms // Cloud sensor ------------------------------------------------------------ // it might be a good idea to add some error checking and force the values to invalid if something is wrong #ifdef DEBUG_MODE_OFF ds18b20_celsius = read_DS18B20(); MLX90614_celsius = read_MLX90614(); delta_celsius = abs(ds18b20_celsius - MLX90614_celsius); float avg_delta_celsius = (avg_delta_celsius*14.0+delta_celsius)/15.0; #endif // End cloud sensor // Rain sensor ------------------------------------------------------------- // it might be a good idea to add some error checking and force the values to invalid if something is wrong // read the sensor on analog A0: int sensorReading = analogRead(A0); // map the sensor range (four options): // ex: 'long int map(long int, long int, long int, long int, long int)' rainSensorReading = map(sensorReading, sensorMin, sensorMax, 0, 3); // End rain sensor } processCommands();}#ifdef DEBUG_MODE_OFFfloat read_DS18B20(){ byte i; byte present = 0; byte type_s; byte data[12]; float celsius; if (OneWire::crc8(ds18b20_addr, 7) != ds18b20_addr[7]) { Serial.println("CRC is not valid!"); return -300.0f; } // the first ROM byte indicates which chip switch (ds18b20_addr[0]) { case 0x10: type_s = 1; break; case 0x28: type_s = 0; break; case 0x22: type_s = 0; break; default: return -301.0f; } ds.reset(); ds.select(ds18b20_addr); ds.write(0x44, 1); // start conversion, with parasite power on at the end delay(1000); // maybe 750ms is enough, maybe not // we might do a ds.depower() here, but the reset will take care of it. present = ds.reset(); ds.select(ds18b20_addr); ds.write(0xBE); // Read Scratchpad //read 9 data bytes for ( i = 0; i < 9; i++) { data[i] = ds.read(); } // Convert the data to actual temperature int16_t raw = (data[1] << 8) | data[0]; if (type_s) { raw = raw << 3; // 9 bit resolution default if (data[7] == 0x10) { // "count remain" gives full 12 bit resolution raw = (raw & 0xFFF0) + 12 - data[6]; } } else { byte cfg = (data[4] & 0x60); // at lower res, the low bits are undefined, so let's zero them if (cfg == 0x00) raw = raw & ~7; // 9 bit resolution, 93.75 ms else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms //// default is 12 bit resolution, 750 ms conversion time } celsius = (float)raw / 16.0; return celsius;}float read_MLX90614(){ int dev = 0x5A<<1; int data_low = 0; int data_high = 0; int pec = 0; i2c_start_wait(dev+I2C_WRITE); i2c_write(0x07); // read i2c_rep_start(dev+I2C_READ); data_low = i2c_readAck(); //Read 1 byte and then send ack data_high = i2c_readAck(); //Read 1 byte and then send ack pec = i2c_readNak(); i2c_stop(); //This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for temps double tempFactor = 0.02; // 0.02 degrees per LSB (measurement resolution of the MLX90614) double tempData = 0x0000; // zero out the data int frac; // data past the decimal point // This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte. tempData = (double)(((data_high & 0x007F) << 8) + data_low); tempData = (tempData * tempFactor)-0.01; float celcius = tempData - 273.15; return celcius;}#endif
  6. Aha, thanks for the explenation, i try to understand how all off this works I will try the new fw after dinner
  7. Is perhaps to CPU heavy to use a float? i am currently modifying your CloudSensorEvoPlus.ino instead of mine code, but i am out on deep water here, a lot of new type of coding for me I will experiment with 15 average readings instead of 300 to speed it up a bit. I put the average formula at the top-ish but i do not understand where the print is... /*** This sketch reads three sensors:* DS18B20 - Connected to D10* MLX90614 - Connected to SCL-A5, SDA-A4* Rain sensor conected to A0* It calculates the temperatures (DS18B20 and MLX90614)* DS18B20: http://playground.arduino.cc/Learning/OneWire* MLX90614: http://bildr.org/2011/02/mlx90614-arduino/*/#define DEBUG_MODE_OFF#ifdef DEBUG_MODE_OFF//get it here: http://www.pjrc.com/teensy/td_libs_OneWire.html#include <OneWire.h>#include <i2cmaster.h>#include <SPI.h>#endif// lowest and highest rain sensor readings:const int sensorMin = 0; // sensor minimumconst int sensorMax = 1024; // sensor maximum// misc#define FirmwareName "CloudSensorEvoPlus"#define FirmwareNumber "0.1"#define invalid -999#define CHKSUM0_OFF// last rain sensor readingint rainSensorReading = invalid;// last cloud sensor readingfloat ds18b20_celsius = invalid;float MLX90614_celsius = invalid;float delta_celsius = invalid;// Average of delta temperaturefloat avg_delta_celsius= (avg_delta_celsius*14.0+delta_celsius)/15.0; <---------------------------#ifdef DEBUG_MODE_OFFOneWire ds(10); // DS18B20 on Arduino pin 10#endifThis is the error i get from microsoft.net framework; ************** Undantagstext **************System.Runtime.InteropServices.COMException (0x80040402): Timed out waiting for received data vid ASCOM.Utilities.Serial.ReceiveTerminated(String Terminator) i C:\ASCOM Build\Export\ASCOM.Utilities\ASCOM.Utilities\Serial.vb:rad 1204 vid ASCOM.CloudSensorEvoPlus.SetupDialogForm.SendCommand(String Command, Boolean Responding) vid ASCOM.CloudSensorEvoPlus.SetupDialogForm.timer1_Tick(Object sender, EventArgs e) vid System.Windows.Forms.Timer.OnTick(EventArgs e) vid System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) vid System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)************** Inlästa sammansättningar **************mscorlib Sammansättningsversion: 2.0.0.0 Win32-version: 2.0.50727.5485 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------Sequencer Sammansättningsversion: 0.2.0.8 Win32-version: 0.2.0.8 CodeBase: file:///C:/Program%20Files%20(x86)/Sequence/Sequencer.exe----------------------------------------System.Windows.Forms Sammansättningsversion: 2.0.0.0 Win32-version: 2.0.50727.5483 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------System Sammansättningsversion: 2.0.0.0 Win32-version: 2.0.50727.5485 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------System.Drawing Sammansättningsversion: 2.0.0.0 Win32-version: 2.0.50727.5483 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------Microsoft.VisualBasic Sammansättningsversion: 8.0.0.0 Win32-version: 8.0.50727.5483 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll----------------------------------------Microsoft.VisualBasic.Compatibility Sammansättningsversion: 8.0.0.0 Win32-version: 8.0.50727.5483 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic.Compatibility/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.Compatibility.dll----------------------------------------Interop.PinPoint Sammansättningsversion: 1.0.0.0 Win32-version: 1.0.0.0 CodeBase: file:///C:/Program%20Files%20(x86)/Sequence/Interop.PinPoint.DLL----------------------------------------mscorlib.resources Sammansättningsversion: 2.0.0.0 Win32-version: 2.0.50727.5485 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------ASCOM.Utilities Sammansättningsversion: 6.0.0.0 Win32-version: 6.1.1.2627 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/ASCOM.Utilities/6.0.0.0__565de7938946fba7/ASCOM.Utilities.dll----------------------------------------System.Core Sammansättningsversion: 3.5.0.0 Win32-version: 3.5.30729.5420 built by: Win7SP1 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll----------------------------------------ASCOM.Exceptions Sammansättningsversion: 6.0.0.0 Win32-version: 6.1.1.2627 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/ASCOM.Exceptions/6.0.0.0__565de7938946fba7/ASCOM.Exceptions.dll----------------------------------------CloudSensorEvoPlus Sammansättningsversion: 0.5.5690.13704 Win32-version: 0.5.0.0 CodeBase: file:///C:/Program%20Files%20(x86)/Common%20Files/ASCOM/SafetyMonitor/CloudSensorEvoPlus.DLL----------------------------------------ASCOM.DeviceInterfaces Sammansättningsversion: 6.0.0.0 Win32-version: 6.1.1.2627 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/ASCOM.DeviceInterfaces/6.0.0.0__565de7938946fba7/ASCOM.DeviceInterfaces.dll----------------------------------------ASCOM.Astrometry Sammansättningsversion: 6.0.0.0 Win32-version: 6.1.1.2627 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/ASCOM.Astrometry/6.0.0.0__565de7938946fba7/ASCOM.Astrometry.dll----------------------------------------System.Windows.Forms.resources Sammansättningsversion: 2.0.0.0 Win32-version: 2.0.50727.5420 (Win7SP1.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_sv_b77a5c561934e089/System.Windows.Forms.resources.dll----------------------------------------************** JIT-felsökning **************För att aktivera JIT-felsökning (just-in-time ) måste .config-filen fördet här tillämpningsprogrammet eller datorn (machine.config) ha jitDebugging-värdet angivet i avsnittet system.windows.forms.Tillämpningsprogrammet måste också vara kompileratmed felsökning aktiverat.Till exempel:<configuration> <system.windows.forms jitDebugging="true" /></configuration>När JIT-felsökning är aktiverad kommer alla undantag som intehanteras att skickas till JIT-felsökaren som är registrerad pådatorn snarare än att hanteras av den här dialogrutan./Daniel
  8. I have tried the ASCOM driver, and it connects fine, and reads the hardware, but i it says "Unsafe" as you can see, but that is probably because i have not yet entered the average value of the Delta temp. That is why i am getting a error message as well?
  9. Hmm... delta_celsius is already a float, maybe thats the problem?
  10. That looks awesome, The "Average Sky Temperature" should be "Average Delta Sky Temp", otherwise, it might get confusing, after all, it is the difference in temperature that are the most interesting bit. I am sadly not having any luck with the; float avg_delta_celsius= (avg_delta_celsius*14.0+delta_celsius)/15.0; (cut it down to 15 values so i didn't have to wait so long to test the code) Still not writing "IsSafe" Do you think there is good to have the arduino write out "IsNotSafe" otherwise? /Daniel
  11. I have tried the new average function, I declared it as an int, don't know if thats the best way, how ever... didn't trigger IsSafe... need som sleep now Here is the code i tried with. Serial.print("Ascom Safety monitor status: "); int avg_delta_celsius= (avg_delta_celsius*299.0+delta_celsius)/300.0; if ((avg_delta_celsius >21) && (range>1)) { Serial.println("IsSafe");Good Night
  12. Hrmmpffff.... cloudy again... at least the code worked and the Commands could be sent to the arduino and the data got received like it should! Everything looks ok so far. I'll check on that average later on /D
  13. I loaded the new firmware, but when i try to compile, it get this; CloudSensorEvoPlus.ino: In function 'void loop()': CloudSensorEvoPlus:110: error: 'processCommands' was not declared in this scopeDo i have to run it together with the driver? Yes, that is exactly what i want to do, Sounds like moving average is the way to go. I will look in to this more later on... getting late here in sweden right now, and clear skies for the first time in two weeks and my new DDM85 needs a polar align /Daniel
  14. That sounds great, this is a hobby project and you should not feel at any means some kind of pressure if you feeling burned out. /Daniel
  15. Hmm, I am stuck in my coding, the problem is that i want to take continuous readings from the MLX90614 (ir/cloud sensor) and want to know the value for debugging etc. BUT to be able to average the calculations between the IR-sensor and the temp sensor (not the actual readings from the sensors) i have to take for instance 300 calculations (1 calculation per second is 5 minutes) This is to not trigger the roof being closed as soon a small little cirrus cloud sweeps pass, but if there is cloud adding up for about 5 minutes... I don't know how to write this code... excuse my bad english... hard to explain but i hope you get a hang of what i mean. I don't want to average readings but the calculation below; delta_celsius = abs(ds18b20_celsius - MLX90614_celsius)and then print out the result, something like this (horrible code, but i think you know what i mean; Serial.print("Ascom Safety monitor status: "); if ((delta_celsius 300/300 >21 ) && (range>1)) // 300 calculations divided by 300 to get the average { Serial.println("IsSafe");If the sensor is read 1 time a second (or is it just the serial.print that is once a second?)
  16. Well, I can´t write software, or at least, i haven't done that before. It might be better to write a software so you can change settings like sensitivity etc. but i lack the knowledge. How does the driver send/recieves commands? I understand that the firmware i write to the hardware now sends only "IsSafe" when it isn't any clouds AND no rain, otherwise it sends nothing at all. Is this a safe way to go? /D
  17. Yep, maybe even more simple, the arduino is sending just "IsSafe" or nothing at all (i think that is what ascom listens to?) I have been writing som more code to get the if statements to work; If the temperature difference is greater than 21 degrees AND there is no rain - it will trigger this; DS18B20 Temperature: 25.44 CelsiusMLX90614 Temperature: 51.24 CelsiusDELTA Temperature: 25.80 CelsiusRain sensor status: Not RainingAscom Safety monitor status: IsSafeIn all other cases, it will write nothing in the Ascom Safety monitor line, like in this case when there is no cloud (greater temp diff than 21 degrees, but a rain warning) DS18B20 Temperature: 25.44 CelsiusMLX90614 Temperature: 46.82 CelsiusDELTA Temperature: 21.38 CelsiusRain sensor status: Rain WarningAscom Safety monitor status: I will now work on the code to make the "IsSafe" command to be written first after a couple of minutes of temp-differenture, not just only one single temp diff measure. Here is the code so far; /*** This sketch reads three sensors:* DS18B20 - Connected to D10* MLX90614 - Connected to SCL-A5, SDA-A4* Rain sensor conected to A0* It calculates the temperatures (DS18B20 and MLX90614)* DS18B20: http://playground.arduino.cc/Learning/OneWire* MLX90614: http://bildr.org/2011/02/mlx90614-arduino/*///get it here: http://www.pjrc.com/teensy/td_libs_OneWire.html#include <OneWire.h>//get it here: http://jump.to/fleury#include <i2cmaster.h>#include <SPI.h>// lowest and highest rain sensor readings:const int sensorMin = 0; // sensor minimumconst int sensorMax = 1024; // sensor maximumOneWire ds(10); // DS18B20 on Arduino pin 10byte ds18b20_addr[8];void setup(void) { Serial.begin(19200); init_DS18B20(); init_MLX90614();}void init_DS18B20(){ Serial.println("Initializing DS18B20 sensor..."); while( !ds.search(ds18b20_addr)) { ds.reset_search(); delay(250); }}void init_MLX90614(){ Serial.println("Initializing MLX90614 sensor..."); i2c_init(); //Initialise the i2c bus // PORTC = (1 << PORTC4) | (1 << PORTC5);//enable pullups if you use 5V sensors and don't have external pullups in the circuit}void loop(void) { float ds18b20_celsius = read_DS18B20(); Serial.println(); Serial.print("DS18B20 Temperature:\t"); Serial.print(ds18b20_celsius); Serial.println("\tCelsius"); float MLX90614_celsius = read_MLX90614(); Serial.print("MLX90614 Temperature:\t"); Serial.print(MLX90614_celsius); Serial.println("\tCelsius"); float delta_celsius = abs(ds18b20_celsius - MLX90614_celsius); Serial.print("DELTA Temperature:\t"); Serial.print(delta_celsius); Serial.println("\tCelsius"); //Rain sensor // read the sensor on analog A0: int sensorReading = analogRead(A0); // map the sensor range (four options): // ex: 'long int map(long int, long int, long int, long int, long int)' int range = map(sensorReading, sensorMin, sensorMax, 0, 3); Serial.print("Rain sensor status: "); // range value: switch (range) { case 0: // Sensor getting wet Serial.println("Rain"); break; case 1: // Sensor getting wet Serial.println("Rain Warning"); break; case 2: // Sensor dry - To shut this up delete the " Serial.println("Not Raining"); " below. Serial.println("Not Raining"); break; } delay(1); // delay between reads //End rain sensor Serial.print("Ascom Safety monitor status: "); if ((delta_celsius >21) && (range>1)) { Serial.println("IsSafe");} delay(1000); }float read_DS18B20(){ byte i; byte present = 0; byte type_s; byte data[12]; float celsius; if (OneWire::crc8(ds18b20_addr, 7) != ds18b20_addr[7]) { Serial.println("CRC is not valid!"); return -300.0f; } // the first ROM byte indicates which chip switch (ds18b20_addr[0]) { case 0x10: type_s = 1; break; case 0x28: type_s = 0; break; case 0x22: type_s = 0; break; default: return -301.0f; } ds.reset(); ds.select(ds18b20_addr); ds.write(0x44, 1); // start conversion, with parasite power on at the end delay(1000); // maybe 750ms is enough, maybe not // we might do a ds.depower() here, but the reset will take care of it. present = ds.reset(); ds.select(ds18b20_addr); ds.write(0xBE); // Read Scratchpad //read 9 data bytes for ( i = 0; i < 9; i++) { data[i] = ds.read(); } // Convert the data to actual temperature int16_t raw = (data[1] << 8) | data[0]; if (type_s) { raw = raw << 3; // 9 bit resolution default if (data[7] == 0x10) { // "count remain" gives full 12 bit resolution raw = (raw & 0xFFF0) + 12 - data[6]; } } else { byte cfg = (data[4] & 0x60); // at lower res, the low bits are undefined, so let's zero them if (cfg == 0x00) raw = raw & ~7; // 9 bit resolution, 93.75 ms else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms //// default is 12 bit resolution, 750 ms conversion time } celsius = (float)raw / 16.0; return celsius;}float read_MLX90614(){ int dev = 0x5A<<1; int data_low = 0; int data_high = 0; int pec = 0; i2c_start_wait(dev+I2C_WRITE); i2c_write(0x07); // read i2c_rep_start(dev+I2C_READ); data_low = i2c_readAck(); //Read 1 byte and then send ack data_high = i2c_readAck(); //Read 1 byte and then send ack pec = i2c_readNak(); i2c_stop(); //This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for temps double tempFactor = 0.02; // 0.02 degrees per LSB (measurement resolution of the MLX90614) double tempData = 0x0000; // zero out the data int frac; // data past the decimal point // This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte. tempData = (double)(((data_high & 0x007F) << 8) + data_low); tempData = (tempData * tempFactor)-0.01; float celcius = tempData - 273.15; return celcius;}/Daniel
  18. Well, because i am going to use a fully automated observatory, i need to be 100% sure of that my bits and pieces works, in case of rain etc. I could use a led-based warning system, but that require my attention through the whole night, witch not is an option. /Daniel
  19. I have started to write (as simple as possible) code to my Arduino Nano clone. It is a rain sensor: http://www.dx.com/p/raindrops-sensor-module-blue-black-199859#.VAaJLmOrjfV A DS18B20 temperature sensor: https://www.sparkfun.com/products/11050 And a MLX90614 IR sensor: http://www.ebay.com/itm/1PC-MLX90614-Contactless-Temperature-Sensor-Module-For-Arduino-Compatible-New-/400837282279?pt=LH_DefaultDomain_15&hash=item5d53c389e7 How it´s connected is shown in the code. I got the code working well, printing out this in the serial monitor: DS18B20 Temperature: 25.00 Celsius MLX90614 Temperature: 26.96 CelsiusDELTA Temperature: -1.96 CelsiusRain sensor status: Not RainingI will change the code to print out the best value for the Ascom safety monitor, probably just "IsSafe"Here is the help section of the Ascom safety monitor; http://ascom-standards.org/Help/Platform/Index.htmlIf it is rain it will immediately send nothing (I believe Ascom safety monitor listens to "IsSafe"?)The trick is to not trigger the safety monitor with each small cloud, but maybe after a five-minute period of clouds?If the Delta temperature is below -21C it is clouds present, if the Delta temperature is higher than -25C it is most certain no clouds (between -21C and -25C there is probably small cirrus or similar)The Arduino code Should not be that hard to code, but the ascot safety monitor driver must be written on a windows pc... and i am a Mac user... maybe there is someone who wan´t to give this a go? Best Regards, Daniel
  20. Hi, i am wondering if there is any diy cloud and rain sensor project with ascom support? (Safety monitor) I built one with a ebay rain sensor and a mlx cloud sensor (ir) and used it with SGL cloud sensor evo, working nice (using only the cloud sensor) But the lack of ascom support makes it fairly useless for me as i need the safety monitor support for my automated observatory. Is there any ascom driver for this?
  21. Oh, that fast! Is it the same time for every magnitude? And as Per sais, great DIY-project... even though i haven´t used mine that much /Daniel
  22. Olly; Approx. how long does one reading take at say 20mag/as2? I made my own SQM a couple of years ago and always wanna now if the time it takes to measure is the same. For me it is maybe 20-30sec at 20 mag/as2. for 21 or even 22 i suppose the reading would take 30-45 sec? / Daniel
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.