Giter Club home page Giter Club logo

aditya-a-garwal / arduino-tft-lcd-3-5-sdcard-logger Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 536 KB

Program to demonstrate data logging using an SD Card with a 3.5" TFT LCD Touchscreen Display (using ILI9486 Driver), Arduino UNO R3/R4 and MCUFRIEND Library

Home Page: https://dumblebots.com/2024/07/02/using-3-5-tft-lcd-display-with-ili9486-arduino-part-3-text-files-sd-card/

License: GNU General Public License v3.0

C 26.81% C++ 73.19%
arduino arduino-shield arduino-uno arduino-uno-r3 arduino-uno-r4 arduino-uno-r4-wifi bmp datalogger lcd lcd-display log-files sdcard touchscreen adafruit-gfx mcufriend mcufriend-kbv

arduino-tft-lcd-3-5-sdcard-logger's Introduction

Log Data to SD Card with a 3.5" TFT LCD Touchscreen With Arduino UNO R3/R4

GitHub License GitHub forks GitHub Repo stars GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests GitHub Actions Workflow Status

Overview

This repository contains a program to log data to an SD Card on a 3.5" TFT LCD Shield along with an Arduino UNO R3/R4/Mega, as shown below -

Image of LCD Touch Shield from Top Image of LCD Touch Shield from Bottom

Most 3.5" TFT LCD Touch displays use the ILI9486 Display Driver and include a resistive touchscreen. The PCB Layout & silkscreen text may vary slightly between displays. This does not change their behaviour and functionality. This repository depends on the following libraries -

The program has been written using PlatformIO, and has been tested on the Arduino UNO R3, Arduino UNO R4 Minima & Arduino UNO R4 WiFi.

Tip

A detailed tutorial on how to use this repository is available at https://dumblebots.com/2024/07/02/using-3-5-tft-lcd-display-with-ili9486-arduino-part-3-text-files-sd-card/. The tutorial includes a comprehensive explanation of the code and how to use it.

Building/Uploading With PlatformIO

Since this project has been written using PlatformIO by default, simply run the following commands to fetch the libraries, build the project and upload the program -

pio pkg install
pio run
pio run --target upload

Building/Uploading With Arduino IDE

Create a new sketch and copy the contents of src/main.cpp from this repository into the default .ino file. Create a new tab/file in the IDE named constants.h and copy the contents of src/constants.h from this repository into this file.

Install the Adafruit Touch Screen Library and Adafruit GFX Library from the Library Manager (under Sketch>Include Library>Manage Libraries...)

Download this repository as a ZIP file and install it by navigating to Sketch>Include Library>Add .ZIP Library, and selecting the downloaded file from the file explorer.

After this, you can Build and Upload the program as usual.

Using the Example

Tip

Before using this example, make sure to calibrate the touchscreen and enter the calibration values in the constants.h file, as shown in this guide.

As soon as the program is uploaded, the display should turn black and the message "SD Card initialization failed" should get printed on the Serial Monitor. Insert a FAT formatted SD Card into the SD Card slot of the TFT LCD Shield and reset the program.

A small green square should be drawn on the top-left of the display, indicating that the program is running, and that it is safe to remove the SD Card/Power-off the board. When the screen is touched, the coordinates of the point are logged onto the SD Card on a new line in the LOGS.TXT file (this file is created automatically if it does not exist). Along with the coordinates, the timestamp of the touch is also stored.

The logs are not updated constantly, but at a rate of 1 Hz (only once per second). When IO is being performed with the SD Card, the square on the top-left of the display turns red, indicating that it is not safe to remove the SD Card/Power-off the board.

Troubleshooting

Some common problems and their solutions -

Problem Solution
Display stays white after uploading program Non-Standard Driver (not ILI9486)
Display not responding after touch Try changing the order of the touch pins in src/constants.h file, i.e. swap the values of XP, YP, XM and YM
Compilation issues related to SPI Update the Arduino IDE version and/or install the SPI library
Display Flickering/Arduino is reset automatically Faulty Power Supply/Cable

arduino-tft-lcd-3-5-sdcard-logger's People

Contributors

aditya-a-garwal avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.