I am a real beginner, I have worked my way through several basic Arduino projects including one that uses the DHT11 temp/humidity sensor. It occurred to me that I could actually use this to send temp and humidity data to my astro PC. The only data strings that are acceptable are NMEA0183. This crude piece of code almost works:
void loop() {
humidity = HT.readHumidity();
tempC = HT.readTemperature();
tempF = HT.readTemperature(true);
dewPointC = (tempC)-((100-humidity)/5);
dewPointF = (dewPointC*9/5)+32;
Serial.print("$PXDR,P,96276.0,P,0,C,");
Serial.print(tempC);
Serial.print(",C,1,H,");
Serial.print(humidity);
Serial.print(",P,2,C,");
Serial.print(dewPointC);
Serial.println(",C,3,1.1*31");
But fails because the check sum (two hex digits after the *) is incorrect. If I compute the correct checksum all is well. I found some code that correctly computes the checksum, but I have no idea how to:
- Assemble the complete string,
- Pass it to the checksum code,
- Add the hex checksum digits and send it via the serial monitor.
I have a feeling I am slightly out of my depth!
Geoff