1

I have two devices. Sensor for temperature and humidity and lcd screen. Both require SDA pin, and I have only one on my arduino.

I want my display to show current temperature but I don't know how to connect two things on one pin.

Can I somehow read from other pins maybe?

Also, what can I do if I have only 1 5V source and I have two devices that require 5V?

My arduino model is Arduino Mega 2560 R3

I have this aosong sensor (AM2301), and I have YwRobots 2 row LCD screen which I want to connect to my board along with sensor.

So... I'm not sure how to connect those two if both require SDA and I have only one.

1 Answer 1

3

You can have multiple I2C devices on the same bus (sharing both SDA and SCL), as long as they have different addresses. The library used to access them should know (or be told, if required) what the address for the device is.

If they are not I2C devices then they cannot both use SDA.

The Aosong device is not an I2C device, but there is no need to connect its "SDA" pin to the Arduino's "SDA" pin; any unused digital pin should work, as long as the library is told which pin to find it on and as long as the electrical requirements of the connection are met.

3
  • So, why is sda label on the board if it doesn't matter what hole I stick the wire in? Does it have any advantages over other holes?
    – Reygoch
    Commented Aug 28, 2014 at 22:27
  • The "SDA" pin on the Arduino is paired with the "SCL" pin in order to connect I2C devices. Commented Aug 28, 2014 at 22:33
  • That humidity and temperature sensor uses a one-wire serial protocol. SDA stands for Serial Data. So in essence they are kind of right, naming it SDA. But it does indeed create confusion.
    – Gerben
    Commented Aug 29, 2014 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.