View Single Post
  #21  
Old 18-10-2013, 02:26 AM
redbeard's Avatar
redbeard (Damien)
Registered User

redbeard is offline
 
Join Date: Nov 2010
Location: Adelaide
Posts: 558
Hi Garbz,

On my scope, a 10" LX200GPS, I have the dew heater just behind the corrector plate which appears to be the best location, and the idea is that the heat going into the tube and slightly heating the back of the corrector plate, (air), stops the dew from forming on the front. I've read also about too much heat as well might not be the best. As all scopes and setups and weather are different so lots of tweaking for optimal results.

At first before the dew sets in, the heater is off as no pwm needed As the temp drops, the code checks the dew point and gets a celsius value, (calculated from the DHT22), and compares this with the temp sensor + say 5 deg and a simple calculation, see code below and credit due to the other guy in the previous post link for that bit.

If the temp sensor reaches the start of the threshold, the pwm starts to turn on, but only enough to satisfy the temp/rules. As the dew point vs temp changes, the pwm keeps ramping up until it hits 100% duty cycle. There it stays until conditions change. Might be power savings as well in light dew.

Each channel is unique, as for my setup I have a guide scope as well, so tweaking can be done seperately on each channel.

The idea of putting the temp sensors under the dew straps, I picked up from lots of searches in astro sites looking for commons in temp sensor positions and under the dew heater seems to be the most intelligent things I read. Some mentioned to put thin rubber/foam as an insulator others not, so I'm about to fit it to the scope as the tests I've done so far have been on the bench and I'm thinking I'll try just heatshrink over the sensor at first and then under the dew heater.

So the real telescope tests are about to happen and I'm sure there will be tweaking of the code to get the optimum, and that's one thing I think the logged data/graphs can help with.

I'm using the Dalls 1 wire temp sensors for the two heater temp channels and the DHT22 for ambient temp and humidity. The humidity sensor is on the inside lid of the small box that sits on the tube, and has holes in the lid to pick up the dew.

Hope that helps.

Cheers,

Damien.


#include <DallasTemperature.h>
#include "DHT.h"

#define DHTPIN 6
#define DHTTYPE DHT22
#define ONE_WIRE_BUS 7
#define ONE_WIRE_BUS_2 19
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(8, 9, 5, 4, 3, 2);
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
OneWire oneWire_2(ONE_WIRE_BUS_2);
DallasTemperature sensors_2(&oneWire_2);

float pot1val;
float pot2val;
float getsense;
float getsense_2;
char pot1buffer[7];
char pot2buffer[7];
char humbuffer[7];
char tempbuffer[7];
char dewpointbuffer[7];
char heatertempbuffer[7];
char heatertempbuffer_2[7];

void setup()
{
pinMode(sw_1_up, INPUT);
pinMode(sw_1_down, INPUT);
pinMode (lcd_led, OUTPUT);
Serial.begin(38400);
lcd.begin(20, 4);
dht.begin();
sensors.begin();
sensors_2.begin();

pot1val = 0;
pot2val = 0;

}

void loop() {
delay(1000);
// Reading temperature or humidity from dht takes about 250 milliseconds
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)

float h = dht.readHumidity();
float t = dht.readTemperature();
float logEx;
float dew_point;

float valpercentpot1;
float valpercentpot2;
int qq;


sensors.requestTemperatures();
getsense = sensors.getTempCByIndex(0);

sensors_2.requestTemperatures();
getsense_2 = sensors_2.getTempCByIndex(0);

logEx=0.66077+7.5*t/(237.3+t)+(log10(h)-2);
dew_point = (logEx - 0.66077)*237.3/(0.66077+7.5-logEx);

if(getsense <= dew_point + 5)
{
pot1val = (dew_point + 5 - getsense) * 50;
if(pot1val > 255)
{
pot1val = 255;
}
}
else
{
pot1val = 0;
}


if(getsense_2 <= dew_point + 5)
{
pot2val = (dew_point + 5 - getsense_2) * 50;
if(pot2val > 255)
{
pot2val = 255;
}
}
else
{
pot2val = 0;
}


analogWrite(10, pot1val); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
analogWrite(11, pot2val);

valpercentpot1 = (pot1val / 2.55);
valpercentpot2 = (pot2val / 2.55);

lcd.setCursor(0, 2);
lcd.print("P1:");
lcd.print(pot1val);


lcd.setCursor(10, 2);
lcd.print("P2:");
lcd.print(pot2val);


lcd.setCursor(0, 0);
lcd.print("H:");
lcd.print(h);


lcd.setCursor(10, 0);
lcd.print("T:");
lcd.print(t);


lcd.setCursor(10, 1);
lcd.print("D:");
lcd.print(dew_point);


lcd.setCursor(0, 3);
lcd.print(getsense); //dallas temp

lcd.setCursor(10, 3);
lcd.print(getsense_2); //dallas temp 2
Reply With Quote