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 (650 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 new [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 new [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  
bassplayer142
professor emeritus


Reged: 10/03/11

Loc: Michigan
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5410321 - 09/08/12 03:46 PM

Not sure what you mean by clunky movement of the pot and that a 5k Would be better. Is that a logarithmic pot? Another added feature would be automatic power supply detection and shutoff so that batteries are not over drained.

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: bassplayer142]
      #5411113 - 09/09/12 03:14 AM

By clunky I mean the output is not smooth and jumps around as you adjust it. I was thinking the Arduino probably has some type of pull up/down resistors as part of the chip on the data lines and the 100K might be to large to over come this if they are a lot lower value.

The pot is a 100K trim pot from Radio Shack. It doesn't specify anything, so I assume it's linear.

Well I dragged my scope out of the garage attic and took a look at it. The voltage spikes up/down or even doesn't move at times while adjusting the pot. So it looks like it is just a cheap junky pot.

Well I'm pretty happy with my current version of the code.
http://michiana-astro.org/projects/dewctrl/DewCrtl3_20120908.pdf
Changes are:
There is now 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. You just change one Boolean constant in the source.
Cleaned up the debug output to the USB serial port.
Rewrote the duty cycle and scroll logic to drive the straps at a higher frequency and have the display scrolling smoother and consistent.
Duty cycle is now adjustable between 0 and 100%.

Yea, I thought a little about a low voltage detect. Let me think about some kind of simple voltage sense circuit I could make to feed an analog input. My electronics theory is pretty rusty as I haven't used it in years.


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]
      #5411774 - 09/09/12 02:47 PM

I am curious about your putting the DHT11 on the outside, venting the case, and putting heat sinks on the tip120's. Were you experiencing thermal issues inside the case? What size heater straps are you using on the tip120's? Have you found the DhT11 is affected by being inside the case and having only the face exposed? Have you tried both mounting locations and found differing results?

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: mitaccio]
      #5411942 - 09/09/12 04:50 PM

Trim pots are notoriously noisy. Although they work, they are mainly used for single time adjustments/tuning. A larger pot would be cleaner for sure.

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]
      #5411999 - 09/09/12 05:26 PM

I did not even try the DHT-11 inside the case, I may later. I just attached with a a few dab's of adhesive from a hot glue gun. I have it on 3" of ribbon cable.

I just have 3 dew straps at the moment:
11" - DN11, 18.8W, 1.49A (C11)
4" - DN05, 7.3W, .61A (120mm MAK)
2" - DN03, 4.1W, .31A (2" eyepiece)

I took heed of your note of concern for over driving the TIP-120's at 1A. "Note: the TIP120s are meant to handle a max of 1amp. So make sure your heaters don't surpass!" Even though the transistors I used are rated at 5A, I figured the heat sinks would be good insurance. With the heat sinks, I can now use what ever size straps I want and never have to worry. But due to space limitations I only have 2.

Venting the 2 rear filler plugs was no big deal. If I have heat sinks, I figured venting would help too. I didn't go crazy with venting, just did the black filler plugs.

Edited by Pauls72 (09/10/12 10:47 AM)


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: bassplayer142]
      #5412026 - 09/09/12 05:47 PM

A 10 or 15 turn trim pot would work much better, but at night in the dark who would want to be cranking and cranking on a pot. I am slim on room inside the case to put a larger size pot.

All the old electronics stores I used to buy stuff from are gone. So it is pretty much Radio Shack or mail order. I was up at Fry's outside Chicago last weekend getting some PC parts, they have ton's of empty peg's in the electronics dept.


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]
      #5414250 - 09/10/12 10:12 PM

Well I found out today the pdf's I previously created and posted have a number of truncated lines. So here is my current version in PC text format and an Arduino .ino source file.

PC-Text: http://michiana-astro.org/projects/DewCtrl/DewCrtl3_20120909.txt

Source: http://michiana-astro.org/projects/DewCtrl/sketch_DewCrtl3_20120909.zip

Last 2 sets of changes:
Sept 9, 2012 - Version 3.4
Added in storing of high and low values of all sensors in EEPROM. Sorry this part is all in fahrenheit at this time.
Added clearing of EEPROM Dew Destroyer variables with two consecutive powerups or rests with no Dallas one-wire sensors connected.
Added in the ability to run without the duty cycle input pot.
Added in the ability to run without the Voltage detect divider resistors.
Fix a bug in the duty cycle logic.

Sept 8, 2012 - Version 3.3
Added in Voltage Detect and display to the screen.
If low voltage is detected > 11.6V the turn off outputs and stop processing almost forever (400000000 miliseconds or just over 111 hours).
Using a USB cable only to power the Aruindo portion of the project, may result in low reference voltage on the Arduindo board and low or wrong voltage readings.
Added operational time to the screen (time since power up or last reset).
Removed S= number of sensors found from the screen. Information was redundant.

I have added a simple voltage divider network of resistors for voltage detect input. Why did I use 2.2K Ohm resistors, because that's what I had in my parts junk box. I used the 25% of the heater voltage and an input to analog pin 1 (A1). The Arduino has a 5V reference that it uses built in.



A couple of pictures of the inside. There are 2 transistors on heat sinks under the rats nest of wires. The other 2 transistors are on the right side. The 4 large bullet diodes are along the left side.






I was looking and there is an Arduino shield that has an RGB LCD display (color) and 5 buttons. It only used 2 data lines to connect to the Arduino. I was thinking if you drove the display in red it should work for the display and with the 5 buttons you could select all kinds of options/menus. Since it only uses 2 data lines, it frees up some additional digital ones for data input/output. On the down side you would have 2 shields stacked and with the display stacking right on-top of the Arduino you would have to use a different case.

Color LCD Shield: http://www.adafruit.com/products/714


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]
      #5414290 - 09/10/12 10:38 PM

I you click on this picture you can watch the updated video.



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]
      #5414300 - 09/10/12 10:44 PM

I really like the LCD shield, but see one issue I hope they resolve: there isn't a PWM control for the backlight. The display may be too bright for astronomical use. But the 2 pin use is a great idea, couple that with the 5 buttons and it has great potential.

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]
      #5415539 - 09/11/12 03:38 PM

I noticed the temperature results of my DHT-11 sensor always drifted up over time. I still have it external to the case and I have some space under it for air flow. As a test, I left it running overnight on the counter and had all 4 Dallas one wire sensors right by the DHT-11. This morning when I got up it showed it was 8F over the the 4 Dallas sensors. I turned it off for an hour or so and then all 5 sensors where the same again. This was with it running about 7 hours.

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]
      #5418155 - 09/12/12 09:42 PM

Sept 11, 2012 - Version 3.5
High and low temp are now stored in Fahrenheit or Celsius, which ever has been selected.
Correct a previous error I made storing some of the values.
Change sensor high/low storage values to a function.
Change low voltage detect to recover and continue in the event of a low voltage spike.
Make Voltage reading a function.
Start working on cleanup of the code.
Current limitation I found this evening, can not store temperatures below zero.

PC-Text: http://michiana-astro.org/projects/DewCtrl/DewCrtl3_20120911.txt

Source: http://michiana-astro.org/projects/DewCtrl/sketch_DewCrtl3_20120911.zip


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]
      #5420837 - 09/14/12 12:18 PM

Sept 13, 2012 - Version 3.6
Offset sensor values stored in EEPROM by 100 to allow for negative numbers. Value range is now from -99 to +155 for all sensors.

PC-Text: http://michiana-astro.org/projects/DewCtrl/DewCrtl3_20120913.txt

Source: http://michiana-astro.org/projects/DewCtrl/sketch_DewCrtl3_20120913.zip


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]
      #5455016 - 10/04/12 12:26 PM

I have added a RTC (Real Time Clock) and EEPROM (external non-volatile memory) module. What I purchased was a Tiny I2C RTC DS1307 and 24C32 module @ $6.00. There are sever different versions of this board being sold with different combinations of the following three components:
DS1307 - RTC (Real Time Clock with about 50 bytes of it's own EEPROM)
24C32 - EEPROM 32K bit (4K x 8bits or 4K byte).
DS18B20 - Dallas One-Wire temperature sensor.

This module's sells for between $4 and $33 depending who you buy it from. I got mine from Deal Extreme, the only bad thing is the long wait of 10-14 days for shipping.
http://dx.com/p/tiny-rtc-i2c-24c32-ds1307-real-time-clock-module-for-arduino-146677?item=1



The devices are simple to hook up as they use 2 analog pins to communicate over a serial bus using the I2C Philips protocol and the wire.h library.
SDA - Analog pin 4 (A4)
SCL - Analog pin 5 (A5)

DS - Digital pin 3 (D3) connection is optional and would only be used if you have a DS18B20 temp sensor on the board. I see no need for this as there already is the DHT11 to measure temp at the unit. It would also require additional program changes to accommodate a fifth Dallas On-Wire sensor. This sensor would be in parallel with the other 4 Dallas On-Wire sensors for the OTA's, Eyepiece and Aux.



Each device on the I2C serial bus has a unique address and there can only be one of each of the devices per serial bus.
DS1307 = 0x68 (104)
24C32 = 0x50 (80)

The 24C32 EEPROM is a slow device when compared to the Arduino and as I found out the hard way it required some delays to prevent extraneous results.

Right now I give the Dew Controller 15 seconds to stabilize and then save all the values to EEPROM memory. After that I save off the values every 15 minutes (900000 milliseconds) for as long as the Arduino is powered up. Four times an hour just seemed like a reasonable number without being over kill. at 4K you can have 341 sets of data entries 341 x 12 bytes = 4092. I leave a set of blank entries every time the Dew Controller is powered up, this makes it easy to locate. Using the Arduino IDE USB Serial Terminal you can dump the EEPROM memory to the screen and then copy and paste it into a .csv file. This allows you to use the data with a spread sheet program like Excel and then graph the data. There has been several concessions that I made to save on memory, I do not save the year as part of the date and I do not save the seconds in the time. Additionally the voltage is rounded to a single decimal place. Here is an example of what the data looks like:

Dumping stored values
'Current Position = 528'
Memory location,Month/Day,Hours:Minutes,S1,S1,S3,S4,Temp,Humidty,DewPoint,Volts
Address=0,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=12,10/3,21:36,77,77,77,76,78,42,55,13.10V
Address=24,10/3,21:50,77,77,77,76,77,42,53,13.10V
Address=36,10/3,22:5,77,76,77,76,78,42,55,13.10V
Address=48,10/3,22:20,77,76,77,76,78,42,55,13.10V
Address=60,10/3,22:35,77,76,77,76,78,41,54,13.20V
Address=72,10/3,22:50,77,76,77,76,78,41,55,13.20V
Address=84,10/3,23:5,77,76,77,76,78,41,54,12.90V
Address=96,10/3,23:20,77,76,77,76,78,41,54,12.80V
Address=108,10/3,23:36,77,76,77,76,78,41,54,12.80V
Address=120,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=132,10/3,23:41,77,76,77,76,78,41,54,13.00V
Address=144,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=156,10/3,23:52,77,76,77,76,78,41,54,13.20V
Address=168,10/4,0:6,77,76,77,76,78,41,54,13.20V
Address=180,10/4,0:21,77,76,77,76,78,41,54,13.20V
Address=192,10/4,0:36,77,77,77,76,78,41,54,13.20V
Address=204,10/4,0:51,77,77,78,77,78,41,54,13.20V
Address=216,10/4,1:7,77,76,77,76,77,40,52,13.20V
Address=228,10/4,1:22,77,77,77,77,77,41,52,13.20V
Address=240,10/4,1:36,76,76,77,76,77,40,52,13.30V
Address=252,10/4,1:51,77,76,77,76,77,41,52,13.20V
Address=264,10/4,2:6,76,76,77,76,77,40,52,13.30V
Address=276,10/4,2:21,76,76,77,76,77,41,52,13.30V
Address=288,10/4,2:36,76,76,77,76,77,40,52,13.30V
Address=300,10/4,2:52,76,76,76,75,77,40,52,13.30V
Address=312,10/4,3:7,76,75,76,75,75,41,51,13.30V
Address=324,10/4,3:21,76,75,76,75,75,41,51,13.30V
Address=336,10/4,3:36,75,75,76,75,75,41,51,13.40V
Address=348,10/4,3:51,75,75,76,75,75,41,51,13.40V
Address=360,10/4,4:6,75,75,75,74,75,41,51,13.40V
Address=372,10/4,4:21,75,75,75,74,75,41,51,13.40V
Address=384,10/4,4:37,75,75,76,75,75,41,51,13.40V
Address=396,10/4,4:52,76,75,76,75,75,41,51,13.50V
Address=408,10/4,5:6,75,75,76,75,75,41,51,13.40V
Address=420,10/4,5:21,76,76,76,75,75,41,51,13.50V
Address=432,10/4,5:36,75,75,76,75,75,41,51,13.50V
Address=444,10/4,5:51,76,75,76,75,75,41,51,13.50V
Address=456,10/4,6:6,75,75,76,75,75,41,51,13.60V
Address=468,10/4,6:22,76,75,76,75,75,41,51,13.50V
Address=480,10/4,6:36,76,75,76,75,75,41,51,13.60V
Address=492,10/4,6:51,76,75,77,75,77,41,52,13.50V
Address=504,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=516,10/4,6:57,77,76,77,76,77,43,53,13.70V
Address=528,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=540,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=552,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=564,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=576,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=588,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=600,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=612,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=624,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=636,0/0,0:0,0,0,0,0,0,0,0,0.00V
Address=648,0/0,0:0,0,0,0,0,0,0,0,0.00V


Oct. 3, 2012 = Version 3.8
Add support for DS1307 RTC module.
Add support for 24C32 EEPROM (32K bits - 4kx8).
Replace limited data storage of EEPROM with larger I2C_EEPROM.
Added date and time to the saved data.
Reworked the save data routines.
Blank entry to indicate power up.
Save readings after the system has about 30 seconds to stabilize and then every 15 minutes after that.


Sept 17, 2013 = Version 3.7
Save off high and low voltages to EEPROM.
Added Serial commands sent through USB ATE or Ardino Serial Terminal (D or d to dump EEPROM memory, Z or z to zero out EEPROM memory, P or p to pause for 30 seconds).
Data in dumped in a format so you can copy and paste it in a csv file to use with a spread sheet.


PC-Text: http://michiana-astro.org/projects/DewCtrl/DewCrtl3_20121003.txt

Source: http://michiana-astro.org/projects/DewCtrl

One thing I have found that seems to pretty common is that documentation, libraries and example programs for all the different modules and devices is skimpy at best, sometimes wrong and a lot of time won't compile and if it does, it doesn't work or only partially works. The datasheets for the devices (if you can find them) are your best reference materials.

I am planning to hook an IR remote to let you set all the dew controller options without a computer and without adding buttons to the controller. You would also be able to control the LCD contrast and duty cycle and no longer require the (2) 100K trim pots. But unfortunately I let the factory smoke out of the IR sensor module. I have a couple of new ones on order.
http://dx.com/p/ir-receiver-module-wireless-remote-control-kit-for-arduino-1-x-cr2025-135520?item=2


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

Reged: 09/15/10

Loc: Basel, Switzerland
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5462727 - 10/09/12 07:33 PM

This looks awesome. I've recently started working on Arduinos for work so I'm tempted to give this project a go next.

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: UmaDog]
      #5463155 - 10/10/12 12:10 AM

If I had it to do over, there are 2 things I would change:

1) I would use a DHT22 sensor instead of a DHT11. It is more accurate and has a larger working range. It gets well below 0C (32F) here in the winter. They have the same pin out, signal and power requirements, but the DHT22 is double the cost of the DHT11.

DHT11
Good for 20-80% humidity readings with 5% accuracy
Good for 0-50C temperature readings 2C accuracy

DHT22
Good for 0-100% humidity readings with 2-5% accuracy
Good for -40 to 80C temperature readings 0.5C accuracy

2) I would one of these boards to reduce the number of wires to the display.
IIC/I2C/TWI/SPI Serial Interface Board Module For Arduino 1602 LCD Display 5V
http://www.ebay.com/itm/221126389469?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1423.l2649

The biggest obstacle I had was in my initial learning of the Arduino was the large number of different versions of the libraries and example code. The fact that some of these don't compile, do not work at all or work with limited or intermittent results made the learning curve that much steeper.

The fact that you are already working with Arduino's will give you a leg up on most people.


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]
      #5532805 - 11/21/12 06:49 PM

Help please someone!

My sketch has the line:

dht22 DHT22;

The IDE compiler throws up an error:

error:'DHT' does not name a type

I don't know how to sort this one out, can anyone help please?

Thanks


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]
      #5532823 - 11/21/12 07:06 PM

I assume your using the DHT11 library or do you have one for the DHT22?
#include <dht11.h>

If you are using the DHT11 library replace the line with this line.
dht11 DHT11;
Also replace all your references to DHT22 with DHT11.

I believe both devices use the same protocol etc... so they can use the same library.

If you can't get it working, zip up your sketch and libraries and send them to me and I'll take a look at it.


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]
      #5535662 - 11/23/12 02:45 PM

Thanks for replying Paul. I have the adafruit library for both DHT11 and 22.

Someone else told to replace the: 'dht DHT' line with this:

#define DHT22PIN 2
#define DHTTYPE DHT22
DHT dht(DHT22PIN, DHTTYPE);

This got me passed the problem I flagged up. But now there are are problems in the main program loop.

However, I will certainly try what you suggest and let you know the result.

Many thanks for offering to look at my sketch; I appreciate that.

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]
      #5535703 - 11/23/12 03:10 PM Attachment (34 downloads)

Hi Paul,

Well, I did as you suggested, but no luck. It stall at 'dht DHT'. With many other compile errors. So


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]
      #5535709 - 11/23/12 03:12 PM

Paul, something went wrong with the last message. So I'll try attaching the zip file again.

Very many thanks for offering to help. I'm out of my depth with this!

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]
      #5535710 - 11/23/12 03:13 PM Attachment (55 downloads)

I'll try again!!!

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]
      #5535711 - 11/23/12 03:14 PM

That one did it.

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]
      #5535774 - 11/23/12 03:53 PM Attachment (33 downloads)

Hi Paul,

Thought I would also send the sketch with all DHT22 lines; which includes the DHT22.h and cpp files.

If you try compiling this one, you'll see that it is not far from working.

Regards

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]
      #5536101 - 11/23/12 07:06 PM Attachment (49 downloads)

Phil,

I commented out 2 lines, found one typo where you had a DHT1 instead of a DHT11.
Then I ended up using my libraries, at least one of your is different.
So attached is the updated sketch and my whole library folder.

It also was getting an error that the compiled code was too big 18.9K, the max allowed is 14K. Your sketch has the board type set to a Nano w/AT Mega168. I changed it to an Arduino UNO and it compiles. If you really do have an Nano w/AT Mega168 you will need to work at reducing the program size down some.

A couple of other things I would recommend:
Change these 4 values to 5, 10 degrees Fahrenheit difference is way more than you need.
int dewAdjust1 = 10; // 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 = 10; //
int dewAdjust3 = 10; //
int dewAdjust4 = 10; /


Since you in the UK set this value to 1 so your temperatures are displayed in Celsius.
boolean temperatureC = 0; // Set to one to display temperatures on Celsius. Note: All math and debugging is still done in Fahrenheit.

Good Luck,
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]
      #5536641 - 11/24/12 04:36 AM

Hi Paul,

That was quick!! Set to a Nano was it, where is that in the code? My board is a Uno R3.

Ok, I'll give it a try now and let you know how I get on.

Very many thanks Paul.

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]
      #5536677 - 11/24/12 06:10 AM Attachment (27 downloads)

Hi Paul,

Sorry to be a pain, but your complete library was not attached. I've got your revised .ino where I can see the corrected typo. I tried compiling it with the library I have, but no go. I've attached a screen shoot of the errors.

Regarding the file size: I presume then that at 18.9k it will not upload to the Uno. That I will need to reduce the size somehow, perhaps starting with most of the comments. What do you think?

Where in the code is the board set; I can't see it anywhere.

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]
      #5536814 - 11/24/12 08:47 AM

Hi Paul,

I'm trying to find out about sketch maximum size, but have not found it yet. However, I see that the Uno has 32K flash memory of which 0.5K is used by the bootloader. my complete libray is 95.8K; is this a problem?

Please forgive my ignorance of all this, I'm a complete novice! Perhaps I should buy the Arduino book.

Regards

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]
      #5536944 - 11/24/12 10:02 AM

Phil,

The sketch source size and library source sizes makes mo difference. It's the compiled object that makes the difference.

My libraries where too big to attach, so I put them on our clubs web site:
http://michiana-astro.org/projects/dewctrl/libraries.zip

I don't put my libraries in the same folder as the sketches. Here is how I have my folders structured. The Arduino compiler knows to look in the correct folders when you have them like this.

Paul







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]
      #5536975 - 11/24/12 10:24 AM

The maximum compiled sketch size is limited by the amount of flash memory on your Arduino board. It happens that in their naming convention on a lot of the boards, the first part of the number is the amount of memory.

168 = 16k
328 = 32k
1280 = 128k
2560 = 256k



I have a Uno in my Dew Controller which is 32K and an Uno clone from China that I am using for testing/experimenting which is also 32K.

The compiler tells you your object program size when it compiles successfully.



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]
      #5537007 - 11/24/12 10:50 AM

Because a lot of the libraries are open source and put out in the public domain for free anyone can go and change them and they do. So you can find a lot of different versions of a library for the same device using the same name. I struggled learning this the hard way. I am by know means an Arduino or C/C++ expert, but I have learned a fair amount in building this project.

The errors generated by the compiler don't always point straight at the problem. The errors especially get convoluted when you are referencing something incorrectly in a library.

It's no problem helping you. I understand your learning pain as I went through it a few months back. It's extremely frustrating when you have no place to go for any help. In my case it forced me to learn a lot more about the Arduino and C/C++ languages.

I'm sitting here fighting with trying to integrate an Infared remote control into mine. When I just add the library in my Arduino either crashes or goes crazy. I know it's a memory conflict, I just haven't been able to find it.


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]
      #5537274 - 11/24/12 01:49 PM

Paul, You're a gentleman, I really appreciate the help you are giving me. Once I have things sorted I'll be doing the same for some other people here in England. I corresponding with a couple of people who are facing the same learning curve.

However, I'll set up my filing system as you have shown, then give it another go with your libraries. Fingers crossed it will compile for me this time.

I've just ordered a couple of books on the Arduino and sketch wrting - I should have done this first. Trouble is I'm impatient and want things working immediately; I doesn't work like that though, does it.

I'll get back to you later with progress.

Very many thanks again.

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]
      #5537430 - 11/24/12 03:52 PM

Ye Gods Paul, its compiled, uploaded and apparently working!!!

The filing system has clearly worked for me, thank you.

So, one thing I must do is slow down the scrolling speed, as its a bit fast and hard to read. Although I have one Dallas hooked up, its not reading it, so I'll check that its working with a test program. The DHT22 is reading Temp and humidity, but the numbers don't add up, because I haven't yet changed all the Fahrenheit to Celsius lines.

The compiled file is 32.256KB and has obviously uploaded OK.

Later I'll hook up an output so that side of it can be read and displayed.

More later Paul, and very many thanks again.

Best regards

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]
      #5537583 - 11/24/12 05:34 PM

Glad to here you got it working.
There is no need to change the program from Fahrenheit to Celsius. If you change the one parameter then everything is displayed in Celsius.


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]
      #5538091 - 11/25/12 12:13 AM

Hi Paul,

Right, now I have the system partially working, in that the Dallas sensors are detected and giving temperature readouts now in Celsius. So far so good.

However, the DHT22 is not reading correctly, giving crazy figures for temp, hum & dew. So, I ran the adafruit DHT tester sketch. When in DHT11 mode, it returned the same ball park crazy numbers; when in DHT22 mode it returned believeable numbers - temp agreed with my digital thermometer.

Sadly it seems that the protocols are different, so I'll now revert to the DHT22 configuration and try compiling again.

Never mind, it was worth a try. I'm happy though in that things are mostly working. Clearly the heater outputs can't work until the temperatures are correctly reported.

An aside: initially the Dallas senors were not detected, this was due to a jumper link on the proto shield having an LED linked to D3. This was preventing the signal pin from pulling up to 5V. There was also an LED linked to D2, but this was not cause of the DHT problem.

Its now 0510 in the morning, and I'm going to bed!!

Good progress Paul.

Cheers

Phil


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: ThadeusB]
      #5538151 - 11/25/12 01:20 AM

Phil,
Are you sampling too fast? The DHT11 can sample every second (1Hz), but the DHT22 can sample every two seconds (.5Hz).


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: tecmage]
      #5538257 - 11/25/12 04:30 AM

Hi Richard,

You have a point there, I had forgotten about the much slower response of DHT22; I'll try that.

Thank you

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]
      #5538301 - 11/25/12 05:44 AM

Hmm, it isn't clear or obvious to me how to change the sampling rate of the DHT22. Is it defined in the dht.h or dht.cpp files?

All very puzzling to this novice.


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: ThadeusB]
      #5538538 - 11/25/12 11:12 AM

Try adding a 2 second delay. Your system should handle the delay with no problem.

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]
      #5539705 - 11/26/12 01:10 AM

The Delays are easy, just insert a 2000 millisecond delay in front of any call to the DHT sensor in the main program loop:

// ********************Main Program Loop********************
void loop(void)
{
if(powerupDone == 0)
{
powerup();
powerupDone ++;
}

// Keep the Analog input for the duty cycle between 0 and 1000.
dutyIn = constrain(dutyIn, 0, 1000);
dutyOut = map(dutyIn, 0, 1000, 0, 1000);
delay(2000);
int chk = DHT11.read(DHT11PIN);

//Lcd display for ambient temp, humidity and dew point on line 1. Remote temps for LX200, ED80, EP & Box on line 2.
lcd.setCursor(0,0);
lcd.print("Temp=");
if (temperatureC != 1) {
delay(2000);
lcd.print(((int)DHT11.fahrenheit()+correctionDHT), DEC);
delay(2000);
sensorhigh = (int((int)DHT11.fahrenheit())+correctionDHT);
sensorStorage(sensorhigh, 15, 25);
}
else{
delay(2000);
lcd.print(((int)DHT11.celcius()+correctionDHT), DEC);
delay(2000);
sensorhigh = (int((int)DHT11.celcius())+correctionDHT);
sensorStorage(sensorhigh, 15, 25);
}


// Display DHT-11 Humidty value
lcd.print(" Hum=");
delay(2000);
lcd.print((int)((float)DHT11.humidity), DEC);
lcd.print("%");
delay(2000);
sensorhigh = ((int)((float)DHT11.humidity));
sensorStorage(sensorhigh, 16, 26);

// Display DHT-11 Dew Point value
lcd.print(" Dew=");
if (temperatureC != 1) {
delay(2000);
lcd.print((int)((DHT11.dewPointFast()*1.8+32)), DEC);
delay(2000);
sensorhigh = ((int)(DHT11.dewPointFast()*1.8+32));
sensorStorage(sensorhigh, 17, 27);
}
else {
delay(2000);
lcd.print((int)(DHT11.dewPointFast()), DEC);
delay(2000);
sensorhigh = ((int)(DHT11.dewPointFast()));
sensorStorage(sensorhigh, 17, 27);
}

// Display the duty cycle settings


It also looks like you will need to do a little tweaking of the DHT11 library to handle the DHT22. You can see the differences in what would be required the library code here:
http://arduino.cc/playground/Main/DHTLib
They both return 40 bits of data, 16 bits humidity + 16 bits temperature + 8 bits of checksum. It's just the DHT11 only uses the first 8 bits of the humidity and first 8 bits of the temperature.
DHT11 = 8 bits humidity, 8 bits filler, 8 bits temperature, 8 bits filler, 8 bits checksum
DHT22 = 16 bits humidity, 16 bits temperature, 8 bits checksum


Device data sheets.
DHT11 http://www.micro4you.com/files/sensor/DHT11.pdf
DHT22 http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Weather/RHT03.pdf


You can open up the library files (.h & .cpp) with notepad or a text editor. I prefer Textpad. http://www.textpad.com/
Just make sure you save off a copy before you do any edits.

Edited by Pauls72 (11/26/12 01:16 AM)


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]
      #5539743 - 11/26/12 02:07 AM

Phil,
I had a nice long explanation typed up and then closed my browser instead of just one tab and lost everything. Anyway do you understand what is going on in this line of code?

lcd.print(((int)DHT11.fahrenheit()+correctionDHT), DEC);

If not I'll type up an explanation for you on some of the basics.
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]
      #5539925 - 11/26/12 08:27 AM

Paul,
Odd you say about typing up and then losing it; my last message suffered a similar fate, typed, clicked on continue and it dissapears - annoying.

However, Thanks again! Putting in delays doea nothing bu cause the LCD to freeze for around 15 secs; as might be expected. The DHT readings still the same.

So, I'm starting to look at your suggestion re- tweaking the dht11 files.

lcd.print(((int)DHT11.fahrenheit()+correctionDHT), DEC); I had assumed this to be a tweak to correct DHT measured T, to correct it to actual T. I may be wrong.

I would appreciate some info on the basics. When writing up long messages, I tend to do it my word processor first, then paste into whatever forum; less chance of losing things that way.

I like Textpad. Good because it can be set up with line numbers - very useful. I had been trying to find this kind of text editor. Thanks for the link.

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: Pauls72]
      #5540095 - 11/26/12 11:01 AM

Hi Paul,
Well, I've had a long read of the Arduino article, have opened the h and cpp files, but I remain in the dark.

I understand bits and bytes etc. However, in this extra from the cpp file we are using, I can't relate anything to byte quantity or how many bytes in the data string:

// READ OUTPUT - 40 BITS => 5 BYTES or TIMEOUT
for (int i=0; i<40; i++)
{
loopCnt = 10000;
while(digitalRead(pin) == LOW)
if (loopCnt-- == 0) return -2;

unsigned long t = micros();

loopCnt = 10000;
while(digitalRead(pin) == HIGH)
if (loopCnt-- == 0) return -2;

if ((micros() - t) > 40) bits[idx] |= (1 << cnt);
if (cnt == 0) // next byte?
{
cnt = 7; // restart at MSB
idx++; // next byte!
}
else cnt--;
}

The comment refers to 5 bytes, but that's the only bit that I understand.

The upshot is that I have no idea how to go about sorting this out. Except, perhaps I should buy a DHT11 and accept the lower specification.
Very frustrating.

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]
      #5540296 - 11/26/12 01:22 PM

Well if you get a DHT11 you can be up and running right away. You can always upgrade to the DHT22 later. I see you can get them on Amazon for 3.50 ($5.60 USD).

I take a look at converting the library, but it won't be for a few days. I don't have a DHT22. I have no local electronics stores anymore other than Radio Shack (If you can call them an electronics store). So currently I would no way to test it.


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]
      #5540450 - 11/26/12 02:48 PM

Paul,
I've just ordered a DHT11 from ebay; 2.70.

What I haven't done is to try to analyse the DHT22 testing sketches, they may give me some clues.

I'll keep on messing with this and let you know the outcome.

Again, I very much appreciate your help with this, but I don't want you to go to too much trouble.

If it comes to it and I can't sort out the DHT22 issues, I could buy one and have it sent to you: what do you think?

The other way is to find out why the DHT22 librairies won't compile with my sketch, when everything changed to 22 from 11. That must be in the *.h and/or *.cpp files. I' will take a look at this too.

I will get there, I do not give up easily.

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]
      #5540598 - 11/26/12 04:17 PM

Paul,
Another option: when I get the DHT11 and presumably will have it working, I could mail the DHT22 to you, for you to play with, keep and use for yourself. If a resolution to the problem if found by you, I then buy another one for myself.
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]
      #5540745 - 11/26/12 06:05 PM

Phil,
No need to send me one. I will order a couple of DHT22's for myself.
To get them cheap (under $5) and with free shipping requires I get them from Hong Kong or other parts of China. Which means 10-14 days shipping.

To order one from someplace in the US is at least $10 or more plus shipping and handling. So your looking at $15 - $30 for just one. Then people wonder why we buy stuff from China.

Regards,
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]
      #5540814 - 11/26/12 06:54 PM

If you're sure Paul, its very good of you to do this.

It never ceases to amaze me how cheap stuff is from China and, often with no postal charge for small items. It has to be done on retirement money!

I'm still trying to crack the problem.

Regards
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: Pauls72]
      #5540815 - 11/26/12 06:54 PM

Phil,

If I am starting out to basic for you I apologize.
Lets start with the Arduino reference, it contains a list of all the reserved words and what they do.
http://arduino.cc/en/Reference/HomePage

Libraries
When you include a library in your program, the whole library and any external libraries or files that it references become part of your program.
#include <EEPROM.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#include <dht11.h>
#include <math.h>

Variables and Constants
This is a space in memory that you allocate to contain a value of data. How it's defined, it's size and what you can do with it all depends on how you define it.
int is a signed integer number and is 16 bits or 2 bytes in size, it can contain any whole number between 32,768 and 32,767.
unsigned int is an unsigned integer number and is also 16 bits or 2 bytes in size, it can contain any whole number between 0 and 65,535.
long a signed integer number and is 32 bits or 4 bytes in size, it can contain any whole number between -2,147,483,648 and 2,147,483,647.
No decimals or fractions are used or allowed in integer or long type variables.
float is a floating point or decimal number and it is a 32 bit or 4 bytes in size, it can contain and number between 3.4028235E+38 and -3.4028235E+38. It is accurate to 6 or 7 decimal places.
double is a floating point or decimal number and it is a 64 bit or 8 bytes in size on some processors and allows for greater accuracy and larger numbers. However on the Arduino Uno it is treated exactly the same a a float.
So the big advantages of these are you can cram large numbers into small spaces in memory. When you define some thing as a char (character) or byte you need to declare an array of them (group) to store a value. They can each only hold one character or digit of a number.
So in int form the value 32,767 takes 2 bytes to store, float takes 4 bytes and in the form of a byte or char would take 5 bytes.
Computers are very good and fast at performing integer math. They are not nearly as fast or accurate at performing floating point math.
String is an special object, it is an array or group of bytes all in a row, and it allows you to access them all as one variable instead of a a group of characters one at a time.

Reserve words and inbuilt functions
So lets start with something simple and partially explain one of these reserved words.
Serial.print();
Serial is a reserved word and it performs a series of functions depending on what comment you put after it. The print tells the system to output the data between the prentices () to the USB serial port. You can open the serial port monitor with in the Arduino compiler and see what is being sent. This is a good tool to use when debugging.
http://arduino.cc/en/Reference/Serial

Serial.print("ABC123 This is a test"); Will send 'ABC123 This is a test' out the USB serial port. The text data must be enclosed by double quotes.

String MyString = "ABC123 This is a test"; This creates a string variable in memory named MyString and loads it with 'ABC123 This is a test'.
serial.print(MyString); Will send 'ABC123 This is a test' out the USB serial port.
So you say why bother. Well if you use the same string of data over and over, every time you have it in our source code it uses up a bunch of memory. When you define it as a variable or constant it only take a few of bytes memory to reference that variable or constant, thus saving you memory.

Serial.printnl(MyString); This sends the same data to the serial port and it sends a carriage return and line feed characters after the data to move the cursor down and to the beginning of the next line.

Serial.println(); This acts just like you have pressed the enter key and just moves the cursor down to the start of the next line.

Math, passing values and Cast
So lets do a little bit of passing values and math.
long MyLong;
float MyFloat="33.999";

MyLong = MyFloat; The compiler will generate a warning or error because the variables are of different types.
MyLong = ((long)MyFloat); This will tell the compiler to take the value in MyFloat and treat it as a long type variable instead of a float and copy it to the MyLong variable throwing away the fractional part of the number. It is called a "cast". It tells the compiler you are aware the variables are different types and are the aware of the consequences. It is commonly used to convert one type of number into to a different form. A kind of converting on the fly.
MyLong = ((long)MyString); This will will not work and you can not convert a string to a any number this way.

Serial.printnl(MyFloat); This will output '33.999' to the serial port.
Serial.printnl((long)MyFloat); This will output '34' to the serial port.

Class or Function
A class or a function is just a part of a program that you call to perform a specific task or set of tasks. In olden days it was know as a subroutine. Either of these can programed to accept variables or pointers passed to it and they can also be programed to return results or variables too. Both of these can be in your main code or in an included library.
So lets suppose we create a function called DoubleIt. It's job in life would be to take what ever you passed to it and double it and return the results to you.

We will declare some variables:
int MyIntResults;
float MyFloatResults;
String MyStringResults;

So we will call our function and place the results in the variable to the left of the equal sign. We also will pass the function a parameter to tell it what type of variable we are sending it. I for int, F for float or S for String.
MyIntResults = DoubleIt(2,I); Would give you a '4'
MyIntResults = DoubelIt(DoubleIt(2,I)); Would give you a '8'. Yes we can call a function from within a function.
MyFloatResults = DoubleIt(2.222,F); Would give you a '4.444'
MyStringResults = DoubleIt(2,S); Would give you '22'

Now if we are a good programer we could write the DoubleIt function figure out on it's own what type of variable you are passing to it. You could even program your DoubleIt function to accept a picture or file name and double it and return the results too. The possibilities are almost endless.

int x = 3;
int MyIntResults;
MyIntResults = x+1; Would give you a 4 and x still contains 3.

int x = 3;
int MyIntResults;
MyIntResults = ++x; Would also give you a 4 and x now contains a 4. ++ and -- tells the compiler to increment or decrement the number. It make a difference if you place it to the right or left of the value as to when it does it.

int x = 3;
int MyIntResults;
MyIntResults = x++; Would give you a 3, but x now contains a 4.

Finally Something Practical
So lets finally get to this:
lcd.print(((int)DHT11.fahrenheit()+correctionDHT), DEC);

lcd.print(); Calls the print function in the lcd library and tells it to output the data inside the prentices ().
lcd.print((), DEC); Calls the print function in the lcd library and tells it to output the data inside the first set of prentices () as a decimal number.
DHT11.fahrenheit(); Calls the Fahrenheit function inside the DHT11 library, and after reading the results of the DHT11 it is returned in Fahrenheit as a floating point number.
(int)DHT11.fahrenheit(); Calls the Fahrenheit function inside the DHT11 library and treat the results as an integer instead of a floating point number.
+correctionDHT Tells the compiler to add the varable 'correctionDHT' to the results. I do this because my DHT11 is always off by about 2 degrees, so I add '-2' to lower the results by 2 degrees.

Something else practical
// ********************LX200 tests********************
if(sensors.getAddress(LX200, 0)) {
if (ts0 >= 1){
sensorStorage(p1, 11, 21);
//if(Meade <= 80) { //This line used for testing
if(Meade <= DEW+dewAdjust1) {
digitalWrite(5,HIGH);
}
else
{
digitalWrite(5,LOW);
}
}
else
digitalWrite(5,LOW);
}
***************************************************************
If the first Dallas OneWire Sensor #0 is present, call the function I wrote to store off the high and low values for the sensor readings to EEPROM memory. I pass 3 values to the function, the temperature, the storage locations for the high and then the low values. This allows me to use the same function for any sensor, no matter how many I have, including both the OneWire and DHT sensor.

If the OneWire temperature is less than 5 degrees above the dew point, turn the output to the transistor on.

If the OneWire temperature is greater than 5 degrees above the dew point, turn the output to the transistor off.

If the OneWire temperature is not present turn the output to the transistor off.

Anything after // is a comment and can be ignored.
Anything between /* and */ is also just a comment.

The Arduino language is very similar to C++. Both are OOP type languages (Object Oriented Programing). You can pass variables, pointers to variables, functions, classes and the results of classes and functions all over the place. It makes it very powerful, but it makes it difficult to read and understand.

Hopefully I have given you enough information so you can read and understand some of the code.

Regards,
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]
      #5540818 - 11/26/12 06:56 PM

Ye Gods! I didn't expect all that; basic is good for this leaner.

Thank you.

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]
      #5541237 - 11/26/12 10:51 PM

Phil,
If you have specific questions just ask an I'll do my best to explain it, if I can. I didn't go too deep into any one piece, just touched on a lot of stuff. I could probably spend a easy half of day on just variables and constants.

One other thing you need to understand is arrays. You can declare array of any type of variable. So lets say I want to store 5 sets of sensor results, I could declare the following as variables.
int sensorResults0;
int sensorResults1;
int sensorResults2;
int sensorResults3;
int sensorResults4;

or you can also do the following:
int sensorResults0, sensorResults1, sensorResults2, sensorResults3, sensorResults4;

Both of these do the exact same thing, they declare 5 variable in memory of type integer.

So lets make an array of integers to store the same 5 values:
int sensorResults[5];

So now there is an array of 5 instances of sensorResults. To access them you use an index value.
sensorResults[0]; This is the first occurrence of sensorResults.
sensorResults[4]; This is the last occurrence of sensorResults.

So then instead of putting a value in the index, you can put a numeric variable in the index.

int sensorResults[5];
for (int MyIndex = 0; MyIndex < 5; MyIndex++){
sensorResults[MyIndex] = MyIndex;
}

So we have a small loop that loads the array with 0 to 4.
sensorResults[0] will have 0
sensorResults[4] will have 4

You need to understand this is close to a machine language and zero is a valid number and all counting starts at zero. Zero is a real number.

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]
      #5541896 - 11/27/12 11:22 AM

Hi Paul,
So far so good with the first set of info you sent, all very understandable. I'll read the second one tonight. Many thanks.

I should have the DHT11 tomorrow. I am just finishing the wiring now, so I should have the build finished tomorrow too. I'll take a couple of photo's to send when complete. Its very neat and should be reliable.

I should also have a couple books on Arduino programming in a couple of days. What I want to know now is exactly how the .h and .cpp libraries work. I've closely compared the adafruit and Arduino.cc DHT libraries, and can see the differences between them and your files, but its not yet clear what controls the bits and bytes. If bits and bytes are the only real difference then, it shouldn't be hard to tweak your libraries. I'm experimenting, but without success yet. It will come.

My wife looked up your location on the USA map; she was curious to know where you live. Not a million miles from where all my relatives live in and around Toronto!

As a matter of interest, what is your background?

Best regards

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]
      #5542410 - 11/27/12 04:23 PM Attachment (29 downloads)

Phil,

I ordered a DHT22, I should have it in about 10 days.

I tried to modify the working DHT11 library to work with a DHT22 instead.
I have no way to test it, so you will need to do that.
Go back to the set of programs and libraries that kind of worked but gave you crazy results. Everything in your main program should point to DHT11 for now, we will fix that later.

In the Libraries/DHT11 folder, replace the dht11.cpp with the attached one. Compile and upload and see if your temperature and humidity results are right.

If you open up the Serial Monitor in the Arduino Compiler/IDE (Interactive Developer Environment) make sure it's set to 9600 baud, you should something like the following. Just to remind you all the background math and debugging to the serial port is in Fahrenheit.

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]
      #5542610 - 11/27/12 06:41 PM

Hi Paul,
I've only just picked up your last post, as I've been busy buiding the box and wiring it. Its at on my desk reading out the Dallas temperatures. It looks good.

I've used the serial monitor quite a lot in fact for doing precisely what you say.

So now, its back to the IDE and try your new cpp file. Fingers crossed. I'll report back shortly.

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]
      #5542627 - 11/27/12 06:55 PM

Paul, you are a genius, its worked!!!

The reading are believable. My digital thermometer reads 21.4C, the DHT returns Temp=19C; hum=61%, Dew=13

It responds to me blowing on it, again, believable.
Amazing; so the next thing is get all the heaters hooked up and see if the whole thing behaves as it should - no reason why not I think.

As we say here, you're a good bloke.

So, no need to mess about with the DHT11 now - good stuff.

Paul, I can't thank you enough for what you have done, I am so grateful.

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]
      #5542673 - 11/27/12 07:25 PM

Paul,
I'm still checking it out; I have two heaters connected which do warm when the DHT temperature is raised a few degrees. So, it seems that it works correctly. So tomorrow I'll have all 4 connected and run some quantitative tests to determine actual temperatures and transistor switching points.

Paul I am delighted!

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]
      #5542681 - 11/27/12 07:29 PM

Also, I'll closely monitor temperature comparison between DHT and external digi thermometer. I should see then whether the correctionDHT needs to be changed.

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]
      #5542910 - 11/27/12 09:50 PM

Phil,

Great, glad to here it works.
Since correctionDHT is a variable, you can just set it to 0 (zero) if you don't need to do any correction.

I sent you a PM with my background.

Regards,
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]
      #5543167 - 11/28/12 01:02 AM

Hi Paul,
I have just had all 4 outputs running. I have tested it such that I can see each output switching individually, with the '^' beside an enabled output. I can follow the rise in temperature and see the switch off point, which coincides with the differential. The precision is better than I can see with my thermometer. Accuracy I not sure of yet, since all 4 Dallas sensors and the DHT22 disagree with my thermometer, as does the DHT22. The screen shot reveals all. Its possible that my DHT also reads about 2 degrees low.

All looking very good. So the next thing is to get it up on the scopes and run it for real.

Photo's following.

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]
      #5543170 - 11/28/12 01:03 AM Attachment (27 downloads)

The attachment didn't do so, so here goes again

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]
      #5543202 - 11/28/12 01:38 AM Attachment (28 downloads)

Photo's attached.

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]
      #5543205 - 11/28/12 01:40 AM Attachment (39 downloads)

Seems that only one photo can be attached per post:

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]
      #5543207 - 11/28/12 01:41 AM Attachment (39 downloads)

And finally:-

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]
      #5543213 - 11/28/12 01:55 AM

Hi Paul,
I think the next thing to do is to include a switch selectable voltage divider, instead of the pot to control the duty cycle. I'm thinking to have 3 or 4 percentages for this. Very easy job but I may find it hard to find switches small enough to fit in a crammed box. Or, if space is a problem I could just bring out a small pot with knob and calibrated scale. I'll consider this in a day or two.

Best regards

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]
      #5544277 - 11/28/12 05:41 PM Attachment (30 downloads)

Phil,

I thought about having several switches or a rotary switch with voltage divider for duty cycle. Then I settled on a pot because it was the easy, quick and required little room. My long term plan is to implement an Infrared Remote control to be able to set most of the variables through it and then remove the pot's for duty cycle and LCD screen contrast.



It hasn't gone well so far. I let all of the factory smoke out of the first IR sensor. No documentation and I got the + supply voltage and signal lines reversed. I was several weeks to get some new ones. Now when I just add the IR library to my program, the Arduino screen goes crazy. I have a small little test program that the IR sensor works, it's just finding the conflicts between the library and something else...

You setup and construction looks nice, neat and clean. If you don't think you have room, you need to look at my rats nest. I accidentally pushed it against the hot soldering iron the other day, so now the top right corner is kind of melted.



I have a new version of the dht11.cpp file for the library attached that I would appreciate if you can try. What it does is looks at the data and decides if it is a DHT11 or DHT22 and returns the proper results. So then the same library can be used for both sensors. It works with my DHT11.

You might want to look at some of the Arduino tutorials on the internet. Some these are reasonably good.
http://www.youtube.com/course?list=ECA567CE235D39FA84&feature=plcp

Regards,
Paul


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: Pauls72]
      #5544688 - 11/28/12 10:19 PM

Awesome work here. Wish I had some more time to play with my own designs and contributions.

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: bassplayer142]
      #5545301 - 11/29/12 10:48 AM

Hi Paul,
Soldering irons; dangerous weapons. Swapping wires= smoke (sometimes)!

The IR idea is a very good one; a useful variable to include would be temperature differential.

I'll test the new cpp later, as I'm soak teasting at the moment with all heaters connected.

Question: I'm trying to work out the logic of Dallas identification. They are firstly identified by their hex addresses:

DeviceAddress LX200 = { 0x28, 0xEB, 0xF5, 0x4A, 0x04, 0x00, 0x00, 0xDE }; // Dallas 0
DeviceAddress ED80 = { 0x28, 0x2A, 0xDC, 0x4A, 0x04, 0x00, 0x00, 0x7D }; // Dallas 1
DeviceAddress EP = { 0x28, 0x8A, 0x54, 0x4A, 0x04, 0x00, 0x00, 0xD4 }; // Dallas 2
DeviceAddress Box = { 0x28, 0xBA, 0xDF, 0x4A, 0x04, 0x00, 0x00, 0x82 }; // Dallas 3

Then we have:

boolean sv1, sv2, sv3, sv4; (sensor variable?)
byte sensorhigh, sensorhigh1, sensorhigh2, sensorhigh3; (0,1,2,3 ?)

// ********************LX200: tests** Dallas, 0, O/P D5
if(sensors.getAddress(LX200, 2)) {
if (ts0 >= 1){
sensorStorage(p1, 11, 21); where the comment refers to Dallas,0

What I'm getting at is that how does the code know which hex address relates to which one of the 0, 1, 2 &3 designations. Is it defined by the order in the code.

Why I ask is that when I first had it all running, the outputs didn't correspond to the inputs. I haven't checked yet I I think I have the hex addresses in the order as above:I will be checking that,in the serial mointor, which I presume, orders them by 0, 1, 2 & 3 ranking.

I had my mind a total knot over this yesterday.

I suspect that I do have something crossed over in the code somewhere, because if I run the box with 3 heaters, the 3 displayed don't make sense. If I run it with 1 heater it displays all 4 heaters at the same temperature. Running all 4 heaters, the displayed values correlate with what is happening at the heaters & sensors.

Once I know the true relationship between hex addresses and binary, I'll be able to work through the code to see what I've done wrong.

In fact I have seen some of those tutorials; not bad.

As a matter of interest what power are your heaters? I'm having a debate with someone over here who is going to use to high a power level, I believe. Some reseearch indicates that around 15 Watts for a 10" SCT; around 5 Watts for a 2" EP, 3 Watts for 1.25" EP. So this is what I have done. This other guy is going for 15 Watts for an 8" SCT. I think he may find that too tapid heating is going to cause rapid differential expansion of the corrector plate = rubbish viewing. Your thoughts would be appreciated.

Got to do some stuff around the house now, so more later.

Best regards

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]
      #5545432 - 11/29/12 12:09 PM

The whole Dallas OneWire temperature sensor world is kind of different. Each IC (Integrated Circuit) device is built with a unique address imbedded in it and no two are ever supposed to be the same. All the input ports are in parallel on the same serial buss. So which one is plugged into which input port makes no difference, that is because we use the device address not the port. The way the program works, is it takes the lowest address device and makes it input number 1. The next is number 2 and so on. So next time you power up or restart if you have the lowest address device unhooked, the next lowest address device would become number 1 because it is the lowest address device that we see. Any output ports that do not have an input sensor attached are turned off automatically.

If you look at my picture you can see the input sensor plugs are marked with coloured electrical tape. The sensor ends are also matching colour coded too. In my case Blue=1, Yellow=2, White=3 and Red=4. I have a label on the back of my unit with this information.

Yes it would be possible to take the address of each Dallas device and tie it to a specific output port in the program. The down side is if that sensor goes bad or the wire breaks, you are out of commission. You would then have to change the program once you get a new sensor to accommodate the new address.


I am using Dew-Not commercial dew straps:
11" SCT DN012 which is roughly 19 watts
4" (102mm) MAK DN005 which is roughly 7.5 watts
2" Eyepiece DN003 which is a little over 4 watts
1" Eyepiece DN002 which is a little over 3 watts
http://www.dew-not.com/specifications.htm

Don't forget when you reduce the duty cycle are effectively reduce the wattage. So I am running my at roughly 80% duty cycle, so my C11 19 watt dew strap is effectively running at 15 watts. It is running at 19 watts roughly 80% of the time.


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]
      #5545453 - 11/29/12 12:25 PM

Sorry, you are looking at the serial monitor and yes, that's an bug with the original code. This should take care of it:

Original source code:
//print Temperature to the USB serial port
Serial.print("OTA-1: ");
Serial.println(Scope);
Serial.print("Eyepiece: ");
Serial.println(Eye);
Serial.print("OTA-2/GuideScope: ");
Serial.println(Guide);
Serial.print("Aux Port #4: ");
Serial.println(Port4);


Changes to fix the serial monitor:
//print Temperature to the USB serial port
Serial.print("OTA-1: ");
if (ts0 >= 1) Serial.println(Scope); else Serial.println();
Serial.print("Eyepiece: ");
if (ts0 >= 2) Serial.println(Eye); else Serial.println();
Serial.print("OTA-2/GuideScope: ");
if (ts0 >= 3) Serial.println(Guide); else Serial.println();
Serial.print("Aux Port #4: ");
if (ts0 >= 4) Serial.println(Port4); else Serial.println();


In your case it would be:
//print Temperature to the USB serial port
Serial.print("LX200: ");
if (ts0 >= 1) Serial.println(Scope1); else Serial.println();
Serial.print("ED80: ");
if (ts0 >= 2) Serial.println(Scope2); else Serial.println();
Serial.print("EP: ");
if (ts0 >= 3) Serial.println(Eyepiece); else Serial.println();
Serial.print("Box: ");
if (ts0 >= 4) Serial.println(EPBox); else Serial.println();


Edited by Pauls72 (11/29/12 12:57 PM)


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]
      #5545616 - 11/29/12 02:10 PM

Paul,
Got it, I see now why I get what I get. So problem as such. I have my outputs labeled and the leads are paired and marked up so that's ok.

Now, I have been running the box all day, however, the outputs only switch on when the DHT22 temperature is greater Dallas temps. If I warm the DHT, then the outputs switch on. I had presumed that the idea of the system was to maintain the heaters at the preset level such that each bit of glass is raised that many degrees above ambient. Have I got this all wrong?

int dewAdjust2 = 4; // this I believe is + (plus)4 degrees. Above DHT?

If I have presumed correctly, could this mean that the correction factor of -2 is incorrect for mine?

Re- dew heaters. Good, it seems that the figures I have chosen are in the right ball park. I have my duty cycle set at 85% at the moment as its below freezing now.

Its now dark and clear in our part of the world - for a change - so I'll see how it goes now that scope heat radiates off. I should then see temperature differential between the skyward end of the scope compared to the DHT22.

Its a great learning curve!

I now have the two Arduino books. The basic one you have pretty much covered with your turorials, indeed you've covered a bit more. So what I'll do is go line by line through the code and try to understand it. I'll ask you If I need to - I'm sure I will need to.

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]
      #5545622 - 11/29/12 02:15 PM

I have just realised I have completely missed the point of this device; its that the T differential is to raise the heaters that number of degrees above DEW POINT.

That has to be it!?


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]
      #5545657 - 11/29/12 02:45 PM

Phil,
Unfortunately work interferes with my hobby, so I can't do too much at the moment.
You are correct, the heaters only come on when the dallas sensor for that output falls below dewAdjustX + the dew point.

So if we say the dew point = 15, and dewAdjust1 = 4, then we will strive to keep the heater on port 1 on until the dallas sensor for port one is at 19 or higher. Then we will turn the heater off until the temperature of the dallas sensor drops below 19.


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]
      #5545995 - 11/29/12 06:40 PM

Hi Paul,
Now then, I have had something quite unexpected going on. When the heaters are in the on state, I'm not getting the expected heating; I thought I had failed Darlingtons. So I rigged a 12 Volt bulb to attach to each output in turn. What happens is that the bulb flashes at a few Hertz; can't say just what but in the 10 Hertz ball park. Then every roughly 17 seconds it will burn bright for about 1.5 seconds, then back to the flashing. Adjusting the duty cycle makes no difference. The pin 13 LED flashes in the same way.
Adding up delays, I think the loop iteration time is 16.5 secs; so there is probably a correlation here.

I have proven its not a psu problem.

It gets worse: powering up again, the LCD displayed nothing. So now back to the PC and hook up the USB. Check serial monitor to see that it read the first iteration then stopped - no activity at all. The Pin 13 LED should flash on loop re-iterations; it had previously. I did a fresh upload in case the sketch had corrupted; no difference.

I think I shall now run some other sketches to test the Arduino board.

Annoying and very frustrating, as I thought I was almost there with it all.

Phil


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: ThadeusB]
      #5546104 - 11/29/12 07:31 PM

One golden rule of electronics is that a working prototype ceases to work when you show your boss . A neat and cleaner addition would be Bluetooth. A low power wireless alternative that supports spp serial port virtualization. There is a free android app I run which can act as a Bluetooth com port giving you control and data viewing on your phone, tablet, or PC.

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: bassplayer142]
      #5546404 - 11/29/12 10:51 PM

Yep, it pulse like that. Changing the duty cycle should change the width of the on/off pulses. The amount of time your light would be on, not the frequency of it. The frequency is tied directly to the display scroll rate.

int noDutyCycle = 1; // Set this to 1, to use without duty cycle input and run the heaters at 100%,

I connected my dew straps direct to the 12V supply and they get hot. I never realized that the Dew heater straps only get warm to the touch when hooked up to the controller. I'll take a look at it and see why.

With opening and closing mine, more than once I have broken a wire.


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]
      #5546484 - 11/30/12 12:05 AM

OK, I found it. On one line I have an = sign and it should be ==.
= is the assignment operator, so it was placing 100 in the value instead of testing against against 100.
== is the is equal to test.

So it was forcing the value to 100 which = 10%. So the duty cycle was always at 10%.


Problem section:

//********************Scroll the display********************
for (int positionCounter = 0; positionCounter < 40; positionCounter++){
voltsDC = getVoltage();
lcd.setCursor(33,1);
lcd.print(voltsDC);
lcd.print("V");
// Display the time since last power up or reset
if(dutyIn = 100) lcd.setCursor(32,0);
else lcd.setCursor(31,0);
displayTime(RTC_UpTime);
lcd.scrollDisplayLeft();
// scroll one position left then wait & call the duty cycle function
// you can change the frequency of the duty cycle & scroll speed by changing the number of times you go through this loop
for (int iCnt1 = 0; iCnt1 <= 3; iCnt1++) {
dutycycleloop(dutyIn, dutyIn);
}
}


Correction:

//********************Scroll the display********************
for (int positionCounter = 0; positionCounter < 40; positionCounter++){
voltsDC = getVoltage();
lcd.setCursor(33,1);
lcd.print(voltsDC);
lcd.print("V");
// Display the time since last power up or reset
if(dutyIn == 100) lcd.setCursor(32,0);
else lcd.setCursor(31,0);
displayTime(RTC_UpTime);
lcd.scrollDisplayLeft();
// scroll one position left then wait & call the duty cycle function
// you can change the frequency of the duty cycle & scroll speed by changing the number of times you go through this loop
for (int iCnt1 = 0; iCnt1 <= 3; iCnt1++) {
dutycycleloop(dutyIn, dutyIn);
}
}


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: bassplayer142]
      #5546522 - 11/30/12 12:37 AM

Quote:

One golden rule of electronics is that a working prototype ceases to work when you show your boss . A neat and cleaner addition would be Bluetooth. A low power wireless alternative that supports spp serial port virtualization. There is a free android app I run which can act as a Bluetooth com port giving you control and data viewing on your phone, tablet, or PC.




I never even thought of using Bluetooth, that's a great idea.
What Bluetooth Android app are you using?


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]
      #5546661 - 11/30/12 04:53 AM

Paul,
The Arduino is fine. It seems I have a problem with the LCD, no broken wires, no bad joints. I think Its faulty, I'll re-wire to be sure though.
I changed that line to == but that hasn't changed the flashing behaviour. Changing duty cycle still has no effect. Very odd.

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]
      #5546943 - 11/30/12 10:34 AM

There are two pins that are are used for the backlight LED on the LCD assy.

Here is a link to info. on the LCD assy. Because there are different versions from different vendors, this may not match yours.
http://www.sparkfun.com/datasheets/LCD/GDM1602K.pdf


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]
      #5547189 - 11/30/12 01:07 PM

Paul,
The backlight is working, the trouble is that no data is displayed. It did work briefly this morining which indicates an intermittent problem. The wiring all checks out end to, so no problem there. I do suspect the contrast pot, as the voltage on the LCD pin Vo is held at 5V regardless of the pot setting. So I'll be changing the pot later.
In the meantime I've not been able to check the new cpp file. However, LCD or not, I will upload with the new one and check it out on the serial monitor.
Christmas shopping has got in the way today.

Phil


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: ThadeusB]
      #5547216 - 11/30/12 01:19 PM

Search bluetooth spp on google app market and you should find it.

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: 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 new [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 new [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  
dan_h
Carpal Tunnel


Reged: 12/10/07

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5568928 - 12/13/12 10:16 AM

I have been following this thread closely. The subject is intriguing and the project is a very nice implementation of technology. I do have some questions though and I hope you do not take these the wrong way. They are probably born out of lack of understanding and are not meant to be a criticism.

Just how automatic is this package? Specifically, can a setup be transferred from one scope to another without a lot of fudging to get the thing running efficiently on a new installation or does the user have to adjust a number of parameters to get it going? Can the needed adjustments be made easily in the field?

dan


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: dan_h]
      #5569080 - 12/13/12 11:34 AM

Hi Dan,
I have just commissioned mine; its working very well indeed, and yes, it is fully automatic I've found. It does take a bit of experimenting to achieve the right temperature differentials for a particular scope.

So in view of individual scope requirements, I would suggest that it may not be an instant transfer from say a large SCT, to a smaller scope such as a refractor. However, as I am going to do, one can have a library of sketches that are set up for different scopes. It is then a simple matter of compiling and uploading a specific sketch to the Arduino to match the scope to be used. This is very simple to do, once the differentials have been determined for particular dew straps. Clearly it would require a PC at the location.

Paul S is helping me a great deal with all this, and is working on individual duty cycles for each output. I'm evaluating the simple version at the moment, that can only be tweaked within the sketch. However, Paul may be coming up with a version that can be controlled externally, with switches or pots, or BlueTooth.

Its a growing animal.


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: dan_h]
      #5569348 - 12/13/12 02:09 PM

Dan,

Up through release 3.8 there where 2 potentiometers (variable resistors or miniature volume controls) as the only user inputs. These control the screen contrast and the duty cycle of the output straps. The duty cycle is the percentage of time that when required to be turned on they actually are turned on.

There are a number of parameters that are pretty much a one time deal. Do you
want to display the temperatures in Celsius of Fahrenheit? Do you want to use the Duty Cycle Function? Do you want to use the Low Voltage Detect, stop running the dew straps if the voltage falls below 11.6V?

boolean temperatureC = 0; // Set to one to display tempertaures on Celsius. Note: All math and debugging is still done in Fahrenheit.
int correctionDHT = 0;//-2; // DHT-11 Temperature sensor correction value.
int noDutyCycle = 0; // Set this to 1, to use without duty cycle input and run at 100% when required
int noVoltage = 0; // Set this to 1, to use without voltage detect input.



There are these 4 variables that you set how much you want the dew strap temperature sensor to be above the dew point. We turn on the heater to try and obtain this temperature and turn it off when reached. Initially I had these set to 10 and found that was over kill for my 102mm MAK, 80mm refactor and eyepieces. So I reduced them to 5 and it has worked well for me. Now when cold weather set in Phil found that 5 temperature was not enough for his 10" SCT, so he bumped the 1st value back up. I hadn't had my C11 out in a couple of months when I needed the dew heater, so I didn't know this.

int dewAdjust1 = 8; // 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 adhust the outputs individually.
int dewAdjust2 = 5; //
int dewAdjust3 = 5; //
int dewAdjust4 = 5; //


These would be the only parameters you might want to change when going between different size scopes. But I'm sure you can find a value that would work for both. My future plans are to make all the parameters adjustable on the fly using either an Infared remote control or BlueTooth connect from a cell phone/PDA.

The system has up to 5 sensors. The DHT 11 or 22 which provides the reference temperature, the humidity and is used to calculate the dew point temp.

Then you can have between 1 and 4 Dallas temp sensors. You place these under your dew straps.

When you power the system up, it will look at how many Dallas temp sensors you have and then use that many outputs. Only 1 sensor, only the first port is used, etc...

The system will strive to keep the temperature of each of the Dallas temp sensors x number of degrees above the calculated dew point and keep it there or above. It does this my turning the outputs to the dew straps on and off. The system doesn't know or care if you have a 65mm reflector, 14" SCT or 20" DOB. It checks all the sensors and decides what to do with the dew heaters about ever 12 seconds, so about 5 times a minute.

It also displays a bunch of information, keeps track of the date and time, stores all the sensor and voltage readings in a couple memory chip every 15 minutes or so (kind of the way your cell phone stores contact information). It also checks for low battery input voltage and shuts down the dew heater outputs if it fall's below 11.6V to keep from killing your battery.


I could have put the display contrast and duty cycle pot's on the outside, but chose not too. Especially since I plan to do away with them.

Phil uses his in his observatory and had to put his DHT sensor up on the OTA to get a good reference, near the dome opening to the outside temperature and humidity. I use my scope outside in the yard and hang the dew controller from the tripod spreader. Since all of my equipment is out in the open, I don't have the problem of being in a protected environment of an observatory.

I am always open to suggestions and for changes to make it better. What else do you think needs to be automated?

For the Arduino I do have a second Arduino Uno 3, a tilt sensor, 3 axis gyroscope sensor and magnetometer (compass), stepper motor controller with motor and 4 channel relay module and Ethernet shield. I don't see how any one of these can help with a dew controller??? I'm thinking about another project of an automatic focuser using some of this stuff.


Post Extras: Print Post   Remind Me!   Notify Moderator  
dan_h
Carpal Tunnel


Reged: 12/10/07

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5569374 - 12/13/12 02:24 PM

Wow Pauls, thanks for taking the time for such a thorough reply.

<< I am always open to suggestions and for changes to make it better. What else do you think needs to be automated?>>

You guys are so many miles ahead of me I am only trying to understand. I am not in a position to offer suggestions for improvements.

Clear skies (and warm dry air!)

dan


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: dan_h]
      #5569449 - 12/13/12 03:15 PM

Paul,

Rewinding a little, I don't actually have version 3.9. I'm using 3.6. I have just trawled through all the posts, and the latest I see is 3.8 where you added the RTC. Would it be better if I compiled 3.9?

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]
      #5569620 - 12/13/12 05:29 PM

Phil,
Unless you have the DS1307 RTC (Real Time Clock) and 24C32 EEPROM modules, you can't go to 3.8 or 3.9.
If you send me your current sketch, I can integrate the 3.7 and 3.9-beta changes into it leaving out the 3.8 stuff for the RTC and larger EEPROM.

Do you have a red LCD screen? If not what colour?
Paul

Edited by Pauls72 (12/13/12 05:45 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: dan_h]
      #5569633 - 12/13/12 05:41 PM

Dan,
I don't mind sharing or helping. Hopefully other people will learn from it and not have to go through some of the stumbling blocks and learning curve that I had to.
Paul


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]
      #5569655 - 12/13/12 05:49 PM

To Pauls72: how did you run the reset button through? I didnt find a good way of making the button pass through from the case to the arduino.

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: mitaccio]
      #5569681 - 12/13/12 06:05 PM

OK Paul, I'll send my sketch tomorrow, its on another PC.

I'm using the plain vanilla blue/grey LCD. Does the red one have a clearer display when scrolling?

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: mitaccio]
      #5569702 - 12/13/12 06:17 PM

I have the reset button on the shield board located under the hole. I took 3 (of the 4) of those little square white buttons that came with the case and glued them together in a stack. I then used a very small drop of hot glue and glued it to the actual reset button. Hot glue is nice, because you can peal or scrape it off and it remains a little flexible. You have to use a small screwdriver or something to kind of guide it through the hole when you put the case back together. You can see them stacked up in this picture.



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]
      #5569792 - 12/13/12 07:25 PM

I just took this video with my cell phone. Sorry I can't hold it that still. The video is slightly out of focus, the display is perfectly clear.

https://www.youtube.com/watch?v=VMPlu6-BRuY


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]
      #5570458 - 12/14/12 08:34 AM Attachment (32 downloads)

Paul,
Your LCD is very much clearer than mine, it doesn't appear to suffer from the lag that mine does. Can you please tell me which one you have?

My latest sketch is attached.

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]
      #5570538 - 12/14/12 09:42 AM

I got the same red LCD that mitaccio used from Sparkfun.
https://www.sparkfun.com/products/791?


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]
      #5570787 - 12/14/12 12:35 PM

Paul,
That LCD doesn't seem to be available in the UK. However, I have found a red backlit with orange characters. I've queried the latency with them. If this one is OK then I don't need to worry about having a 4 line display. Cheap too, 4 (6$)


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: ThadeusB]
      #5571522 - 12/14/12 08:41 PM

I have some questions about the setup you guys are doing. Keep in mind, that even though I got this thing started that I am a beginner at electronics and programming. This was my first project ever!

1)What is the concensus on the DHT11 vs DHT22? Is the range worth the delay?

2)Ports: How often do you need 4 heaters?

3)Powering the arduino. I run my arduino off the 12v supply. I haven't had any issues, but are there advantages to running it separately at a lower voltage?

4)Duty Cycle/PWM I know my coding in this area was very simple, but it seems to work well in my climate. What advantage over my original coding is there to the Duty Cycle/PWM? It seems that you are using a pot to adjust the duty cycle. Doesn't this remove the automation?

I have to say, I am super pleased at how much this has taken off. Thanks for keeping this going and improving as much as you have.


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]
      #5571866 - 12/15/12 12:47 AM

1) For those of us in other parts of the world, the change from the DHT11 to the DHT22 is probably the most important and even mandatory.

DHT11
0 to 50C (32 to 122F) 2C
20 to 80% Humidity 5%

DHT22
-40 to 80C (-40 to 176F) 0.5C
0 to 100% Humidity 2%

Here in the Midwest in winter the temperature routinely fall's well below 32F and the humidity can go below 20%. In heat of summer the humidity can exceed 80%. As a secondary plus, the DHT22 is more accurate.

The way the program currently is structured, we only go through the main program loop every 12 seconds. So we look at the DHT sensor a few times pretty quickly and then it sits for the next 10-11 seconds. So the delay of the DHT22 only being able to be read every 1/2 second isn't an issue. But even at this rate we can adjust the dew straps on/off up to 5 times per minute.

2) Scope, Eyepiece, Finder scope, Telrad, Mount Hand controller.
When imaging I will take out 2 scopes, one for imaging and one for visual. Scope and Guide scope, then Scope and Eyepiece on the second one.

3) There is nothing wrong with powering everything off of one 12V supply. The main issue is the dew heater straps use a lot of power. I didn't want that much current flowing through the Arduino board or shield, especially if you have a dew strap or cable short out. A dew strap for my C11 uses 1.57A, plus for the 2" eyepiece .32A, plus for the guide scope or finder .5A. So it is possible to end up with 4-5 Amps going to the dew straps, this would smoke the runs off the Arduino or shield. So I have separate isolated inputs for the two. From my battery I have a cable with 2 connectors at the end. One with a 2.1mm connector for the Arduino and the other with a 2.5mm for the dew straps.

I suppose if you run the Arduino off of a 9V transistor battery or 4AA 1.5V batteries it will run cooler, but I didn't find this as an issue.

4) Well the system currently uses both your original concept for turning the dew heaters on/off, plus it has variable duty cycle. By reducing the duty cycle you reduce the wattage/heat output of dew straps. This gives you give a lower more even heat, slower change in temp. But it lets me use my C11 dew strap on my 102mm MAK, because I can adjust the wattage way down. This is important with home made dew heater straps, you can control their heat output. Now with the latest changes we are testing you can run each of the different outputs at different duty cycles.

Although we could drive the dew straps in an analog manner, to control the percentage without introducing some feedback circuitry this would be harder to regulate or know exactly what percentage we are driving the straps at. Now using Pulse Width Modulation when a dew strap needs to be turned on, we are turning the straps on/off at about 10HZ. We are then controlling the width of the positive and negative portions of the pulses with fairly accurate control. Wen we run at 100% then stay in all the time they are required. When using PWM and under driving your dew straps, your dew straps will last longer electrically.



You had a great idea, I wish that I would of though of it. I learned my electronics in the early to mid 1970's. So I learned about both vacuum tubes and solid state electronics. Solid State was in it's infancy and I kind of grew along with it for 20 years or so. Then I transitioned over to the application software side of the world. The Arduino is programed in a OOP (Object Oriented Programing) language similar to C++. And the libraries are in C++. Now, I deal in some totally different languages, but I have learned other OOP languages on different systems (Algol, Pascal, Java, Visual Basic) over the years. If you know the concepts behind OOP languages, it makes it easier to learn and understand other OOP style languages. There are a lot of things similar between all OOP languages. Things like Class, Function, passing variables and pointers and objects, use of pointers, defining variables, types of variables, use of casting, overloading operators are all common to all OOP's. The commands, their syntax and uses is different between the different languages, but not totally foreign.

I had never heard of an Arduino before I read your post on this project. I was looking at building a Dew Controller, but nothing as sophisticated as this. When I first built mine, the program wouldn't even compile. I soon found there are a bunch of different versions of the libraries for the different devices floating around the web. Getting the correct combination was quite a challenge.

I also wanted to increase the ports from 2 to 4 and had some other ideas for improvement that kept growing over time. So this project motivated me to learn the Arduino, it's programing language and some C++.


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]
      #5575699 - 12/17/12 01:10 PM Attachment (39 downloads)

Phil,
Attached is a semi-consolidated 4.2a beta version with the multiple duty cycles for the different ports. I took your sketch and added in my changes from 3.7, some of 3.8 and the 3.9c-beta versions. I also made a change so that the Dallas onewire sensor values are saved in either Fahrenheit or Celsius accordingly.

What is different for sure is that I have the additional code for the RTC (Real Time Clock) and EEPROM 32K memory modules. I now have a idea/plan for making a version that we could both use. That way it will make it easier for us to stay in sync.

I wish my Bluetooth stuff and my DHT22 would get here soon.
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]
      #5577393 - 12/18/12 02:20 PM

Paul,
I think in the New Year, once recovered from the cost of Christmas, I'll buy another Arduino Uno plus proto shield, and start getting to grips with the coding. Then perhaps to join in with some development.

When you do finally get your BlueToothe device, let me know what it is exactly, so I can take a look at it for future reference. I may then go ahead a buy one myself to experiment with.

As a matter of interest regarding the RTC, have you implemented that as a device for sidereal time checks?

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]
      #5577679 - 12/18/12 06:04 PM Attachment (35 downloads)

Phil,

The date/time is read from the RTC module and displayed during the power up sequence.

During operation I alternate between the Arduino powered up time and the actual time. So the first time scrolling through I display the powered up time with a little up arrow to the left of it. The next time through I display the actual time from the RTC module (HH:MM) in military or 24 hour clock format. I thought it would be nice to have the time on the display since it was already lit up.

Last I use the date time when storing off the all the reading to the external EEPROM. I save the date and time along with the temperature, humidity dew point and all temp of all 4 Dallas sensors.

I am using an DS1307 RTC module. Cost was about $4 (I'd guess about 2).

So I think I have finished consolidating and have one version that should work for both of us.

Some new parameters:
boolean noRTC = 0; // Ver 4.3 - set to 1 when there is no Real Time Clock module present.
boolean noExtEEPROM = 0; // Ver 4.3 - set to 1 when there is no External 32K EEPROM module present.

// Ver 4.3 - Make displayed port names variables.
// Put your output port names here, the maximum size including the equal sign is 6 characters.
char port1Display[7] = "OTA1=";
char port2Display[7] = " Eye=";
char port3Display[7] = " OTA2=";
char port4Display[7] = " Aux=";

All the parameters that you will need to change should be grouped together in the source. The source has mine, so you will have to change them.

There are a few small changes/enhancements that I made while making the other changes. I started making more comments when I made changes, this is to make it easier for you to follow along. I was not about to unsolder or cut the wires to my RTC or external EEPROM modules, so I will rely on you to test that part.

Awhile back I picked up a second Arduino, a prototyping board and a bunch of the jumper wires. It makes life so much easier when messing with this stuff. The Arduino Uno is a clone from Hong Kong for like $13 (7). The only real difference I noticed is it uses USB serial port 7 instead of 5.

Regards,
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]
      #5580612 - 12/20/12 12:45 PM

Thank you Paul, I might just RTC myself. However, in order to do this, I'll have to get a bigger box, mine is crammed to the brim as it is; it would sense anyway, making it easier to mess with things as this seems to be an ongoing project.

I've looked at the BlueTooth links, very neat gadgets, and very cheap, I'll see if I can locate them here. Is there an existing program for send commands from a PC? Or is this something else that has to be developed?

Good idea putting in more comments. I am currently on the programming learning curve by reading the two books I bought. I just need to buy that second Arduino - I may get a clone too. One of the books refers to downloadable sketches to experiment with, I'm just about to get them and work through them. Your previous notes are coming in very handy for clarity. Its all beginning to make sense now.

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]
      #5580804 - 12/20/12 02:35 PM

Paul,

I found this one on fleabay, looks the same device:

http://www.ebay.co.uk/itm/Wireless-CSR-mainstream-Bluetooth-V2-0-RF-Transceiv...

So, New year may seeing me going this routs too. Also found the RTC arduino compatible module, very cheap.


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]
      #5580844 - 12/20/12 02:51 PM

Quote:

Paul,

I found this one on fleabay, looks the same device:

http://www.ebay.co.uk/itm/Wireless-CSR-mainstream-Bluetooth-V2-0-RF-Transceiv...

So, New year may seeing me going this routs too. Also found the RTC arduino compatible module, very cheap.




Yup, looks like the exact same one.

On many of these modules the boards may be slightly different, but electrically and software command wise they are the same.

Quote:

Is there an existing program for send commands from a PC? Or is this something else that has to be developed?



In the top of the serial monitor window there is a line where you can input text (or in our case commands) and click on the send button.



By the way, if you look at my dew controller, the RTC and external EEPROM modules are wrapped in electrical tape and placed vertically on edge along the right hand side. Talk about not having room.


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]
      #5581598 - 12/20/12 10:45 PM Attachment (31 downloads)

Phil,
I found a few variables that I missed when replacing the names out of the code and making them all generic.
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]
      #5582346 - 12/21/12 11:41 AM

Paul,
Yes, I'm aware of the serial monitor Send line, just haven't used it yet.I'm starting to look at he code required to do this 2 way communication.

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]
      #5583908 - 12/22/12 11:27 AM

Thanks for the new code Paul. I keep that on file for the time being. I'll probably get the RTC in the New Year, and perhaps get the BlueTooth items too.

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]
      #5604069 - 01/04/13 04:05 AM

Paul,
I'm now taking a look at the latest code posted: 20121220

It appears now that the hex codes for the Dallas sensors no longer need to be defined. Previous code for my sensors:

DeviceAddress LX200 = { 0x28, 0xEB, 0xF5, 0x4A, 0x04, 0x00, 0x00, 0xDE };
DeviceAddress ED80 = { 0x28, 0x2A, 0xDC, 0x4A, 0x04, 0x00, 0x00, 0x7D };
DeviceAddress EP = { 0x28, 0xC0, 0xDD, 0x4A, 0x04, 0x00, 0x00, 0xD4 };
DeviceAddress Box = { 0x28, 0x4C, 0xF2, 0x4A, 0x04, 0x00, 0x00, 0x56 };

New code:

DeviceAddress Port1In, Port2In, Port3In, Port4In;

Where the device addresses are variables, meaning that if different straps + Dallas sensors are used, the addresses are automatically determined by the code in setup and the main loop.

Am I understanding this correctly Paul?

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]
      #5604258 - 01/04/13 08:45 AM

Phil,
You are correct.

Here is where basic setup is done:

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress Port1In, Port2In, Port3In, Port4In;


Then here is where we search to see how many sensors are present, up yo 4. This is the actual search for the first sensor. !sensors.getAddress(Port1In, 0)

void setup() {
Serial.begin(9600);
Wire.begin();
sensors.begin();
//Search for devices on the bus and assign based on an index
lcd.begin(16,2);
resetLCD();
lcd.createChar (0, upSymbol); // load special character to the LCD - an up arrow used to indicate power up time in front of the power uped time on the display.
resetLCD();
lcd.print("Sensors Found: ");
if(!sensors.getAddress(Port1In, 0)){Serial.println("Unable to find address for Device 0"); lcd.setCursor(0,1); lcd.print("No Sensors ");}else {ts0=1;lcd.setCursor(0,1); lcd.print("#1 ");};
if(!sensors.getAddress(Port2In, 1)) Serial.println("Unable to find address for Device 1"); else {ts0=ts0+1; lcd.print("#2 ");};
if(!sensors.getAddress(Port3In, 2)) Serial.println("Unable to find address for Device 2"); else {ts0=ts0+1; lcd.print("#3 ");};
if(!sensors.getAddress(Port4In, 3)) Serial.println("Unable to find address for Device 3"); else {ts0=ts0+1; lcd.print("#4 ");};
delay(displayDelay2);
sensors.setResolution(Port1In, 10);
sensors.setResolution(Port2In, 10);
sensors.setResolution(Port3In, 10);
sensors.setResolution(Port4In, 10);


This should give you an idea of how the sensors/library can be used.
http://milesburton.com/Dallas_Temperature_Control_Library

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: ThadeusB]
      #5604442 - 01/04/13 10:10 AM

Paul,

I Have now run the sketch after tweaking for my naming. It does exactly what I thought. This is a really useful feature Paul, when using the unit on different scopes with different straps.

I have tried putting in the few lines of code - just 7 -for the IR keypad. However, It won't compile as the sketch is now to big; 33,268 bytes. So, it looks like something will have to go in order to implement the keypad; I may remove all RTC stuff, as I don't think I really need that.

More later.

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]
      #5611327 - 01/08/13 02:41 AM Attachment (26 downloads)

Hi Paul,
I have made a few very small changes to make things ordered and logical. I had been thrown slightly, by the port order not matching pinMode:-

in the last version, pinMode order is 4,5,6,13 (logical)
In the void setup and void loop, the port order was 5, 6, 4, 13.
I have changed them all so that they match the pinMode order.

It is now easy to determine which sensor and strap relates to the outputs.

My file with new comments is attached.

Phil


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5636958 - 01/22/13 01:54 PM

I am so glad I have found this topic. I read all the posts once, and will read them a couple of more times, just to make sure I understand all that I need to do to make this controller. I hope I will get your help if needed. For start, I have ordered the Uno. It will arrive in two weeks. In the meantime, I will try to order other components, and then join the team

Thanks!


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: AstroShomy]
      #5637301 - 01/22/13 04:36 PM

Could you please tell me if I will be able to use this shield http://postimage.org/gallery/22fqzgo2/

Thanks!


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: AstroShomy]
      #5638773 - 01/23/13 11:52 AM

Hi AStroShomy,
You would be best getting one without the breadboard on top, such as this one:-

http://www.ebay.co.uk/itm/190694443142?ssPageName=STRK:MEWAX:IT&_trksid=p...

On this type you make a solder job of fitting the components.


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: AstroShomy]
      #5638774 - 01/23/13 11:52 AM

Quote:

Could you please tell me if I will be able to use this shield http://postimage.org/gallery/22fqzgo2/

Thanks!




That will work for prototyping, testing or temporary setup. However, if you are making a permanent configuration, I would suggest a shield that you can solder the wires/components into. Just my own personal preference.


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]
      #5638788 - 01/23/13 12:00 PM

Snap!

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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: ThadeusB]
      #5639178 - 01/23/13 04:15 PM

The breadboard is actually optional... I can use this shield without it...

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


Reged: 02/19/13

Re: How to make an automatic dew controller - Arduino new [Re: AstroShomy]
      #5688465 - 02/19/13 08:36 AM

Hi guys,

I have been thinking of doing something like this for awhile, but this has taken it to the next level and beyond.

Great thread. Do you have a complete circuit diagram for your latest version ?

I found many individual sketches in here but I couldnt see a latest and greatest all in one circuit diagram.

Thanks in advance

PTB


Post Extras: Print Post   Remind Me!   Notify Moderator  
drbyyz
sage
**

Reged: 11/04/12

Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #5688580 - 02/19/13 09:52 AM

Quote:

Hi guys,

I have been thinking of doing something like this for awhile, but this has taken it to the next level and beyond.

Great thread. Do you have a complete circuit diagram for your latest version ?

I found many individual sketches in here but I couldnt see a latest and greatest all in one circuit diagram.

Thanks in advance

PTB




+1 for that request. I've finished my homemade heating strip that fits nicely around my corrector plate and is powered by a 12V ON/OFF power supply. Next part of this project is to incorporate my Arduino and some temp/humidity sensors to regulate the power supply.


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: drbyyz]
      #5700380 - 02/25/13 06:37 PM

OK, I made one consolidated diagram of everything. Hopefully this will work you you guy's.
http://michiana-astro.org/Projects/DewCtrl/Dew-All-In-One.pdf

Should you need it, here is the Arduino Uno R3 schematic.
http://michiana-astro.org/Projects/DewCtrl/Arduino_Uno_Rev3-schematic.pdf


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


Reged: 02/19/13

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5703825 - 02/27/13 04:43 PM

Paul,

Exactly what I was hoping for.
I'll get cracking on it.

Thanks very much.

Cheers

PTB


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #5770593 - 04/01/13 11:43 AM

Hi guys,

After some time, I managed to get all that I needed and I managed to connect the Arduino, Sparkfun's Protoshield, DHT22 and one wire sensor (I have also bought the real time module with EEPROM, bit I will include that later). Now, could somebody tell me what the next step is? Is it possible to use any of your sketches posted here or I need to start over? If so, could I get some help regarding the basic sketch which would include LCD, 4 onewire sensors, and DHT22? I would like to have temperatures shown in Celsius, regardless of the method.


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: AstroShomy]
      #5770603 - 04/01/13 11:46 AM

I forgot to mention, I would also like to have separate heater power input.

What do you guys think about this solution:

http://stargazerslounge.com/topic/162586-arduino-dew-heater-control/page__st_...


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: AstroShomy]
      #5770702 - 04/01/13 12:22 PM Attachment (55 downloads)

You can use the attached version of the dew controller sketch and libraries.
In the following section of the source, all you have to so is set the appropriate values to 1 to turn off using the device. Then it doesn't care that the device isn't present. The same thing goes for displaying the temperatures in Celsius, set it to 1 and your all set.

boolean noRTC = 0; // Ver 4.3 - set to 1 when there is no Real Time Clock module present.
boolean noExtEEPROM = 0; // Ver 4.3 - set to 1 when there is no External 32K EEPROM module present.
boolean noDutyCycle = 0; // Set this to 1, to use without duty cycle input and run at 100% when required
boolean noVoltage = 0; // Set this to 1, to use without voltage detect input.
boolean temperatureC = 0; // Set to one to display tempertaures on Celsius. Note: All math and debugging is still done in Fahrenheit.


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5772756 - 04/02/13 12:05 PM

Excellent, thanks for the answers.

I can't find the version 4.3. Could you post it here please?


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: AstroShomy]
      #5773117 - 04/02/13 03:09 PM

The version I posted is newer and contains all of the 4.3 changes.

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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5773769 - 04/02/13 07:22 PM

I am terribly sorry Paul, I didn't see the attachment.

Thanks so much!


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: AstroShomy]
      #5785506 - 04/08/13 09:31 AM

Is it possible also to get some help with the part of the system responsible for the separate power input for the heaters? What do I need to use there?

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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: AstroShomy]
      #5785520 - 04/08/13 09:37 AM

Paul, what do you think about this solution: http://stargazerslounge.com/topic/162586-arduino-dew-heater-control/page__st_...

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: AstroShomy]
      #5786528 - 04/08/13 06:00 PM

I'm not sure what your referring too in the link?
For my 12V supply for the dew heaters, I am using a 12V AGM deep cycle Marine and RV battery (20 amp hour rate:55). I have mine set up with separate inputs for the heater strips and Arduino, but I am currently using the 12V battery to feed both. You can use any 12V DC supply as long as it supplies sufficient current to power all your straps at 100%. Plus I would add in another 25-50% reserve capacity.

The ground is common to both of them. The Arduino can be powered by anything from 5V up to 24V I think.

So I feed 12V through a fuse and then 4 bullet diodes and from the diodes to the connectors for the 4 dew straps. The other side of the dew strap connectors goes to the TIP120 transistors.

Hope this all makes sense.


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5787340 - 04/09/13 04:09 AM

I was refering to the circuit diagram, which uses 2N7000N and IRF5305.

I want to have a separate power input for the heaters, so that all that power don't pass throught the Arduino board all the time.


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: AstroShomy]
      #5787582 - 04/09/13 08:39 AM

Your making the circuit more complex than it needs to be.
My TIP-120 transistors are mounted to the case not the board. So only the control signal comes from the Arduino. I also have the ground from the 4 transistors tied into the Arduino. So they are fairly well isolated from the Arduino.

I have heat sinks on 2 of them so they could handle more current if required. The TIP-120 is rated at 5 Amps. A commercial dew strap for a 16 inch scope only requires 2.15 Amps. This is the highest wattage dew strap I could find and well within the limits of the TIP-120. I have a 10 Amp fuse on the 12V to the dew straps for protection.


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5787673 - 04/09/13 09:31 AM

Perfectly clear Paul! Thank you so much!

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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5787684 - 04/09/13 09:37 AM

It has actually already been posted, right?










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: AstroShomy]
      #5787717 - 04/09/13 09:59 AM

The left hand power jack (2.5mm) goes to the dew heaters, the right hand one (2.1mm) goes to the Arduino.

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: Pauls72]
      #5787797 - 04/09/13 10:49 AM

Stupid question, but what diode did you use?

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: Pauls72]
      #5787842 - 04/09/13 11:16 AM

http://www.amazon.com/Phantom-ArduinoTiny-24C32-DS1307-Module/dp/B00AMX0LY0

Does this board have both the RTC and the EEPROM required?

It would be awesome if we had an updated parts list. As far as I can tell, the parts required have changed significantly from the first page.


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]
      #5789373 - 04/09/13 11:39 PM

I used some diodes I had in my parts junk box. They where rated at 5A and something over double 12V. They are wrapped up and I can't look at the numbers. As long as they handle the current and voltage, they are not that critical. You can even build it without them. I only put them there for reverse voltage protection.

Yes it looks like that module will work for both the RTC and EEPROM.


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: Pauls72]
      #5789383 - 04/09/13 11:46 PM

Thanks Pauls for having such a nice parts list. I'll give it a whirl in a few weeks.

Post Extras: Print Post   Remind Me!   Notify Moderator  
ubermick
super member
*****

Reged: 04/12/12

Loc: San Rafael, CA
Re: How to make an automatic dew controller - Arduino new [Re: Raginar]
      #5796728 - 04/13/13 02:37 PM

All I can say is...

I read the first post in this thread and got really excited, and having thumbed through the rest of the thread, I'm sitting here utterly confused. It seems - SEEMS - to the utter layman that is me, that the original how-to post that kicked off this thread is now somewhat "obsolete" with Paul's modifications?

If so, Paul, if I promise to buy you several refreshing beverages next time I'm in Indiana, can I talk you into making a new step-by-step article? Please? Pretty please? With Naglers on top?


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: ubermick]
      #5797354 - 04/13/13 07:19 PM

Ubermick,

Yea, it has been upgraded significantly from the last slide. You can follow it, but it would be awesome to have the current device in schematics form... I think I could figure it out if I had a good parts list.


Post Extras: Print Post   Remind Me!   Notify Moderator  
ubermick
super member
*****

Reged: 04/12/12

Loc: San Rafael, CA
Re: How to make an automatic dew controller - Arduino new [Re: Raginar]
      #5797382 - 04/13/13 07:41 PM

Yeah Chris, I've ordered the stuff I *know* I need - the R3, shield, LCD display, DHT22, and a pack of Dallas onewire sensors - but now seeing folks using RTCs and EEPROMs, and the various flavours of this box has my head spinning. (Should be noted that the spinning head is a result of me not being particularly electronics-minded, and on the overall dumb as a rock)

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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: ubermick]
      #5797401 - 04/13/13 07:50 PM

That was exactly how I felt when I was reading this for the first.... and the 17th time as well...

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: ubermick]
      #5798044 - 04/14/13 10:13 AM

Same boat I get the feeling this isn't the only forum they use too.

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: ubermick]
      #5799841 - 04/15/13 02:42 AM Attachment (84 downloads)

Attached to this post you will find a parts list. These same parts or their equivalents can be purchased from a number of different sources at a wide variety of prices. I used to work on computers and other business equipment as my job, as well as other electronics as a hobby. So I have a number of components out in cabinets and boxes in the garage and didn't have to buy everything.

You can use a DHT11 or a DHT22, the DHT22 is preferred as the DHT11 is only good to 32F or 0C. Another limitation of the DHT11 is it only returns values for 20-80% humidity readings with 5% accuracy.

Optional components are just that, optional. The dew controller will run fine with out them. There is a section in the code where you can turn on/off the optional features. The current source code will run in the original hardware as long as you disable the optional pieces in the source code.
Optional RTC
Optional 32K I2C EEPROM
Optional Low input voltage detect - 4 resistors
Optional run at a reduced Duty Cycle, no additional components.
You don't have to use connectors, you can hard wire the sensors and power cord straight in if you want. There are all kinds of project cases that you can use.

In the following section of the source, all you have to so is set the appropriate values to 1 to turn off using the device. Then it doesn't care that the device isn't present. The same thing goes for displaying the temperatures in Celsius, set it to 1 and your all set.

boolean noRTC = 0; // Ver 4.3 - set to 1 when there is no Real Time Clock module present.
boolean noExtEEPROM = 0; // Ver 4.3 - set to 1 when there is no External 32K EEPROM module present.
boolean noDutyCycle = 0; // Set this to 1, to use without duty cycle input and run at 100% when required
boolean noVoltage = 0; // Set this to 1, to use without voltage detect input.
boolean temperatureC = 0; // Set to one to display tempertaures on Celsius. Note: All math and debugging is still done in Fahrenheit.



This is a consolidated diagram of everything. Hopefully this will work you guy's.
http://michiana-astro.org/Projects/DewCtrl/Dew-All-In-One.pdf

Should you need it, here is the Arduino Uno R3 schematic.
http://michiana-astro.org/Projects/DewCtrl/Arduino_Uno_Rev3-schematic.pdf


I've played around with an infared remote module and a bluetooth module to add remote control and more functions. But none of that is in the current source sketches I put out here.

This is the only astronomy form I frequent, although I do go over to Astromart to see what people are selling on a regular basis. The only other internet form I frequent on a regular basis is muscle car forum. However, I'm not on here every day.

I looked for help when I was first building mine and couldn't get it to work. I kind of found out I was pretty much all by myself. So I learned to program the Arduino on my own and went to town. Not a programer by trade, I do have enough of a programing background that I cleaned up the source code and made it modular along the way as well as inserted comments. Along came ThadeusB, I helped him through some bugs he had and he had changed some of the source. At some point I consolidated both our sources into one, this made it easier for us to both have the same source. I believe I have answered most of the peoples questions, I don't want people hanging out there and struggling the way I did. I have gotten a number of PM's form people which I have responded too also.

If you have a problem or question, ask here or send me a PM and I'll do my best to help you.

I travel a lot for work, so if I'm out of town at a customer site, it might be a couple of days before I get back to you. Please be patient.


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: ubermick]
      #5799845 - 04/15/13 02:47 AM Attachment (165 downloads)

This is the most current source code along device libraries.

Edited by Pauls72 (04/15/13 02:52 AM)


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]
      #5799852 - 04/15/13 02:59 AM

If you are planning on making any changes, it will be a great help to you if you can at least read and understand some type of OOP (Object Oriented Programing) language, such as C, C++, Java, Visual Basic, Pascal, Algol, etc...

This whole thing has kind of been a work in progress as well as a learning experience for me.


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: Pauls72]
      #5800035 - 04/15/13 09:01 AM

Paul,

Thanks! I hope we weren't badgering you about it. I couldn't tell because I saw references to multiple different forums (maybe it was just for ideas).


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: Raginar]
      #5800118 - 04/15/13 09:56 AM

Paul... you are THE man! Thanks a million!

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: AstroShomy]
      #5800252 - 04/15/13 11:12 AM

Paul,

I'll try to keep the changes to a minimum.


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: Raginar]
      #5800297 - 04/15/13 11:28 AM

I am the creator of this thread. Although I love the changes, do agree that the intent of making the dew controller easily seems to be lost. My original design works fine, for me. But I too would love to see a new write-up on the currently upgraded design.

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]
      #5800486 - 04/15/13 12:57 PM

After you install Arduino software, you need to set up your folder/directory structure similar to this:



You do not need to place it on the C drive or in the root of a drive, it's just where ever you start at this is the way the folders need to be structured. I did not list all the folders only a enough to give everyone the idea.


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


Reged: 02/19/13

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5802118 - 04/16/13 08:32 AM

Here is a schematic I am working on based on the awesome work of others. I still need to check it properly for mistakes. Hopefully it doesnt do more harm than good.

https://dl.dropboxusercontent.com/sh/v5vzmi50xbdsits/0nG8COEP65/Dew_Controlle...

Cheers

PTB


Post Extras: Print Post   Remind Me!   Notify Moderator  
ubermick
super member
*****

Reged: 04/12/12

Loc: San Rafael, CA
Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #5807658 - 04/18/13 08:39 PM

Hmm... since the thermoprobes will basically be living in the dew straps, I'm pondering using a four-pin connector for each strap - two wires for the heater itself, and then two for the dallas sensors. Something like this:



Any of the more eletrically inclined folks see any issue with that? Would running the current to the nichrome next to the sensor wires cause any interference?


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: ubermick]
      #5807962 - 04/18/13 11:56 PM

There are 2 wires to the dew strap and there are 3 wires going to the Dallas On-Wire sensors, Supply Voltage, Ground and Data. You can run the sensors off of 2 wires, but it reduces the performance of them. The Data wire can be used for the Supply voltage (Parasitically Powered). However I remember reading there are some restrictions and disadvantages when using the devices Parasitically Powered.


Something else to keep in mind. All four or however many Dallas On-Wire sensors are hooked up in parallel. Each of the sensors has a unique address inbuilt to the sensor. The way the dew controller works is the one with the lowest address becomes the first sensor and the highest address becomes the last sensor. So you could determine the addresses and always plug the sensor/strap plugs in the same order. Also you can not skip one when plugging them in.


Post Extras: Print Post   Remind Me!   Notify Moderator  
ubermick
super member
*****

Reged: 04/12/12

Loc: San Rafael, CA
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5809143 - 04/19/13 05:36 PM

So a five pin version of that would be the way to go, should I want to incorporate the Dallas sensors into the dew straps (apologies, saw people were using stereo wire, and assumed two wires for the sensor)

But then if I'm reading this correctly, if I do that, then I need to plug ALL dew straps in and run them, even though I may not be using them? (For example, was thinking of having four straps - OTA, eyepiece, finder, guidescope for down the road, but on a night when I just want to use the OTA strap, I'd still have to run the four?)

This thread is doing a magnificent job of making me feel remarkably dim! In fact, this is how I think of myself before reading this thread:



And this is how I think of myself about 60 seconds into this thread!


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: ubermick]
      #5809975 - 04/20/13 02:24 AM

I used the shield of the stereo cable for ground onm the 4 Dallas sensors.

You can plug in any number of sensors between 1 and 4. The Dallas one wire sensors are really IC's (integrated circuits), so they are intelligent sensors. When you power up or reset the dew controller it scans for the addresses of the sensors. Each sensor has a unique 64 bit serial number or address etched into the IC. So the manufacturer can make 18,446,700,000,000,000,000 unique addressed devices.

So when we power up, we scan the one wire buss and say we find the following addressed devices:
50621
9351004
1127
50653

We then assign results as follows:
#1 = 1127
#2 = 50621
#3 = 50653
#4 = 9351004


So now we unplug the sensor with the address of 50621 and power up the dew controller and we get the following sensor assignments:
#1 = 1127
#2 = 50653
#3 = 9351004
#4 = (none)

So now we unplug all the sensors except 9351004 and power up the dew controller and we get the following sensor assignments:
#1 = 9351004
#2 = (none)
#3 = (none)
#4 = (none)

So what I did is wrap each sensor with a different color electrical tape, I put the same color tape on the plug ends of the sensor cables. I determined which sensor was witch and placed a label on the back with their order of precedence:
B=1 Y=2 W=3 R=4
So my blue is the lowest address and the red is the highest address.

This is done this way because of the people who designed the One Wire interface and communications protocol. The One wire devices use the same one wire to communicate in both directions to and from the device. Each device has it's unique serial number or address. You can kind of think of this like cell phones that all share the same radio waves, just each one had it's own phone number.

The way the program works, is any output port without a sensor assigned to it is turned off. So if you only have 1 sensor hooked up, it always controls the first output port/dew strap, regardless of the address of the sensor.

I hope this all make some resemblance of sense.



Post Extras: Print Post   Remind Me!   Notify Moderator  
ubermick
super member
*****

Reged: 04/12/12

Loc: San Rafael, CA
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5810898 - 04/20/13 01:23 PM

Paul, you're a scholar and a saint, and I think everyone in here appreciates your patience!

I suppose what I'm confused about is that with the address being provided by the dallas sensor, the ports where they connect to the box/arduino aren't assigned. Therefore does it really matter where they're plugged in? I don't see anywhere in the construction where the ports are bound to their corresponding sensor (but as I've repeatedly mentioned, my intelligence is lacking!)

In otherwords, using your example, if I had the following configuration, I can't see why this wouldn't work:

#1 = 9351004
#2 = (none)
#3 = 1127
#4 = (none)

Or am I just missing something, and there is someplace that mentioned that the sensors do have to be used in ascending sequence?


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: ubermick]
      #5813899 - 04/21/13 07:49 PM

Would this diode do the job?

www.mikroprinc.com/index.php?page=shop.getfile&file_id=7972&product_i...


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: AstroShomy]
      #5816932 - 04/23/13 07:44 AM

The dew strap output port assignment is done by the program. So if you use this:
#1 = 9351004
#2 = (none)
#3 = 1127
#4 = (none)

The program assigns them like this:
#1 = 1127
#2 = 9351004
#3 = (none)
#4 = (none)

Those diodes will work just fine.


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]
      #5822728 - 04/25/13 06:11 PM

For those that tinker: I am planning a new build project. This one is to have a DHT22 sample the air temp and humidity and send to a website that will show instant values plus show the 1, 3 and 7 day trends. Also have a sensor take cloud coverage values (read something about this on a Yahoo groups cloud sensor) and show it on the site. Thus creating a device that will show the temp, humidity, dew point and cloud coverage/sky quality of a site. This will hopefully go beyond the SQM Ethernet device, if not, atleast be cheaper! If interested PM me and we can get things going.

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: mitaccio]
      #5823462 - 04/26/13 01:03 AM

Mitaccio,

The SGL guys already have something very similar. I'm building part of it (no SQM) to include with my focuser. If you want to chat, that'd be fun.


Post Extras: Print Post   Remind Me!   Notify Moderator  
ubermick
super member
*****

Reged: 04/12/12

Loc: San Rafael, CA
Re: How to make an automatic dew controller - Arduino new [Re: Raginar]
      #5823472 - 04/26/13 01:14 AM

Blargh! All my bits just arrived to put one of these together, and now there's a new and improved version in the works!!?! Boooo!

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


Reged: 02/19/13

Re: How to make an automatic dew controller - Arduino new [Re: ubermick]
      #5905254 - 06/06/13 04:34 AM

Hi Paul,

I'm making slow but good progress on getting this complete.
Its nice to follow some instructions and it just works with no or little hassle. So thanks for all the guides.

Quick question.
With the latest code posted, am I correct in understanding that the duty cycle potentiometer connected to A0 is no longer implemented in the working code?

Or am I mistaken.

Cheers

Dave


Edit:
Just another thing.

I seem to be able to accidentally freeze the clock by plugging & unplugging the sensors while turned on.

I then have to go through the resetting clock procedure before the clock will start working again.
Since discovering this I have always disconnected from power before mucking about with the sensors.

Anyone else noticing this ? Or is it just me ?

Edited by Ptb (06/07/13 06:53 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
don clement
Vendor (Clement Focuser)


Reged: 02/02/11

Loc: Running Springs, California
Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #5905285 - 06/06/13 05:45 AM

To guarantee no dew forms on optics it is only necessary to have optics above ambient temperature. There is no need to monitor humidity. Assuring that optics is above ambient temperature is ALL that is required to prevent dew forming. My minimalist DIY circuit automatically keeps optics a very small amount above ambient. My circuit has no microcontroller, no software, no display, an absolute minimum of parts, and can be built for less than $10.
Parsimony.
http://clementfocuser.com/images/Temperature_Control_Print.pdf

Don Clement


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: don clement]
      #5905457 - 06/06/13 08:43 AM

Nice Don I kindof figured we were over-thinking this.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Hamsterdam
super member
*****

Reged: 03/23/11

Loc: smack dab in the middle of the...
Re: How to make an automatic dew controller - Arduino new [Re: Raginar]
      #5906585 - 06/06/13 06:27 PM

In my odd world, I have 2 routes to detect temp, humidity and dewpoint at a glance. We have a weather station that feeds to a weather website. I can either look right to the horse's mouth, or pull up the website, and my weather station readings are right there. Sorta like talking to the horse via skype.

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: Hamsterdam]
      #5941548 - 06/26/13 02:43 PM

While working on another arduino project - Barndoor tracker with intervalometer - I ran across a code for a heater that I thought might be usable for keeping the optics at a regulated temperature via PWM but incorporates a predictive factor too. Adafruit Sous Vide .

Also, Hamsterdam, I am curious to see some pics and if possible, the coding for your weather station. I am wanting to do something similar but have a infra-red sensor displaying sky temps.


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


Reged: 02/19/13

Re: How to make an automatic dew controller - Arduino new [Re: mitaccio]
      #5961124 - 07/08/13 07:59 PM

And here's my implementation all finished.

Pretty Happy with it. Its pretty much exactly the same as Paul had posted circuitwise except I added some diodes for input polarity and incorporated the RTC and memory onto the board instead of separate module.

Again....Thanks heaps Mitaccio and Paul for all the guides.

Cheers

PTB







Post Extras: Print Post   Remind Me!   Notify Moderator  
Undermidnight
BEOTS "Tweener Cup" winner
*****

Reged: 05/25/04

Loc: Untermitternacht
Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #5962062 - 07/09/13 11:57 AM

Ok, I need to jump on board and build me one. I have build dew heaters in the past, but nothing as cool as this. Thanks for posting the information.

Jason


Post Extras: Print Post   Remind Me!   Notify Moderator  
galaxy_jason
Vendor


Reged: 05/22/07

Loc: Texas
Re: How to make an automatic dew controller - Arduino new [Re: Undermidnight]
      #5962253 - 07/09/13 02:06 PM

I see you have caught the Arduino bug. Lots of fun. Now, for your next revision, skip the
Arduino board and shield. You can reduce size considerably by using the controller on
a little grid PC board or go all out and learn Kycad and make your own custom
PC board through services like OSH Park

Here is a link to breadboarding the Arduino. You can by the chip from Sparkfun with the
boot loader already uploaded.

http://log.liminastudio.com/itp/physical-computing/breadboard-arduino-fast-ch...


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: galaxy_jason]
      #5964165 - 07/10/13 02:37 PM

There isn't a commercial dew controller on the market that has all the functionally that this does. Yes, this is overkill if all you need/want is a very basic dew controller. But it is a great learning experience of what you can do with a micro controller.

Ptb,
I like the way you etched and stacked your PCB's, why cleaner than my build.

Jason,
That's a great idea.

I find that a lot of people who try and build some of these electronic projects lack the soldering skills. Not to say how many are using a huge high wattage soldering gun. Stuff like this is not for the faint of heart. In the end, you do need to be able to solder and know a little bit about electronics.


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


Reged: 02/19/13

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #5966446 - 07/11/13 10:14 PM

Paul, Thanks for comments. I need to do it this way as my electronics skills are better than my mechanical skills. I think the Perspex cutout for the lcd can be exhibit A for this argument .

Jason, yep the arduino bug. Seriously addictive. 3 years and counting. I am trying to resist a next revision, but you are absolutely right. Can be squashed down by going to bare bones arduino chip and removing arduino premade board.

This one is 4 boards high.
-LCD panel
-Custom Board 5 volt instrumentation
-Custom Board 12 volt power supply, fuse and 12v switching.
-Arduino Duemilanove/Uno board.

Could get down to 2 boards I reckon. LCD + everything else.

The reason I didn't was I like the usb connector on the premade arduino boards. I have never found a FTDI chip for USB that wasn't surface mount soldered only. I tried surface mount soldering in the past and it is definitely outside my skillset.

Another thing that made it taller than I thought is the RCA sockets. I had to use 2 sets of arduino headers to clear them. The final dimensions were 100mm wide x 80mm high x 55mm deep.

I like oshpark and use them for my smaller boards and they are the best quality I have ever seen, but they get pricey for larger boards. I had these made through Seeed. I had to get the lower board remade as I made several mistakes in my first design layout of that board.

I used Eagle for design but am thinking of learning Kicad for licensing size limit reasons.

But, this version will do me. Its completely compatible with Mitaccio / Paul's current design and will enable me to upload any updates with no code change on my part. (Except for my slightly different voltage sensing calibration factor).

Cheers

PTB

Edited by Ptb (07/11/13 10:16 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Wford
member
*****

Reged: 05/03/11

Loc: South Africa
Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #5992681 - 07/27/13 10:03 AM

Hi I just came across this post and wondered if any one used a dfrobot lcd shield for this project(http://www.dfrobot.com/index.php?route=product/product&product_id=51#.UfPS9Wao2AE).Would it work? i got one lying around

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: Wford]
      #5994593 - 07/28/13 11:50 AM

I don't see why you couldn't use it. It uses different pin's so you would have to change the sketch to accommodate it. It also uses two more pin's than the display we used. So you would have to either give up something or try moving something over to the analog pin's. You can use Analog pins 0-5 as digital pins 14-19 with some minor limitations.

http://www.instructables.com/id/How-to-add-6-extra-pins-to-your-Arduino-with-...


Post Extras: Print Post   Remind Me!   Notify Moderator  
sparkyht
super member
*****

Reged: 11/10/07

Loc: 43N 89W
Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #6019122 - 08/11/13 02:06 PM

Quote:

And here's my implementation all finished.

Pretty Happy with it. Its pretty much exactly the same as Paul had posted circuitwise except I added some diodes for input polarity and incorporated the RTC and memory onto the board instead of separate module.

Again....Thanks heaps Mitaccio and Paul for all the guides.

Cheers

PTB










That is amazing! Did you ever think about putting those together as a kit for sale? If so, I think I would like to be your first customer.

Just....WOW!


Edited by sparkyht (08/11/13 02:15 PM)


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


Reged: 02/19/13

Re: How to make an automatic dew controller - Arduino new [Re: sparkyht]
      #6028651 - 08/16/13 07:37 AM

Hi,

Thanks for that. No, I think it would be poor form to sell the hard work of others. I designed the boards, but the circuit and code is Mittaccio's and Pauls.

I can post the board files i made, and links to components sources i used as well as some pcb manufacturer links. Will put them up in a few days.

Cheers

Ptb.


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


Reged: 02/19/13

Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #6048413 - 08/27/13 09:08 AM Attachment (68 downloads)

Sorry for delay. Here are the board files for the 2 different boards. Which are both stacked onto the arduino like in the pictures. I still need to dig out ebay links for the parts.

Cheers

PTB


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


Reged: 02/19/13

Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #6048415 - 08/27/13 09:08 AM Attachment (69 downloads)

And here's the second board

Post Extras: Print Post   Remind Me!   Notify Moderator  
Mike Clemens
Frozen to Eyepiece
*****

Reged: 11/26/05

Loc: Alaska, USA
Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #6154387 - 10/23/13 08:38 PM Attachment (41 downloads)

Wow!! I needed to check back in here! Lots of progress has been made by others.

I put my own dew controller project down for quite a few months, but have picked it up recently with a vengeance. Here are a couple shots from the last couple weeks.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Mike Clemens
Frozen to Eyepiece
*****

Reged: 11/26/05

Loc: Alaska, USA
Re: How to make an automatic dew controller - Arduino new [Re: Mike Clemens]
      #6154389 - 10/23/13 08:39 PM Attachment (41 downloads)

And a single board design I am moving towards with everything, XMEGA AVR, bluetooth, OLED display, all heaters, thermo controls, RTC, on the same board... drop in and go!

Post Extras: Print Post   Remind Me!   Notify Moderator  
Mike Clemens
Frozen to Eyepiece
*****

Reged: 11/26/05

Loc: Alaska, USA
Re: How to make an automatic dew controller - Arduino new [Re: Mike Clemens]
      #6154391 - 10/23/13 08:39 PM Attachment (29 downloads)

Some case end prototypes.

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: Mike Clemens]
      #6156011 - 10/24/13 05:40 PM

Mike,
You dew controller project looks very nice.
Do you have some details on it?

I had played around with an infrared remote then a Bluetooth module. My problem is I basically ran out of memory on the Arduino UNO. To add anything, I was having to drop out something else.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Mike Clemens
Frozen to Eyepiece
*****

Reged: 11/26/05

Loc: Alaska, USA
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #6156288 - 10/24/13 08:22 PM

> Do you have some details on it?

<terminator voice>
I have detailed files.

I have two versions being made. One.. very small. One, full size but still handheld.

Specifications:

* Small version - 3 heater ports, small OLED display
* Large version - 5 heater ports, large OLED display

Everything else is the same:

* Switching power supply. Low loss no matter if you feed it 7.5V or 18V input.

* Super quality ENIG gold plated circuit boards. AVR XMEGA CPU.

* Connect up to 5 temp. probes, assign any of them as "ambient" and use any of them for heater control. 4 megabits of EEPROM for temperature logging.

* Bluetooth connectivity to Android phones/tablets for monitoring and control.

* RS232 port for monitoring and control. Includes 1/2 amp rated pin 9 power supply for using Wifi or other dongles which can be powered over Pin 9.

Heater algorithms (per channel): Simple full ON/OFF, Simple Ambient Temperature Tracking (+/- offset), or the cadillac, the full blown multi-channel PID controller algorithm.

* Low loss, high amperage busses inside device for moving the big heater currents around.

* Solid state MOSFET heater switching channels, overcurrent protected, reverse polarity protected, and ESD protected.

Mount control:

* Battery backed real-time-clock and NGC/M/IC celestial libraries with GOTO control through RS232 port. (You can connect it to your mount instead of a computer.) Astro-Physics mount initialization.

* Joystick port for panning Astro-Physics mounts around.

I was really just building a heater controller but couldn't resist the extras I wanted for my own mount.


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: Mike Clemens]
      #6156525 - 10/24/13 10:47 PM

Quote:

I was really just building a heater controller but couldn't resist the extras I wanted for my own mount.



I understand how that happens.


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


Reged: 02/19/13

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #6158874 - 10/26/13 10:21 AM

Wow man. That is beautiful.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Wford
member
*****

Reged: 05/03/11

Loc: South Africa
Re: How to make an automatic dew controller - Arduino new [Re: Ptb]
      #6161798 - 10/28/13 02:23 AM

I have the following problem in getting my project to work.Maybe some of the other user had a similar problem and found a solution.When I have connected the LCD and powered up all that I see on the display is a bunch of zeros that is flashing.Any sugesstions

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: Wford]
      #6162068 - 10/28/13 09:09 AM

I would suggest you start by hooking up the usb cable, then unplug all the dew straps and dew strap sensors. Next bring up the Arduino IDE (Compiler) and select Tools, then select Serial Monitor. You should get a screen that looks something like this:



You can reset the dew controller to get it to start over.
This will make sure the basic unit is working.

If this doesn't work, either write or down load a very simple sketch/program to verify the basic Arduino works. My first guess would be that you have wired up the display wrong.


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: Wford]
      #6164963 - 10/29/13 04:57 PM

Here is a very simple sketch/program that you can use to test the display.
It will output a message to the display and to the USB serial port.

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
Serial.begin(9600);
}

void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
// Output the same information to the serial port.
Serial.println("Hello world!");
Serial.println(millis()/1000);
// Wait 5 seconds
delay(5000);
}


Post Extras: Print Post   Remind Me!   Notify Moderator  
Wford
member
*****

Reged: 05/03/11

Loc: South Africa
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #6176656 - 11/05/13 12:29 AM

Thanks Paul I tried the code but still had trouble.I ordered a new LCD and tried again and then everything worked ok.
much appreciated


Post Extras: Print Post   Remind Me!   Notify Moderator  
ratacitorul
newbie


Reged: 01/01/14

Re: How to make an automatic dew controller - Arduino new [Re: Mike Clemens]
      #6285383 - 01/01/14 11:53 AM

Hi Mike,

wow, you built a Rolls there :-) - I would like to attempt to replicate your setup (maybe with some changes based on part availability in Belgium) - would you mind sharing the whole thing in one place? I looked through your past posts in the thread and am a bit lost - it seems some parts of your set-up are missing...

thanks in advance

Vasile


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


Reged: 11/30/12

Re: How to make an automatic dew controller - Arduino new [Re: ratacitorul]
      #6286898 - 01/02/14 04:18 AM

+1... I would like to build it too. Please Mike, share the details

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


Reged: 08/26/08

Re: How to make an automatic dew controller - Arduino new [Re: AstroShomy]
      #6299445 - 01/08/14 07:36 AM

I am building my own dew controller with an arduino Leonardo board and i have a problem and i would like some help. At my hardware i have a 20 column 4 row LCD display and along with the sensors i need i want to place an external EEPROM chip in order to store calibration data for the sensors and a value in order to dim the LCD backlight. The EEPROM chip i have is the 24LC256. At my sketch i need to include the wire.h library in order to initialize later on the I2C bus. When i do that at the setup function the program freezes and at the display i get random garbage eg. 3'''''and so on. Another solution would be to use the I2C Master Library http://dsscircuits.com/articles/arduino-i2c-master-library.html best suited for the leonardo but when i use the commands i can't get it to work in order to read/write data. Any help would be much appreciated

Here is a part of the start of my code along with the most important parts of the setup function

#include <LiquidCrystal.h> //LCD Library
#include <MenuBackend.h> //MenuBackend library - copyright by Alexander Brevig
#include <OneWire.h> //Onewire Library
#include <DallasTemperature.h> // Dallas library
#include <Wire.h> //I2C Library for external EEPROM
#include "DHT.h" // DHT Library

#define DHTPIN 8 // DHT sensor pin on arduino
#define DHTTYPE DHT22 // DHT22 sensor
#define ONE_WIRE_BUS 12 //pin where one bus sensor is connected
#define EEPROM_ADDRESS 0x50 //address for external EEPROM

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire); //Pass oneWire reference to Dallas Temperature.
DeviceAddress HeaterTemp = {
0x28, 0x57, 0xFF, 0x08, 0x04, 0x00, 0x00, 0x0FE }; //Dallas sensor address
DHT dht(DHTPIN, DHTTYPE); //define the dht instance
LiquidCrystal lcd(2, 3, 4, 5, 6, 7); //LCD pins

boolean ButtonPushed = 0;
float temperature = 0;
int humidity = 0;
float dew = 0;
float ota = 0;
int read_button = 0;
boolean menus = 0; //case for menus
byte lcd_brightness; //starting amount of brightness for lcd the will be read form EEPROM
int fadeAmount = 5; //amount of lcd fading
int reading = 0; //initial reading for analog buttons

const int HeaterPin = 10; //FET pin No.
const int Buzzer = 11; //buzzer pin
const int backlightPin = 13; //LCD backlight dim pin

byte newChar[8] = {
B00110,
B01001,
B01001,
B00110,
B00000,
B00000,
B00000,
B00000};

void setup(){
Serial.begin(9600); //used for debugging
//while(!Serial); //whether it is as comment or active this command does nothing
Wire.begin(); //initialize I2C bus HERE THE PROGRAM CRASHES
delay(15); //delay to make sure the EEPROM is initialized
pinMode(HeaterPin, OUTPUT); //mode of FET pin
pinMode(Buzzer, OUTPUT); // Mode of buzzer pin
pinMode(backlightPin, OUTPUT); // pinmode for lcd pin


lcd_brightness=(eepromRead(0,0),DEC); //read value from EEPROM
// Serial.println(lcd_brightness);
lcd.begin(20, 4); //initialize 20 char 4 line lcd
lcd.createChar(0, newChar);
lcd.setCursor(0,0);

//---opening test text---
analogWrite(backlightPin, lcd_brightness);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Kostas Dew Buster");
lcd.setCursor(0,1);
lcd.print("Version 0.15");
lcd.setCursor(0,2);
lcd.print("Test Build 0.5");
lcd.setCursor(0,3);
lcd.print("====================");
delay(5000);
lcd.clear();

//---initialize sensors---
dht.begin();
sensors.begin();
sensors.setResolution(HeaterTemp, 9); //set resolution of Dallas sensor to 9 bits i.e. 0,5C
}


and here is a test program with the I2C master library in order to read/write data at the external EEPROM, The problem i have with this code is that i can't read the specified register address at the EEPROM

#include <I2C.h>
#define ADDRESS 0x50

int test;

void setup()
{
Serial.begin(9600);
I2c.begin();
I2c.write(ADDRESS,0x00,0x00,35);
test = I2c.read(ADDRESS,0x00,1);
delay(5000);
Serial.println( test);

}

void loop()
{
}

Edited by akira (01/08/14 07:54 AM)


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: akira]
      #6299673 - 01/08/14 10:02 AM

For your crash I would try commenting out the MenuBackend library. I never used this and it doesn't look like you need it at this point in time.

// #include <MenuBackend.h> //MenuBackend library - copyright by Alexander Brevig


I used version 1.01 of the Arduino IDE. If you are using a newer version, it could also be an incompatibility between one of the include files and the IDE.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Boon2u
newbie


Reged: 05/16/13

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #6332890 - 01/24/14 02:52 PM

Hi Pauls72
I have been following this thread closely and have finally built a functioning controller using your code and I must first say thank to you & Mitaccio for the inspiration.
The only issue that I am running into is my LCD has a very slow refresh rate when it gets cold. The scrolling text becomes a blur. Is there a simple way to adjust your code to make it scroll 16 positions quickly and then pause for 4 or 5 seconds, scroll 16 more, pause, etc? I'm still learning the Arduino system and a total noob at coding. I've been studying your code & comparing it to other examples trying to experiment but I have not had much success. I got the scroll to jump 16 positions at once which helps but can't find where the length of the pause comes in.
Thanks, Boon


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: Boon2u]
      #6333787 - 01/24/14 10:53 PM

Boon,
I'll take a look at it, but it will be a few days before I have time.
One of the things I am doing is I am using the display loop as part of the duty cycle timing. So it's not a straight forward display problem. The LCD response is due to the cold on the LCD and another user reported it to me a few weeks ago.
Paul


Post Extras: Print Post   Remind Me!   Notify Moderator  
Boon2u
newbie


Reged: 05/16/13

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #6334982 - 01/25/14 02:14 PM

Pauls,
Thanks for the quick reply.
It's no big deal. I usually operate my obsy remotely from the house anyway, it's not like I'm hanging around outside in January any longer than I have to. The controller works great all by itself.
Boon


Post Extras: Print Post   Remind Me!   Notify Moderator  
Bobbyni
journeyman


Reged: 04/27/13

Re: How to make an automatic dew controller - Arduino new [Re: Boon2u]
      #6337901 - 01/27/14 12:08 AM

Hi Paul,
newbie here too....
I would guess CFO = Wife ...right?
Because mine is and Astronomy + electronic = $$$$$$$$$$$$$$$$$$
So, I can understand the irritation of CFO....lol

I started to follow up this threat and started to purchase Arduino related parts..... Since the threat is 12 page long, i might lost from some of them about the answer to my question here: dht11 Works only between 0C to 60C , right? Thanks


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: Bobbyni]
      #6338541 - 01/27/14 11:19 AM

DHT11
Good for 20-80% humidity readings with 5% accuracy
Good for 0-50C temperature readings 2C accuracy

DHT22
Good for 0-100% humidity readings with 2-5% accuracy
Good for -40 to 80C temperature readings 0.5C accuracy

So the DHT11 is probably OK if you live in a very moderate climate. But if you live where the weather hits some extremes (which is most of us) then the DHT22 will be better suited for your use.

CFO = Chief Financial Officer, you are correct it's the wife. She has a good point for being concerned. I'm looking at adding a separate rider on our homeowners insurance to cover my equipment. I've taken inventory and added up the my costs and the cost to replace. I never realized how much I had spent.


Post Extras: Print Post   Remind Me!   Notify Moderator  
manoss27
newbie


Reged: 05/25/13

Loc: GREECE
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #6339215 - 01/27/14 05:06 PM

Hi,
i feel ready to build the dew heater controller thanks Paul & Mitaccio for the idea and progress...May i ask if its possible to connect rotary controller or push buttons for navigation so you will have the option to add menu for preferences and desirable view mode....

Regards
Manos

Edited by manoss27 (01/28/14 06:10 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Bobbyni
journeyman


Reged: 04/27/13

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #6339952 - 01/27/14 11:41 PM

Yeah, CFO just got my card's transaction and went kuku about how many purchases from eBay.... Hahaha....
Yes, I live in Calgary, AB and temp. Is at Negative side..... Bought HT22 ...
Still waiting for sensors to arrive...
Thanks Paul and Mike! For sharing and answering questions helping all in need!!


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


Reged: 08/26/08

Re: How to make an automatic dew controller - Arduino new [Re: Bobbyni]
      #6401243 - 02/28/14 02:34 AM Attachment (4 downloads)

I have a small problem with the FET implementation and i would like some help. I use the ITS621L1 and according to the datasheet http://www.farnell.com/datasheets/85678.pdf i need to have the pins 3 and 2 to the arduino signal pin and arduino GND respectively. On the other hand i need to have pin 4 connected at +12V and pin 1, which is the output, at the positive of my dew strap, the GND of the dew strap is connected at the battery's negative pole. When i turn on the circuit the output voltage to my dew strap is +6V when the arduino signal at pin 3 is 5 volt, which is the signal to turn on the dew heater. The ST pin, used for diagnostic is 0 so there is something wrong.

According to the truth table when i have the status IN1 = 1, OUT 1 = 1 ST = 0 i have a short circuit at Vbb (output channel) but by checking the solderings i made i have no short circuits at the FET's pins.

By unplugging the GND form the input and with no load i get IN1 = 0, OUT = 0, ST = 1 and from the truth table i get an overtemperature signal.

Am i missing something? Any help is appreciated.

Edited by akira (02/28/14 02:35 AM)


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


Reged: 08/26/08

Re: How to make an automatic dew controller - Arduino new [Re: akira]
      #6401246 - 02/28/14 02:35 AM Attachment (26 downloads)

truth table

Post Extras: Print Post   Remind Me!   Notify Moderator  
Imhotep III
newbie


Reged: 03/11/14

Re: How to make an automatic dew controller - Arduino new [Re: akira]
      #6596098 - 06/22/14 05:51 PM

most of what I read it seems like everyone who built one is happy with results(Hopefully.)
Its been several months and it would be nice to hear from you guys how its working in the field under real world conditions.


Post Extras: Print Post   Remind Me!   Notify Moderator  
paul hart
Pooh-Bah
*****

Reged: 06/01/04

Loc: Long Island, New York
Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #6596519 - 06/22/14 10:29 PM

Very nice job, I'll put it on my bucket list.

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: paul hart]
      #6598944 - 06/24/14 09:57 AM

I have tried adding features like an infrared remote and bluetooth to control the options. I also tried adding a few more features to the program. At some point, usually early on the program will hang, crash or go crazy. Since we are near the memory limit of the Arduino Uno, my educated guess is that drivers are interfering with one another or the program is over writing pieces of itself, etc...

So I've kind of just let it sit as it is stable.

A couple of people where having problems with the LCD not working well in the cold. They where looking at having the display scrolling stopped or putting a heater on the display.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Imhotep III
newbie


Reged: 03/11/14

Re: How to make an automatic dew controller - Arduino new [Re: Pauls72]
      #6601849 - 06/25/14 08:15 PM

Thanks for your response Pauls72. I'm starting my project in a few weeks.

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
12 registered and 16 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: 22109

Jump to

CN Forums Home


Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics