Jump to content

Narrowband

Arduino dew heater control


Gina

Recommended Posts

Hi Jason,

Thank you for the links, I alraedy have the adafruit one plus many others from US sites. Its finding something that compiles is a problem. I'll take a look at the tutorial now!

Cheers

Phil

Link to comment
Share on other sites

  • Replies 238
  • Created
  • Last Reply

Has anyone managed to find the math library? I have all the others for this project, however the math one is very elusive it seems. The Arduino.cc site just takes one around in ever decreasing circles.

Now have the Uno working with the LCD, by running test sketches, so far so good.

I now understand how the 'include' lines work. I had assumed that all libraries had to be uploaded individually; no, the Arduino IDE does this once the libraries have been correctly set up in a: My Documents/Libraries/sketch_name/ filing system. Once verified the upload will compile and upload the sketch plus libraries called upon by 'include'.

However, I deviate; I still need to find that elusive math library!!!!!!!!!!!

Hope to have the DHT22 tomorrow, so I can hook that up, then obtain the Dallas hex ID codes. I can then attempt to update the coding to identify all sensors.

This certainly is a hell of a learning curve!!

Phil

Link to comment
Share on other sites

I have been playing with this over the weekend.

I currently have the lcd display set out how I want it with the temp, humidity displayed from the DHT22 on the top line, and the due temperature calculated and displayed on the secound line.

The bottome 2 lines have the 4 Dallas sensors diplaying each reading.

DSC_0086.jpg

I then added code to controll the heater PWM outputs acording to the dallas temperature reading against the duepoint temperature.

This part is still on going, but is looking good so far. I am sat here with LED's lighting up and the serial monior showing the values as I minipulate the temperatures with a heater.

Jason.

Link to comment
Share on other sites

Hi Jason,

Actually, the math code isn't included, at least not in the download I got from Arduino.cc. Clearly you have it; would you mind sending me a copy of the library please?

philromford@gmail.com

I would greatly appreciate that if you would.

Cheers

Phil

Link to comment
Share on other sites

Ah, I've found the math.h file. Only after doing a file search did I find it, its deeply buried in an AVR folder - not obvious!!!!! The point being it was not visible in the Arduino IDE import sketches.

There we go.

Link to comment
Share on other sites

I am developing my own code after following several tutorials for each sensor and the lcd, and playing with them to work out how it all works. Now I am puting it all together.

I couldn't find the math library but when I added the include math line it worked.

Jason.

Sent from my LT15i using Tapatalk 2

Link to comment
Share on other sites

Has anyone yet tried to obtain the DS18B20 hex addresses?; necessary for multiple sensors. Hacktronics provide code for doing this. It works. However, I found it necessary to remove the protoshield with attached LCD etc. as this prevented the Dallas from talking to D3.

Link to comment
Share on other sites

I have my code all written now but am having a problem when trying to compile in the Arduino IDE. Currently just one problem line:

dht22 DHT22 ;

Compile sends this:

error: 'dht22' does not name a type

I've seen this line of code in several other sketches, so I presume people have not encountered the same issue.

Any pointers please??

Phil

Link to comment
Share on other sites

Hi Jason,

I had those lines of code in already. So, I commented out the dht22 DHT22 line and tried compiling again. I had exactly the same result.

error: 'DHT' does not name a type

Referring to the line: DHT dht(DHTPIN, DHTTYPE);

This is very puzzling; following the first few lines of my code. Do you see anything wrong here?:

#include <EEPROM.h>

#include <OneWire.h>

#include <DallasTemperature.h>

#include <LiquidCrystal.h>

#include <dht.h>

#include <math.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // defines digital pins LCD uses

// dht22 DHT22;

#define ONE_WIRE_BUS 3

#define DHTPIN 2

#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

Phil

Link to comment
Share on other sites

Hi Guys,

I am still having trouble with the DHT22 coding. I have attached my full code, and here is the error text thrown up in the IDE:

line 43: error: 'DHT' does not name a type

in void loop

line 383: error: 'DHT' was not declared in this scope

Would someone please take a look at it for me and advise perhaps.

The actual problem appears to be in this line:

int chk = DHT22.read(DHTPIN);

line: 43 is the same as anyone elses, indeed the same as in adafruit files.

I've tried just about every combination of DHT DHT22 that I can think of, but what you see is the best I can get. Its probably the simplest of things that I simply haven't thought of.

I would very much appreciate some help here. I'm so close to having this working I think - I hope!

Thanks in advance.

Phil

DewCtrl_pjr_Fahr_r_1v10.txt

Link to comment
Share on other sites

Phil,

one thing I can see you have diferent to me is the library name,you have #include <dht22.h>, I have #include "DHT.h"

I have a very limited understanding and your sketch is a lot more complex than mine!

Jason.

Link to comment
Share on other sites

Hi Jason,

Yes, you're right. I had changed that after realising it was incorrect: I now have "dht.h" having changed the case of the source file. I changed the case to prove a point.

Having had another look at library building in Arduino.cc I found that all of the *.cpp and *.h files called for should be put in the same folder as the sketch, but not to include anything irrelevant. So I now have this:

MyDocuments/Arduino/Libraries/SketchName/ with all files called for in it. This works! So, the primary problem has now been resolved, in that the DHT22 is now recognised in the code lines previously problematic. However, a load of other lines are now showing errors which all come down to the "22" in the DHT name. Its about ensuring that the three code lines you sent me have the correct designations, and that in my case the the 'Main Program Loop' lines follow the schema. I hope to have this sorted tomorrow. Once I have cracked this I'll be uploading when successfully compiled - and see if anything works!!! I'm sure at least some of it will.

I've also added a line:

#include <Arduino.h> (there is no .cpp file. the .h file can be found in: arduino-1.0.2/hardware/arduino/cores/arduino

Their examples seem to include that line; it can't do any harm.

I'll be posting progress on this incredible learning curve. Like you, I'm not a programmer but learning a heck of a lot in a short time. My very old brain still seems to work a bit.

Phil

Link to comment
Share on other sites

Busy making may heater tapes, using nichrome wire, duct tape, velcro, glue, plus mounting the DS18B20's in each one.

Gina, how far did you get with yours in respect of the selectable switching? I'm considering adding this if its felt to be of real value.

Phil

Link to comment
Share on other sites

Hope it all works out Phil, I am just puting the finishing touches to my sketch now.

I am going to put it all in a plastic box and run it outside with a spare finder scope, so I can test it out over a couple of evenings when I have the scope out.

I found puting the nichrome wire into heatshrink tubing worked very well, and no chance of anything shorting out!

Jason.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.