I am trying to build a 4 channel temperature monitor using the MAX6675 module with an I2C interface to an LCD screen. I am using an arduino UNO to read the temperature values from multiple MAX6675 modules and flusing that information the LCD after averaging over multiple readout cycles.
I would like to add a serial interface to this to be able to query the temperature values when needed. However, when I connect UNO to a PC I can only see temperature values for 2 channels with rest of the channels showing NaN. This not a problem when I power it using an USB power adapter or usb charging connectors.
How can I have both a I2C interface to see the values flushed to the screen as well as query the temperature values from a PC?
Make a hand-drawn wiring diagram and post a picture of it. Clearly label non-obvious parts. Post all your code auto-formatted in code tags. Post any relevant serial output. Now we have a clue.
No, I either power it up by connecting the USB-A to B connection to a PC or a USB power adapter. I can see the temperature reading on all the 6-8 channels on my LCD screen when it is connected to the power adapter but not when connected to the PC’s USB port.
I’ve attached the code I’m using for my temeperature monitor here.
Physically, the connections are as per the code. All the MAX6675 sensors have common clock (CLK) and serial out (SO) lines, with unique chip select (CS) lines to the microcontroller. The MCU does a serial read out from these slave devices in a loop.
Please post it here in a reply to this topic, using code tags when you do
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
Oh, that’s a stupid mistake. But, even with this commented out. I can only see readout on 4 channels on the LCD screen. After the moving Serial.begin to setup(), I have the same issue on my serial monitor. I can only see temperatures of 4 channels and the rest are just 0s or NAN as my code writes out 0s.
C:\Temp\arduino_modified_sketch_241483\sketch_sep01a.ino:13:20: warning: initializer-string for array of chars is too long [-fpermissive]
char channels[8] = "ABCDEFGH";
^~~~~~~~~~