Temp sensor problems

Related to the development libraries, released by Curt Binder
Post Reply
Bryan
Posts: 147
Joined: Wed Jul 06, 2011 1:49 am
Location: Vancouver, B.C.

Temp sensor problems

Post by Bryan »

Roberto:

Having an issue with the temp sensor set-up. When added to the board they do not show up on the display. only one can be read at a time. if I reboot, the unit freezes, display is black until I unplug one of them and then it returns to life. Will only operate with one sensor

Also noted that even when just using one sensor, no matter what socket I plug it in, it only displays on T1

Here is my ReefFeatures.h


#ifndef __REEFANGEL_FEATURES_H__
#define __REEFANGEL_FEATURES_H__


#define WavemakerSetup
#define ATOSetup
#define MetalHalideSetup
#define wifi
#define StandardLightSetup
#define DirectTempSensor
#define DisplayLEDPWM



#endif // __REEFANGEL_FEATURES_H__


main.cpp

#include <WProgram.h>
//#include <wsupport.h>




#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>






void setup()
{
ReefAngel.Init(); //Initialize controller

// Ports that are always on
ReefAngel.Relay.On(Port8);
ReefAngel.LCD.SetContrast(30); // Set contrast to 60
}

void loop()
{
ReefAngel.ShowInterface();

// Specific functions
ReefAngel.StandardATO(Port1);
ReefAngel.StandardLights(Port2);
ReefAngel.MHLights(Port3);
ReefAngel.Wavemaker1(Port4);
ReefAngel.Wavemaker2(Port5);
ReefAngel.StandardFan(Port6);
ReefAngel.StandardHeater(Port7);
}






int main(void)
{
init();

setup();

for (;;)
{
loop();
}
return 0;
}
-=Bryan=-
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Temp sensor problems

Post by rimai »

It will always be T1 no matter which port.
It's a digital sensor and will be assigned T1, T2 and T3 according to the laser incribed address it was assigned at manufacturing following their order of release. Each sensor has a unique address.
But, the way you are describing, it seems you have a bad probe.
Do you get readings from both of sensors if they are plugged individually?
Roberto.
Bryan
Posts: 147
Joined: Wed Jul 06, 2011 1:49 am
Location: Vancouver, B.C.

Re: Temp sensor problems

Post by Bryan »

Roberto:

Probes are fine, each one plugged in individually and they work (have to reboot though), plug in two and reboot the screen goes black, pull out a sensor and the screen jumps to life and everything is fine. ??
-=Bryan=-
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Temp sensor problems

Post by rimai »

Are you running your board on 3.3V or 5V?
Roberto.
Bryan
Posts: 147
Joined: Wed Jul 06, 2011 1:49 am
Location: Vancouver, B.C.

Re: Temp sensor problems

Post by Bryan »

5V
-=Bryan=-
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Temp sensor problems

Post by rimai »

Can you tell me the value of R29?
Roberto.
Bryan
Posts: 147
Joined: Wed Jul 06, 2011 1:49 am
Location: Vancouver, B.C.

Re: Temp sensor problems

Post by Bryan »

4.7K
-=Bryan=-
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Temp sensor problems

Post by rimai »

Are you extending the cable?
4k7 should be good enough.
I used even 10K before with no problems.
But in your case, it seems not to be the case.
Would you be able to change it to a smaller one?
Any value above 1K should be good.
Roberto.
Bryan
Posts: 147
Joined: Wed Jul 06, 2011 1:49 am
Location: Vancouver, B.C.

Re: Temp sensor problems

Post by Bryan »

Hi Roberto:

Cable not extended, tried 2K and no luck same thing, wonder if it is a code issue. Do you have a default PDE that I should use to test.
-=Bryan=-
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Temp sensor problems

Post by rimai »

Very weird.
I wonder if it has anything to do with the libraries on AVR Studio.
Try loading up this hex file.
It's compiled with avr-gcc through Arduino IDE.
Attachments
LibraryTest.zip
(19.55 KiB) Downloaded 496 times
Roberto.
Bryan
Posts: 147
Joined: Wed Jul 06, 2011 1:49 am
Location: Vancouver, B.C.

Re: Temp sensor problems

Post by Bryan »

Hi Roberto:

Afraid you may be right <sigh>. Do you mind posting the sketch you used. I think I might know what the problem is in AVRStudio, but want to make sure I have the right sketch code first.
-=Bryan=-
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Temp sensor problems

Post by rimai »

I actually used the standard libraries, but here is the sketch.
Attachments
LibraryTest.pde
(2.18 KiB) Downloaded 422 times
Roberto.
Bryan
Posts: 147
Joined: Wed Jul 06, 2011 1:49 am
Location: Vancouver, B.C.

Re: Temp sensor problems

Post by Bryan »

I think it might be one of the compiler optimization flags I am using in AVRStudio that could be causing the problem. They both use AVR-GCC so can't see why it would not work other than my addition of additional flags.
-=Bryan=-
Bryan
Posts: 147
Joined: Wed Jul 06, 2011 1:49 am
Location: Vancouver, B.C.

Re: Temp sensor problems

Post by Bryan »

Yup, that was what it was, one of the optimization flags I was using, just not sure which one though, will be a process of elimination. Used the standard flags that Arduino uses and it worked, albeit a larger hex size.
-=Bryan=-
Post Reply