Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't find fona #323

Open
Jen-n14 opened this issue May 10, 2023 · 2 comments
Open

Couldn't find fona #323

Jen-n14 opened this issue May 10, 2023 · 2 comments

Comments

@Jen-n14
Copy link

Jen-n14 commented May 10, 2023

Hi!
I would like to ask for help about my project. I am making a flood monitoring system with sms notification usinh arduino uno r3, gsm 900a module and water level sensor. Below is the wiring of my system.
I tried uploading the code and it was successful yet my serial monitor says couldn't find fona.
May I know what can I do to solve the issue?

Your help will be greatly appreciated💗

Code:
//Tech Trends Shameer
//Flood Alert Call and SMS

#include <SoftwareSerial.h>
#include "Adafruit_FONA.h"

#define FONA_RX 2
#define FONA_TX 3
#define FONA_RST 4

int resval = 0; // holds the value
int respin = A3; // Water Level Sensor Pin

#define FONA_RI_INTERRUPT 0
SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);

Adafruit_FONA fona = Adafruit_FONA(FONA_RST);

char PHONE_1[21] = ""; // Enter your Mobile Number

char tempalert[141]= "Flood Alert" ;
void setup()
{
// pinMode(gas_sensor_pin,INPUT);
Serial.begin(115200);
// dht.begin();
Serial.println(F("Initializing....(May take 3 seconds)"));
delay(5000);
fonaSS.begin(9600); // if you're using software serial
if (! fona.begin(fonaSS)) { // can also try fona.begin(Serial1)
Serial.println(F("Couldn't find FONA"));
while (1);
}

fona.print ("AT+CSMP=17,167,0,0\r");
Serial.println(F("FONA is OK"));
//fona.sendSMS(PHONE_1, welcomemessage);
// pinMode(gas_sensor_pin, INPUT);

}

void loop(){

resval = analogRead(respin);

Serial.print("Water Level:");
Serial.println(resval);

if(resval>200 )
{
Serial.println("Flood Alert");
make_multi_call();
send_multi_sms();
}

}

void send_multi_sms()
{
if(PHONE_1 != ""){
Serial.print("Phone 1: ");
fona.sendSMS(PHONE_1,tempalert);
delay(20000);
}

}
void make_multi_call()
{
if(PHONE_1 != ""){
Serial.print("Phone 1: ");
make_call(PHONE_1);
delay(20000);
}

}

void make_call(String phone)
{
Serial.println("calling....");
fona.println("ATD"+phone+";");
delay(20000); //20 sec delay
fona.println("ATH");
delay(1000); //1 sec delay
}

Wiring :
S -> A3

-> 5v
-> GND
Rx -> tx of arduino
Tx -> rx of arduino
VCC -> 5v
GND -> GND
IMG_20230414_132344
IMG_20230414_132336
IMG_20230414_132131
IMG_20230414_124607_edit_59153718843055
IMG_20230414_124232
IMG_20230409_212005
Untitled21_20230510210554

@Mark-Wills
Copy link

Mark-Wills commented May 11, 2023 via email

@pmethods
Copy link

pmethods commented Aug 13, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants