Pages: [1] 2   Go Down
Author Topic: using the tx and rx lines  (Read 2339 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am looking to use a sure electronics temp humidity sensor that uses i2c. I am looking to comunicate with the device. I have tried some of the wire library but have had no luck.

Can any point me to some pages that will help me to learn to program my 168 to com with the sensor and print the info on a lcd. I have the lcd library figured out mostly just not how to print a responce to the i2c.
Thanks all,
Hugh
Logged

Sheffield --- UK --
Offline Offline
Sr. Member
****
Karma: 0
Posts: 377
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can't generalize how to communicate with any device which uses i2c, so each device is a little bit different to program, so you want to say which i2c sensor you are using.

But normally the method is something like.

int read_io(int cmd_reg)
{
int tmp;  
Wire.beginTransmission(io_address);
Wire.send(cmd_reg); //  most devices have a command reg , or eeproms have two byte address
Wire.endTransmission(); // now start reading
Wire.requestFrom(io_address, 1); ,< ------ Set the number of bytes to read
tmp=Wire.receive(); // add more if needed or make a loop
return tmp;
}  // end of read_io

io_address is the i2c device address
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Peter,
I will give it a try. I have to send $sure humidity to the unit to get the response from the sensor. I am a newbie and really thanks u for the help. any other pointers would also help.
Hugh smiley
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33974
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you quite sure it is I2C you need because in I2C communications you don't usually send strings like this to devices.
Logged

Sheffield --- UK --
Offline Offline
Sr. Member
****
Karma: 0
Posts: 377
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I was just answering the question, but after farther research I'm still no wiser which sensor you are talking about.

There are sensor in searching for sure electronics, which are serial, sp1 , etc , So it could be anything.    
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks everyone
this is the website with the sensor
 http://www.sure-electronics.net/download/index.php?name=DC-SS500&type=0

It is a DC-SS500 you can input this into there search on this page and get a data sheet.

I do not know if it is I2C for sure. It uses two lines to communicate over. I can also get the data through two analog signals and convert them through some sort of table. I thought it would be easier just to input the data string as came in and use it to display the current temp and humidity.
thanks again,
Hugh
Logged

Sheffield --- UK --
Offline Offline
Sr. Member
****
Karma: 0
Posts: 377
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi , No it`s not i2c is serial .

Baud rate 9600
1 start bits
8 data bits
0 parity bits
1 stop bits

http://www.sure-electronics.net/download/DC-SS500_Ver1.0_EN.pdf
« Last Edit: September 22, 2009, 07:45:13 pm by peter224722 » Logged


Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Hi , No it`s not i2c is serial .

It appears to also have SPI communications capabilities.


Lefty
Logged

Sheffield --- UK --
Offline Offline
Sr. Member
****
Karma: 0
Posts: 377
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes , but if you had a choice which one to use serial or SPI , which you would you pick , and is the easiest to program ?  
Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33974
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but if you had a choice which one to use serial or SPI

SPI if speed was a requirement, but you are limited in distance of the cabling.

Serial if distance to the sensor is important and you don't need data transfer to be so fast. With humidity there is no hurry as it doesn't change that fast.

Quote
and is the easiest to program
Very much the same.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SPI ok I am going to put the sensor and the micro on the same board. So I will not need to travel far with the info. I so need to get the info out of the sensor and  into the 328. There I will use it to contol the A/C during the night mostly to dehumidify the air in the house. The temp is usually ok but the humidity rises. I think with the scroll compressor and the fan on a low speed for short periods of time I can dehumidify and save money over just having the temp set so low that it does the same thing with the humidity. sort of a money saving event at night to be a little more comfurtable.
Thanks all,
Hugh
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have this module but I am unable to get an accurate reading, could you show the code you use in your program?
Thank you
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

[size=12]I do have the same DC-SS500 temperature and humidity sensor from sure-Electronics.
I tried a lot without success. I want to use the SPI interface with the arduino. The sensor is connected with the 4 Pins of the SPI, 5V and GND. Everything what I receive is a echo from my own command. Please help! Is there is anybody out there who has a working script to read the data? Now I created a website with all the informations about the sensor. Look here:
Quote
Sorry for the english/german mix on the page.  :smiley
[/size]
Ralf/German
« Last Edit: April 16, 2010, 09:37:03 am by RaKa » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I have an successful implementation of the serial interface with the DC-SS5500 at;

http://www.phanderson.com/arduino/

PHA
Logged

Baltimore, MD
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

RaKa,

If you haven't figured it out yet it looks like you are not sending the whole command string.  The most likely reason you are getting what you send is because the board has echo turned on.  You have to send at least 11 bytes (ie '$sure Temp\n') to get a temperature.
Logged

Pages: [1] 2   Go Up
Jump to: