2 temperatures, 1 board

I was designing a project recently. It is supposed to receive information from a temperature sensor and then move a servo accordingly. However, I have run into a problem in the future…
I plan to use two different temperature sensors to send data to a computer and/or an AND gate for processing. Is it possible to have two temperature sensors connected to the same board, and both signals going through the same cable, to the same computer/IC, on the same program, without interference? Or do I have to buy a separate board for that purpose?
Any advice, criticism, and/or questions are welcomed.

(Also, here is the code I’m using so far–listed below. Please don’t go all-out on the Open-Source idea yet, as it is a work-in-progress for a serious project.)

/*This project is for the STEM project I'm doing (8th grade, USA). It reads the temperature, and logs it, and moves the servo (attatched to an air vent register)between 0 and 90 degrees.
At one setting (0 or 90 degrees, remember)the register is open, while the other setting closes the vent.
Currently this project is set on a heating system--too hot, and the vent register closes. To switch to cooling, just switch around 0 and 90 in the comment-surrounded areas so
that the air vent register is open instead of closed and vice versa, so that the temperature falls instead of rises.

DO NOT utilize this code in any way at the moment--it has not been 'released,' due to the fact that its purpose has not been served yet.*/

#include <Servo.h>
Servo servol;
const int temperaturePin = 0;
int position;

void setup()
{
  Serial.begin(9600);
  servol.attach(9);
  
  servol.write(0);
}

void loop()
{
  float voltage, time, degreesF;
  voltage=getVoltage(temperaturePin);
  time = millis()/1000;
  degreesF = (voltage-0.5) * (900.0/5.0) + 32.0;
  
  Serial.print ("Seconds since reset: ");
  Serial.print (time);
  Serial.print (" | Degrees(F): ");
  Serial.println(degreesF);
  Serial.println(position);
  
  delay(3000);
  
  position = turnservo (degreesF, position);
}
int turnservo(float degreesF, int position)
{
  if ((degreesF <=64)&&(position==0))
  {
    //--------------------------------------------//
    for (position = 0; position < 90; position++ )
    //--------------------------------------------//
    {
      servol.write(position);
      delay(70);
    } 
  }
  //---------------------------------------//
  else if ((degreesF >=66)&&(position==90))
  //---------------------------------------//
  {
   for (position = 90; position >0; position-- )
   {
      servol.write(position);
      delay(70);
   } 
  }
  return position;
}
float getVoltage(int pin)
{
 return (analogRead(pin)*0.004882814);
}

StringersUno: Is it possible to have two temperature sensors connected to the same board, and both signals going through the same cable, to the same computer/IC, on the same program, without interference?

Yes. An obvious choice is the Dallas DS18B20 sensor. This uses a "one wire" system and you can have a swag of them on one pin of your Arduino. All you need to know is here:

http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html

Yes. An obvious choice is the Dallas DS18B20 sensor. This uses a "one wire" system and you can have a swag of them on one pin of your Arduino.

Wait, sorry. I worded that strangely. By the 'single cable' I meant the cable connecting the Arduino to the computer... I just want to know if two sensors connecting to the same Arduino will cause any interference at all to each other, if they were supposed to send different sets of information that the computer has to separate and display.

StringersUno: Wait, sorry. I worded that strangely.

You probably did, and maybe still are, but the answer is the same.

By the 'single cable' I meant the cable connecting the Arduino to the computer... I just want to know if two sensors connecting to the same Arduino will cause any interference at all to each other, if they were supposed to send different sets of information that the computer has to separate and display.

No.

What you mean by "computer" is far from clear, but it is still "no".

You can have two, or several, sensors of the same type in the manner I referred to, or you can have sensors of several types serving entirely different purposes. The Arduino sorts it all out and sends the data to the computer, of whatever type, over a single cable. That is the Arduino's job - or should be.

oh ok.

...'computer' was careless. I meant my laptop, which houses the code. Thank you for the explanation, I get it now. How slow of me. :sweat_smile:

A laptop functions in exactly the same way as a desktop. The careless bit is here:

to the same computer/IC, on the same program,

The code required to run an Arduino is housed in the arduino.

StringersUno: I was designing a project recently. It is supposed to receive information from a temperature sensor and then move a servo accordingly. However, I have run into a problem in the future... I plan to use two different temperature sensors to send data to a computer and/or an AND gate for processing. Is it possible to have two temperature sensors connected to the same board, and both signals going through the same cable, to the same computer/IC, on the same program, without interference?

Yes. You need to design a protocol for sending the temperatures to the computer, so that the computer can sort them out. One possibility is to always send both temperatures, for example like this:

18.5,20.3 18.6,20.3 18.6,20.4

and so on. The computer program interprets the value before the comma as the first temperature, and the value after the comma as the second. New line indicates that a new pair of readings is about to be sent.

[EDIT: I'm assuming you will be sending the data to the computer via the Arduino serial port, or the virtual serial port over USB if it is a Leonardo.]

Thank you! It worked!