Hello. I am a beginner in this field. I could not find how to control servo with max6675. If you can help me find information
Try using a microcontroller between the 6675 and the servo
Which Arduino do you have ?
Can you read data from the sensor and print it to the Serial monitor ?
Does the Servo Sweep example work ?
How are you planning to power the servos ?
You get some information from the MAX6675 then you do some interpreting of that and send some appropriate control signal/s to the servo.
You'll have to decide what should be happening and write some code for it because there's no obvious connection between a temperature reading and what a servo is doing.
Steve
I have an arduino nano I connected the above sensor to the microcontroller and got the correct temperature numbers on the serial port monitor. But I can not figure out how to move the servo at the set temperatures
But I can not figure out how to move the servo at the set temperatures
And neither can we until you tell us the relationship that you want between the sensor reading and the servo position.
Maybe you need the map() function?
What do you want the servo to do based on the temperature ?
Take a look at the map() function. It will allow you to convert a range of temperatures to a range of servo angles
I found the approximate code but there was a dalas one wire sensor used. I tried to insert max6675 but as it turned out I did not have the enough knowledge to achieve the desired result. Below is the code
servo_temp_6675.ino (891 Bytes)
Please POST the code.
In code tags.
Tell us what it did do that you didn't want it to, and what it didn't do that you did want it to.
#include "max6675.h"
#include <Servo.h>
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
Servo serv;
void setup() {
Serial.begin(9600);
serv.attach(10);
}
void loop() {
int temp;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
temp = (thermocouple.readCelsius());
temp = map(temp, -20, 50, 10, 140);
serv.write(temp);
delay(1000);
}
Yeah.
In code tags.
Guess you missed that bit.
And the bit about what it does that don't want and what it doesn't do that you do want it to.
Never mind.
Now go back and look at the code you posted, look at your code I posted. Notice a difference?
Which one would you want to see, the code you posted or your code that I posted? That's why the request for code tags.
#include "max6675.h"
#include <Servo.h>
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
Servo serv;
void setup() {
Serial.begin(9600);
serv.attach(10);
}
void loop() {
int temp;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
temp = (thermocouple.readCelsius());
temp = map(temp, -20, 50, 10, 140);
serv.write(temp);
delay(1000);
}
I would like to know what is the relationship between the temperature and the servo.
Such as the servo can run 180ish degrees. A possible relationship would be +90 and minus -90 degrees could relate to +90C and -90C.. So what is your desired relationship with temperature and servo position?
I want the servo to move at the appropriate angle according to the temperature. For example, at -10 degrees Celsius move the servo by 10 degrees angle on 50 degrees Celsius at 15 degrees angle by 80 degrees Celsius by 140 degrees and when the temperature drops to 50 degrees Celsius return servo to 15 degrees angle and also when the temperature becomes 10 degrees Celsius Servo return to 10 degrees angle and so on in a circle
givmen1:
I want the servo to move at the appropriate angle according to the temperature. For example, at -10 degrees Celsius move the servo by 10 degrees angle on 50 degrees Celsius at 15 degrees angle by 80 degrees Celsius by 140 degrees and when the temperature drops to 50 degrees Celsius return servo to 15 degrees angle and also when the temperature becomes 10 degrees Celsius Servo return to 10 degrees angle and so on in a circle
-10C = 10 servo degrees
50C = 15 servo degrees.
So the ratio would be 60C to 5 servo degrees, but then you state a different relationship. So, again what is the relationship between temperature and servo angle?
As a note, I can barely see a .7 degree servo torque, so seeing 60 movements in 5 degrees will be difficult to see.
Which temperature sensor do you have? Is it a thermocouple or a one wire sensor like DS18B20?
JCA34F:
Which temperature sensor do you have? Is it a thermocouple or a one wire sensor like DS18B20?
it is thermocouple on max6675
TheMemberFormerlyKnownAsAWOL:
Yeah.
In code tags.
Guess you missed that bit.And the bit about what it does that don't want and what it doesn't do that you do want it to.
Never mind.
sorry for my wrong post. of course yours is better. I am learning all of that and I appreciate all the time you give to a diligent person like me who is trying to make his life little bit better and also then be able to help others
#include "max6675.h"
#include <Servo.h>
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
Servo serv;
void setup() {
Serial.begin(9600);
serv.attach(10);
}
void loop() {
int temp;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
temp = (thermocouple.readCelsius());
temp = map(temp, -20, 50, 10, 140);
serv.write(temp);
delay(1000);
}
JCA34F:
Which temperature sensor do you have? Is it a thermocouple or a one wire sensor like DS18B20?
Do DS18B20s work with 6675s?
OK, thanks for code tags.
Now tell us what the posted code actually does and how that differs from what you want the code to do.
If you print the temperature to serial monitor, do you get the right temperature displayed?