Fuel monitoring system

Please I need help for my project. I am using a sensor gauge to monitor fuel level and send messages at different fuel level to the specified phones numbers.
But I discovered that, only smaller phones get the messages while big android do not. In big android phones, only the phones number shows without the real message.
Again, it sends multiple messages. Please help.

#include <SoftwareSerial.h>
//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino #3 & #2

int gaugeVal;
int fullVal = 0;
int halfVal = 5;
int lowVal = 10;
int fuelGauge = A0;

void setup()
{
//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);

//Begin serial communication with Arduino and SIM800L
mySerial.begin(9600);

Serial.println("Initializing...");
delay(1000);
mySerial.println("AT"); //Once the handshake test is successful, it will back to OK
updateSerial();
mySerial.println("AT+CSQ"); //Signal quality test, value range is 0-31 , 31 is the best
updateSerial();
mySerial.println("AT+CCID"); //Read SIM information to confirm whether the SIM is plugged
updateSerial();
mySerial.println("AT+CREG?"); //Check whether it has registered in the network
updateSerial();
mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
updateSerial();
mySerial.println("AT+CMGS="+2348098112427"");//change ZZ with country code and xxxxxxxxxxx with phone number to sms
updateSerial();
mySerial.print("Am ready sir"); //text content
updateSerial();
mySerial.write(26);

pinMode(fuelGauge, INPUT);
}

void loop()
{
gaugeVal = analogRead(fuelGauge);
Serial.println(gaugeVal);
delay(1000);
if (gaugeVal == fullVal)
{
Serial.print("Tank full");
mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
updateSerial();
mySerial.println("AT+CMGS="+2348098112427"");
updateSerial();
mySerial.print("The tank diesel is 100% of its volume sir"); //text content
updateSerial();
mySerial.write(26);
}

if (gaugeVal == halfVal)
{
Serial.print("Tank is half");
mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
updateSerial();
mySerial.println("AT+CMGS="+2348098112427"");
updateSerial();
mySerial.print("The tank diesel is 50% of its volume sir... please ready to Refill me"); //text content
updateSerial();
mySerial.write(26);
}
if (gaugeVal == lowVal)
{
Serial.print("Tank is Low");
mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
updateSerial();
mySerial.println("AT+CMGS="+2348098112427"");
updateSerial();
mySerial.print("The tank diesel is 0% of its volume sir... please Refill me"); //text content
updateSerial();
mySerial.write(26);
}
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}

You hijacked an unrelated thread. Please open a new thread for your topic. When you do, please use code tags.

Is it a crime?

Depends where you are insisting to go... :slight_smile:

@Eghosa

[b]TOPIC SPLIT
Please do not hijack existing topics

Could you take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

5 posts were split to a new topic: Hijacking existing topics

If the message is received on 'a phone', that means that the message is sent correctly using the SIM units AT-commands. Whatever happens at the other end may have something to do with the receiving phone.

A post was merged into an existing topic: Hijacking existing topics