I've built this GPS Speedometer with a CYD (Cheap Yellow Display) module that has touchscreen controls.
It has customizable speed range, units (km/h, mph, knots) and mileage function. It also displays accurate time from the satellite data.
It has customizable speed range, units (km/h, mph, knots) and mileage function. It also displays accurate time from the satellite data.
Settings menu can be opened by touching and holding anywhere on the screen.
Disclaimer : For Educational Purpose Only.
Parts required:
1. 2.8" ESP32 CYD Board
Note: There are many clones of this board, you may buy the same model (ESP32-2432S028R) as I've used here to avoid setup error.
Download all required libraries :
i) lvgl (Only use v8.3.11)
i) lvgl (Only use v8.3.11)
ii) LovyanGFX (latest)
iii) TinyGPSPlus-ESP32
New to Arduino / ESP programming ?
Follow this PDF guideline for step by step process
Note: It takes about 10-15 minutes to compile the code first time. You need to wait for 2-5 minutes to get satellite signal after a cold start. Placing the GPS module indoor will reduce the signal reception. Mileage is saved in non volatile storage so powering off won’t erase the data.
If you face any issue send me an email with subject "CYD GPS" to abid.business01@gmail.com





Ciao per il modulo gps, và bene anche il neo 6M?
ReplyDeleteYes
Deletegrazie per la info, ma io sto usando un Cyd 2.8lcd esp32-32E , ma alo schermo non si vedec orrettamente , vedo solo una parte di schermo e limmagine a specchio , quale riga devo modificare?
Deletenice work bro..i think this can for racebox
ReplyDeleteHi Abid, really cool work! I'd love to try building it.
ReplyDeleteSince I'd like to use it outdoors, do you have any suggestions for making the touchscreen waterproof? I'd like to integrate it into my motorcycle's dashboard.
thank you!
Is this unit US-C powered only or work off a battery like the original design? Can the speedometer gauge be configured to read 25 MPH instead of 2.5 x 10?
ReplyDeleteFYI: Most CYD boards are the ESP32-2432S028 version (even the ones you linked). They require a different driver. ESP32-2432S028R uses the ILI9341 display driver and ESP32-2432S028 (non-R / newer or dual-USB variants) uses the ST7789 or ST7789V display driver.
ReplyDeleteThis comment has been removed by the author.
Deletema con questa modifica del file correggi anche il problema del touch screen? nel mio caso modificando il file .ino sono riuscito a mettere in quadro il monitor ma la configurazione del touch risponde male, in pratica mi muove solo la banda rossa della velocità sul tachimetro e non apre la pagina di configurazione
DeleteIf you have the ESP32-2432S028 version (like I bought), replace the contents of LGFX_CYD.hpp with the following and it should work (it works for me).
Delete#pragma once
#define LGFX_USE_V1
#include
// ESP32-2432S028 (non-R / dual-USB CYD): ST7789 240x320 on HSPI + XPT2046 touch on VSPI + PWM backlight
class LGFX : public lgfx::LGFX_Device
{
lgfx::Panel_ST7789 _panel; // was Panel_ILI9341
lgfx::Bus_SPI _bus;
lgfx::Light_PWM _light;
lgfx::Touch_XPT2046 _touch;
public:
LGFX(void)
{
{ // Display bus (HSPI)
auto cfg = _bus.config();
cfg.spi_host = SPI2_HOST;
cfg.spi_mode = 0;
cfg.freq_write = 40000000; // still glitchy? -> 27000000
cfg.freq_read = 16000000;
cfg.spi_3wire = false;
cfg.use_lock = true;
cfg.dma_channel = SPI_DMA_CH_AUTO;
cfg.pin_sclk = 14;
cfg.pin_mosi = 13;
cfg.pin_miso = 12;
cfg.pin_dc = 2;
_bus.config(cfg);
_panel.setBus(&_bus);
}
{ // Panel
auto cfg = _panel.config();
cfg.pin_cs = 15;
cfg.pin_rst = -1;
cfg.pin_busy = -1;
cfg.memory_width = 240;
cfg.memory_height = 320;
cfg.panel_width = 240;
cfg.panel_height = 320;
cfg.offset_x = 0;
cfg.offset_y = 0;
cfg.offset_rotation = 0;
cfg.dummy_read_pixel = 8;
cfg.dummy_read_bits = 1;
cfg.readable = true;
cfg.invert = false; // colors look like a negative? -> true
cfg.rgb_order = false; // red/blue swapped? -> true
cfg.dlen_16bit = false;
cfg.bus_shared = false;
_panel.config(cfg);
}
{ // Backlight
auto cfg = _light.config();
cfg.pin_bl = 21;
cfg.invert = false;
cfg.freq = 44100;
cfg.pwm_channel = 7;
_light.config(cfg);
_panel.setLight(&_light);
}
{ // Touch (VSPI, separate bus)
auto cfg = _touch.config();
cfg.x_min = 300;
cfg.x_max = 3900;
cfg.y_min = 200;
cfg.y_max = 3700;
cfg.pin_int = 36;
cfg.bus_shared = false;
cfg.offset_rotation = 4; // touch rotation
cfg.spi_host = SPI3_HOST;
cfg.freq = 1000000;
cfg.pin_sclk = 25;
cfg.pin_mosi = 32;
cfg.pin_miso = 39;
cfg.pin_cs = 33;
_touch.config(cfg);
_panel.setTouch(&_touch);
}
setPanel(&_panel);
}
};
This is tried and tested. I deleted my earlier comment as it had one digit wrong.
C'è un errore nello script, manca una riga nella parte inaziale , bisogna modificare così per n on dare errore di compilazione
Delete#pragma once
#define LGFX_USE_V1
#include //riga mancante ( in pratica manca il riferimento alla libreria)
Aggiungere dopo include LovyanGFX.hpp
DeleteIf I purchase the ‘Buy option 1’ 2.8" ESP32 CYD Board is this the correct one.
ReplyDeleteIn its description it states it’s a ESP32-2432S028R.
It does the picture of the board is ESP32-2432S028. Look at the pictures in the reviews as well. You could always msg the seller.
DeleteI purchased the "Option 1" CYD and it is the correct one. File compiled and uploaded successfully.
DeleteProblema Cyd risolto in gran parte, il mio e un Cyd della dymore che purtroppo a tutti o quasi tutti i pin configurati diversamente per cui abbiamo dovuto fare delle modifiche allo sketc originale, l'interfaccia principale funziona ma non riusciamo ad accedere alla schermata delle configurazioni , ovunque tocchiamo sullo schermo fa solo muovere la banda rossa della velocità, potresti indicarmi che modifiche apporatre per risolvere il problema?
ReplyDeleteCould you develop a variant of this project wth rpm-gauge displayed arround the speed indicator, by mixing the code with this project https://abidcg.blogspot.com/2026/09/rpm-gauge.html
ReplyDeleteI have the parts ordered from the suggested supplier and have installed the suggested libraries. I get this message "In file included from c:/Users/g4xat/Documents/Arduino/libraries/lvgl/src/misc/lv_log.h:16,
ReplyDeletefrom c:/Users/g4xat/Documents/Arduino/libraries/lvgl/lvgl.h:25,
from c:\Users\g4xat\Documents\Arduino\libraries\lvgl\src/lvgl.h:17,
from D:\Arduino\SpeedometerGPS\SpeedometerGPS.ino:2:
c:/Users/g4xat/Documents/Arduino/libraries/lvgl/src/lv_conf_internal.h:41:18: fatal error: ../../lv_conf.h: No such file or directory
41 | #include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder*/
| ^~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: exit status 1"
Whats the fix??
Thanks
So I moved all the files into the C drive-Arduino and it works, uploaded and all OK. Thanks for sharing....
DeleteI followed the directions. I pushed the code to the ESP32 and it reset.
ReplyDeleteThe screen has a bunch of various colored pixels 00:60 with the 6 backwards and a white stripe at the bottom. What am I doing wrong?
I posted a picture of the output at:
https://1drv.ms/i/c/df677523e3bd7d68/IQDGOmGUbfzKQ5BQY0FLbUBmAZX4IBdRmzEQWSw7e61spws?e=mXsotS
Thank you for this great project. I am looking to create a heads up display for my bike.
Probabilmente stai usando il mio stesso schermo cyd , per risolvere fai riferimento al post di Curate7 facendo attenzione di completare la riga incompleta che qui per motivi di simboli viene omessa
DeleteThank you for the response. I tried that before and just now. I copied the code to LGFX_CYD.hpp and got the same result as before. Same weird screen. I am new at this. Is there something that I need to do the the code after I copy it? Is there something else that I can try?
DeleteAi aggiunto la parte mancante? Lovjangfx dopo il define. Trovi scritto nella risposta mia al posto di Cure7
DeleteI think your CYD is using ST7789 driver for display. Please open LGFX_CYD.hpp and change lgfx::Panel_ILI9341 _panel; to
Deletelgfx::Panel_ST7789 _panel;
scroll down, then in the panel config set
cfg.invert = true; and cfg.readable = false;. Everything else stays the same: the pins, the 240x320 size, and the touch settings.
If red and blue look swapped,
set cfg.rgb_order = true;, and if you see glitches, keep freq_write at 40000000 (some ST7789 boards run fine at 80000000). If the touch ends up mirrored, change the
touch offset_rotation until the corners read correctly.
Wow, this is awesome! Now my display looks great.
DeleteGot the display to work and the touch rotation setting worked with 4.
I verified the GPS board is connected correctly, but I am not receiving any GPS signal. Any ideas?
The onboard blue LED won't blink after connecting to satellites if your GPS module is faulty,
Delete