Hi everyone,
I have a project for a firearms company where I need to measure three spots on a barrel. Other parts of the circuit use a NEMA 23 stepper motor to discharge a firearm remotely and force sensors to measure recoil. I am using the MAX 31855 board to measure the temperature. In the prototyping stage I hooked up all three boards on a breadboard and used 1 meter long type K thermocouples. The data received by the Arduino MEGA was then sent to a Nextion display which displayed all three temperature simultaneously. It worked fine and displayed accurate temperatures.
Now I have instead soldered the three boards to a solderable breadboard and used 15.5 feet of 22 AWG wire to communicate with the arduino which is now housed in an electrical box. Now when I try to get a reading the nextion will only display zero no matter what! The same is true when I look at the serial monitor. The code that I am using is the same code that worked fine on a breadboard the only change has been the increased amount of wire and soldering.
Here are the steps I have taken to solve this.
- Reverse the leads on the Type K thermocouples.
- Verify that all connections are correct to the Arduino MEGA and the boards.
- Make sure that I am getting close to 5 volts at each boards Vin (4.91 volts)
- Ensure that the output of each board is changing DO (0.91-1.46 volts)
Here is my code.
I am also very new to programming and electrical in general.
There are some pictures on my Drive
https://drive.google.com/file/d/1GVDD3G ... sp=sharing
https://drive.google.com/file/d/1-pubLA ... sp=sharing
https://drive.google.com/file/d/1KOEHLZ ... sp=sharing
https://drive.google.com/file/d/1jKX26z ... sp=sharing
#include <SoftwareSerial.h>
#include <SPI.h>
#include "Adafruit_MAX31855.h"
#define MAXDO 30
#define MAXCS 27
#define MAXCLK 28
#define MAXCS2 34
#define MAXDO2 35
#define MAXCS3 38
#define MAXDO3 39
// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);// MAXCLK = Turns on the thermocouple amplifier chip MAXCS = Clock cycle all three thermocouple amplifiers, MAXDO = Output voltage from amplifier
Adafruit_MAX31855 thermocouple2(MAXCLK, MAXCS2, MAXDO2);
Adafruit_MAX31855 thermocouple3(MAXCLK, MAXCS3, MAXDO3);
void setup() {
while (!Serial); // Wait for Serial
Serial.begin(9600);
}
void loop() {
double temperature = thermocouple.readCelsius();
if (isnan(temperature)) {
Serial.println("Something wrong with thermocouple!"); // Error check checks to see if a wire has disconnected from the terminal block
} else {
String command = "temperature.txt=""+String(temperature,1 )+"""; // This is the code used to store the temperature and send to the display
Serial.print(command);
endNextionCommand();
}
double temperature2 = thermocouple2.readCelsius();
if (isnan(temperature2)) {
Serial.println("Something wrong with thermocouple!"); // Error check checks to see if a wire has disconnected from the terminal block
} else {
String command = "temperature2.txt=""+String(temperature2,1 )+"""; // This is the code used to store the temperature and send to the display
Serial.print(command);
endNextionCommand();
}
double temperature3 = thermocouple3.readCelsius();
if (isnan(temperature3)) {
Serial.println("Something wrong with thermocouple!"); // Error check checks to see if a wire has disconnected from the terminal block
} else {
String command = "temperature3.txt=""+String(temperature3,1 )+"""; // This is the code used to store the temperature and send to the display
Serial.print(command);
endNextionCommand();
}
}
void endNextionCommand() // Subroutine used to send the data to the Nextion screen
{ delay(750);
Serial.write(0xff);
Serial.write(0xff);
Serial.write(0xff);
}
Main Wiring Diagram-Model.pdf (35.4 KB)