Needed Components:
- Arduino MEGA 2560
- ILI9341 240 x 320 display
- Any kind of sensor – For test I used Adafruit MAX31856 Thermocouple Amplifier
- 2 Potentiometers
- 8 x 1 kΩ resistors
Description:
Use a ILI9341 240 x 320 display to show temperature collected with Adafruit MAX31856 Universal Thermocouple Amplifier on Arduino Mega 2560.
The values are registered every DeltaTime seconds and stored in an array.
2 simple 10 kOhm potentiometers are used as controls to select the screen and the thermocouple.
With the potentiometer on pin A1 it's possible to select the thermocouple (or your sensor), the potentiometer on A0 will switch from the screen with all the thermocouples values to his graph. The graph is auto scaling every 5 seconds. On the graph the selected thermocouple is reported on the bottom left. On the bottom right there is the minimum value on the graph, on the top right the maximum value and in the center the actual value.
In the present demo only one thermocouple is implemented: the CDL is easily modifiable to show up to 7 different sensors.
In this project I use Hardware SPI because the ILI screen is much faster than using the Software SPI (
here the info about Arduino SPI).
MAX
Adafruit MAX31856 Universal Thermocouple Amplifier (K, J, N, R, S, T, E, or B type thermocouple).
The tutorial is well explained and the connections are simple.
MAX Connections:
Vin +5 V from MEGA
3Vo not used
GND to MEGA ground
SCK to MEGA pin 52
SDO to MEGA pin 50
SDI to MEGA pin 51
CS to MEGA pin 53
FLT not used
DRDY not used
ILI
ILI9341 2.2" Serial TFT 320x240 LCD Display
ILI works at 3.3 V. To connect the SPI I used a siple 1 kΩ /1 kΩ voltage divider (
I found this suggestion here) and works perfectly !
ILI Connections:
VCC 3.3V on MEGA
GND to common circuit ground (same as MAX)
CS: MEGA pin 48 to 1 kΩ to CS and to 1 kΩ to common ground
RESET to 3.3 V
D/C: MEGA pin 47 to 1 kΩ to D/C and to 1 kΩ to common ground
SDI: MEGA pin 51 (same used for MAX) to 1 kΩ to SDI and to 1 kΩ to common ground
SCK: MEGA pin 52 (same used for MAX) to 1 kΩ to SCK and to 1 kΩ to common ground
LED 3.3V on MEGA
SDO directly to MEGA pin 50 (Arduino has no problem to read the 3.3V signal from ILI)
Potentiometers
Thermocouple Selector: 5V to one side, ground the other, center to MEGA pin A1
Switch main screen / graph same 5V to one side, ground the other, center to MEGA pin A0
100 µF in parallel to the 5V and ground (- side to ground).
The file can be four
HERE
Required Libraries:
ILI9341:
https://github.com/adafruit/Adafruit-GFX-Library
https://github.com/adafruit/Adafruit_ILI9341
MAX
https://github.com/adafruit/Adafruit_MAX31856
Time
https://github.com/PaulStoffregen/Time
Here the schematic: