Hi everyone, I'm Jonathan and this is my very first post in the forum.
I'm currently building a home project on which I can monitor temperature sensor data between 2 arduinos over a nRF24L01+ wireless communication set. As soon as this communication is properly working, it will be sent to a RPI runing Node-Red + InfluxDB + Grafana to visualize the data over the serial port, which btw is already working fine. Everything that is RPI-related is out of the scope of my request, but would be more than happy to share it if requested.
My setup is as follows:
Transmitter:
- Arduino Pro Mini
- nRF24L01+ module with a 3.3v regulator
- MAX6675 K-Thermocouple sensor
Receiver:
- Arduino UNO
- nRF24L01+
Challenges:
- I have read on different forums about creating a data bus for the MISO/MOSI communications, so I made it as it is shown on the diagram attached.
- Also read that I could use a different pin on Pro Mino for CS for the MAX6675, so I set it up on pin 7
Request for assistance:
- Can you help me confirm if my connections are correct? If not, what changes should I make?
- No information is being received on the UNO, as I am monitoring the serial port for debuging the received data
I'm attaching the diagram and codes for both boards.
Your help is truly appreciated.
Regards!
Transmitter code:
#include "max6675.h"
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
MAX6675 ktc(6, 7, 12); // Create a Module (CLK, CS, SO)
RF24 radio(9, 10); // Create a Radio (CE, CSN)
const byte address[6] = "00001";
void setup(){
Serial.begin(9600);
delay(500);
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
double jobTemp = ktc.readFahrenheit();
Serial.println(jobTemp);
// char text[] = "Hello World"; //double T1 = ktc.readCelsius();
//Serial.println(text);
//radio.write(&text, sizeof(text)); //radio.write(&T1, sizeof(T1));
radio.write(&jobTemp, sizeof(jobTemp));
delay(2000);
}
Receiver code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(9, 10); // Create a Radio (CE, CSN)
const byte address[6] = "00001";
int tempF;
void setup(){
Serial.begin(9600);
delay(500);
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
//tempF = "";
radio.read(tempF, sizeof(tempF));
Serial.println(tempF);
delay(200);
}