Show Posts
Pages: [1]
1  Using Arduino / Sensors / Re: DS18B20 error on: June 26, 2012, 05:12:06 am
yes, it works when taking out.
2  Using Arduino / Sensors / Re: DS18B20 error on: June 25, 2012, 01:44:15 am
Hello,
I connected the shield to the ground like MarkT suggested. I also changed the 4k7 to a 2k2 resistor. But no positive result. The same problem, sometimes everything works good, and sometimes the reading of the 8 sensors give -127. If I then remove 1 sensor than the reading of the other 7 sensors are ok again, and I get a -127 value for the removed sensor. Could the sensor be broken? I will try changing the sensor and hope it will fix the problem.
3  Using Arduino / Sensors / Re: DS18B20 error on: June 19, 2012, 01:53:17 am
Thank you for your replys.

I use 3 wire setup. Max length is 3 meter. I use a normal wire ( coating with inside 3 wire + shield wire around. but the “shield” wire is not connected to ground). Max temp. are 90°C.
I updated the “onwire” lib, but the same problems. I now replaced the arduino with another. For the moment no problems. Maybe the arduino was “broken”. It was not new, I used it before on other projects, but it did works for a few months. I will try the new arduino, if I get the problem again, I will connect one side of the shield wire to ground.
Thanks for the reply, I will keep you updated.
4  Using Arduino / Sensors / DS18B20 error on: June 18, 2012, 12:46:55 am
Hello,
I made a temperature controller unit for my car. It runs on WVO. It measures 8 different temperatures with the DS18B20. Everything works great for a month now, but a few days ago suddenly a get the temperature -127 on the lcd for all the 8 sensors. When I removed 1 specific sensor everything works again ( I get a -127 for that sensor on the lcd ). I replaced this sensor with another DS18B20 and it works again. So, problem solved I thought. But this morning, I get the error again.(-127 value for al the sensors )
After a minute the values where back to normal. I worked with the “old” Onewire lib in my arduino software. So I downloaded the latest version a will trie to upload my sketch later this day to see if this solved the problem.
Anyone another suggestion? Someone can explain this or had this problem also?
Thanks

Code:
/*
  Example of using the SparkSoftLCD library for the Arduino
 
  2010 C. A. Church
     http://openmoco.org/   
*/

 

#include "SparkSoftLCD.h"

#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into pin 3 on the Arduino
#define ONE_WIRE_BUS 3

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

// Assign the addresses of your 1-Wire temp sensors.
// See the tutorial on how to obtain these addresses:
// http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html
DeviceAddress TempSensor1 = { 0x28, 0x53, 0x5C, 0xEC, 0x02, 0x00, 0x00, 0xC9 };
DeviceAddress TempSensor2 = { 0x28, 0x75, 0x61, 0xEC, 0x02, 0x00, 0x00, 0xA5 };
DeviceAddress TempSensor3 = { 0x28, 0xBA, 0x6C, 0xEC, 0x02, 0x00, 0x00, 0xF2 };
DeviceAddress TempSensor4 = { 0x28, 0x9C, 0x3F, 0x82, 0x03, 0x00, 0x00, 0x03 };
DeviceAddress TempSensor5 = { 0x28, 0x35, 0x43, 0x82, 0x03, 0x00, 0x00, 0x85 };
DeviceAddress TempSensor6 = { 0x28, 0x1D, 0x3B, 0x82, 0x03, 0x00, 0x00, 0xC1 };
DeviceAddress TempSensor7 = { 0x28, 0xAB, 0x2E, 0x82, 0x03, 0x00, 0x00, 0xDA };
DeviceAddress TempSensor8 = { 0x28, 0x0E, 0x47, 0x82, 0x03, 0x00, 0x00, 0x8F };


  // LCD transmit pin
#define LCD_TX 2

SparkSoftLCD lcd = SparkSoftLCD(LCD_TX);

int temperatuur1=0;  // Warmte wisselaar
int temperatuur2=0;  // IP ingang, deze mag niet boven de 69°C komen. vanaf 66°C moet de elektrische verwarming van de filter uitgeschakeld worden. Vanaf 69°C moet de bypas opspringen. Op 68°c mag deze terug afspringen
int temperatuur3=0;  // Temperatuur Filter
int temperatuur4=0;  // Buiten temperatuur
int temperatuur5=0;  // IP uitgang
int temperatuur6=0;  // Temperatuur Tracing, deze mag max 45°C worden,
int temperatuur7=0;  // Temperatuur Leiding
int temperatuur8=0;  // Temperatuur tank

int outputTR =  4;  // Aansturen Tracing 
int outputFI =  5;  // Aansturen verwarming Filter
int outputVA =  6;  // Aantsturen vacuumklep
int outputBY =  7;  // Aansturen ByPass

void setup() {
 
 pinMode(outputTR, OUTPUT);
 pinMode(outputFI, OUTPUT);
 pinMode(outputVA, OUTPUT);
 pinMode(outputBY, OUTPUT);
 pinMode(8, OUTPUT);
 pinMode(9, OUTPUT);
 
 
 
Serial.begin(9600);
  sensors.begin();
  // set the resolution to 10 bit (good enough?)
  sensors.setResolution(TempSensor1, 10);
  sensors.setResolution(TempSensor2, 10);
  sensors.setResolution(TempSensor3, 10);
  sensors.setResolution(TempSensor4, 10);
  sensors.setResolution(TempSensor5, 10);
  sensors.setResolution(TempSensor6, 10);
  sensors.setResolution(TempSensor7, 10);
  sensors.setResolution(TempSensor8, 10);
 
 
   // setup lcd
   
 pinMode(LCD_TX, OUTPUT);
 lcd.begin(9600);
 lcd.clear();
 
   // hidden cursor
 lcd.cursor(0);
 
 show_setup();
 

}

void printTemperature(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
 //float temp1 = sensors.getTempC(TempSensor1);
  if (tempC == -127.00) {
    Serial.print("Error getting temperature");
  } else {
    Serial.print("C: ");
    Serial.print(tempC);
    Serial.print(" F: ");
    Serial.print(DallasTemperature::toFahrenheit(tempC));
  }
}

void loop() {
 
 sensors.requestTemperatures();
 
 temperatuur1 = sensors.getTempC(TempSensor1);
 temperatuur2 = sensors.getTempC(TempSensor2);
 temperatuur3 = sensors.getTempC(TempSensor3);
 temperatuur4 = sensors.getTempC(TempSensor4);
 temperatuur5 = sensors.getTempC(TempSensor5);
 temperatuur6 = sensors.getTempC(TempSensor6);
 temperatuur7 = sensors.getTempC(TempSensor7);
 temperatuur8 = sensors.getTempC(TempSensor8);
 
 // Serial.print("Getting temperatures...\n\r");
 //                                      sensors.requestTemperatures();
 
  //Serial.print("Temp5: ");
 // printTemperature(TempSensor1);
  //Serial.print("\n\r");
  //Serial.print("Temp2: ");
  //printTemperature(TempSensor2);
  //Serial.print("\n\r");
  //Serial.print("temperatuur1: ");
 //Serial.print(temperatuur5);
 // Serial.print("\n\r");
  //Serial.print("temperatuur2: ");
  //Serial.print(temperatuur2);
  //Serial.print("\n\r");
  //Serial.print("temperatuur3: ");
  //Serial.print(temperatuur3);
  //Serial.print("\n\r\n\r");
 
 

 
  delay (400);
    lcd.clear();
   
      // block-style blinking cursor:2
      // underscore style cursor:1
      // hidden cursor:0
    lcd.cursor(0);
    // cursorTO ( rij, kolom )
    lcd.cursorTo(1,1);
    lcd.print("WW  IP  FI  OT");
    lcd.cursorTo(1,3);
    lcd.print(temperatuur1);
    lcd.cursorTo(1,7);
    lcd.print(temperatuur2);
    lcd.cursorTo(1,11);
    lcd.print(temperatuur3);
    lcd.cursorTo(1,15);
    lcd.print(temperatuur4);
   // delay(500);
   
   // lcd.clear();
   
      // hidden cursor
    lcd.cursor(0);
    lcd.cursorTo(2,1);
    lcd.print("IP  TR  LE  TA");
    lcd.cursorTo(2,3);
    lcd.print(temperatuur5);
    lcd.cursorTo(2,7);
    lcd.print(temperatuur6);
    lcd.cursorTo(2,11);
    lcd.print(temperatuur7);
    lcd.cursorTo(2,15);
    lcd.print(temperatuur8);
   
   
   
   // regeling tracing
   if ( (temperatuur6) < (-20) )
   {
    digitalWrite(outputTR, LOW); //error, inlezeing gebeurd niet goed
   
   }
   else
   {
      if ( temperatuur6 < 44 )
     {
      digitalWrite(outputTR, HIGH);
     }
   
     else
     {
      digitalWrite(outputTR, LOW);
     }
     
   }
   // regeling filter, inlezen temperatuur ingang IP en temperatuur filter
   
   if ( (temperatuur3) < (-20))
   {
    digitalWrite(outputFI, LOW) ; //error, inlezing temperatuur gebeurd niet goed
   }
   else
   {
     if ( (temperatuur3 < 80)&&(temperatuur2 < 64) )
     {
      digitalWrite(outputFI, HIGH);
     }
     else
     {
      digitalWrite(outputFI, LOW);
     }
     
   }
   
   // regeling Bypass, inlezen temperatuur ingang IP en temperatuur uitgang ip
   
   if (((temperatuur2) < (-20))||((temperatuur5) < (-20) ) )
   {
     digitalWrite(outputBY, LOW);// error, inlezing temperatuur gebeurd niet goed
   }
   else
   {
      if ( (temperatuur2 > 68)||(temperatuur5 >78 ) )
     {
      digitalWrite(outputBY, HIGH);
     }
     else
     {
      digitalWrite(outputBY, LOW);
     }
   
   }

}



void show_setup() {
 
 lcd.print("Frontera on PPO");
 
   // send cursor to 2nd row, first column
 lcd.cursorTo(2,1);
 
 delay(400);
 
 for (byte i = 0; i <= 15; i++ ) {
     delay(150);
       // scroll display to the right
     lcd.scroll(true);
 }
 
 delay(400);
 lcd.print("Version V09");
 
 
 for (byte i = 0; i <= 15; i++ ) {
     delay(150);
       // scroll back to the left, revealing our new text
     lcd.scroll(false);
     //lcd.clear();
 }
 
}
5  Using Arduino / Networking, Protocols, and Devices / Re: How to send a sms with a Sony Ericsson phone on: February 08, 2011, 09:27:30 am
Hello Hulk

Thanks for the post. There where some problems with my account on the new forum. But now it works. I didn’t have the chance testing your code. I ordered a new data cable, but I didn’t received it yet. The other data cable is in use in another project.
Here is my code you asked for.
Code:
#include <NewSoftSerial.h>

NewSoftSerial mySerial(2, 3);//(rxpin, txpin ) green from usb is Rx, white from usb is Tx. So green form usb ( from phone ) is connected with pin 3, white with pin 2.
//use a voltage diveder, the T68i use 3.3V.
int sensPin=0; // analog pin 0 gebruikt om licht sensor in te lezen
int val = 0;// analoge waarde wordt weggeschreven in val
int runonce = 0;// geheugen om maar 1 maal een sms te sturen. Men moet dus de mic resetten wil men het programma terug laten lopen om een sms te sturen
int detect1=0;
int detect2=0;
void setup()  
{
  
  Serial.begin(9600);
  Serial.println("Send SMS with T68");
  // set the data rate for the NewSoftSerial port
  mySerial.begin(9600);
  pinMode(13, OUTPUT);// pin 13 geeft aan wanneer de brander in nood gegaan is


  

}

void loop()                     // run over and over again
{

  if (mySerial.available()) {
      Serial.print((char)mySerial.read());
  }
  if (Serial.available()) {
      mySerial.print((char)Serial.read());
  }
 val = analogRead(sensPin);
 //Serial.println(val);// gebruik dit om de lichtsensor af te regelen op de brander
 
 if ((val>260)&&(detect2==1))
 {
 runonce=1;  
 }
 

  
 
 if((val>260)&&(detect1==0))
 {
  delay(8000);
  detect2=1;
  
 }
 else
 {
   detect2=0;
 }

 
 
 
 if ( (val > 260)&&(runonce==1) )
 {
   runonce=0;
   digitalWrite(13, HIGH);
   //Serial.println("send sms");//test zenden sms
  
  mySerial.println("ati");
  delay(3000);
  mySerial.println("AT+CMGF=0"); // Set PDU mode
  delay(3000);
  mySerial.println("AT+CMGS=31"); // Number of octets
  delay(3000);
  mySerial.print("0011000B912374276628F50000AA134279D84D2ECB41D524F558B40699CCA213"); // Sends "Brander UITGEVALLEN" to "+32477266825"
  delay(3000);
  byte ctrlz = 26;
  mySerial.print(ctrlz);
  delay(3000);
  detect1=1;
  detect2=0;
  
 }

}
6  Forum 2005-2010 (read only) / Interfacing / Re: How to send a sms with a Sony Ericsson phone on: January 20, 2011, 04:36:22 am
Hello Hulk, thanks for the reply. In de mean while I bought a cable and removed the “usb to serial converter”. I connected it to the arduino. With newsoftserial I can send at commands with seralmonitor. The next thing I did was loading your example so the arduino will tell the T68i to send an sms. But I get a error while compiling the example. I get some error that newsoftserial not recognize “myserial.write(26); So I changed that line to:
byte ctrlz = 26;
mySerial.print(ctrlz);
And now it will compile and the program works. The arduino sends an sms with the T68i.
I tried the software sserial2mobile, but it will not work because we use PDU?
So I just use your link: http://www.twit88.com/home/utility/sms-pdu-encode-decode to convert to PDU. Can you send me an example how to read an sms from the T68i? for example when I send an sms “output 13 high” to the T68i, is it possible to read this with the arduino and the put digital pin 13 high?
Thanks,
7  Forum 2005-2010 (read only) / Interfacing / Re: How to send a sms with a Sony Ericsson phone on: January 19, 2011, 01:07:53 am
In the mean while i discovered that the K750i doesn't have a straight serial connection. (I tried everything)  When installing the phone in windows it creates a few virtual com ports. So it's not possible to connect the arduino to the phone straight away.
http://alienproject.wordpress.com/tag/radiometrix-ntx2/
http://alienproject.wordpress.com/2009/04/14/at-commands-with-the-w800/
The only thing you can use is maybe this:
http://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino/
I now bought an old T68i. It came with a KRY 105 192 R2C “USB docking station” :
http://cgi.ebay.co.uk/Sony-Ericsson-KRY-105-192-R2C-KRY-111-117-R6A-Cable-/150544506221
After finding the right driver for this and installed in in xp I saw 1 serial com port. This was the usb to rs232 com port from the docking station. I connected the phone to the docking station, opened HyperTerminal, choose the com port of the docking station and I can send at commands. Later this day I'm going to buy a DCU-11 cable, I will remove the usb to serial converter and will test it when connected the arduino to the T68i. I think I need to use a voltage divider:
http://alienproject.wordpress.com/tag/radiometrix-ntx2/
http://hollandshoogte.wordpress.com/2010/07/27/t68i-sms-working/
I will keep you posted.
8  Forum 2005-2010 (read only) / Interfacing / Re: How to send a sms with a Sony Ericsson phone on: January 12, 2011, 01:44:32 am
Hello, I have a K750i. I connected the phone on XP with hyperterminal. I had to choose the right COM port, but i can send AT commands and it response. I use your example and can send a sms  trough hyperterminal. In computer management I see that there are a few com ports when installing the phone. I had to choose the right one in hyperterminal, otherwise it doesn't work.
I then tried to connect the K750i with arduino. But no result. How does the arduino now witch com port to choose on the phone?
I connected the usb cable to the arduino, except the red (5V) because it than want to charge the phone. I don't now if there is a converter of some kind in the usb cable. Maybe it's better to connect straight to the phone?

Thanks!
9  Forum 2005-2010 (read only) / Interfacing / Re: Sony Ericsson T230 - Working with Arduino. on: January 17, 2011, 07:27:57 am
Hello, i have a sony ericsson K750i. When connecting the phone with the usb cable to the pc, opening hyperterminal and choosing the right com port i'm able to sent an sms with the at commands.
When connecting the phone with the usb calbe to arduino it doesn't work.
When i measure the signals with a scoop when the phone is connected with hyperterminal, i don't see the typical bit train i expect when communicating serial.
anyone any idee? Thanks,

Kind regards
Pages: [1]