Hello guys, Im new here and i was planning to do a project however i got stuck and i need help. My project needs to connect two arduinos connected together, any ideas how i can do that, also its possible that one of the arduinos will have a shield on it, if the shield is covering the pins, how can i connect them? thanks
Give us more details.
Purpouse of the proyect.
Purpouse of connecting two arduinos.
Which shields are you going to use.
Also, there are many ways of connecting 2 arduinos, here are three protocols:
Serial (uart)
I2C
SPI
Shields don't cover pins: they usually bring the pins out again on top. Apart from the pins the shield actually needs (say to drive motors if it's a motor shield) the pins should be available. This list may help you determine which pins any shield uses.
I've connected two Unos with Wixels before.... quite an elegant solution.
Briefly, its a ph meter based project, one arduino will be responsible of connecting to the ph meter, and i want the second arduino to do something if the ph value is a certain number. Do i need a shield to connect an arduino to ph sensor analog kit?
OmarNasser:
Do i need a shield to connect an arduino to ph sensor analog kit?
I doubt it. If it's this one or similar, just needs to connect to one of the analog pins.
Why do you need two Arduinos?- can't the one that reads the pH also do the "something"....
JimboZA:
I doubt it. If it's this one or similar, just needs to connect to one of the analog pins.Why do you need two Arduinos?- can't the one that reads the pH also do the "something"....
Thats why I asked the purpouse. Most begginers projects that involve two arduino can.be done using only one Arduino.
Apparently, i need to connect a pin to "VCC" which isnt on the arduino uno board, so i'll need a shield, if theres a shield on the arduino, can it still do something ?
Check the sensor, Vcc is likely to be 5V.
Yep you can do stuff when the board has a shield: a shiled's really just an easy way to connect things. But you probably don't need a shield.
Post details of the sensor for more meaningful advice.
Ill try to make it as clear as possible, the arduino controls the ph meter, the ph meter calculates the phvalue of the certain substance, and if that substance is acidic the arduino spins a servo, the servo pushes a bucket that drops a neutralizer . The pic below is the wiring of the ph meter to the shield, can it be done without a shield?
Nope you don't need a shield.... 5V, Gnd and one of the 6x analog pins (on a Uno), and then control the servo from one of the digital pins.
Give the servo its own power though: not good practice to power a servo from the Arduino direct. Connect the servo -ve, the servo power -ve and the Arduino ground together else the servo control line has no 0 reference.
Ps... at most you might find it handy to use a small breadboard, just to facilitate joining wires together where necesary.
Thanks a lot for your help, highly appreciated:D
Any ideas of how i can display the Ph value onto and LCD? Thats the code below, will it work?
#define SensorPin 0 //pH meter Analog output to Arduino Analog Input 0
unsigned long int avgValue; //Store the average value of the sensor feedback
float b;
int buf[10],temp;
void setup()
{
pinMode(13,OUTPUT);
Serial.begin(9600);
Serial.println("Ready"); //Test the serial monitor
}
void loop()
{
for(int i=0;i<10;i++) //Get 10 sample value from the sensor for smooth the value
{
buf*=analogRead(SensorPin);*
- delay(10);*
- }*
- for(int i=0;i<9;i++) //sort the analog from small to large*
- {*
- for(int j=i+1;j<10;j++)*
- {*
_ if(buf*>buf[j])_
_ {_
_ temp=buf;
buf=buf[j];
buf[j]=temp;
}
}
}
avgValue=0;
for(int i=2;i<8;i++) //take the average value of 6 center sample*
avgValue+=buf*;
float phValue=(float)avgValue5.0/1024/6; //convert the analog into millivolt_
_ phValue=3.5phValue; //convert the millivolt into pH value_
_ Serial.print(" pH:");
Serial.print(phValue,2);
Serial.println(" ");
digitalWrite(13, HIGH);
delay(800);
digitalWrite(13, LOW);
}*_
Use the code icon to properly write code on the post, this way it wont hurt to read it.
#define SensorPin 0 //pH meter Analog output to Arduino Analog Input 0
unsigned long int avgValue; //Store the average value of the sensor feedback
float b;
int buf[10],temp;
void setup()
{
pinMode(13,OUTPUT);
Serial.begin(9600);
Serial.println("Ready"); //Test the serial monitor
}
void loop()
{
for(int i=0;i<10;i++) //Get 10 sample value from the sensor for smooth the value
{
buf=analogRead(SensorPin);
delay(10);
}
for(int i=0;i<9;i++) //sort the analog from small to large
{
for(int j=i+1;j<10;j++)
{
if(buf>buf[j])
{
temp=buf;
buf=buf[j];
buf[j]=temp;
}
}
}
avgValue=0;
for(int i=2;i<8;i++) //take the average value of 6 center sample
avgValue+=buf;
float phValue=(float)avgValue*5.0/1024/6; //convert the analog into millivolt
phValue=3.5*phValue; //convert the millivolt into pH value
Serial.print(" pH:");
Serial.print(phValue,2);
Serial.println(" ");
digitalWrite(13, HIGH);
delay(800);
digitalWrite(13, LOW);
}