ATtiny85 + GPS module + GSM module: feasible?

Is it at all feasible to use ATtiny85 connected via software serial to a GPS module to receive GPS data (ATtiny RX connected to GPS TX), and connect the software serial TX to connect to a GSM module to transmit a text message (with GPS coordinates)?

I refer to previous posts years ago (ie ) where a compilable program is used (below) to receive GPS data on an ATtiny (Digispark).

I assume that the Digispark internal clock will need to be calibrated (OSCCAL) so as to ensure proper software serial functioning.

Many thanks for any useful information or comments!

// Include the SoftwareSerial library
#include <SoftwareSerial.h>

// Constants
#define txPin 5      //tx pin in GPS connection
#define rxPin 3      //rx pin in GPS connection

// Set up the GPS serial port
SoftwareSerial gps = SoftwareSerial(rxPin, txPin);

// Variables
byte byteGPS = 0;
int i = 0;
int state = 0;
char dataGPG[100] = "";
char *pch;
char *GGA[15];
int sat = 0;

void setup()
  //setup for Serial Port

  // clear screen
  //  Serial.write(0xFE);
  //  Serial.write(0x1);
  //  delay(10);

  //setup for GPS Serial Port
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);

  //setup satellites signal
  pinMode(1, OUTPUT);
  digitalWrite(1, LOW);     // Turn off the led until a satellite signal

  //  Serial.write(0xFE);
  //  Serial.write(0x80);
  //  delay(10);


void loop()
  Serial.write(254); // cursor to beginning of first line
  Serial.print("Waiting GPS data...");

  // Prepare all for reading GPS Serial Port
  memset(dataGPG, 0, sizeof(dataGPG));    // Remove previous readings
  byteGPS = 0;                            // Remove data
  byteGPS =;                   // Read the byte that is in the GPS serial port


  // Find the desired string
  while (byteGPS != '$')
    byteGPS =;


  // Save the string in an array
  i = 1;
  dataGPG[0] = '$';


  while (byteGPS != '*' )
    byteGPS =;
    dataGPG[i] = byteGPS;

  dataGPG[i] = '\0';
  string();                                 // Call to the function that manipulates our string


  This function will allow us to identify the data we need to get the longitude, latitude ...

void string()
  i = 0;
  memset(GGA, 0, sizeof(GGA));          // Remove previous readings

  pch = strtok (dataGPG, ",");

  // Analyze the saved interval in pch to see if it the needed string
  if (strcmp(pch, "$GPGGA") == 0)
    while (pch != NULL)
      pch = strtok (NULL, ",");
      GGA[i] = pch;

    plot(GGA, "$GPGGA");        // Call to the function that is going to display the data

  This function organize the gps data received for printing in the serial monitor.

void plot(char **GGAPrint, char *trama)
  state = atoi(GGAPrint[5]);
  sat = atoi(GGAPrint[6]);

  if (trama == "$GPGGA" && state == 1)
    digitalWrite(1, HIGH);            // Then there are satellites, the LED switch ON

    //Serial.print("UTC Hour -> ");
    //Serial.print("Latitude -> ");
    //Serial.print("Longitude -> ");
    //Serial.print("GPS quality: 0=null; 1=GPS fixed -> ");
    //Serial.print("Number of satellites -> ");
    //Serial.print("Horizontal Dilution of Precision -> ");
    Serial.print("Antenna altitude -> ");
    //Serial.print("Geoid Separation -> ");


  else                                // If no satellite connection
    digitalWrite(1, LOW);                                              // Turn off the LED
    //Serial.print("|--- Satellites Used -->");
    //Serial.println(" |");
    Serial.println("Waiting location");

Are you using the bare ATtiny85 microprocessor chip or the Digispark board?

I wanted to do something similar (feed GPS output to the Digispark board and extract the speed). But I couldn't work out how to make the serial connection.

What you want to do ought to be possible as long as the code fits into 6k.

I use a bare ATtiny85, so no bootloader. ISP programming with USBtiny.

I would suggest developing the project on a "regular" Arduino to begin. This will make it easier to get your code working because you will be able to use serial monitor to help with debugging. It will also tell you how much ram and flash memory you are going to need, including the various libraries involved. Hopefully, once it is working on the larger Arduino, you will find need less than 8KB flash and 0.5KB ram and you can then migrate to the Attiny.

Very good suggestion! I should have thought of that earlier, thanks.

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