I have my project using vibration and GSM800L interfacing with arduino Nano, plss help me a code where when the sensor trigered the sms text the the vibration sense. Thank you so much
Hello, @ginoo0531. Share your project drawing and sketch. It will help.
+---------| USB |---------+
| D13/SCK MISO/D12 |
| 3.3V MOSI/D11~|
+----------+ | Vref SS/D10~|
| Vibration|-----| A0 D9~|
|? Sensor ?| | A1 NANO D8 | +-------------------------+
+----------+ | A2 D7 | |[-] ANT LED[0] |
| A3 D6~| | NET |
| A4/SDA D5~| | VCC SIM800L RING |
| A5/SCL D4 | | RST DTR |
| A6 INT1/D3~|-----| RXD MIC+ |
| A7 INT0/D2 |-----| TXD MIC- |
| 5V GND | | GND SPK+ |
| RST RST | | SPK- |
| GND 5V DO GND TX1 | +-------------------------+
| Vin DI SCK RST RX1 |
+-------------------------+
Goodeve do you have code of this wiring diagram? Plss help me we need this for our project in thesis
Okay. You must draw your project diagram showing:
- The Nano
- The SIM800L
- The vibration sensor
- The power supply - connected to the Nano, the SIM800L and the vibration sensor.
- The "output" (how you will know the SIM800L, sensor and Nano are working)... usually the SerialMonitor, but you might be using an LCD... plss show.
You can "hand draw" your diagram on Paint (it does not have to look as pretty as my drawing) or on a piece of paper with a pen then photograph it and upload the photograph.
You have a thesis? Very nice. What is the title and subject? (but first, do the above)
We don't write code for but. You do that, and we help You along the road.
This is a code that I wrote for getting gas sensor notification using SIM900A. You have to modify this code according to your setup:
int sensorValue;
int GasSensorPin =A0; //Gas Sensor Connection
int buzzerPin=3;
void setup()
{
pinMode(buzzerPin,OUTPUT);
pinMode(GasSensorPin,INPUT);
Serial.begin(9600); // sets the serial port to 9600
}
void sms() {
Serial.begin(9600); //Baud rate of the GSM/GPRS Module
Serial.print("\r");
delay(1000);
Serial.print("AT+CMGF=1\r");
delay(1000);
Serial.print("AT+CMGS=\"+8801------\"\r"); //Number to which you want to send the sms
delay(1000);
Serial.print("Gas detected\r"); //The text of the message to be sent
delay(1000);
Serial.write(0x1A);
delay(1000);
}
void loop()
{
sensorValue = analogRead(GasSensorPin); // read analog input pin 0
Serial.println(sensorValue,DEC); // prints the value read
if(sensorValue<300)
{
Serial.println("No gas");
digitalWrite(buzzerPin,LOW);
}
else
{
//Serial.println("Gas detected");
digitalWrite(buzzerPin,HIGH);
sms();
}
delay(100); // wait 100ms for next reading
}
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.