Show Posts
Pages: 1 ... 36 37 [38] 39 40
556  Using Arduino / Project Guidance / Re: Temp measurement and display on: August 14, 2011, 06:03:02 pm
hey, thanks that works great. I'm still really new to the arduino but learning little bits here and there especially thanks to people like yourself smiley

would it be complicated to have the degrees c symbol move to the left by one space when the temperature reading is in single figures?

Edit...

tried putting in if/else statements. It does compile and run but when the temp is <10 i get two degrees symbols for example 2°°C?

is it ignoring the if/else and just running both?

Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);




#include <math.h>

double Thermister(int RawADC) {
 double Temp;
 Temp = log(((10240000/RawADC) - 10000));
 Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
 Temp = Temp - 273.15;            // Convert Kelvin to Celcius

 return Temp;
}

void setup() {
lcd.begin(16, 2);
delay(100);
 Serial.begin(115200);
   pinMode(13, OUTPUT);     
}





void loop() {
    lcd.clear();
 
      lcd.setCursor(0,0);
lcd.print(int(Thermister(analogRead(0))));


if (int(Thermister(analogRead(0)))  <= 10)
{
  lcd.setCursor(1,0);
  lcd.print((char)223);
 
 
    lcd.setCursor(2,0);
    lcd.print ("c");  // action A
}
else if (int(Thermister(analogRead(0)))  >= 10)
{
  lcd.setCursor(2,0);
  lcd.print((char)223);
 
 
    lcd.setCursor(3,0);
    lcd.print ("c");  // action B
}


 
  lcd.setCursor(2,0);
  lcd.print((char)223);
 
 
    lcd.setCursor(3,0);
    lcd.print ("c");



 Serial.println(int(Thermister(analogRead(0))));  // display Fahrenheit
 
 
   digitalWrite(13, HIGH);   // set the LED on
  delay(2);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(10000);              // wait for a second
 
}

557  Using Arduino / Project Guidance / Re: Temp measurement and display on: August 14, 2011, 05:32:20 pm
right, if i reset the board when the temp is below 10 degrees the lcd displays fine, so I guess when it goes below 10 I need to clear the display or something?
558  Using Arduino / Project Guidance / Temp measurement and display on: August 14, 2011, 05:16:43 pm
hi all, just messing around and getting used to the arduino.

I've hooked up a 10k thermistor and got it working using a tutorial to feedback data over serial. I have added too the code to display on my lcd screen. It works but when the temp goes below 10 degrees the display moves the digit over so for example 9 degrees reads 90. It does not display like this on the serial monitor however, but I used the same code to get the data over the display?
Hope that makes sense!

Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);




#include <math.h>

double Thermister(int RawADC) {
 double Temp;
 Temp = log(((10240000/RawADC) - 10000));
 Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
 Temp = Temp - 273.15;            // Convert Kelvin to Celcius

 return Temp;
}

void setup() {
lcd.begin(16, 2);
delay(100);
 Serial.begin(115200);
}





void loop() {
 
      lcd.setCursor(0,0);
lcd.print(int(Thermister(analogRead(0))));
 
  lcd.setCursor(2,0);
  lcd.print((char)223);
 
 
    lcd.setCursor(3,0);
    lcd.print ("c");



 Serial.println(int(Thermister(analogRead(0))));  // display Fahrenheit
 delay(1000);
}

559  Topics / Home Automation and Networked Objects / Re: Time/temperature controller on: August 13, 2011, 09:43:16 pm
looks great! any videos? smiley
560  Using Arduino / General Electronics / Re: Thermistor question on: August 12, 2011, 10:36:26 pm
I see, so really all that would vary would be the current? but still 5v as you say
561  Using Arduino / General Electronics / Thermistor question on: August 12, 2011, 09:31:21 pm
I have just started messing with a 10k thermistor and got a temperature to display on my lcd using the first simple example on this page http://www.arduino.cc/playground/ComponentLib/Thermistor2

is this anymore or less accurate from using the longer examples and/or a look up table?

also, what are the pro's (if any) and cons of not using a voltage divider and just running 5v through the 10k thermistor and measuring what comes out the other side?

how long could the cable to the thermistor be without effecting the resistance too much?

thanks!
562  Using Arduino / Displays / Re: LCD does not work unless Arduino is reset. on: August 12, 2011, 09:07:36 pm
still got the problem with mine, delay does not seem to help, I've even tried up too 10 seconds
563  Using Arduino / Project Guidance / Re: Three voltage measurements + output to a LCD screen on: August 08, 2011, 05:43:31 pm
Hi, yes the lcd lib is the most recent I think, it states the date that you mentioned smiley-sad
564  Using Arduino / Project Guidance / Re: Three voltage measurements + output to a LCD screen on: August 05, 2011, 07:03:29 am
hey mate.

I have tried a delay as the first instance in the set-up, still doesn't work 9 times out of 10. I have even tried up to 10 seconds delay smiley-sad

Is it possible to issue a command for a full reset? so it will reset once on its own? Thinking about it probably not because it will just loop on reset won't it lol.

Do you think it needs something in the library changing?

thanks
565  Using Arduino / Project Guidance / Re: Three voltage measurements + output to a LCD screen on: August 04, 2011, 07:05:21 am
I guess it must be something to do with initial power up, I hope I don't have to have a hardware solution to fix it!

Thanks I will take a look at the links. The thing is we have about 400 of those screens at work, they were given as part payment from a customer, so I have no idea where they came from and it would be really good to be able to get some use out of them so I would like to fathom it out lol.

I tried a delay as the first thing the code runs but no luck smiley-sad

your phi-shields look useful I might have to get one for fiddling at home smiley

Thanks again
566  Using Arduino / Project Guidance / Re: Three voltage measurements + output to a LCD screen on: August 03, 2011, 05:28:24 pm
I think you are right there, i have a same set-up at home (arduino uno, same model lcd) and that is also temperamental with exactly the same fault. I don't have any different LCD's to try I don't think, although I may have a serial display at work that I could possibly look at.

what kind of additions to the code do you have to put in to get your screen to work?

thanks for your time by the way  smiley
567  Using Arduino / Project Guidance / Re: Three voltage measurements + output to a LCD screen on: August 03, 2011, 11:54:29 am
When it first powers up I get solid black along the first line ie. all pixels. 9 times out of 10 it hangs like this until I reset the board, rarely these squares appear for around 1-2 seconds then the code runs.

I have tried powering from 12v dc, and usb both with the same issue?

I am using a 150ohm resistor on the back light to drop from 5v to approx 4v

I have just uploaded a short video, let me know if you can view the format. http://shedbass.net/dtokez/VID_20110803_174424.m4v

thanks again!
568  Using Arduino / Project Guidance / Re: Three voltage measurements + output to a LCD screen on: August 03, 2011, 08:11:25 am
Excellent thanks, |measured Aref to gnd and got a difference of 5.02v so you were bang on smiley

When I measure the 5v line to gnd I get about 4.9v - But I guess its the analoge ref that counts?

One issue I'm having is that sometimes the board does not run when first plugged in, I have to reset. This would be a bit of a pain once its mounted in an enclosure lol
Is there something wrong with the setup in the code?
Here is what I have now..

Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

int analoginput = 0;
int analoginput1 = 1;
int analoginput2 = 2;
float vin = 0.0;
float vin1 = 0.0;
float vin2 = 0.0;

void setup(){
 
 // declaration of pin modes
 lcd.begin(16, 2);
delay(100);


    lcd.setCursor(0, 0);
   lcd.print("REAPsystems V1.1");
       lcd.setCursor(0, 1);
   lcd.print("iSensor tester");
   
   
   delay(4000);
   
   
   
  lcd.clear();

}



void loop(){
 
 
     delay(1400);


 // read the value on analog input
lcd.setCursor(0,0);
lcd.print ("Vin:");
vin = analogRead(analoginput)*5.023/1024*2;
lcd.print(vin, 3);
lcd.setCursor(9,0);
lcd.print ("v");
 
lcd.setCursor(0,1);
lcd.print ("A:");
vin1 = analogRead(analoginput1)*5.023/1024;
lcd.print(vin1, 2);
lcd.setCursor(6,1);
lcd.print ("v");


lcd.setCursor(9,1);
lcd.print ("B:");
vin2 = analogRead(analoginput2)*5.023/1024;
lcd.print(vin2, 2);
lcd.setCursor(15,1);
lcd.print ("v");


delay(1400);

}

Thanks for the help!

569  Using Arduino / Project Guidance / Re: Three voltage measurements + output to a LCD screen on: August 02, 2011, 10:29:40 am
Got it working now thanks  smiley-cool

I did not use 10 ohm resistors though as the current would have been stupid lol silly me!

One thing though, is there a way of calibrating, or is there no real reason why it should not be accurate?

when I place a voltage on one of the inputs, sometimes (more often than not) one of the other inputs rise a little. is this just noise?

I don't really want to decrease the value of the pull down's because someone suggested that its not really that good to have the analogue pulling to gnd

thanks for all the help  smiley
570  Using Arduino / Project Guidance / Re: Three voltage measurements + output to a LCD screen on: August 02, 2011, 09:29:11 am
I need to use a voltage divider I think, and if I used two 10ohm resistors I should get 2.5v from 5v according to my calculations?

The thing I'm confused about is how would I adapt the coding?
Pages: 1 ... 36 37 [38] 39 40