Project tutorial
Arduino WhatsApp Messages - Send WhatsApp Messages Using Pi

Arduino WhatsApp Messages - Send WhatsApp Messages Using Pi

You can send WhatsApp messages using Arduino or Raspberry Pi with serial communication and Twilio Python API.

  • 10,709 views
  • 2 comments
  • 44 respects

Components and supplies

Apps and online services

About this project

There was a time when SMS was one of the most powerful communication tools but with the arrival of Android phones and social networks, the trend has changed and people have switched to WhatsApp due to simplicity and the cheap messaging service which helps you send multimedia easily.

originally posted at https://highvoltages.co/tutorial/arduino-tutorial/arduino-whatsapp-messages-send-whatsapp-messages-using-pi/

People have been using GSM to send the alert message using Arduino but with the change of trend, we should change our approach too. So, in this instructable, we will be going to discuss how to integrate WhatsApp alert messages using Arduino and it will save the money you would have spent on GSM module.

NOTE: You can use this method for Arduino, Raspberry Pi or you can use it simply with Python on any platform.

Set Up 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,

  • Go to www.twilio.com.
  • Sign up for an account.
  • Verify your number.
  • Then navigate to SMS chatbot.
  • Give your project a name.
  • 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.
  • Go to WhatsApp.
  • Activate sandbox by going into the sandbox.
  • Then you will be given a WhatsApp number and a code, you will have to send SMS with that code to the number.
  • Your number will be added and then you will have to go to the console and copy your Account SID and auth token.

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 = 'AC1d8ea8f74323a'
  
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)

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);
}

Video Tutorial

Conclusion

This way you can send WhatsApp alert using Arduino, You can use the same code to send it from raspberry pi and for pi we will not need any serial communication. You can follow me if you are interested in similar projects, also don't forget to check our you tube channel.

Code

Schematics

Circuit
Fs6ra18jr0yti2p large vc82itu64b

Comments

Similar projects you might like

Arduino + Raspberry Pi + Ubidots Made Easy

Project tutorial by David Escobar

  • 13,099 views
  • 4 comments
  • 38 respects

SMS alerts for arduino 101 BLE

Project tutorial by Alexis Santiago Allende

  • 2,100 views
  • 0 comments
  • 8 respects

Flat Panel Switchboards

Project tutorial by Kirthik vasan

  • 1,336 views
  • 2 comments
  • 12 respects

Alexa BBQ/Kitchen Thermometer with IoT Arduino and e-Paper

Project tutorial by Roger Theriault

  • 2,657 views
  • 0 comments
  • 9 respects

Anomaly Detection & Temperature Monitoring Using Bolt IoT

Project tutorial by ashish anand

  • 1,658 views
  • 1 comment
  • 15 respects
Add projectSign up / Login