Hi, everyone. Few days back we learned how we can upload data to Thingspeak cloud IoT platform. But it is very tedious job to every time open the web browser and insert command or data. So today we will develop an android app that will do it for us. It is recommended that you go through the Thingspeak documentation first. Ok so let's get started.
What you need
- Laptop or PC with internet connection.
- Thingspeak account.
- Android smartphone.
- Google account.
What is this APP thing?
In this tutorial we will make use of the Thingspeak Apps. You may ask what is this App. It is nothing but services provided by Thingspeak to communicate with your devices. These apps can be accessed by POST, GET, PUT and DELETE HTTP requests. You can check out my previous post on how to make an HTTP request to upload data to your Thingspeak Channel. In this tutorial we will make use of the following Thingspeak Apps.
- Talkback - This App is used to control your device based on some decision made on the basis of your sensor data in your channel. Using this app you can store commands which your device may fetch at regular intervals or when an event occurs to execute.
- React - This is a decision making App. We can use this app to trigger an event based on your Thingspeak data channel. The field on which decision is to be made can be String, Location or Numeric data. There are a whole lot of logic that you can execute based on the data. In this project I will use my android app to get my current GPS location and upload it to my channel based on which an event will be triggered.
- ThingHTTP - This App is used to do an HTTP request from within Thingspeak. So we can use this App to trigger our Talkback App in turn to update the commands.
Getting the Idea
What I am trying to do here is that I will develop an Android app that will POST my current location to my Thingspeak channel which will trigger some logic in the React App. This App will in turn call the ThingHTTP App to send a PUT request to my Talkback App and update the current command. This command will be fetched by my device on regular interval to perfom some action. The last part will not be covered in this post. I will cover it in my next post.
Setting up Thingspeak
It is assumed that you already have a Thingspeak channel set up. If not follow my previous post.
Before moving on please read the documentation each of this App so that you have a better understanding of how they work.
- Open your Thingspeak account and click on the Apps tab.
- You will get your Apps menu. Now click on Talkback App.
- Now click on "New Talkback".
- Now Fill in the Name and select your channel and set a default command by clicking add new command. For now we will add "CLOSE".
- Now again click on the Apps tab and go to the "ThingHTTP" App.
- Now click on "New ThingHTTP" and fill up like this and save your ThingHTTP.
- Now create another ThingHTTP App for closing. Like this.
- Now click on App and now go to the React App.
- Click on :"New React" and fill up like this. Save your React App.
- Now create another React App in similar manner for closing like this.
- While doing all the above steps give the parameters carefully like latitude, longitude,api_key etc. specific to your Apps.
- Now you are ready to go. Lets create the Android App.
Setting up App Inventor 2
Since you are developing an app for android it is already assumed that you have a google account. Now go to the website http://ai2.appinventor.mit.edu. Use your google account to log in and create a new project. App Inventor is an online development platform for creating android apps without any knowledge of programming. It is based on graphical block development. You only need to arranged the required blocks just like a puzzle. Follow the getting started guide to have a clear understanding.
- After you have opened App Inventor 2 and created a project bring the following objects to the canvas. Check this image to get a list.
- Change the Button1 Text to Turn OFF and the Button2 Text to Turn ON
- Change the Web1 url to https://api.thingspeak.com/talkbacks/<your Talkback ID>/commands/<your command ID>
- Change the Web2 url to https://api.thingspeak.com/update
- Change the Clock1 Time interval to 10000.
- Change LocationSensor1 Time interval to 10000.
- Now click on "Blocks" on the top left corner of your screen.
- If you have gone through the Getting started portion then you will be familiar with the blocks. So arrange the blocks as shown below.
- Replace Web1.PutText api_key to your Talkback API_Key.
- Replace Web2.PostText api_key to your Channel API_Key.
- Now click on "Build"->"App(save .apk to my Computer)". It will download the file to your PC. Transfer the file to your android phone and install the app.
Running the Apps
- Now turn ON you GPS and WiFi/Data connection.
- Now open the Talkback App on your Thingspeak account. You will find the default command as CLOSE.
- Now open the app in your android phone and wait for sometime untill the location is displayed.
- Now refresh the Talkback page. If you are at or near the location you specified in your React App, the command will automatically change to OPEN. You can also manually TURN ON/OFF using the buttons provided.
What will you Make?
Isn't it awesome? Now you can automatically pre-cool your room when you are close to your home or you can turn the room lights ON or OFF using the app. There are limitless possibilities of things that you can connect and control through the internet using simple tools like Thingspeak, App Inventor etc. Please keep me posted about your projects and if you are facing any difficulty in understanding the instructions please let me know through the comments. In our next post we will see how we can make our devices fetch these commands at regular intervals and perform certain tasks. Till then keep making and if you like my post please share and +1 me on google.
Hi! I just wanna do autowatering system. How I can start watering with buttons start/stop
ReplyDeleteIn your android app create a button which will send POST request to update the commands in the talkback app. On the controller side use GET requests to execute those commands. One command can be executed only once. Check out this page for more info. https://thingspeak.com/docs/talkback
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletehi, Sounak
ReplyDeleteThank you for showing your project.
I could learn thingspeak app by you too.
Now talkback app's version was changed and it did not become to return a response about OPEN & CLOSE as status on its app.
If possible, Advice me with something.
I want to get a response and the status on thingspeak's Channel and android app(app inventor).
Thank you.
i cant acces my thingspeak talkback using this app to add a new command, inorder to add a talkback command. what i have to do?????
ReplyDeleteis there any video tutorials explaining more about talkback,react and thinghttp ??
ReplyDeleteHii thanks for showing that....I actually want to get a graph from the thingspeak to Android app......can you help me with that please!!!!
ReplyDeleteHi,
DeleteYou can do an HTTP request to thingspeak to get your past data. Refer to Thingspeak documentation for that. After that you can use some graph plotting APIs like Plotly to get some graphs.
how can i login thingspeak user account in my own android app?
ReplyDeleteHi Jatin,
DeleteEverything in Thingspeak works through HTTP requests. Every profile will have it's unique API key which allows you to use all the features of thingspeak.
wonderful project
ReplyDeleteHey! I wanna send a command from my android app to control some ports on my development board, how can I do it?
ReplyDeletehey bro!
DeleteI also want to do the same but even above project is not working , when I run my app it always pop-up an error "wrong no. of argument for posts" would u please help. any help is appreciable.
Thanks for sharing this informative blog embedded systems training institute | embedded systems training in bangalore
ReplyDeleteYou are most welcome.
Deletehttps://play.google.com/store/apps/details?id=aarsoftronix.thingspeak
ReplyDeleteBest app for thingspeak work
That is cool. At the time I wrote this blog I think this app was not there.
Deletehttps://play.google.com/store/apps/details?id=comaarsoftronix.facebook.ihome
ReplyDeleteBest for esp8266 work
You can still use this applications to track someones location.
ReplyDeleteHi,
ReplyDeleteSorry guys I was out of touch from this blog for 2 years. I couldn't reply to most of your comments. But now I am planning to continue the blog with some new projects.
Hi,thanks for this tutorial,can this be done in android studio?
ReplyDeleteI have ESP8266 connected to DHT22. I see Temperature and Humidity on Thingspeak, both Private or Public. All I want to do now is control a relay from my Android cell phone. It would be great to see a step by step and comments from someone. I really do want to learn, but finding it really tough.
ReplyDeletehi,how do i notify my android when some changes occur in the threshold level which is an matlab output
ReplyDeleteif you try renaming the master file, like the way some people did on gaana app, it won't play. download
ReplyDeleteBut how can I get data from thingspeak...I am facing problem in that part. Can u guide us?
ReplyDeletethat's awesome! Am having some difficulties with my project, that is building an app that will be able to track my wearable tracking device.
ReplyDeletesir i just need send or post mobile gps data to thingspeak.can you explain me? sir.
ReplyDeletenice one
ReplyDeletetutuapp is the best app to download any kind of paid app free of charge. tutuapp android pokemon go game is the most famous game in the world and you can download it free of charge. Not only pokemon go app you can download any kind of apps free of charge.
ReplyDeleteYou are doing a great job. You inspire me to write for other. Thank you very much. I would like to appreciate your work for good accuracy and got informative knowledge from here... Embedded System Training in Chennai
ReplyDeleteEmbedded System Training Institute in Chennai
install kodi firestick app using above link and unlock the features of it. all updates are free of charge.
ReplyDeleteThis information is impressive; I am inspired by your post writing style & how continuously you describe this topic. Embedded System Training in Chennai
ReplyDeleteEmbedded System Training Institute in Chennai
I have recently started a blog, the info you provide on this site has helped me greatly. Thanks for all of your time & work.
ReplyDeleteHow to create an app
This comment has been removed by the author.
ReplyDeleteInspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
ReplyDeleterpa training in Chennai | rpa training in pune
rpa online training | rpa training in bangalore
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeleteData Science training in Chennai | Data science training in bangalore
Data science training in pune| Data science online training
Pyton training in Kalyan nagar
After reading your post I understood that last week was with full of surprises and happiness for you. Congratz! Even though the website is work related, you can update small events in your life and share your happiness with us too.
ReplyDeletejava training in omr | oracle training in chennai
java training in annanagar | java training in chennai
I likable the posts and offbeat format you've got here! I’d wish many thanks for sharing your expertise and also the time it took to post!!
ReplyDeletepython training Course in chennai
python training in Bangalore
Python training institute in kalyan nagar
I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
ReplyDeletehealth and safrety courses in chennai
Outstanding blog with lots of information. Keep posting more like this.
ReplyDeleteData Science Course in Chennai
Big Data Analytics Courses in Chennai
DevOps certification in Chennai
DevOps Training in Chennai
Best AWS Training in Chennai
AWS course in Chennai
Data Science Training in OMR
Data Science Training in Porur
ReplyDeleteThis blog is very fantastic! Its much more useful information to me and Thank you for your wonderful post. Please posting...
Excel Training in Chennai
Advanced Excel Training in Chennai
corporate training in chennai
Tableau Training in Chennai
Oracle Training in Chennai
Primavera Training in Chennai
Power BI Training in Chennai
Excel Training in Chennai
Advanced Excel Training in Chennai
ReplyDeleteThe way of you expressing your ideas is really good.you gave more useful ideas for us and please update more ideas for the learners.
Hadoop Training in Chennai
Big data training in chennai
Big Data Training in Anna Nagar
JAVA Training in Chennai
Python Training in Chennai
Android Training in Chennai
Hadoop training in chennai
Big data training in chennai
big data training in velachery
Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.
ReplyDeleteGood discussion.
Cloud Computing Courses in Chennai
Cloud Computing Training in Chennai
Angularjs Training in Chennai
AWS Training in Chennai
Big Data Analytics Courses in Chennai
CCNA Course in Chennai
SEO Training in Chennai
Cloud Computing Training in Annanagar
I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful.
ReplyDeletedate analytics certification training courses
data science courses training
I just couldn't leave your website before telling you that I truly enjoyed the top quality info you present to your visitors? Will be back again frequently to check up on new posts.
ReplyDeleteAI learning course malaysia
ReplyDeleteI was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more.
Data Science Course
After reading your article I was amazed. I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article.Data Science Courses
ReplyDeleteThanks for sharing great info with us.
ReplyDeleteI wanted to write a little comment to support you and wish you a good continuation All the best for all your blogging efforts.Your good knowledge and kindness in playing with all the pieces were very useful.
data science course in pune
Thanks for giving this useful post..
ReplyDeleteinplant training in chennai
inplant training in chennai
inplant training in chennai for it.php
Australia hosting
mexico web hosting
moldova web hosting
albania web hosting
andorra hosting
australia web hosting
denmark web hosting
Two full thumbs up for this magneficent article of yours. I've really enjoyed reading this article today and I think this might be one of the best article that I've read yet. Please, keep this work going on in the same quality.for more info:
ReplyDeletehttps://360digitmg.com/course/certification-program-on-big-data-with-hadoop-spark
https://360digitmg.com/course/machine-learning-using-python-r
https://360digitmg.com/course/artificial-intelligence-ai-and-deep-learning
ReplyDeleteGreat post.I really liked you article,your writing style is simply awesome with useful information. Best python certification course in Bangalore is offering Python training with 100% Placement assistance.Get certification under certified experts
nice post.
ReplyDelete360Digitmg Data Science training
I truly love this post..
ReplyDeleteThanks for sharing with us,
We are again come on your website,
Thanks and good day,
Please visit our site,
buylogo
This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
ReplyDeleteDatascience training in chennai
This comment has been removed by the author.
ReplyDeleteGreat post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
ReplyDeleteData-Analytics training in hyderabad
Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
ReplyDeleteData-science online course in Chenna
Beautiful Blog. really Impressive.
ReplyDeleteData Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery
Cool stuff you have and you keep overhaul every one of us
ReplyDeleteSimple Linear Regression
Great post i must say and thanks for the information.
ReplyDeleteData Science Course in Hyderabad
I want like your blog. yes very interesting this article.
ReplyDeletePython Training in Chennai | Certification | Online Training Course | Python Training in Bangalore | Certification | Online Training Course | Python Training in Hyderabad | Certification | Online Training Course | Python Training in Coimbatore | Certification | Online Training Course | Python Training in Online | Python Certification Training Course
Excellent skill. I like that in your blog content.
ReplyDeletePython Training in Chennai | Certification | Online Training Course | Python Training in Bangalore | Certification | Online Training Course | Python Training in Hyderabad | Certification | Online Training Course | Python Training in Coimbatore | Certification | Online Training Course | Python Training in Online | Python Certification Training Course
very well explained. I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteCorrelation vs Covariance
Simple Linear Regression
data science interview questions
KNN Algorithm
Logistic Regression explained
wonderful article. I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries. data science courses
ReplyDeleteYou should be a piece of a challenge for probably the best website on the web. I will suggest this site!
ReplyDeletelive
Wow such an amazing content keep it up. I have bookmarked your page to check out more informative content here.
ReplyDeleteSASVBA Provides Best Deep Learning Course in Delhi with Latest Development Environment and Frameworks. We keep Our Courses Up to Date with the Latest industrial trends. SASVBA Is One of the best training Deep Learning Institute in Delhi NCR Which Helps Students to Crack Interviews in Tech Giants. We train college students as well as school students.
FOR MORE IMFO:
Hey everyone.
ReplyDeleteWe are giving you the big best offer to buy logo design for your business with 80% off I expect You will be happy with us.Logo Designers
this is really great content thanks for sharing with us keep sharing more helpful content like this...!
ReplyDeleteare you guys have an interest in web designing or logo designing then visit us?
Logo Designers
Data Science Training in Pune
ReplyDeleteThanks for this content you have shared, very useful.
This comment has been removed by the author.
ReplyDeleteNice blog. Informative and knowledgeable content. Big thumbs up for this blog. I really enjoyed this blog. Thank you for sharing with us.
ReplyDeleteData Science Course Training Institute in Hyderabad
Hi! This is my first visit to your blog! We are a team of volunteers and new initiatives in the same niche. Blog gave us useful information to work. You have done an amazing job!
ReplyDeletesatta
satta matta matka
Wonderful blog. I am delighted in perusing your articles. This is genuinely an incredible pursuit for me. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome!
ReplyDeletedata analytics courses in hyderabad with placements
yeni perde modelleri
ReplyDeletesms onay
Turkcell Mobil Ödeme Bozdurma
nft nasıl alınır
ANKARA EVDEN EVE NAKLİYAT
TRAFİK SİGORTASI
dedektör
HTTPS://KURMA.WEBSİTE
aşk kitapları
EMBEDDED ONLINE COURSE
ReplyDeleteBEST EMBEDDED SYSTEM TRAINING IN CHENNAI
ReplyDeleteThis instruction is quite beneficial! Developing an Android app that can connect with Thingspeak Apps appears to be a game changer for IoT projects. I'm looking forward to your next post detailing the remaining phases. Thank you for your contribution! 🚀📱
ReplyDeleteData Analytics Courses in India
The author brilliantly explains how to create an Android app to interact with Thingspeak for IoT control. This informative and well-structured guide encourages creativity in IoT projects.
ReplyDeleteData Analytics Courses In Dubai
ReplyDeleteI found the post to be highly good. The shared information are greatly appreciated
Regards
Dubai water Delivery
This advice is really helpful! It appears that creating an Android app that can link with Thingspeak Apps will revolutionise IoT applications. I anticipate reading about the remaining phases in your upcoming post. I appreciate your contribution.
ReplyDeleteData Analytics Courses in Agra
nice blog
ReplyDeleteData Analytics Courses In Vadodara
The blog is comprehensive tutorial for Android App to connect to Thingspeak thanks for sharing informative blog post.
ReplyDeleteDigital Marketing Courses in Italy
Thank you for sharing! I always appreciate engaging with such high-quality content that offers valuable insights. The presented ideas are not only excellent but also remarkably innovative, adding a cool and enjoyable touch to the post. Keep up the fantastic work.
ReplyDeleteVisit: Financial Data Analytics: Risk Management and Investment Strategies
Connecting an Android app to ThingSpeak for data is a smart move. Using ThingSpeak's API provides seamless integration for real-time data visualization and analytics. Ensure a user-friendly interface. great work.
ReplyDeleteData analytics framework
I found the post to be highly good. The shared information are greatly appreciated. ücretsiz yabancı yarış tahminleri
ReplyDeleteThe blog is comprehensive tutorial for Android App to connect to Thingspeak thanks for sharing informative blog post. Sıcak Haberler
ReplyDeleteConnecting an Android app to ThingSpeak is a great way to interact with IoT data. By using HTTP requests, you can send and retrieve data from ThingSpeak for monitoring or controlling devices. Make sure to handle network operations in the background to ensure smooth user experience.
ReplyDeleteData science courses in Pune
An interesting guide on connecting Android apps to ThingSpeak. Improve your IoT analytics skills with these
ReplyDeleteData science courses in France