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)
mitaccio
professor emeritus
*****

Reged: 03/17/09

Loc: Oahu, Hawaii
How to make an automatic dew controller - Arduino
      #5321008 - 07/16/12 08:30 PM Attachment (651 downloads)

For Christmas I got an arduino and set out to make a dew controller that was capable of reading the ambient temperature, humidity and calculate the dew point, then read the temperature of the optics and turn on/off the dew heater straps to keep the optics a preset value above dew point. I wanted to make it easy to replicate and very cost friendly.

You don't need to be a programmer to make this, I have done it for you. Arduino's were built with the idea that anyone can code, and that codes were meant to be shared. I used several sources for inspiration and code, too many to count let alone site. I do not claim to have come up with this code entirely on my own, but rather the specific design. The design only allows for 2 sensors/heaters but could easily be changed to add more sensor/heater elements.

The coding is written in fahrenheit. I will try to get a code posted for celsius. The heaters are designed to turn on when the sensors for the scope are 10*F or less above the dew point. You can change the coding easily if you want it to be higher or lower than that. I find 10*F to be enough to keep things dry under high dew conditions, but not cause thermal issues.

If you have about 3-6 hours of time on your hands and are at least passable with a soldering iron and wire strippers, I think you might just have a chance And don't be afraid to try. I don't work in electronics, computers or programming. So chances are you are better qualified to do this than I was!

Step 1: Parts

I am providing links to the sites where I bought most of my parts. Some I had on hand, but you will find everything in this list except for tools, which you probably already have. If you need tools, DO NOT GO TO RADIOSHACK, THEY WILL ROB YOU. Instead buy them from the suppliers below.

Sparkfun.com
Arduino $29.95
Shield $14.95
Ribbon wire $.95
LCD display $14.95
100K Trim Pot $.95
1K Resistor $.25 x 2

Adafruit.com
Enclosure $15
Dallas OneWire sensors with resistor $4 x 2
DHT11 with resistor $5

RadioShack (yikes! Other sources are cheaper!)
Tip120 Darlington transistor $1.99 x 2
[=http://www.radioshack.com/product/index.jsp?productId=2103224&numProdsPerPage=60]RCA sockets[/url] $4.19
1/8 Stereo Socket 2 pack $3.19
330 Ohm Resistor $1.19


Step 2: Arduino and code

You will need to download some codes and libraries. Don't worry, it's simple. Download the program at Arduino.cc and install. There are three libraries that you will need to add to the library folder that is created when you install the Arduino program. If you need any help installing the program or adding the libraries, the arduino.cc website details it nicely for beginners.

dht11.lib
dallasonewire.lib
math.lib comes with the arduino program
lcd.lib comes with the arduino program

Once you have the arduino program installed and the libraries loaded, it's time to put in the code and send it to the arduino. Copy the code I am attaching and paste it in the arduino program. Connect the arduino via usb cable (most wired printers use this cable, so if you don't have one, someone you know will probably lend you one). Then you will send the code to the arduino using the upload button in the upper left. Assuming you put the libraries in the right place, you have the brains of the project done. Now it's on to the display, sensors and output.

Step 3: Arduino shield

A shield is a fancy word for something that sits on the arduino. You will need to assemble the proto-shield from sparkfun.com following the instructions on their website under the product page. You don't need to worry about the switches and leds unless you are particular like me about doing everything in the instructions. I like using the shield because it allows me to fit things how I want and leaves room for personal adaptation if desired. It also allows me to separate the arduino from the project should something bad happen.

Step 4: Display

The lcd screen requires enough wires that I opted for a ribbon. It keeps things neat and clean. Follow the attached diagram to hook up the lcd screen to the arduino shield. Make sure you take time to wire it up right. The potentiometer (knob) allows you to adjust the contrast on the screen to the right level. The resistor keeps the screen from being too bright. If you find it is too bright for you, just get a higher resistor. Once you are done with this stage you can put the shield on the arduino and see your progress. Plug the arduino into power via usb and the lcd should light up and display ***ArDewIno*** on the top line. If it does, great! Move to the next step. If it doesn't, check your wiring, you crossed wires somewhere.
http://i1242.photobucket.com/albums/gg535/mitaccio/lcd.jpg

Step 5: DHT11

This little blue thing is going to sense the outside air temperature and humidity. The dht11 library will compute the dew point for you. Follow the attached diagram to hook up the dht11 sensor to the shield. Once you are done with this stage you can check on your progress. Power up the arduino and now it will display the temperature, humidity and dew point on the top line of your lcd! If not, you need to check your wiring again, you crossed wires somewhere.
http://i1242.photobucket.com/albums/gg535/mitaccio/dht11.jpg

Step 6: Dallas OneWire

These tiny little black things are awesome! They are able to sense the temperature fast and have unique addresses. This means we can replace them when needed and the coding doesn't need to be redone. Cut the 12' stereo cable in half. Carefully strip the wires and solder them to the OneWire sensor following the diagram (cut the sensor prongs to about 1cm). Make sure that the wiring is the same for both of the sensors. Isolate the three prongs using a small amount of wire tape, then cover the connection and the bottom half of the sensor in heat shrink tubing. I doubled the heat shrink tubing for strength. Hook up the wiring to the shield following the diagram. Make sure the wiring is correct across the plug. Power up the arduino and the second line will now display something other than OTAXX. You should now be displaying the temperature of each sensor. If not, you need to check your wiring again, you crossed wires somewhere. Now, a note: the sensors have a specific address. If both are plugged in, the lower address will be the OTA address. If only one is plugged in, it will default to the OTA address and the other heater display will not be present. You will have to check and see which has the lower address by holding one of the sensors in your hand and seeing which displayed temperature changes. Also, the coding requires that the sensors be plugged in BEFORE you power up the arduino. If you don't, it won't know the addresses of the sensors. It only checks for the addresses once on startup and never checks again.

The display shows when the arduino tells the heaters to run. If the heater is on a "^" will display after the sensor temperature indicating that it is working to bring the sensor temperature up using the heaters.
http://i1242.photobucket.com/albums/gg535/mitaccio/onewire.jpg

Step 7: TIP120

We now have a system that checks the temperatures, calculates the dew point, compares the temperature to dew point and determines when the heaters need to be turned on. Now we power up the heaters. Trim the TIP120 prongs to about 1cm and connect them following the diagram. These things are able to use low voltage (5volts) to control high voltage (12volts in our case). Sorry, there isn't an easy way to check you did these right at this point. Note: the TIP120s are meant to handle a max of 1amp. So make sure your heaters don't surpass!

Step 8: Power

Now we add in our regular power, in this case a car cigarette lighter plug. Follow the diagram on how to power both the heaters and the arduino. Don't worry, the arduino is meant to operate at any power input from 7-12volts with no problem, and will handle up to 20v with minor heat generation. So as long as you are using a car battery or 12volt supply, you will be fine. PAY ATTENTION TO POLARITY, you can't get this one wrong or you will experience the "mystic blue smoke" associated with destroyed electronics. Check that it works as expected.
http://i1242.photobucket.com/albums/gg535/mitaccio/tip120.jpg

Step 9: Fitting it all together

Now it's time to put it all in the case. Start off by putting the black covers on one of the sides and screwing the arduino board in. Next, cut some craft foam (dollar store item) to shape around the top opening where the lcd will go and stick it on. This keeps out any dust/debris and also prevents the excess light the lcd creates from getting out. Screw the lcd in place. Hot glue two of the tan buttons into one side of the black cover that has four holes in it. The other side you will need to trim so that the DHT11 will fit in. At the top of the case you will put the OneWire plugs and the heater plugs. Make sure that they are spaced far enough apart to work, but be aware that the case posts keep you from going out too far. Also make sure they are to the back far enough that they don't touch the lcd. Bring power in from the bottom on the usb side of the arduino. Put the TIP120s on the black back cover using some double sided sticky tape. Now, you should be able to close up the case! If you have followed all these steps it should look very clean and professional, at a fraction of the price of a manufactured unit. Test that everything works by plugging it in to a 12volt power.

Conclusion:

This was a fun little project. I find it satisfying to build something that saves me money or does something I can't buy ready-made. This way I got both. Now I get people asking me what it does and where they can get one. Sorry, but these aren't sold in stores! And while there are other variations of arduino powered dew controllers out there, they lack one important thing, decent instructions. I plan to edit these plans as many times as it takes to make it easy for anyone to build. So comments are appreciated.

Clear skies, and optics!


Edited by mitaccio (07/16/12 08:49 PM)


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

Reged: 03/17/09

Loc: Oahu, Hawaii
Re: How to make an automatic dew controller - Arduino new [Re: mitaccio]
      #5321035 - 07/16/12 08:51 PM Attachment (405 downloads)

Here is the finished product. Sorry, but for some reason my pictures aren't working right, you will have to settle for links on the diagrams for now.

Post Extras: Print Post   Remind Me!   Notify Moderator  
tecmageModerator
Carpal Tunnel
*****

Reged: 01/13/10

Loc: Glenview, IL
Re: How to make an automatic dew controller - Arduino new [Re: mitaccio]
      #5321052 - 07/16/12 09:06 PM



Post Extras: Print Post   Remind Me!   Notify Moderator  
MAURITS
scholastic sledgehammer


Reged: 09/22/09

Loc: Belgium
Re: How to make an automatic dew controller - Arduino new [Re: tecmage]
      #5321354 - 07/17/12 02:07 AM

WAW, what a nice controller!

Post Extras: Print Post   Remind Me!   Notify Moderator  
yashi
super member


Reged: 11/15/11

Re: How to make an automatic dew controller - Arduino new [Re: MAURITS]
      #5321444 - 07/17/12 06:28 AM

well done

but why did you use the Arduino platform, and not just the uC? it takes like ?5? additional Cent items to get it running.

i dont even understand why this arduino thing even exists. :/
why should i use it and not the standard evaluation circuit from the atmegaX manual?


Post Extras: Print Post   Remind Me!   Notify Moderator  
Raginar
Postmaster
*****

Reged: 10/19/10

Loc: Rapid CIty, SD
Re: How to make an automatic dew controller - Arduino new [Re: yashi]
      #5321511 - 07/17/12 08:20 AM

Mit, That's awesome! Thanks for posting such great instructions. Looks like a good rainy-day project.

Post Extras: Print Post   Remind Me!   Notify Moderator  
tecmageModerator
Carpal Tunnel
*****

Reged: 01/13/10

Loc: Glenview, IL
Re: How to make an automatic dew controller - Arduino new [Re: yashi]
      #5321634 - 07/17/12 09:51 AM

Very nice project, and great use of Arduino.

Quote:

i dont even understand why this arduino thing even exists. :/




Arduino was created to extend microcontrollers and embedded systems design to larger audiences. For people not familiar with microcontrollers, Arduino is easier to work with. There's plenty of modules (shields), libraries and code available online to get people going very quickly.

Quote:

why should i use it and not the standard evaluation circuit from the atmegaX manual?




People used to a standard eval board and circuit and programming an ATmega or PIC, probably won't use it. I've been using them to introduce Microcontrollers and Embedded System Design to my students.


Post Extras: Print Post   Remind Me!   Notify Moderator  
yashi
super member


Reged: 11/15/11

Re: How to make an automatic dew controller - Arduino new [Re: tecmage]
      #5322116 - 07/17/12 03:03 PM

Quote:

I've been using them to introduce Microcontrollers and Embedded System Design to my students.




Im not a teacher, but for me it was much easier to work with the C on the binary level. everything is explained in the manual. everything is always based on the same 8bit/2x8bit register system. plus i don't have to learn strange third-party functions.
well what ever works for you is fine i guess

sadly there are almost no viable projects out there..because whatever i could build, i can buy twice as good for half the price darn you china!

Edited by tecmage (07/17/12 03:27 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
elwaine
Pooh-Bah


Reged: 06/18/06

Loc: Jupiter
Re: How to make an automatic dew controller - Arduino new [Re: yashi]
      #5323737 - 07/18/12 02:57 PM

WOW!

I cheated and bought a DewBuster. It doesn't do all of the things your's does, but it sure does the job. Still, I wish I had your talent!!!

Regards,


Post Extras: Print Post   Remind Me!   Notify Moderator  
tecmageModerator
Carpal Tunnel
*****

Reged: 01/13/10

Loc: Glenview, IL
Re: How to make an automatic dew controller - Arduino new [Re: elwaine]
      #5323777 - 07/18/12 03:30 PM

Mitaccio,
I wanted to followup and give you some feedback on your project. If you have room in the enclosure, you might think about using batteries (9V or a few AAs) for the Arduino. I know it will handle up to 20V, but it runs VERY hot.

If you could, post some pictures of the actual project.


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

Reged: 03/17/09

Loc: Oahu, Hawaii
Re: How to make an automatic dew controller - Arduino new [Re: tecmage]
      #5323951 - 07/18/12 06:09 PM

Tecmage, I will get some pics up. The controller is running off of the 12v supply and has no issue doing so. I verified there was no appreciable change in case temp. I chose not to add batteries to run the arduino separately as I didn't want the hassle of having to open the case when batteries die.

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: mitaccio]
      #5401903 - 09/03/12 09:35 PM

Well I have taken on building one of these, but with some enhancements. I had a few challenges with getting the correct versions of the libraries that work with this original source code.

Right now with it outside of the case I have 4 controller circuits set up. The TIP-120 driver transistors are actually rated at 5A continuous and 8A peak. This should be way more than is needed to drive any dew strap. I am looking at putting them on some heat sinks to ensure long life. However, space is at a premium in this small case. I only have room for about 2-1/2 heat sinks. Right now I'm looking at the following three options:

Option A
1) OTA1 - Full heat Sink
2) EyePiece - No heat sink
3) OTA2/Guider - Full heat sink
4) Port4 - No heat sink

Option B
1) OTA1 - Full heat Sink
2) EyePiece - No heat sink
3) OTA2/Guider - 2/3's heat sink
4) Port4 - 2/3's heat sink

Option C
1) OTA1 - Full heat Sink
2) EyePiece - 1/2 heat sink
3) OTA2/Guider - 1/2 heat sink
4) Port4 - 1/2 heat sink

Although I don't need a 4th port, I figured it would be good to have one there just in case and not use it, than to add it on later. Right now I'm looking for opinions on what I should use for a heat sink configuration and am open to other suggestion's too.

You can get an idea of the current requirements of the different size dew straps here:
http://www.scopestuff.com/ss_dnot.htm


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

Reged: 03/17/09

Loc: Oahu, Hawaii
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5401973 - 09/03/12 10:10 PM

I would use a heat sink for your OTA and maybe the guider, depending on its size. I assume you are planning to use this on your 11"? I don't use any heat sinks and have an 8" that causes no issues for the tip120. Very interested to see your build pics.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Perigny270
super member


Reged: 10/23/11

Loc: Temiscaming, Quebec
Re: How to make an automatic dew controller - Arduino new [Re: mitaccio]
      #5402000 - 09/03/12 10:24 PM

Thanks for the details. I have a box of Arduino stuff just wating to go. Sparkfun makes some neat little 5V heating pads too.

Post Extras: Print Post   Remind Me!   Notify Moderator  
bassplayer142
professor emeritus


Reged: 10/03/11

Loc: Michigan
Re: How to make an automatic dew controller - Arduino new [Re: Perigny270]
      #5402898 - 09/04/12 12:22 PM

Nice project. I work with embedded systems at my job currently and can verify that they are a lot of fun even at home. The only real problem is the time it takes to make something and to do it right is pretty extensive.

That's why open source is so great!


Post Extras: Print Post   Remind Me!   Notify Moderator  
Raginar
Postmaster
*****

Reged: 10/19/10

Loc: Rapid CIty, SD
Re: How to make an automatic dew controller - Arduino new [Re: bassplayer142]
      #5406325 - 09/06/12 10:42 AM

Can you make your own straps? I'd like to build the straps and controller.

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: Raginar]
      #5407680 - 09/07/12 02:46 AM

Yes you can build your own dew straps, search the web for "Homemade dew heaters".
There are also much simpler controllers you can build.


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]
      #5407716 - 09/07/12 04:12 AM

I finished building my Arduio based dew controller, I have made a number of changes along the way.

1) I added a separate power input for the dew strap circuits. I'm thinking this way I can run the Arduio off of 5V and the the heaters off of 12V.
2) I put a power diode on each of the heater strip circuits to protect from reversed input power.
3) The cigarette lighter power plug I used is fused with a 10A fuse.
4) I added a third and fourth input sensor (OTA-#2/Guider & Port4).
5) I added a third and fourth output control circuit using digital pins D4 & D13.
6) I added a circuit to control the duty cycle. It is a 100K trim pot between 5V and Ground with the slider going to analog pin A0. You can adjust it through the lower button hole on the front panel.
7) I added TO-220 heat sinks on control circuit's for OTA-#1 and OTA-#2.
8) I drilled a number of holes in the two rear filler panels for additional ventilation.
9) I added additional information to the screen and scroll it.
10) I used a strip of ribbon cable and mounted the DHT-11 Temperature/Humidity sensor to the outside of the case.
11) I added a reset button to the front of the case.

I cleaned up the code some and added some comments, to make it more human readable. I display "ns" for No Sensor. At the top right of the top line I display S= with the number of sensors found.

Right now you can vary the duty cycle between 50-100%. The adjustment is kind of clunky. If I did it again I would use a smaller pot, maybe 5K so the adjustment would be finer. Right now duty cycle runs 20 seconds.

Future changes that I plan to do:
Make the duty cycle a function and call it from the display scroll loop which takes 10 seconds.

Problems I ran into:
1) Finding the correct versions of the libraries.
2) Squeezing all the stuff into the case. I had to cut off one of the case mounting posts and trim up another. I added a blob of hot glue to reinforce the one I trimmed up.
3) One of the cap's on the shield 5V line was shorted.
4) The ribbon cable is fragile and the wires fine. They break very easily.
5) The original code defaulted to having circuit #1 turned on if no sensor is detected.

My current source code:
http://michiana-astro.org/projects/dewctrl/DewCrtl3_20120904.pdf

External Libraries that I used:
http://michiana-astro.org/projects/dewctrl/libraries.zip












If you click on this picture it will show you a short video of the display scrolling.



Edited by Pauls72 (09/07/12 11:23 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Blanston
newbie
*****

Reged: 04/14/12

Re: How to make an automatic dew controller - Arduino [Re: Pauls72]
      #5408388 - 09/07/12 01:48 PM

I have been watching this thread very closely. The project is very cool and you guys have done some fine work. My question is about the Dallas temp sensors. I figure that they need to be placed near the areas you want to monitor like the eyepiece/mirror (in my case)? Wouldn't the heaters affect these sensors when they are working, or do you just have to mount the sensors in the general area?

TLDR: Where do you mount the temp sensors?


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: Blanston]
      #5410139 - 09/08/12 01:54 PM

I just put the sensors right under the heater straps and it has worked well. But I haven't got to use it all that much yet.

Yes the sensor is effected by the heater strap, but it doesn't matter. The temperature under the dew strap will be 10 degrees greater than the dew point. Because nothing is insulated you are radiating off the heat and what ever you are trying to heat will be cooler than under the dew strap anyway. Your objective is not to cook the glass, just heat it up enough to prevent dew from forming.

Right now the code is set to drive the temperature of the Dallas sensors 10F above the dew point. Which means the glass will be something like 5-8F above the dew point. You could always change this value up or down accordingly.

So far the 10F has worked, but I was thinking it may need some tweaking. I recently made this a variable so it's easy to change in the source.

Other recent changes I made to the code:
I added an option to display the temperatures in Fahrenheit or Celsius. I didn't change any of the logic, so everything in the background is still done it Fahrenheit.
I cleaned up the debug output to the USB serial port.
I've redoing the duty cycle and scroll logic to drive the straps at a higher frequency and have the display scroll smoother and consistent.

For those thinking of building one of these, by far this is not the cheapest dew controller that you can build. But it is accurate, efficient and one of the coolest ones out there.

If anyone has any ideas for addition features of functionally, please post it.

Thanks to mitaccio for coming up with this project!


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
13 registered and 25 anonymous users are browsing this forum.

Moderator:  tecmage, rflinn68 

Print Thread

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


Thread views: 22144

Jump to

CN Forums Home


Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics