problem with MAX6675 and 40X1

rmeldo

Senior Member
Hi forum,

I need help with interfacing the Maxim 6675 thermolcouple to digital converter.


1) my home project is, eventually, the climate control of my house. For the moment I am concentrating to measuring and logging the temperature of the bricks in the storage heater. They reach up to 550 degC (multimeter reading)

2) I haven't much experience in electronics, .... but I keep reading.

5) For the moment I am prototyping with an AXE22P prototype board with a 40X1, (customized as Westaust55) and a breadboard carrying the 6675, mounted on an adaptor board.

See picture.

The picture does not show it clearly, but the outputs 6 and 5 of are used to drive the CS and SCK signals for the serial protocol of the MAxim chip.

The Maxim output is collected by input 5 of the 40X1.

The 6675 datasheet is:

http://datasheets.maxim-ic.com/en/ds/MAX6675.pdf

My code is the minimum to test the interfacing:

I have taken it from P Anderson site. From what I can understand the code is compatible with the serial protocol from the datasheet, but I need confirmation please.



Now the problem:

I see fluctuating, somewhat random readings. I display them either with a "debug" command or to the AXE33 LCD display.

I see the value of TEMP varying from zero (most of the time) to 16, to 4, to 2, to 3, to whatever. The temperature should be ~20 degC, constant, as the thermocouple tip is on my desk.

The microcontroller works, it can download the software and light LED (not shown), etc.

I have two MAX6675 and they both behave in a similar way. I have been careful and quick in soldering it to the adaptor board and I believe the soldering is OK, with no bridges, bu how can I check?.


If I measure the voltage from the thermocouple directly on the breadboard and I heat the tip with my fingers I see the voltage moving by several mV, but the value of TEMP does not vary accordingly.


I don't have an oscilloscope to inspect the connection between the Picaxe and the MAX, so I am looking for advice on whether my code is right and what tests to carry out next.

Thanks in advance

Riccardo
 

Attachments

Last edited:

rmeldo

Senior Member
With the cable attached I read fluctuating values. (on the AXE33 LCD)

Without the cable everything is zero. (on the AXE33 LCD)
 

MPep

Senior Member
For temperature measurement, may I ask why a DS18B20 is not used??
They are much easier to use, direct to digital temperature measurements.
 

rmeldo

Senior Member
The reason for using a thermocouple is the temperature range up to 600degC for the brick temperature --> I need a K thermocouple.

I will be using DS18B20 for the air temperature outside the heater

Riccardo
 

MPep

Senior Member
Hi Riccardo,

Sorry missed that part of your original post.

Have you checked to see if the LCD indeed indicates the correct temperature?
Maybe try using SERTXD and read the temperature in a terminal program first. See if it is still misbehaving. Probably okay though.

Another point to check on, is whether the Programming leads are correctly terminated? What would check on first: the GND connection is not necessarily terminated to 0V, or Programming Input is not tied to 0V via resistors.

As far as
I am looking for advice on whether my code is right
is concerned, you will need to post your code in its entirety for people to read in order to offer advise/comment.
 

rmeldo

Senior Member
The LCD when connected to a Picaxe 18X datalogger works OK.

Also, when connected to my circuit, the LCD reading agrees with the "debug" window from the Picaxe programming program.

I installed the LCD yesterday because I thought that the debug window would mess up the timings of the serial protocol with the maxim chip.

The download connection should be OK since it is on the Axe22P board and not made by me.

I reattach the complete code in plain text here:

Thanks Riccardo

""""""""""""""""""""""""""""""""""""
symbol CS = Output6
symbol SCK = Output5
symbol MISO = Input5


Symbol val = w0
Symbol N = b6
Symbol temp = W1

main:
gosub measTemp
'debug
gosub flash
goto main

measTemp:

high CS ' idle

'pause 100
low SCK

low CS ' start transmission sequence

val = 0
for N = 1 to 16
' low SCK ' opposite to P anderson
high SCK
val = val * 2 + MISO
low SCK
' high SCK ' opposite to P anderson
next

high CS 'terminate the transmission

temp = val/32

serout 4,N2400,(254,128,"b2=",#b2," ")
serout 4,N2400,(254,192,"b3=",#b3," ")
serout 4,N2400,(254,136,"temp=",#temp," ")
serout 4,N2400,(254,200,"val =",#val," ")

return


flash:

high 7
pause 600
low 7
pause 300
high 7
pause 300
low 7
pause 300
high 7
pause 600
low 7
pause 300
goto main


return

""""""""""""""""""""""""""""""""""""
 
Last edited:

lbenson

Senior Member
Your "GOTO MAIN" in the "flash" subroutine should not be there--you will get stack overflows. I'm not sure how that would affect your temperature readings tho. If you put a "pause 10" before your "next" statement, would that alter the reading (tho there isn't one in the PHAnderson code).
 

westaust55

Moderator
Layout of AXE022 proto-board for 40X1

Riccardo,
In the photo, I presume that the yellow wire is supposed to be for the input signal to Input 5.
In the photo you have it connected to P5 for the PICAXE Net connections. The PICAXE “normal” inputs are at the bottom of the PICAXE chip (Input 0 at the left side). See the attached marked up photo.

At the moment you would not be getting any temp reading as shown in your photo.

Have a look at the AXE022 layout diagram in post 4 of this thread I posted when I first started on this forum.
http://www.picaxeforum.co.uk/showthread.php?t=9025

Also have a look at the first schematic from the first attachment in post 5 for this thread
http://www.picaxeforum.co.uk/showthread.php?t=10576
It is my schematic for the AXE022 which shows about 95% of the circuitry of the board.
 

Attachments

Last edited:

rmeldo

Senior Member
Ibensons, Westausts55, and al lothers.

The problem was I was using the wrong connector, like Westausts55 pointed out. As soon as I moved the wire to the right place all started working. Also thanks for the documentation.

Regarding the software bug I see the problem with the "return" instruction I haven't changed it yet, so I don't know what the effect will be yet.

After making it work I compared the readings from the same thermocouple as read with my circuit and a multimeter and they agree to the same degC.

For future reference:

1) the code from P. Anderson works
2) the Max6675 chip seems fairly robust (both the two I used work), surviving my soldering (I soldered the first one to the board first and then soldered the header pins. For the second one I reversed the process).

Riccardo
 

westaust55

Moderator
AXE022 with 40X1 and other modules

My i2c bus board is just a small section of vero strip board on which I use 4 of the tracks for:
1. +5V
2. i2c Clock
3. i2c Data
4. 0V

I bring the +5V and 0V direct from my power supply module and the i2c signals over from my AXE022 board.

I have the 2 rows of 2 wide header sockets so I can plug 4 pin headers and use 4 strand (core) ribon cable from that bus board to the various permanent modules in my experimenters box.

In the attached photo you can see the section of vero board. Has been labellled as "i2c Comms Buss"
 

Attachments

BeanieBots

Moderator
I want to experiment with 4 DS18B20 on the same i2c bus and I have been thinking on how to make things "modular"
Um.. the DS18B20 is NOT I2C. It's one wire.
It is possible to hang many on the same line once you know their serial numbers. Look up OWIN & OWOUT. These commands are only available on the X1 chips.
 

rmeldo

Senior Member
Thanks for pointing that out... I have been reading about the wrong commands then .....

silly of me, since I had chosen to use the 40X1 exactly because of the one wire capability

I will make a board with "one wire" bus and i2c buses instead.
 
Last edited:
Top