Sie sind auf Seite 1von 4

instructables

Arduino Whatsapp Messages - Send Whatsapp Messages Using Pi or


Arduino

by AsimZ

There was a time when SMS was one of the most message using Arduino but with the change of trend,
powerful communication tools but with the arrival of we should change our approach too. So, in this
Android phones and social networks, the trend has instructable, we will be going to discuss how to
changed and people have switched to Whatsapp due integrate WhatsApp alert messages using Arduino
to simplicity and the cheap messaging service which and it will save the money you would have spent on
helps you send multimedia easily. GSM module.

originally posted at https://highvoltages.co/tutorial/ar NOTE: You can use this method for Arduino,
duino-tutorial/arduino-whatsapp-messages-send-what raspberry pi or you can use it simply with python
sapp-messages-using-pi/ on any platform.

People have been using GSM to send the alert

https://youtu.be/LXCovjVAJhE

Arduino Whatsapp Messages - Send Whatsapp Messages Using Pi or Arduino: Page 1


Step 1: Setup Twilio Account

We will be using Twilio API for python to send WhatsApp Alert message. In order to get started with twilio, you will
have to follow the following steps,

1. Go to www.twilio.com .
2. Sign up for an account.
3. Verify your number.
4. Then navigate to SMS chatbot.
5. Give your project a name.
6. A flow chart will be opened, but as we are using Twilio API for python we do not need that instead
go to programmable SMS.
7. Go to WhatsApp.
8. Activate sandbox by going into the sandbox.
9. Then you will be given a WhatsApp number and a code, you will have to send SMS with that code
to the number.
10. Your number will be added and then you will have to go to the console and copy your Account SID
and auth token.

Step 2: Install Twilio Library and Run Basic Code

Now make sure you have python installed in your laptop or Raspberry Pi. Go to terminal or command prompt and
write,

pip install twilio

then paste your account SID and auth token in code and run the program,

# Download the helper library from https://www.twilio.com/docs/python/install

from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/console

account_sid = 'AC1d8ea8f74325f727ccbd85a78e20e23a'

auth_token = 'your_auth_token'

client = Client(account_sid, auth_token)

message = client.messages.create(

body='Hello there!',

from_='whatsapp:+14155238886',

to='whatsapp:+15005550006'

print(message.sid)

Arduino Whatsapp Messages - Send Whatsapp Messages Using Pi or Arduino: Page 2


Step 3: Arduino Connection

Make Arduino connection and upload the following code,

int val;
int tempPin = 0;

void setup()
{
Serial.begin(9600);
}

void loop()
{
val = analogRead(tempPin);
float mv = ( val/1024.0)*5000;
float cel = mv/10;
if(cel>=22.00){
Serial.println(cel);
}
delay(1000);
}

Step 4: Video Tutorial

Arduino Whatsapp Messages - Send Whatsapp Messages Using Pi or Arduino: Page 3


Step 5: Follow Us on Social Media

FACEBOOK

INSTAGRAM

YOUTUBE

WEBSITE

Arduino Whatsapp Messages - Send Whatsapp Messages Using Pi or Arduino: Page 4

Das könnte Ihnen auch gefallen