Possible problem using DS1307 RTC while using emonTx Arduino Shield

Good afternoon guys.

I'm fairly new to arduino, but for my work, I will need to use an arduino (I'm currently using arduino ETHERNET) and also an emonTx Arduino shield because I'll need to measure current inputs. Align with this I'll need to store my measures with the correct date, so I will also need a clock module of some sort in order to measure time and date. For what I've searched, I think I'll possibly go for the DS1307 RTC.

My question is, since the emonTx arduino shield uses the pins 1 to 4 for readings, and the DS1307 RTC uses pin 4 and 5 for readings also, isn't there going to be a conflict on the readings?

Thanks in advance for any help you guys can provide me.

Best regards, John.

Either remap the shields A4 pin to the A0 pin or use another Arduino type (Leonardo or Mega2560 are candidates) where the I2C pins are not mapped to the analog inputs.

Thanks for the quick answer :slight_smile:

As I said I'm fairly new to the arduino envoirment, but I noticed that the RTC I want uses two outputs called SCL e SDA, and that the arduino ETHERNET I use has two inputs with the same name.

So just to confirm, can´t I use those inputs instead of A4 and A5? After some research I've read that SCL and SDA are/were used for I2C, and that was previously done using the A4 and A5 pins.

Best regards, John.

.

So just to confirm, can´t I use those inputs instead of A4 and A5? After some research I've read that SCL and SDA are/were used for I2C, and that was previously done using the A4 and A5 pins.

The SDA/SCL pins are directly connected to A4/A5 on the Arduino Ethernet board. The additional pins are there to extend the compatibility with the different Arduino board types. So you can use the SDA/SCL pins with a shield and on the UNO (and Ethernet and some other types) they are connected to A4/A5, on the Mega2560 they are connected to D20/D21 and on the Due/Leonardo they are separate pins that are not used otherwise.

BTW: SCL is solely an output on the Arduino (in your usage), while SDA is an input as well as an output, that depends on the current state of the I2C communication.

So because they are directly connected, I can't use the RTC and the emonTx at the same time? Because in my case I have to store current that the sensors read, and time but I'll not use them both at the same time (I have to save the readings and time&date every minute 24/7 for an large period of time).

Best regards, John.

So because they are directly connected, I can't use the RTC and the emonTx at the same time?

You can use both but you have to modify the emonTx shield, at least if your pin description is correct (you haven't provided a link to that product yet).
As I wrote in my first post you have to remap one pin on the shield and you can use both at the same time. You may also have to modify the library (if there is one) to use the modified pin out.

You have other options:

  • use another Arduino type. Leonardo or Mega2560 would be candidates because they don't have the I2C pins shared with analog inputs.
  • Connect the DS1307 to other pins and use a software emulation to do the I2C protocol.

You can use both but you have to modify the emonTx shield, at least if your pin description is correct (you haven't provided a link to that product yet).

You're absolutely right, I'm sorry. The link of the emonTx shield I use is here http://wiki.openenergymonitor.org/index.php?title=EmonTx_Arduino_Shield#emonTx_Arduino_Shield

The thing is I'm stuck with the arduino ETHERNET, I can't use other arduino types, so I'm guessing I'll have to remap the emotx shield and alter the library (witch is honestly scaring me, because like I said, I'm new to this types of envoirments :), and I had enough trouble soldering the shield as it was, so I'm scared to imagine what I'll have to do to remap one pin and change the library code :sweat_smile:).

Isn't there anyother types of RTC's that don't use I2C, and don't use pins A1 to A4?
I ask these because of two things:

  1. it would solve my problem and it would be the "elegant solution".
  2. All the RTC's I found used I2C.

Again, best regards (and thank you very much for the pacience and help you've been giving), John.

The thing is I'm stuck with the arduino ETHERNET, I can't use other arduino types, so I'm guessing I'll have to remap the emotx shield and alter the library (witch is honestly scaring me, because like I said, I'm new to this types of envoirments smiley, and I had enough trouble soldering the shield as it was, so I'm scared to imagine what I'll have to do to remap one pin and change the library code smiley-sweat)

You can use a go-between shield for the remapping. Costs a bit more but is much easier:

Isn't there anyother types of RTC's that don't use I2C, and don't use pins A1 to A4?

You can use an SPI based RTC as this one: