Forum >dfr0151 temperature and eeprom code for UNO
dfr0151 temperature and eeprom code for UNO

Helloooo Arduio champions,
Does anyone have code for the temperature sensor (1wire) and the eeprom (I2C) to run with the clock code for this module?
I have the clock running fine but the other two devices error - it wont find the temperature sensor. The sample code (for due?) compiles with <<As of Arduino 1.0, the Wire.receive() function was renamed to Wire.read() for consistency with other libraries.>> but replacing this command gives me even more issues.
Any help would be appreciated...
Phaedrus.
Does anyone have code for the temperature sensor (1wire) and the eeprom (I2C) to run with the clock code for this module?
I have the clock running fine but the other two devices error - it wont find the temperature sensor. The sample code (for due?) compiles with <<As of Arduino 1.0, the Wire.receive() function was renamed to Wire.read() for consistency with other libraries.>> but replacing this command gives me even more issues.
Any help would be appreciated...
Phaedrus.
2014-08-30 02:40:40 Hello Phaedrus,
Did you fix the EEPROM problem?
Here is a library, I tried before.
And for the I2C address, you can set by soldering on the back.
Like what I did in the picture. connect with a resistance.
write code:
Please note the order of the serial port and I2C, if you initialize serial port first, you need add a small delay between them like this one:
Or it will be a bug.
Grey.CC
Did you fix the EEPROM problem?
Here is a library, I tried before.
And for the I2C address, you can set by soldering on the back.
Like what I did in the picture. connect with a resistance.
write code:
#include "Wire.h"
#include "i2cEEPROM.h"
void setup()
{
i2cEEPROM.begin(0x50);
byte num = i2cEEPROM.readByte(0)**;
i2cEEPROM.writeByte(0,num);
Serial.begin(9600);
}
void loop()
{
Serial.println(i2cEEPROM.readByte(0));
delay(1000);
}
Please note the order of the serial port and I2C, if you initialize serial port first, you need add a small delay between them like this one:
void setup()
{
Serial.begin(9600);
delay(10);
i2cEEPROM.begin(0x50);
byte num = i2cEEPROM.readByte(0)**;
i2cEEPROM.writeByte(0,num);
}
Or it will be a bug.

2014-08-29 17:05:30 Hey Jose,
Yep, dfrobot and learn etc. Didn't get to this baud rate issue for a while because none of the other examples would even compile. Seems simple now :-)
I only 'need' about 30 bytes for user data settings and thought that this TinyRTC module with eeprom would be a way to eliminate the levelling of the on board eeprom and will be a simple plug in option when updating the embedded project - without having to connect a PC - rewrite the required addresses - compile - download - rem out the write code - compile - download, etc. Just take a pre-programmed clock module and plug it in - done.
Now that I have such an abundance though, I will be storing min/max temps and time stamps etc.
Check out the AdaFruit FRAM - seriously fast and seriously stable and much bigger for serious data logging
[url=http://www.adafruit.com/product/1895]http://www.adafruit.com/product/1895[/url]
[url=http://www.adafruit.com/product/1897]http://www.adafruit.com/product/1897[/url]
Just got (todays mail) a couple of the little 8Kb versions - Adafruit examples seem to be really good - we shall see :-)
Cheers,
Phaedrus$
Phaedrus
Yep, dfrobot and learn etc. Didn't get to this baud rate issue for a while because none of the other examples would even compile. Seems simple now :-)
I only 'need' about 30 bytes for user data settings and thought that this TinyRTC module with eeprom would be a way to eliminate the levelling of the on board eeprom and will be a simple plug in option when updating the embedded project - without having to connect a PC - rewrite the required addresses - compile - download - rem out the write code - compile - download, etc. Just take a pre-programmed clock module and plug it in - done.
Now that I have such an abundance though, I will be storing min/max temps and time stamps etc.
Check out the AdaFruit FRAM - seriously fast and seriously stable and much bigger for serious data logging
[url=http://www.adafruit.com/product/1895]http://www.adafruit.com/product/1895[/url]
[url=http://www.adafruit.com/product/1897]http://www.adafruit.com/product/1897[/url]
Just got (todays mail) a couple of the little 8Kb versions - Adafruit examples seem to be really good - we shall see :-)
Cheers,
Phaedrus$

2014-08-28 23:49:10 Phaedrus,
Thanks for sharing! I've run on serial baudrate issues before and it is sure annoying. eventually I've learn to recognize the funny characters :P
[quote="Phaedrus"]
Now I can play with 4Kb? of I2C_eeprom, yay! ;D - still not sure what addresses I'm supposed to be using but at least I have something running to work on.
[/quote]
As far as you are not using the eeprom from something else, you can use any of the addresses.
What are you planning to do with all the eeprom? data logging?
Cheers!~
Jose
Thanks for sharing! I've run on serial baudrate issues before and it is sure annoying. eventually I've learn to recognize the funny characters :P
[quote="Phaedrus"]
Now I can play with 4Kb? of I2C_eeprom, yay! ;D - still not sure what addresses I'm supposed to be using but at least I have something running to work on.
[/quote]
As far as you are not using the eeprom from something else, you can use any of the addresses.
What are you planning to do with all the eeprom? data logging?
Cheers!~

2014-08-28 20:57:01 Hey Grey,
Problem solved - I think...
The only example that compiled at all is in the 1307 library TinyRTC_Test_V13 but all it returned on serial was garbage. I stripped out all the irrelevant code - leaving just the eeprom write/read code - and still got garbage. Yep, it was the simplest change - Serial.begin(19200); every example I've used for the UNO so far has a default Serial.begin(9600); ... With this change I can run the original file as well!
This took me ages to figure out.
Now I can play with 4Kb? of I2C_eeprom, yay! ;D - still not sure what addresses I'm supposed to be using but at least I have something running to work on.
Thanks again,
Phaedrus$
Phaedrus
Problem solved - I think...
The only example that compiled at all is in the 1307 library TinyRTC_Test_V13 but all it returned on serial was garbage. I stripped out all the irrelevant code - leaving just the eeprom write/read code - and still got garbage. Yep, it was the simplest change - Serial.begin(19200); every example I've used for the UNO so far has a default Serial.begin(9600); ... With this change I can run the original file as well!
This took me ages to figure out.
Now I can play with 4Kb? of I2C_eeprom, yay! ;D - still not sure what addresses I'm supposed to be using but at least I have something running to work on.
Thanks again,
Phaedrus$

2014-08-28 06:23:29 Another Update >>
Well duh, the DS18B20 won't address because it is missing!! ;) Will get some and try again...
Still have the issues with the I2C eeprom (24C32) though - at least there is a chip there ;D
Phaedrus.
Phaedrus
Well duh, the DS18B20 won't address because it is missing!! ;) Will get some and try again...
Still have the issues with the I2C eeprom (24C32) though - at least there is a chip there ;D
Phaedrus.

2014-08-28 03:47:46 UPDATE - The Arduino IDE example for I2C eeprom uses an outdated(?) command compiler returns <<As of Arduino 1.0, the Wire.receive() function was renamed to Wire.read() for consistency with other libraries.>>
Tried a GitHub search and found a newer version which is a contributed library with the correct commandset, I have tried to include these two files as a library but have no idea what I'm doing and can't get it to work - when I include this library into known working code the compiler returns <<EEPROM_I2C/EEPROM_I2C.h:1092: error: expected unqualified-id before numeric constant>>
??? Very Confused...
Phaedrus. ???
Phaedrus
Tried a GitHub search and found a newer version which is a contributed library with the correct commandset, I have tried to include these two files as a library but have no idea what I'm doing and can't get it to work - when I include this library into known working code the compiler returns <<EEPROM_I2C/EEPROM_I2C.h:1092: error: expected unqualified-id before numeric constant>>
??? Very Confused...
Phaedrus. ???

2014-08-27 23:42:07 Hey Grey,
This is really cool - I'm really a hardware type with a lot of VisualBasic experience - always hated C++ but so far having great success with the Arduino system.
"Except the DS1307 real time clock, the module also integrate the I2C EEPROM chip(24C32) and the DS18B20 sensor interface."
Will have another go at finding eeprom code for this chip but I've spent ages playing around with different examples trying to get it running - the Arduino eeprom works a treat, but this I2C chip would really help me in my current project...
When I run the sample code for the temperature sensor (dfr0151\OneWire\Sample) - I am changing the default OneWire ds(10) to OneWire ds(2) to match the wiring diagram but get "No more addresses." back??
Cheers,
Phaedrus.
Phaedrus
This is really cool - I'm really a hardware type with a lot of VisualBasic experience - always hated C++ but so far having great success with the Arduino system.
"Except the DS1307 real time clock, the module also integrate the I2C EEPROM chip(24C32) and the DS18B20 sensor interface."
Will have another go at finding eeprom code for this chip but I've spent ages playing around with different examples trying to get it running - the Arduino eeprom works a treat, but this I2C chip would really help me in my current project...
When I run the sample code for the temperature sensor (dfr0151\OneWire\Sample) - I am changing the default OneWire ds(10) to OneWire ds(2) to match the wiring diagram but get "No more addresses." back??
Cheers,
Phaedrus.

2014-08-27 19:24:49 Hello Phaedrus,
Which temperature sensor are you using now?
The EEPROM should not be difficult, you can check Arduino IDE--> Files-->Examples-->EEPRM to check the sample code.
Grey.CC
Which temperature sensor are you using now?
The EEPROM should not be difficult, you can check Arduino IDE--> Files-->Examples-->EEPRM to check the sample code.
