Create a wooden pet that connects with Facebook

Auteur avatarSimone Ferrecchia DIGIJEUNES | Dernière modification 9/12/2019 par Clementflipo

Create a wooden pet that connects with Facebook italiano.PNG

Introduction

In this tutorial we will create a wooden pet that connects with Facebook. It will post a message of your choice on your own timeline whenever its tail is touched.

Matériaux

  • 1 x ESP32 board with power cable
  • 4 x jumper wires
  • 1 x breadboard
  • 1 x Led
  • 1 x 250 kohm resistor (or similar)

Outils

  • 1 Pc with Arduino IDE installed

Étape 1 - Set up an account on adafruit.io

Once you ve set up an account on adafruit.io, go on creating a new Feed.

Create a new feed and name it, for example, “touchsensor”.



Étape 2 - Install arduino IDE

Download arduino.cc/en/Main/Software




Étape 3 - Prepare the ESP32 board on your computer

Follow the instructions provided on github for your OS

For windows

If you have troubles following the instructions for windows, you may find some help below.

To find the Sketch directory, click File > Preferences, on arduino IDE.

The process of cloning existing repository may take a tomatically.

Do not quit until it's done. Do not shut any pop up window until they shut automatically.




Étape 4 - Check that the board is correctly configured



Étape 5 - Wiring the led and the touch sensor to the ESP32




Étape 6 - Place the electronic inside the pet



Étape 7 - Programming on tuniot



Étape 8 - Install Adafruit_MQTT.h and Adafruit_MQTT_Client.h libraries on Arduino IDE

Sketch > Include Library > Manage Libraries…




Étape 9 - Programming on arduino IDE

To upload the code on Arduino IDE, click on the “copy arduino code into clipboard” button.

Then paste the code onto Arduino IDE, and upload it to the ESP32.

if you click on Serial Monitor (top right of the Arduino IDE screen), you should see the value recorded by the touch sensor (see image below).

It means that your ESP32 is connected to the internet, and that it’s sending the value recorded by the internal touch sensor on-line, on adafruit.io



Étape 10 - Create an applet on IFTTT

Click on My Applets.

Choose New Applet.

Click on THIS (see image below).

Search for Adafruit.

Choose Monitor a feed on Adafruit IO.

Configure it as follows (see image below)

And Click on Create trigger.

Étape 11 - Complete the applet on IFTTT

Click on THAT

Choose Facebook.

Choose Create a status message.

Type your message and click on Create action.


Étape 12 - Final

In this case, the message that will be posted on your Facebook timeline is “Don’t touch my tail!”




Notes et références

This tutorial has been developed as part of the I TECH project, co-financed by the Erasmus + program of the European Commission. For more info contact us on info@digijeunes.com.

Commentaires

Published