Saturday, 25 February 2017

Cheap Data Logger V3 - Independent Data Logger


Major upgrade !

Finally the data logger is able to work autonomously. The data are saved to the SD card every DeltaTimeSave seconds and they are plotted on the graph every DeltaTimeMem seconds. It's possible to transfer the data from Arduino to the pc using serial communication without stoppig the CDL and it's possible to change the value of  DeltaTimeSave and  DeltaTimeMem from the computer 

New features:
  • SD card
  • Intro image
  • Save data to SD
  • Send data by serial to pc with Processing (only in main screen)
  • Change the data save and plot frequency by serial from pc with Processing (only in settings screen)
  • 3 different X range graphs with autoscale
  • Added total X scale time reference in graph
  • Line connecting points if less than 80 points in graph



CDLv3 Manual (here the pdf file):


Needed Components:

Connections:

For MAX and ILI Screen same connections used in the CDLv2. Here the link to CDLv2, here the new CDLv3 full schematic:





 ILI9341 SD Card:


Attention: in my case the SD is not working correclty if I use a voltage divider for the SD_CS, but it's working with a direct connection to pin 46.

SD_CS to MEGA pin 46
SD_MOSI to ILI9341 MOSI
SD_MISO to ILI9341 MISO
SD_SCK to ILI9341 SCK

DisablingAutoResetOnSerialConnection

With my MEGA connecting a 10μF capacitor between the RESET and GND works perfectly. This is absolutely necessary otherwise any attempt of data transfer with the pc will restart Arduino.

1) format a SD card as FAT32 and copy this file on it
2) insert the SD in the ILI9341 slot
3) load the CDLv3 Arduino Sketch normally on arduino
4) unplug the USB
5) connect a 10μF capacitor between the RESET and GND
6) power Arduino with the DC adapter
7) plug the USB to synch the arduino clock (using the processing sketch "CDLv3SyncAndSave.pde")
8) unplug the USB

Attention 

to load the intro logo I used the example "spitftbitmap.ino" from the Adafruit ILI9341 Library released under the MIT license.



Now you have a real independent data logger ! 




Data Transfer:

To transfer the data plug the USB to the pc and use the Processing sketch "CDLv3SyncAndSave.pde". You need to move to the main screen (see the manual).


The file Data.txt will be saved in the same directory of the processing sketch.





Change Settings Values:

To change the value of  DeltaTimeMem or DeltaTimeSave use the processing sketch  "CDLv3Settings.pde". Change this values in the processing sketch then launch the script:

int DeltaTimeMem = 3600;   
int DeltaTimeSave = 1;



You need to move to the settings screen (see the manual).



Example of successful change og settings:



Known Issue: change  DeltaTimeMem or DeltaTimeSave require several attempt. Just keep trying until you get it right !


Files:

Manual
CDLv3 Arduino Sketch
CDLv3Settings.pde
CDLv3SyncAndSave.pde

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



Friday, 2 December 2016

Cheap Data Logger V2 - Arduino clock synchronization

Small update:
Just added clock synchronization.





Download Processing and this file, load the sketch CDLv2 on arduino and just run the sketch SyncArduinoClock using processing.



Welcome in the present !



The file CDLv2 can be four HERE

Here the schematic (same as CDLv1):

Cheap Data Logger V1



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: