OneWire vs TWI vs SLI vs I2C

Help me Please. I am so confused.

My DS18b20 uses one wire, and the examples use port 9 as the data line. It appears that I could use ‘any Dx’ line, even port 2. It requires OneWire.
My DS1307 clock requires the Wire library, uses a convoluted low level setup ( DDRC|=_BV(2) |_BV(3); // POWER:Vcc Gnd
PORTC |=_BV(3); // VCC PINC3.
I2C uses a 4 pin connector with +5V,Grnd, SDA and SCL, and uses A4 and A5.
SLI uses 4 pins, but for a different scheme, but when used negates the use of D0 and D1.

I am trying to build a control that monitors 5 ds18b20s, uses the DS1307 clock and stores the data on an SD card. I am afraid of what devices can be on the same comm system, and how to clearly discriminate between them.

I am sure other newbies have been challanged by this, Can I get a generic discussion on these issues? I do not expect a specific critique of my code below, but a better understanding of where and how these different comm systems are used and relate.

I have tried to integrate example code from Clock and from DS18b20 examples as partially shown below:

#include <WProgram.h>
#include <Wire.h>
#include <DS1307.h>
#include <OneWire.h>
#include <DallasTemperature.h>
 

//              set up Solar cell 

 
const int solarPin = A2;   //Analog input pin that the solar cellis attached to

int solarValue = 0;         // value read from the SolarCell
float solarvoltsValue = 0;       // var for convert to float

//               Set up DS18b20 One Wire on digital 2


// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
#define TEMPERATURE_PRECISION 9

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);

// arrays to hold device addresses
DeviceAddress hotboxThermometer, outsideThermometer, houseThermometer, hotoutThermometer;

//              Set up RTC 

int rtc[7];
int ledPin =  13;
int fan1Pin = 3;           // set Fan1 (low speed) as digital output pin 3
int fan2Pin = 4;            // set Fan2 (hi speed) as digital output pin 4
//              Enter void setup()

void setup()
{


// these following two lines worke with Clock, but causes failure when //integrated. I have  remarked them out, and the program now runs both the clock //and ds18b20.  
//

  //DDRC|=_BV(2) |_BV(3);  // POWER:Vcc Gnd //  
  //PORTC |=_BV(3);  // VCC PINC3
  pinMode(ledPin, OUTPUT);  
  pinMode(fan1Pin, OUTPUT);
  pinMode(fan2Pin, OUTPUT);  // allow the fans to run for a few seconds for verification.
  delay(5000);
  digitalWrite(fan2Pin, HIGH);
  delay(5000);
  digitalWrite(fan1Pin, HIGH);
  delay(5000);
  
 
  Serial.begin(9600);
  
  Serial.println("    Dallas Temperature IC Control Library");
  Serial.println("       Real Time Clock Control");
  Serial.println("        Read Solar Cell Power");

  Serial.println("  Fans turned OFF");
//             Do not need to set the clock now
//  RTC.stop();
//  RTC.set(DS1307_SEC,1);
//  RTC.set(DS1307_MIN,40);
//  RTC.set(DS1307_HR,20);
//  RTC.set(DS1307_DOW,6);
//  RTC.set(DS1307_DATE,12);
//  RTC.set(DS1307_MTH,8);
//  RTC.set(DS1307_YR,11);
//  RTC.start();

//             Set up the find of all DS18b20s

  // Start up the library
  sensors.begin();

  // locate devices on the bus
  Serial.print("Locating devices...");
  Serial.print("Found ");
  Serial.print(sensors.getDeviceCount(), DEC);
  Serial.println(" devices.");

  // report parasite power requirements
  Serial.print("Parasite power is: "); 
  if (sensors.isParasitePowerMode()) Serial.println("ON");
  else Serial.println("OFF");
 

oneWire.reset_search();
  // assigns the first address found to insideThermometer
  if (!oneWire.search(hotboxThermometer)) Serial.println("Unable to find address for hotboxThermometer");
  // assigns the seconds address found to outsideThermometer
  if (!oneWire.search(outsideThermometer)) Serial.println("Unable to find address for outsideThermometer");
 // assigns the seconds address found to outsideThermometer
  if (!oneWire.search(houseThermometer)) Serial.println("Unable to find address for houseThermometer");
 // assigns the seconds address found to outsideThermometer
  if (!oneWire.search(hotoutThermometer)) Serial.println("Unable to find address for hotoutThermometer");

The DS18B20 can run off any data pin and each one has a unique address so you can put as many as you want on that one pin. The only extra hardware you need is a 4.7k pull-up resistor on the data pin. There is a OneWire Scanner sketch around which will allow you to determine the addresses of the chips.

SPI (MISO/MOSI/SCK/SS) uses the hardware SPI pins and one random data output pin for SS (Slave Select). Since the hardware SS pin has to be left as an output it is a good choice if you have a choice. You can talk to multiple SPI devices as long as each one a) uses a unique SS pin and b) you reset the SPI configuration each time you change devices.

TWI/I2C requires two pull-up resistors and uses the hardware I2C pins (A4,A5). Devices have addresses and some have selectable addresses so you can have more than one on the bus. Some devices are I2C-compatible only as long as they are the only device on the bus so if a working device stops working when you add another device, that may be your problem.

“My DS1307 clock requires the Wire library, uses a convoluted low level setup ( DDRC|=_BV(2) |_BV(3); // POWER:Vcc Gnd
PORTC |=_BV(3); // VCC PINC3.”
What the heck?
Just use wire.h library.

Seems to me you have 4 sets of pins that are not conflicting.

DS1307 - I2C using A4/A5 pins

SD card - SPI using D11,D12, D13 and some other pin (D10 for instance)

int ledPin = 13; <<< tru enough - but SPI.begin() will take over control of that pin. Don’t plan on using it unless you have SPI.end before it and then SPI.begin after it.

Onewire - can be any other pin using 5 of the 12 pins left.

And Serial, using D0/D1 for Rx/Tx.

Not sure what SLI is, the hardware you desribe does not seem to use it.