Pages: 1 2 3 [4] 5 6 7   Go Down
Author Topic: Automated Reptile Control System(webserver, Data Logging, RTC and much more)  (Read 36643 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ps. what rtc module do you use ? I do not know why but I just can not start mine - it is Tiny RTC I2C module...
thanks!

Really appreciate your help and response!!!
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 48
Posts: 2297
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have five of those, they cost a couple of dollars each, and they all work fine. I have heard that they must have a battery installed to work. I don't understand why, but somebody recently had a dud battery and that was apparently the problem.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I will test the battery ( perhaps I will buy another RTC)

Would you have an idea when trying to connect with smartphone, arduino freezes - orange led starts blinking and no response...
Is there a way to use mobile devices with your control system?
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 48
Posts: 2297
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No idea, I don't have a smart phone.  My involvement is more about feeds to the internet and the only mobile device is a laptop getting the same data feed via bluetooth. 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No idea, I don't have a smart phone.  My involvement is more about feeds to the internet and the only mobile device is a laptop getting the same data feed via bluetooth. 

thanks for fast reply!

I wonder if there is anybody who has tried to connect to this sketch with a smartphone ?

Thanks !
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,

thanks - manual moisture control works now.

I have encountered another issue, when trying to connect with smartphone, arduino freezes - orange led starts blinking and no response...
Is there a way to use mobile devices with your control system?

Thanks!

i have experienced this as well when using the stock android browser. i have to use Mobile Fire Fox browser and i have no issues when using my smart phone. i have not determined what the cause of this behavior is. Just use fire fox mobile and you should not have any problems. there must be some issue with how the stock andriod browser behaves that keep the sketch in an infinite loop within the client connected code.

Thanks, I will test the battery ( perhaps I will buy another RTC)

Would you have an idea when trying to connect with smartphone, arduino freezes - orange led starts blinking and no response...
Is there a way to use mobile devices with your control system?

the battery is required to keep the RTC module's time going when no external power is applied. otherwise the clock resets to zero.

ps. what rtc module do you use ? I do not know why but I just can not start mine - it is Tiny RTC I2C module...
thanks!

Really appreciate your help and response!!!
i just did a search on amazon for RTC modules.



« Last Edit: March 31, 2013, 10:21:27 am by wallaceb » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi, any idea why I am only getting Middle Ground temp reading although Cold and Middle sensors connected.
Two one wire sensors with 4,7k resistors on each.

thanks!
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 48
Posts: 2297
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You only need one 4k7 but I don't know if this is the cause of your problem.
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi, any idea why I am only getting Middle Ground temp reading although Cold and Middle sensors connected.
Two one wire sensors with 4,7k resistors on each.

thanks!

i honestly do not know. i myself have one 4.7k resistor per sensor as well since each data line goes to its own dedicated I/O pin. do you have the sensors connected to the correct pin? have you tried to make sure the sensors that are not working, work correctly when connected to the I/O pin of one that does?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi, any idea why I am only getting Middle Ground temp reading although Cold and Middle sensors connected.
Two one wire sensors with 4,7k resistors on each.

thanks!

i honestly do not know. i myself have one 4.7k resistor per sensor as well since each data line goes to its own dedicated I/O pin. do you have the sensors connected to the correct pin? have you tried to make sure the sensors that are not working, work correctly when connected to the I/O pin of one that does?
As far as I know one wire sensors are attached to 22,24,26, 28,30 pins.
Only getting Middle Ground readings, however after switching from Celsius to Fahrenheit I can get readings wherever sensor is connected, do you work on F or C?
thanks!!!
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i keep mine in F the entire time. i just checked, and it is doing the same thing on my system when set to C.... i will have to look into what is going on.
« Last Edit: April 12, 2013, 06:07:58 pm by wallaceb » Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

found the issue

change the current code:

Code:
void CONVERT_TEMP(byte Sensor_PIN, byte & temp_whole, byte & temp_fract, byte & temp_status) {
  OneWire  dSensor1(Sensor_PIN);
  byte i;
  byte present = 0;
  byte data[12];
  byte addr[8];
  int HighByte, LowByte, TReading, SignBit, Tc_100;
 
 
  if ( !dSensor1.search(addr)) {
    dSensor1.reset_search();
    delay(250);
    temp_whole = 0;
    temp_fract = 0;
    temp_status = 0;
    badsensorcount ++;
    return;
  }

  if ( OneWire::crc8( addr, 7) != addr[7]) {
      temp_whole = 0;
    temp_fract = 0;
    temp_status = 0;
    badsensorcount ++;
    return;
  }

  // The DallasTemperature library can do all this work for you!

  dSensor1.reset();
  dSensor1.select(addr);
  dSensor1.write(0x44,0);         // start conversion, without parasite power on at the end
 
  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a dSensor1.depower() here, but the reset will take care of it.
 
  present = dSensor1.reset();
  dSensor1.select(addr);   
  dSensor1.write(0xBE);         // Read Scratchpad

  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = dSensor1.read();
  }

  LowByte = data[0];
  HighByte = data[1];
  TReading = (HighByte << 8) + LowByte;
  SignBit = TReading & 0x8000;  // test most sig bit
  if (SignBit) // negative
  {
    TReading = (TReading ^ 0xffff) + 1; // 2's comp
  }
  Tc_100 = (6 * TReading) + TReading / 4;    // multiply by (100 * 0.0625) or 6.25
 
  if (temp_scale == 1){//if using degrees F, the celcius reading from the sensor must be converted
     temp_whole = (int)(((Tc_100)*(1.8))+3200)/100;
     temp_fract = (int)(((Tc_100)*(1.8))+3200)%100;
     if (temp_whole > 32){
       temp_status = 1;//if the temperature is above 32 degrees F, then the sensor is OK
     }else{
       temp_status = 0;//the sensor must be bad as the temperature must never get down as low as 32 degrees F, the snake would die!!
     }
   }else{//if using degrees C, the temp reading is good as is.
     middle_temp_whole = Tc_100/100;
     middle_temp_fract = Tc_100%100;
     if (temp_whole > 0){
       temp_status = 1;//if the temperature is above 0 degrees C, then the sensor is OK
     }else{
       temp_status = 0;//the sensor must be bad as the temperature must never get down as low as 0 degrees C
     }
   }
}

to

Code:
void CONVERT_TEMP(byte Sensor_PIN, byte & temp_whole, byte & temp_fract, byte & temp_status) {
  OneWire  dSensor1(Sensor_PIN);
  byte i;
  byte present = 0;
  byte data[12];
  byte addr[8];
  int HighByte, LowByte, TReading, SignBit, Tc_100;
 
 
  if ( !dSensor1.search(addr)) {
    dSensor1.reset_search();
    delay(250);
    temp_whole = 0;
    temp_fract = 0;
    temp_status = 0;
    badsensorcount ++;
    return;
  }

  if ( OneWire::crc8( addr, 7) != addr[7]) {
      temp_whole = 0;
    temp_fract = 0;
    temp_status = 0;
    badsensorcount ++;
    return;
  }

  // The DallasTemperature library can do all this work for you!

  dSensor1.reset();
  dSensor1.select(addr);
  dSensor1.write(0x44,0);         // start conversion, without parasite power on at the end
 
  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a dSensor1.depower() here, but the reset will take care of it.
 
  present = dSensor1.reset();
  dSensor1.select(addr);   
  dSensor1.write(0xBE);         // Read Scratchpad

  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = dSensor1.read();
  }

  LowByte = data[0];
  HighByte = data[1];
  TReading = (HighByte << 8) + LowByte;
  SignBit = TReading & 0x8000;  // test most sig bit
  if (SignBit) // negative
  {
    TReading = (TReading ^ 0xffff) + 1; // 2's comp
  }
  Tc_100 = (6 * TReading) + TReading / 4;    // multiply by (100 * 0.0625) or 6.25
 
  if (temp_scale == 1){//if using degrees F, the celcius reading from the sensor must be converted
     temp_whole = (int)(((Tc_100)*(1.8))+3200)/100;
     temp_fract = (int)(((Tc_100)*(1.8))+3200)%100;
     if (temp_whole > 32){
       temp_status = 1;//if the temperature is above 32 degrees F, then the sensor is OK
     }else{
       temp_status = 0;//the sensor must be bad as the temperature must never get down as low as 32 degrees F, the snake would die!!
     }
   }else{//if using degrees C, the temp reading is good as is.
     temp_whole = Tc_100/100;
     temp_fract = Tc_100%100;
     if (temp_whole > 0){
       temp_status = 1;//if the temperature is above 0 degrees C, then the sensor is OK
     }else{
       temp_status = 0;//the sensor must be bad as the temperature must never get down as low as 0 degrees C
     }
   }
}
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i realized i never put up pictures of my entire final setup










Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks great, everything is organized as it should be - but where is the snake smiley-wink ?

Have you update your code recently ?
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks great, everything is organized as it should be - but where is the snake smiley-wink ?

Have you update your code recently ?

the snake only like to come out at night  smiley-sleep

my latest will be uploaded later tonight. only a few small things have been tweaked, and i re-added corrected code so the RTC will update off NTP servers once a day.
Logged

Pages: 1 2 3 [4] 5 6 7   Go Up
Jump to: