Return to the Cloudy Nights Telescope Reviews home pageAstronomics discounts for Cloudy Nights members
Get a Cloudy Nights T-Shirt Submit a Review / Article

Click here if you are having trouble logging into the forums

Privacy Policy | Please read our Terms of Service | Signup and Troubleshooting FAQ | Problems? PM a Red or a Green Gu uh, User

Equipment Discussions >> Equipment

Pages: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | (show all)
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: bassplayer142]
      #5547458 - 11/30/12 04:16 PM

Hi Paul,
Now we are back in business! The LCD contrast pot was faulty, so I now have my data displayed again - that's a relief.
I have it hooked up with 2 Dallas and one heater + one bulb. I can see now that the duty cycle function is spot on. Low % = short pulses, high % = long pulses, 100% = continuous.

So there we are, all is hunky dory.

I have also uploaded using the new cpp file, whichis running perfectly.

I have temporarily brought the duty cycle pot out on a flying lead, so it will be easy to tweak for optimum control. I'll see how I feel later about taking all up to the dome and get the whole system running - I should really.

So, big relief that nothing has cooked off.

Question: have you thought at all about designing in independent duty cycle control for all outputs? I reckon that would be an excellent feature. Perhaps when I know significantly more about the programming, I may take a look at this myself.

PM being sent.

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pauls72
professor emeritus
*****

Reged: 10/28/07

Loc: LaPorte, IN
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5547535 - 11/30/12 05:05 PM

Glad to here you got it fixed and working again.

Quote:

Hi Paul,

Question: have you thought at all about designing in independent duty cycle control for all outputs? I reckon that would be an excellent feature. Perhaps when I know significantly more about the programming, I may take a look at this myself.

PM being sent.

Phil




No I haven't thought about that. But I did put these 4 variables so each one could have it's own temperature. Do you think it would be useful to run them at different duty cycles?

int dewAdjust1 = 5; // Temperature difference between the Dallas one wire heater sensors and the controller DHT-11 sensor, in Fahrenheit. One for each output port so you can adjust the outputs individually.
int dewAdjust2 = 5; //
int dewAdjust3 = 5; //
int dewAdjust4 = 5; //

The duty cycle logic is tied into the screen scrolling logic. And the outputs are actually a little higher duty cycle than the input, because when we go out of the display scroll logic and measure all the temperatures, humidity, voltage and do all the other updates the dew heaters are put back in the original state they where when we started the scrolling. What can I say, but I fudged a little on a few things. Same thing goes for my input voltage detect circuit, it could be designed better. It's just I had 4 brand new - 1K ohm 2% resistors in my junk box.

I don't know if you realized, but on the serial monitor there are 3 commands you can put in:
z or Z = zero out the EEPROM
p or P = pauses the application and it sits and does nothing for roughly 100 seconds.
d or D = dumps the EEPROM contents to the serial port. You can then copy and past them into a text or spread sheet file.


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5547555 - 11/30/12 05:28 PM

That was quick Paul! Yes,I do think its useful since individual straps will have their own behaviour, i.e. power may not be perfectly matched to its bit of glass. Independent control could achieve a perfect balance I think.

I'll plug that bit of code in and sort out adding the extra pots.

I did't know about those monitor commands. Looks useful Paul.

I'm off up to the dome now to get everything hooked up, may even get a bit of observing in.

More tomorrow.

Best regards

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5547766 - 11/30/12 07:43 PM

Paul,
I've had it all plugged in and working at 90% DC. Thats fine, but I have just changed the correctionDHT to +0.5 as the DHT was reading 2.5C less than my thermometer. Because of the previous -2, the heaters were not raising the T enough to control dew on the SCT. Try that tomorrow night.

I will have to mess about with the heaters as well, to increase the EP one by say 2 Watts and the Box by probably 3 Watts. The ED80 one I don't know yet.

Its a tweaking game now to get the balance that works.

Forget what I said about about plugging in the dew adjust code, its what is already in there. I do think having the ability to set individual duty cycles would be good.

So, good progress tonight, I would say.

Best regards

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5548571 - 12/01/12 10:54 AM

Paul,
I've tweaked the 'correctDHT' again, so now the DHT22 reads within 0.5C of my thermometer. Its all switched on now and the dew point is close to the trigger point I think. I've also reset the delta T to 4C. So its a waiting game to see if it behaves itself.

I'm considering taking the DHT22 away from the box on a flying lead, so its not influenced by box temperature, i.e. the transistors warming it. This would of course cause erroneous readings thus upsetting the correct trigger point. I want it away from body heat or any other source of warmth. The most logical place I think is to fix it at the business end of the scope, but obviously clear of the dew strap. I have seen that one or two people have said, 'why not put it inside the box'; that defies all logic, it could never give the correct reading. Have you any thoughts on this?

I have also re-worked the dew straps, so I now have 18 Watts at the SCT; 8.5 Watts for the ED80, and 4 Watts for the EP. I'm experimenting with the box. trying 5 Watts.
The box by the way is where I keep EP's ready for use.

Waiting in anticipation.

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5548629 - 12/01/12 11:39 AM

Paul,
I forgot to add that the DHT should face downwards, so dew can't settle on the sensor element; apparently they don't like dew!
Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5548958 - 12/01/12 03:19 PM

Paul,
I've had it running for about 15 hrs since the heaters kicked in. At first the dewadjust lines:

int dewAdjust1 = 5;
int dewAdjust2 = 5; //
int dewAdjust3 = 5; //
int dewAdjust4 = 5; //

as you can 5 degrees. This was not enough for the sct, it dewed up fairly quickly. I think this is because it is the one radiating out to space the most directly. The ED80 isn't mounted so can't be certain of that one yet, its lying on its side by the pier. The EP & Box have been raised to 6 degrees each. I notched up the SCT 1 degree at a time until I could the dew starting to clear; its currently set at 8 degrees. Once its cleared, I can probably back it off 1 degree at a time until just begins to dew up, then increase by 1 or 2 degrees.

The excellent news is that its working properly. What I will do though is make a wider strap for the SCT and fully insulate it so its more like an electric blanket. At the moment all I've done is apply double sided tape directly onto the corrector plate mount, wind on 2 turns of nichrome, then tape over plus a strip of cooking foil. Its only about 15mm wide. There is too much heat loss around the rest of the exposed plate mounting, so not very efficient.

Very good, very pleased.

One small addition I'm going to make, is to add an LED Plus resistor to each output, That will give an absolute indication of which heaters are on, or off.

Excellent!

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5551672 - 12/03/12 08:52 AM

Paul,
I have now fitted 4 LED's so I can see instantly which outputs are on. This will be particularly useful when I have less than 4 attached. As you said having less than the full compliment changes the order of Dallas detection, thus changing which outputs trigger.

I've just finished making a much better strap for the SCT, with 4 turns of nichrome, which spreads the heat right across the corrctor plate mounting. I can see immediately that this is much more efficient than the first effort, so can now start reducing the temperature differential.

Next I'll put in a 3 way connector for DHT22 and mount that on the topp end of the SCT, thermally insulated from it. I really think this is the right thing to do.

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pauls72
professor emeritus
*****

Reged: 10/28/07

Loc: LaPorte, IN
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5555729 - 12/05/12 01:59 PM Attachment (24 downloads)

Phil,

Alright, I've added the ability to set the duty cycle separately to different values for each of the 4 outputs. Right now the only way to set them is in your source code and then compile and upload it to the Arduino. I have attached a version for you to test with or to take the pieces and copy them into your program.

Up top I have added these 4 variables:
// Added at 3.9 for Multiple duty cycles.
int dutyIn1 = 90;
int dutyIn2 = 80;
int dutyIn3 = 75;
int dutyIn4 = 25;


I rewrote the // *****************Duty Cycle Function*********************
And I added a new function above it // *****************Multi Duty Cycle Function*********************

I did not remove any of the original source code to get duty cycle from the pot yet or what is on the display. This was just to get it working and test it. So it will need to be cleaned up.

I ordered a BlueTooth Transceiver Module and will take a stab at using BlueTooth instead of Infrared Remote to set the variables on the fly.

Also thinking about it I found there is a hole in my modified DHT11 library.
If the temperature is exactly 25.6C and the humidity is exactly 25.6% at the same time, the library will return the values as if they came from a DHT11 instead of a DHT22. Now I know the odds of this happening are small, but in the computer world I learned to never say never no matter how small the odds are. I have a couple of ideas of what I need to do to fix it and will test as soon as the DHT22 I ordered gets here.

Paul


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5559322 - 12/07/12 01:41 PM

Paul,

Good stuff, I'll try that and let you know.

That's an odd with the 25.6! Why should that be I wonder?

The BlueTooth idea sounds a good one to me.

I have been lucky with clear nights this week, so the system has had plenty of running time. I switch the Arduino on a couple of hours before intending to work. I am finding that everything is nicely stabilised, and, I am getting absolutely no dew - its a revelation, with never had such clear viewing before. I'mm passing everything on to a couple of people here in the UK. One of whom had tried to follow the 'mitaccio' schema, but came thoroughly unstuck; as I would have but for your help.

I have now mounted the DHT22 at the top of the SCT; this works perfectly. It meant that I could reduce the temperature differential by 2 degrees.

I may be able to report later on the duty cycle mod.

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pauls72
professor emeritus
*****

Reged: 10/28/07

Loc: LaPorte, IN
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5559512 - 12/07/12 03:46 PM

Both the sensors return 5 bytes of bit oriented data.
The DHT11
Byte 1 = humidity value 0-255
Byte 2 = 0 or 00 hex
Byte 3 = temperature value 0-255
Byte 4 = 0 or 00 hex
Byte 5 = check sum or check digit of the 4 bytes

The DHT22
Byte 1 & 2 = humidity value 0-65536
Byte 3 & 4 = temperature value 0-65536
Byte 5 = check sum or check digit of the 4 bytes

What I am doing is if the value of bytes 2 and 4 are both zero, then I assume it is a DHT11. If either is anything but zero then I assume it is a DHT22. On a DHT22 when the humidity is 25.6% the DHT22 returns a value of 0100 hex (256 decimal) for bytes 1 and 2, so byte 2 would be all zeros. The same for the temperature of 25.6C the DHT22 returns 0100 hex (256 decimal) for bytes 3 and 4.

So at 25.6% humidity and 25.6C the DHT22 returns the same values of data as a DHT11 would at 1% humidity and 1C.

Now the DHT11 doesn't go below 20% humidity so it should never get to this value.


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5559663 - 12/07/12 05:39 PM

Got it Paul.

I didn't have time tonight to plug in the duty cycle code; too busy sorting out PHD guiding and getting it to recognise my web cam. Messed about by cloud coming and going.

I have been using Metaguide, but I'm not too happy with it, so hopefully PHD will do the job, and, it integrates with EQMOD, which I use all the time. So it should be the way to go I think.

A guy I'm talking to here has developed his own Arduino code, and is getting on pretty well it seems. He uses a 4 line LCD. I'll get his code when he releases it, and send it on to you.

I'll probably do the code tomorrow.


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5559664 - 12/07/12 05:39 PM

Got it Paul.

I didn't have time tonight to plug in the duty cycle code; too busy sorting out PHD guiding and getting it to recognise my web cam. Messed about by cloud coming and going.

I have been using Metaguide, but I'm not too happy with it, so hopefully PHD will do the job, and, it integrates with EQMOD, which I use all the time. So it should be the way to go I think.

A guy I'm talking to here has developed his own Arduino code, and is getting on pretty well it seems. He uses a 4 line LCD. I'll get his code when he releases it, and send it on to you.

I'll probably do the code tomorrow.


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5565990 - 12/11/12 01:50 PM

Hi Paul,
I've just got round to trying the multi duty cycle function, but I clearly have put it in the wrong place, as what I did knocked out one of the sensor inputs, leaving 3 running normally:

// *****************Duty Cycle Function*********************
// Added at 3.9 for Multiple duty cycles.
int dutyIn1 = 90;
int dutyIn2 = 80;
int dutyIn3 = 75;
int dutyIn4 = 25;
void dutycycleloop(int dutyInn, int dutyOutt)

I don't understand the 3.9 reference. So, if you could please put me straight on this, I'll try again.

Have you got the BlueTooth yet?

Freezing fog tonight, so no observing sadly.

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5566031 - 12/11/12 02:14 PM

Hi Paul,
Now that the temperature is down to 0.9C by my thermometer, I'm getting erroneous readings off the DHT22. Temp=6552, Hum=99%, Dew=6440

And this from the serial monitor:

Duty Cycle pot in=818
LX200: 34.25
ED80: 48.20
EP: 59.45
Box: 32.00
Temp=11827
Humidity=99%
DewPoint:11627
Voltage divider input=615

I presume from this, that there is something amiss in the DHT cpp file. Can you suggest what might be happening here.

I can tell you, winter has really set in here!

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pauls72
professor emeritus
*****

Reged: 10/28/07

Loc: LaPorte, IN
Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5566624 - 12/11/12 09:47 PM

Phil,
I'm guessing your right. I took a quick look at it and see no glaring obvious faults. I'm guessing it has to do with the high order bit which indicates negative temperature (below zero).

Bluetooth components where shipped from Hong Kong on 4th Dec.

DHT22 and a couple other things I bought off of Evil Bay from the same vendor have an estimated delivery date of between 12th Dec. and 31st Dec. The early date of the between keeps moving back every day. They don't show a shipped date, only the estimated delivery dates.

The 3.9 is the version number. Up at the top are some comments as to what changes in each of the versions.

Paul

Edited by Pauls72 (12/11/12 10:03 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pauls72
professor emeritus
*****

Reged: 10/28/07

Loc: LaPorte, IN
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5566779 - 12/11/12 11:32 PM Attachment (31 downloads)

Phil,
My suspicion was right, the high order bit indicating a negative number was the problem. It was going through a "word" type variable which has no sign bit. so when the temperature when below 0C the math got messed up. OK, so here you go a new version of the DHT library that will handle negative temperatures from the DHT22. I forced some values into the variables to simulate the DHT22 for my testing.
Paul


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5567333 - 12/12/12 10:58 AM

OK Paul, I plug compile with this one and test later, when the temperature has dropped again. I've compared it with the previous version, but haven't yet spotted the difference. I'll keep looking unless you can give me a clue.

Ah, 3.9, I should have twigged that one.

Good old fleabay eh?

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pauls72
professor emeritus
*****

Reged: 10/28/07

Loc: LaPorte, IN
Re: How to make an automatic dew controller - Arduino [Re: ThadeusB]
      #5567412 - 12/12/12 11:51 AM

In the dht11.cpp file:

******************************************************************************

int sign = 1;
if (bits[2] & 0x80) // Test for a negative temperature
{
bits[2] = bits[2] & 0x7F; // By anding this byte with hex 7F we strip for the high order bit.
sign = -1;
}

//Orginial source code, this is the line that I replaced.
//temperature = sign * word(bits[2], bits[3]) * 0.1;

//New code to allow for negative temperatures, these are the lines I replaced them with.

long temp2 = word(bits[2], bits[3]);
temperature = sign * temp2 * 0.1;



******************************************************************************
word variables are 16 bits in length with no sign, 0 to 65535.
long variables are 32 bits in length with a sign, -2,147,483,648 to 2,147,483,647.
int variables are 16 bits in length with a sign, -32,768 to 32,767.

I probably could have just used a int instead of a long for "temp2" to fix the problem.

Edited by Pauls72 (12/12/12 11:53 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
ThadeusB
member


Reged: 11/14/12

Loc: Somerset, UK
Re: How to make an automatic dew controller - Arduino [Re: ThadeusB]
      #5567996 - 12/12/12 05:31 PM

Paul,
Only down to -1C but looks fine, well done!

Hoping for coldeer night tomorrow.

Phil


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | (show all)


Extra information
6 registered and 11 anonymous users are browsing this forum.

Moderator:  cbwerner, tecmage, rflinn68 

Print Thread

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled


Thread views: 22309

Jump to

CN Forums Home


Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics