Go Down

Topic: using the tx and rx lines (Read 4831 times) previous topic - next topic


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,


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.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


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 :)


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


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.    


thanks everyone
this is the website with the sensor

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,


Sep 23, 2009, 02:44 am Last Edit: Sep 23, 2009, 02:45 am by peter224722 Reason: 1
Hi , No it`s not i2c is serial .

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



Hi , No it`s not i2c is serial .

It appears to also have SPI communications capabilities.



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 ?  


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.

and is the easiest to program

Very much the same.


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,


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


Apr 16, 2010, 04:34 pm Last Edit: Apr 16, 2010, 04:37 pm by RaKa Reason: 1
[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:

Sorry for the english/german mix on the page.  ::)


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





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.

Go Up