ICEINSPACE
Moon Phase
CURRENT MOON
Waxing Crescent 39.9%
|
|
28-08-2016, 02:05 AM
|
Registered User
|
|
Join Date: May 2012
Location: Brisbane
Posts: 644
|
|
Just be careful with how smart you want to make it. "Linux device" is a bit misleading in what people think it means. Most Linux devices like a Raspberry Pi run the full OS like Debian and can do almost anything. The predecessor to this one ran OpenWRT which is in comparison quite limiting.
Still way overpowered and should be able to easily control a dew heater (as well as many other things) but just go in with the right expectations.
|
08-09-2016, 08:33 AM
|
Registered User
|
|
Join Date: Sep 2016
Posts: 6
|
|
Considering making myself one of these. Looks like a great project. What size of project box is needed for a 4 channel controller?
|
09-09-2016, 10:28 PM
|
|
Registered User
|
|
Join Date: Aug 2015
Location: Sydney
Posts: 1,758
|
|
Good questions. Not quite sure how much heat that would generate inside the box. What sort of elements would it be driving ? For an OTA and other things ?
|
13-09-2016, 06:00 AM
|
Registered User
|
|
Join Date: Sep 2016
Posts: 6
|
|
Info please
I am about to start assembling the components for this controller. I am a bit lost with the power aspect.
The extension board has a 5.5mm socket. The wiring diagram shows 12v supply. I assume the 12v supply from the battery pack plugs in here.
Do I need to do anything to my Arduino before I apply power? I don't want it going BANG on me.
It is my understanding that an Arduino is 5v when powered through USB but can take 12v supply through VIN. I take it then plugging the battery into the 5.5mm socket it is connected through VIN then???
Sorry for the noob questions. I'm picking this up bit by bit as I progress with the build......
|
18-09-2016, 01:44 AM
|
Registered User
|
|
Join Date: Sep 2016
Posts: 6
|
|
Well, build complete...... almost. MOSFET is in the post, arriving Wednesday...
Power applied to partial build just to check. Did find one issue. Connections for screen asked for SCL and SCA leads to be crossed. When I did this the screen did not work. When I put them the "wrong" way, it all works perfectly.... GO figure
|
18-09-2016, 11:56 AM
|
Peter
|
|
Join Date: Mar 2015
Location: Adelaide
Posts: 6
|
|
Hi Shand,
I have just tested my new build of this unit all is working except the heater temp sensors do you get a reading of temperature Under the Status on your DS18B20 ?Currently my is returning Status = Error
thank Peter
|
18-09-2016, 01:01 PM
|
|
Registered User
|
|
Join Date: Aug 2015
Location: Sydney
Posts: 1,758
|
|
Peter
The two most obvious things are wrong input port or ds18b20 not wired correctly. Just check that - check the i/o you are connected to compared to the code , and . If still not working PM me.
And make sure you have the updated code i posted recently .
Chris
|
22-09-2016, 04:58 PM
|
Peter
|
|
Join Date: Mar 2015
Location: Adelaide
Posts: 6
|
|
Quote:
Originally Posted by ChrisV
Peter
The two most obvious things are wrong input port or ds18b20 not wired correctly. Just check that - check the i/o you are connected to compared to the code , and . If still not working PM me.
And make sure you have the updated code i posted recently .
Chris
|
Up and Running!! Thanks Chris for your support
and everyone else who contributed to this great project
|
28-09-2016, 11:42 PM
|
|
Registered User
|
|
Join Date: Aug 2015
Location: Sydney
Posts: 1,758
|
|
Nice !
And an update. Now does 4 channels.
Last edited by ChrisV; 10-10-2016 at 05:07 PM.
|
10-10-2016, 09:50 PM
|
Registered User
|
|
Join Date: Jul 2016
Location: Ayr
Posts: 12
|
|
Thanks Chris you are a star....great project
|
11-10-2016, 12:27 AM
|
Registered User
|
|
Join Date: Sep 2016
Posts: 6
|
|
Nice one Chris....... need to drill another hole now.....
|
11-10-2016, 09:39 AM
|
|
Really just a beginner
|
|
Join Date: Jun 2009
Location: Brisbane
Posts: 3,040
|
|
Excellent - will try this out in due course!
DT
|
11-10-2016, 12:36 PM
|
|
Formally Escortitis
|
|
Join Date: Sep 2016
Location: Perth
Posts: 20
|
|
Great project. Built in a few hours including a couple of homemade heater straps, and used to great effect last night. Thanks Chris for sharing such a good project.
|
11-10-2016, 03:08 PM
|
|
Registered User
|
|
Join Date: Aug 2015
Location: Sydney
Posts: 1,758
|
|
Thanks all, any problems post or PM me.
Chris
Quote:
Originally Posted by redtail
Thanks Chris you are a star....great project
|
|
20-10-2016, 10:36 PM
|
Registered User
|
|
Join Date: Sep 2016
Posts: 6
|
|
LCD Upgrade..... working
Ok, thanks to ChrisV for his help with this.... (would never have been done otherwise...)
I ordered the wrong screen from ebay (2004A) when I first went to build this controller. Re-ordered with the correct OLED one.
The LCD eventually arrived from China and its a HUGE screen compared to the OLED one.
Due to the size of the box I used (to get use of the 4 channels on the MOSFET eventually) I think the larger LCD screen just looks better....
http://vid182.photobucket.com/albums...ps9sa9x8ob.mp4
This is the CODE used for the LCD in case anyone else fancies doing the same.....
Quote:
/*
Dew Heater Controller v4.1_LCD, 18 Oct 2016
Uses Arduino Nano with extension board
Display
20 x 4 LCD, using I2C.
Ambient temperature & humidity
- 1x sensor = DHT22 on digital pin 2
4x temperature sensors for feedback control of heaters on telescope glass
- temperature sensors = DS18B20 on digital pins 10, 11, 12, 8
- heater outputs = digital 3, 5, 6, 9 (PWM). To MOSFET heater drivers
*/
// global constants
const int numHeaters = 4; // max number of heaters
const float tempCutOff = 30; // heater cut-off if too hot
const float dewPointThreshold = 5; // threshold above dew point to start heater
// the display = LCD 20x4 I2C
#include <Wire.h>
// #include <LCD.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
// setup DHT22 for ambient temperature & humidity sensing.
// on pin 2
#include <DHT.h>
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
#define DHTPIN 2 // the DHT22 pin
DHT dht(DHTPIN, DHTTYPE);
float dewPointAmbient;
float temperatureAmbient;
float humidityAmbient;
boolean errorDHT22;
// Setup glass temp sensor & heater outputs (MOSFET Driver modules)
// temp sensors on pins 10, 11, 12, 8. DS18B20s using Onewire library
// heater outputs on PWM pins 3, 5, 6, 9
int heaterDutyCycle[] = {0, 0, 0, 0}; // drive to heater
int heaterPin[] = {3, 5, 6, 9}; // heater pins
// Have separate pin for each DS18B20. Easier to wire up and less confusing
#include <OneWire.h>
#include <DallasTemperature.h>
int DS18B20Pin[] = {10, 11, 12, 8};
OneWire oneWire1(DS18B20Pin[0]);
OneWire oneWire2(DS18B20Pin[1]);
OneWire oneWire3(DS18B20Pin[2]);
OneWire oneWire4(DS18B20Pin[3]);
DallasTemperature sensor1(&oneWire1);
DallasTemperature sensor2(&oneWire2);
DallasTemperature sensor3(&oneWire3);
DallasTemperature sensor4(&oneWire4);
boolean errorDS18B20[numHeaters];
float tempHeater[numHeaters];
// general - delay for sensor and "i" for counting
int theDelay = 1000; // need ~1sec delay after DS18B20 read in parasitic mode
int i;
void setup() {
// activate LCD module
lcd.begin (20,4); // for 20 x 4 LCD module
lcd.setBacklightPin(3,POSITIVE);
lcd.setBacklight(HIGH);
// Display intro and heating parameters
lcd.clear(); // clear &set cursor to 0,0
lcd.print("DewHeater 16x4 LCD");
lcd.setCursor (0,1); // go to start of 2nd line
lcd.print("Threshold = ");
lcd.print(dewPointThreshold,0);
lcd.print(char(223));
lcd.print("C");
lcd.setCursor (0,2); // go to start of 3rd line
lcd.print("Cutoff = ");
lcd.print(tempCutOff,0);
lcd.print(char(223));
lcd.print("C");
delay(theDelay*4);
// setup heater output pins, and set to zero
for (i = 0; i < numHeaters; i++) {
pinMode(heaterPin[i], OUTPUT); // sets the pin as output
heaterDutyCycle[i] = 0;
analogWrite(heaterPin[i] , heaterDutyCycle[i]);
}
}
void loop() {
// Read ambient temperature & humidity from DHT22
// If no read error, calculate dew point
errorDHT22 = getDHT22data();
// display ambient temp/humidity
displayAmbientData();
// Read temperatures from DS18B20s and set duty cycle.
for (i = 0; i < numHeaters; i++) {
// read the heater, return if an error and value to global variable tempHeater
errorDS18B20[i] = getDS18B20data(i);
// send duty cycle to heater output, set to 0 if any read errors
heaterDutyCycle[i] = setDutyCycle(i);
analogWrite(heaterPin[i] , heaterDutyCycle[i]);
if ( !errorDS18B20[i] ) {
// display heater data if its connected (no errors)
displayHeaterData(i);
}
}
}
boolean getDHT22data() {
float logEx,dewPoint;
boolean anError;
// read the DHT22
humidityAmbient = dht.readHumidity();
// Read temperature as Celsius (the default)
temperatureAmbient = dht.readTemperature();
// Reading temperature or humidity takes about 250 milliseconds. So put in a delay
delay(theDelay);
if (isnan(temperatureAmbient) || isnan(humidityAmbient)) {
// if error reading DHT22 set all to 0
temperatureAmbient = 0;
humidityAmbient = 0;
dewPointAmbient = 0 ;
anError = true;
}
else {
// if no error reading DHT22 calc dew point
// Using the more complex dew point calculation
logEx=0.66077 + 7.5*temperatureAmbient/(237.3+temperatureAmbient) + (log10(humidityAmbient) - 2);
dewPointAmbient = (logEx - 0.66077)*237.3/(0.66077+7.5-logEx);
// This is the simpler calc
// dewPointAmbient = temperatureAmbient - ((100 - humidityAmbient)/5.0);
anError = false;
}
return anError;
}
boolean getDS18B20data(int theHeater) {
boolean anError = false;
// if sensor/heater connected, start the sensor,
// read temperatures & save to global array tempHeater
// I used to have a 1sec delay after each read, but not needed ?
if (theHeater == 0) {
sensor1.begin();
sensor1.requestTemperatures();
tempHeater[theHeater] = sensor1.getTempCByIndex(0);
}
if (theHeater == 1) {
sensor2.begin();
sensor2.requestTemperatures();
tempHeater[theHeater] = sensor2.getTempCByIndex(0);
}
if (theHeater == 2) {
sensor3.begin();
sensor3.requestTemperatures();
tempHeater[theHeater] = sensor3.getTempCByIndex(0);
}
if (theHeater == 3) {
sensor4.begin();
sensor4.requestTemperatures();
tempHeater[theHeater] = sensor4.getTempCByIndex(0);
}
if (tempHeater[theHeater] == -127) {
anError = true;
}
return anError;
}
int setDutyCycle(int theHeater) {
// set output duty cycle for each heater, using temp diff between heater and ambient dew point
float aboveDewPoint;
float theDutyCycle = 0;
if (errorDHT22 || errorDS18B20[ theHeater ]) {
// Heater OFF if error reading DHT22 or DS18B20 (for this heater)
theDutyCycle = 0;
}
else {
if ( tempHeater[ theHeater ] > tempCutOff ) {
// Heater OFF if above cut-off
theDutyCycle = 0;
}
else {
// Heater ON if Temp < Threshold(C) above dew point(C)
aboveDewPoint = tempHeater[ theHeater ] - dewPointAmbient;
// restrict between 0 & threshold
aboveDewPoint = constrain( aboveDewPoint , 0.0 , dewPointThreshold );
// PWM 0 - 100% duty cycle EQUIV TO analog 0 - 255
theDutyCycle = 255 * (( dewPointThreshold - aboveDewPoint ) / dewPointThreshold );
}
}
return theDutyCycle;
}
void displayAmbientData() {
lcd.clear(); // clear & set cursor to 0,0
lcd.setCursor (0,0); // go to start of 2nd line
if (errorDHT22) {
// error reading DHT22
lcd.print("Temp Humidty DewPt");
lcd.setCursor (0,1); // go to start of 2nd line
lcd.print("-error DHT22-");
}
else {
// if ambient read okay display DHT22 data
lcd.print("Ambient");
lcd.setCursor (0,1);
lcd.print("Temp = ");
lcd.print(temperatureAmbient, 0);
lcd.print(char(223));
lcd.print("C ");
lcd.setCursor (0,2);
lcd.print("Humidity = ");
lcd.print(humidityAmbient, 0);
lcd.print("% ");
lcd.setCursor (0,3);
lcd.print("DewPoint = ");
lcd.print(dewPointAmbient, 0);
lcd.print(char(223));
lcd.print("C ");
}
delay(theDelay*2 );
}
void displayHeaterData( int theHeater ) {
float thePerCentDutyCycle;
thePerCentDutyCycle = 100 * heaterDutyCycle[ theHeater ] / 255;
lcd.clear(); // clear & set cursor to 0,0
lcd.print("Heater ");
lcd.print(theHeater+1);
lcd.print(": ");
lcd.print(tempHeater[ theHeater] , 0);
lcd.print(char(223));
lcd.print("C ");
if (tempHeater[ theHeater] > tempCutOff) {
// if above cut-off
lcd.print("CutOFF");
}
else {
if ((tempHeater[ theHeater] - dewPointAmbient) > 0) {
lcd.print("(+");
}
else {
lcd.print("(");
}
lcd.print(tempHeater[ theHeater] - dewPointAmbient , 0);
lcd.print(")");
}
lcd.setCursor (0,1); // go to start of 2nd line
lcd.print("Power: ");
lcd.print(thePerCentDutyCycle , 0);
lcd.print("%");
delay(theDelay*2);
}
|
Last edited by Shand359; 20-10-2016 at 10:39 PM.
Reason: adding text
|
21-10-2016, 04:10 AM
|
Registered User
|
|
Join Date: Jul 2016
Location: Ayr
Posts: 12
|
|
Well done Shand
|
24-10-2016, 10:01 AM
|
|
Formally Escortitis
|
|
Join Date: Sep 2016
Location: Perth
Posts: 20
|
|
Hi Chris,
Thought it worth mentioning a few issues I ran into over the weekend with the latest update. I had not been running a screen with my unit which has been running great on two channels using the 2nd August update, but when a 128x64 oled arrived Friday, I decided to install it, and also update to the most recent code release.
Much frustration ensued until i realized the display initialize is 0x3D. This seems contrary to your notes in the code. The SSD1306 screen I used is in the link below, I'm not sure why it would be different to what you used originally, but maybe something I missed?
http://core-electronics.com.au/monoc...c-display.html
Anyway, with that issue out of the way, the next glitch had the display not advance past the intro screen (threshold/cutoff etc..). And this one I can't seem to work out. The code seem's identical with regards to screen function across the two updates, I haven't line for lined the code but from a quick scroll I couldn't find any reasons why it should not work (screen only that is, heater function was fine). If I swap back to the August-2nd update code, make the 0x3c - 0x3D change, everything runs fine.
I will keep hunting for the issue, but thought I would let you know what I experienced.
|
12-12-2016, 07:41 AM
|
Registered User
|
|
Join Date: Dec 2016
Location: San Diego
Posts: 4
|
|
Chris, Awesome design. I love that this can be put together with no bread boarding or soldering. Thank you for sharing!
Is there any chance you could make a code revision to display in Fahrenheit?
Thank you,
Matt
|
16-12-2016, 12:55 AM
|
Registered User
|
|
Join Date: Dec 2016
Posts: 2
|
|
Hi Chris,
Thanks for a great project. Im currently 'trying' to make it work. After a lot of head scratching over v.3 and the dht error, I finally decided to read the entire thread and found v.4! This has compiled nicely.
Im now battling a multi-format OLED which is configured in some odd way, I think for 3SPI. Hopefully get the display working (another, I2C only one on order anyway) soon, and can crack on with the sensors!
Martin
|
Thread Tools |
|
Rate This Thread |
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +10. The time is now 05:20 AM.
|
|