Code for Seven segment display PROJECT

Hello guys, I am creating a project: GPS clock using Arudino and GPS module (Neo 6m)

I have locked GPS module to satelite and verified its working using lcd screen. Now i am facing trouble code for Displaying time on seven segment display using GPS module

We have done multiplexing of 4 seven segment display (anode)

Problem Statement: Now i need to create code to extract Time from GPS module ( Neo 6m ) and Display it on the four 7 segments's ( Hour : Minute ) format

EDIT:
CODE for GPS module with LCD , have verfied on lcd it works. Now instead of LCD need to make it work for 7 segment

#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = 4, TXPin = 3;// Here we make pin 4 as RX of arduino & pin 3 as TX of arduino 
static const uint32_t GPSBaud = 9600;


TinyGPSPlus gps;

SoftwareSerial ss(RXPin, TXPin);

void setup()
{
  Serial.begin(9600);
  ss.begin(GPSBaud);

 
}

void loop()
{
  while (ss.available() > 0)
    if (gps.encode(ss.read()))
      displayInfo();

  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
    while(true);
  }
}

void displayInfo()
{
  Serial.print(F("Location: ")); 
  if (gps.location.isValid())
  {
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(","));
    Serial.print(gps.location.lng(), 6);
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F("  Date "));
  if (gps.date.isValid())
  {
    Serial.print(gps.date.month());
    Serial.print(F("/"));
    Serial.print(gps.date.day());
    Serial.print(F("/"));
    Serial.print(gps.date.year());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  
  Serial.println();
}

Will appreciate if you guys provide me a starting points to understand the logic and code

start by figuring out how to display something on your 7-segment display

then without the 7-segment display, figure out how to read your gps device using the serial monitor.

then combine what you've learned to use both together

1 Like

I have figured out how to read GPS device and got the code to display on 7 SEG
but having trouble combining the two logics

shouldn't you have resistors for each LED segment (not just the common). not clear if you're multiplexing the displays

post your code

1 Like

Hi.
I use the TM1637 4-digit 7-segment LED display module. It needs only 4 connections - 5V, GND, DIO & CLK. There are a couple of libraries available that do all the low level detailed work. All the user does is tell it the number to display and in what format.

1 Like

Resistors are connected to VCC of 7 Seg, which works as Select Line (“Select Lines” are the wires which enable or disable the communication to the individual devices)

I rerfered this website :slight_smile:
https://electronics-project-hub.com/interfacing-7-segment-display-with-arduino/#:~:text=Multiplexing%20of%207%20segment%20display%20involve%20connecting%20each%20segments%20together,wires%20instead%20of%2032%20wires

TM1637 is a smalll display, I need it to display on 4-inch 7 segment to be visible from afar
Any suggestion for this matter?

Yes. This was discussed a few months back. Someone had your exact need and worked out a way of using the processor on the TM1637 to drive a large display.

I'll try to locate the discussion.

1 Like

TM1637 can drive a 4-inch 7 segment display using drive transistors.

Your current schematic will not work with a display of that size. The segments tend to be made up of multiple LEDs in series/parallel, requiring more voltage and current than can be supplied directly by an arduino.

< edit > Using four TPIC6B595 shift registers would be another option, if you do not want to multiplex the display.

1 Like

CODE for GPS module with LCD , have verfied on lcd it works. Now instead of LCD need to make it work for 7 segment

#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = 4, TXPin = 3;// Here we make pin 4 as RX of arduino & pin 3 as TX of arduino 
static const uint32_t GPSBaud = 9600;


TinyGPSPlus gps;

SoftwareSerial ss(RXPin, TXPin);

void setup()
{
  Serial.begin(9600);
  ss.begin(GPSBaud);

 
}

void loop()
{
  while (ss.available() > 0)
    if (gps.encode(ss.read()))
      displayInfo();

  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
    while(true);
  }
}

void displayInfo()
{
  Serial.print(F("Location: ")); 
  if (gps.location.isValid())
  {
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(","));
    Serial.print(gps.location.lng(), 6);
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F("  Date "));
  if (gps.date.isValid())
  {
    Serial.print(gps.date.month());
    Serial.print(F("/"));
    Serial.print(gps.date.day());
    Serial.print(F("/"));
    Serial.print(gps.date.year());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  
  Serial.println();
}

Please elaborate

Absolutely, for that problem i plan on using driver IC ULN2003A and BCD to 7seg Decoder
Rectify me if I am off the path

Got something? :slight_smile:

Here is the discussion:

Look at post #88. He was able to drive a 0.8 inch display from the TM1637 (just expand the box above too see the full post.)

1 Like

Will go through it, Thanks Brother

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.