What is Bard: Google’s New AI Chatbot That Can Enhance Your Search Experience

Google Event IO 2023 The Future of Technology Unveiled Fetured Image

Are you tired of sifting through pages and pages of search results to find what you need? Google’s got your back with Google Bard, its new AI chatbot designed to enhance your search experience. But what exactly is Bard, and how does it work?

Google recently unveiled its newest virtuoso: Bard AI. The stage was set, the spotlight shining bright, as the grand event, Google I/O 2023.

Homepage of Bard AI

Bard provides results based on your preferences and learns from your search history to deliver more accurate results. It can even understand complex queries and provide specific answers to your questions.

In Bard, you can ask questions in a conversational manner and it can provide follow-up questions to narrow down your search even further. It’s more interactive and personalized than the traditional Google search.

How Google Bard works: The power of LaMDA and generative AI

Bard is Google’s latest AI chatbot that is designed to enhance your search experience. The chatbot uses cutting-edge technology, including the LaMDA model and generative AI, to provide you with more personalized and conversational search results.

At the heart of Bard’s capabilities is the LaMDA model, which stands for “Language Model for Dialogue Applications.” This technology allows the chatbot to understand the context of your queries and generate more natural and human-like responses.

This means that you can ask questions in a conversational manner and get relevant answers that feel like you’re talking to a real person.

Unleash the Power of Google Bard AI: Watch the Official Google YouTube Video Now!

.

Additionally, Bard leverages generative AI to provide you with more personalized search results. The chatbot can learn from your search history and preferences to deliver results that are tailored to your needs. This means that you can get more accurate and relevant results without having to sift through pages of search results.

What Google Bard can do

Bard isn’t just a search engine, it’s a multi-talented AI assistant that can help with a variety of tasks. For example, Bard can analyze images to identify objects and provide information about them. Bard can also help with coding and app integration, making it a valuable tool for developers. Additionally, Bard can provide personalized recommendations based on your preferences and search history.

Content Creation

Experimenting with Bard

Google Bard AI can generate high-quality content on any given topic. By analyzing existing content and drawing from a vast database of knowledge, it can produce articles, blog posts, product descriptions, and other types of content in a matter of seconds.

Language Translation

With its advanced language processing capabilities, Google Bard AI can translate text from one language to another with a high degree of accuracy. This makes it an ideal tool for businesses that need to communicate with customers and partners in different parts of the world.

Sentiment Analysis

By analyzing the tone and context of a given piece of text, Google Bard AI can determine the overall sentiment expressed in that text. This can be useful for businesses that want to gauge public opinion on a particular topic or product.

Chatbots

Chat with Google Bard chatbot

Google Bard AI can be used to create chatbots that can interact with customers on a website or social media platform. These chatbots can answer common questions, provide product recommendations, and even make purchases on behalf of customers.

Image and Video Analysis

With its advanced image and video recognition capabilities, Google Bard AI can analyze visual content and provide insights on its composition, content, and context. This can be useful for businesses that want to optimize their visual content for better engagement and conversion rates.

How to use Google Bard: Tips and tricks for getting the most out of it

Google Bard AI is an incredible tool that can significantly enhance your content creation process. To make the most out of this AI-powered platform, consider the following tips and tricks:

1. Familiarize Yourself with the Interface:

Take some time to explore the Google Bard AI interface and understand its various features and functionalities. Get acquainted with the different tools available, such as automated writing, language translation, and content enhancement.

2. Define Your Content Goals :

Clearly define the purpose and goals of your content before using Google Bard AI Determine whether you need to generate blog posts, articles, product descriptions, or optimize existing content.

3. Provide Clear Instructions:

When using the automated writing feature, provide clear and concise instructions to Google Bard AI. Specify the desired tone, style, and target audience to ensure the generated content aligns with your requirements.

4. Collaborate with Bard AI:

Understand that Google Bard AI is not meant to replace human creativity but rather augment it. Use Bard AI as a collaborative tool, leveraging its suggestions and recommendations to enhance your writing.

5. Stay Ethical and Compliant:

Ensure you adhere to ethical guidelines and legal requirements when using Google Bard AI. Avoid plagiarism, respect copyright laws, and verify the accuracy of any information generated by the tool.

The Future of conversational AI and Bard

Bard is just the beginning of what’s possible with conversational AI. As the technology advances, we can expect to see more AI chatbots like Bard that can provide personalized, natural language search experiences. Whether you’re a developer or just someone who wants to enhance their search experience, Bard is definitely worth checking out.

As technology continues to advance, we can expect conversational AI to play an increasingly prominent role in our daily lives.

Looking for more exciting news on the latest advancements in AI technology? Check out my latest blog post covering Google I/O Event, where I dive into the most innovative developments in the world of AI and beyond.

Don’t miss out on the cutting-edge insights – head to my blog now!

xMEMS Silicon Micro Speakers: The Future of Sound Reproduction

xMEMS Silicon Micro Speakers The Future of Sound Reproduction Fetured Image

The Evolution of Audio Technology

Audio technology has gone a long way since the advent of the phonograph in the late 19th century. From the debut of magnetic tape in the 1930s to the 80s the advancement of digital audio continuously innovation and advancement. Here we are going to talk about Micro speakers.

The introduction of digital audio has been one of the most significant advances in audio technology. Unlike analog audio, which produces sound through physical vibrations, digital audio employs binary code to represent audio signals.

The Problem with Coil Speakers: Phase Distortion

Traditional coil speakers have limitations that affect sound quality, including phase distortion, and varying the timing of sound mid, and high frequencies. This can result in a muddled and unclear sound, particularly in the presence of multiple audio sources. Phase distortion in coil speakers highlights the need for innovative solutions like silicon speakers in audio technology.

xMEMS’s Innovative Solution: Silicon Micro Speakers

xMEMS Labs‘ silicon-based speaker technology will replace century-old coil speakers. This allows for dependable mass manufacturing of solid-state speakers using semiconductor fabrication technology, resulting in better-fidelity, high-resolution audio.

Layers of Micro Speakers

xMEMS’s innovative solution to traditional audio technology lies in its development of silicon speakers. Traditional coil speakers can experience phase distortion and other audio quality issues. The silicon micro speakers are able to produce clearer and more accurate sound reproduction.

How Silicon Micro Speakers Work

Silicon micro speakers use a different mechanism to produce sound compared to traditional coil speakers. Instead of a coil, micro speakers use a thin frame made of silicon that is able to vibrate at high frequencies when current is applied. This vibration produces sound waves that are then amplified through a small cavity within the speaker housing.


xMEMS speakers use silicon membranes to achieve phase precision faster and more solidly than any coil speaker. Also, the $100,000 hi-fi speakers for mastering have a 7-degree phase shift (on a scale of zero to 360),

Silicon speakers, on the other hand, can reduce the phase shift to about 1 degree. There is no temporal delay in the way the sound is delivered.”

If you’re interested in learning more about xMEMS’s silicon micro speakers be sure to check this video

The Advantages of xMEMS’s Technology

Silicon speakers are also significantly smaller than traditional coil speakers, making them ideal for use in portable devices such as smartphones. Despite their small size, however, silicon micro speakers are able to produce high-quality sound that rivals larger speakers.

Silicon speakers have a significant advantage due to their small size, enabling them to function in various devices, including smartphones, wearables, and hearing aids. Moreover, they produce clearer and more accurate sound with reduced phase distortion than traditional coil speakers.

The Future of Sound Reproduction

xMEMS’s silicon micro speakers are set to have a major impact on the audio industry in the coming years. Silicon micro speakers are gaining popularity in various industries as they offer clearer and more accurate sound than traditional coil speakers.

Additionally, the compact and versatile nature of silicon speakers makes them suitable for use in diverse applications, such as smartphones and automotive systems.

Conclusion

In conclusion, xMEMS’s silicon speakers represent an exciting advancement in the field of audio technology. Using semiconductor manufacturing processes, silicon speakers offer advantages over traditional coil speakers in terms of precision, consistency, and sound quality.

Overall, the unique mechanism of silicon micro speakers makes them an innovative and promising solution for the future of sound reproduction.

Thank you for reading our blog! Don’t forget to check out our other informative posts by clicking on the links below.

AirJet Solid State Cooling Chip: The Efficient Solution for Thermal Management

AirJet Solid State Cooling Chip The Efficient Solution for Thermal Management Featured Image

Importance of thermal management in electronic devices

Effective thermal management is essential because electronic devices generate a significant amount of heat during their operation. This heat can cause damage to the device and even lead to its failure if not managed properly.

There are several reasons why thermal management is crucial in electronic devices. First, it helps to prevent overheating, which can cause damage to the internal components and affect the device’s performance. Overheating can also lead to the melting of wires and other parts, which can result in electrical shorts and other malfunctions.

Thin Laptop's Cooling Fans releasing heat

Another reason why thermal management is important is that it can improve the reliability and lifespan of electronic devices. By maintaining a stable temperature, the device’s components are less likely to experience thermal stress, which can cause premature failure.

What is AirJet Solid State Cooling Chip

The AirJet Solid State Cooling Chip is a revolutionary cooling technology that provides an efficient and reliable thermal management solution for electronic devices. It utilizes air as a coolant, making it a highly cost-effective and energy-efficient alternative to traditional cooling methods.

AirJet Solid State chip visual representation of air flowing through
Image: Frore Systems

The AirJet is designed with a microchannel heat exchanger integrated into a silicon chip. This allows for rapid heat transfer away from the electronic device, keeping the chip at a stable temperature. The heat is then dissipated into the surrounding air, providing an effective and efficient cooling solution.

If you want to dive deeper into this topic, hit play on the video below for a more visual experience.

The pulsating jets of air remove heat from the heat spreader at the bottom of the AirJet with high efficiency. The flowing air reaches the same temperature as the heat spreader which is in contact with the processor. Hot air exits to the side via an integrated spout. Moreover, AirJet technology offers a compact and lightweight design, making it an ideal solution for electronic devices with limited space.

Advantages of using AirJet for thermal management

  • One of the key advantages of the AirJet Solid State Cooling Chip is its energy efficiency. Compared to typical cooling technologies, such as fans and pumps.
  • The AirJet chip utilizes much less energy, resulting in decreased energy consumption and cost savings. This makes it a great choice for electrical equipment that demands efficient and cost-effective cooling.
  • Another key advantage of the AirJet is that it does not rely on mechanical parts, it requires minimal maintenance. This makes it a reliable solution for electronic devices that require high levels of uptime and dependability.
  • It can be easily integrated into a wide range of devices, including mobile phones, laptops, tablets, and other portable devices.
Graph of Comparison of AirJet vs Other cooling solutions power consumption
Image: Frore Systems

For More Info about how AirJet is more beneficial than legacy Solutions check the Frore System website.

How does AirJet Solid State Cooling Chip work

Desktops use different of methods to cool chips, including radiators and coolers, massive fans, and even water cooling via many hoses. However, a desktop case provides enough interior space to make those alternatives feasible. Because laptops and tablets have little storage space, these options are significantly less viable. That’s what makes Frore’s AirJet so fascinating.

These solid-state coolers have the potential to increase heat dissipation capabilities when stacked side by side. A prime example would be 5 AirJet Pro units, which have the ability to cool a 50W CPU. It’s remarkable how effective they are! With the capability to blow air up to 200 km/h, the cooling power is truly impressive.

Frore Systems developed two chips, the AirJet Mini and Pro, that will be attached to a laptop’s processor in place of a heat pipe or fan. According to business executives, both chips practically silently cool the laptop’s CPU, providing more air pressure but also less disruptive noise than a traditional fan.

Frore anticipates that their AirJet chips will significantly reduce internal heat within a laptop, allowing the machine to function longer in a higher-power mode. That would be around 1.5 times the present performance of a laptop.

The pulsating jets of air remove heat from the heat spreader at the bottom of the AirJet with high efficiency. The flowing air reaches the same temperature as the heat spreader which is in contact with the processor. The heat is then dissipated into the surrounding air, providing an effective and energy-efficient cooling solution.

After reviewing the benefits of AirJet Solid State Cooling Chip for thermal management, it is clear that this technology is a highly efficient and reliable solution for regulating the temperature of electronic devices.

ESP32 Auto Connect To The Strongest WiFi Network

Do you know we can store multiple WiFi credentials in ESP32?
Not just storing ESP32 can automatically connect to the strongest WiFi network among them.

Project Overview 

IoT is all about internet connectivity, and until now, we only depended on one WiFi credential stored in our ESP32. But depending on a single WiFi network is not sufficient for reliable operation.

In this guide, we will discuss how we can store multiple WiFi credentials in our ESP32 code. And among all the WiFi networks, ESP32 will automatically connect to the best network.

This way, we can ensure the best internet connectivity to our ESP32 based IoT projects.

Parts Needed 

For this tutorial, we will use the following parts:

  • ESP32 Development Board
  • Breadboard

Prerequisites

We will be using Arduino IDE for programming ESP32. If you are not familiar with Arduino IDE, then check out our guide on

 ❑ Getting started with Arduino IDE

Additionally, we will need to install the ESP32 board package to Arduino IDE, follow our guide on

❑ Installing ESP32 in Arduino IDE

You can skip both steps if you have done it before.

Auto-Connecting To Best WiFi network

We will use prebuild espressif library WiFiMulti to store multiple WiFi networks and choose the best network among them.

Following changes are required to use this code:

  1. Add your all SSID names in ssid0ssid1….. and so on.
  2. Add your passwords in pass0pass1….. and so on.

If you do not want to fix the WiFi credentials into your code, then check out our tutorial on

 ESP32 Using Wi-Fi SmartConfig

Here is the code:

 

/*
  Date: 24-09-21
  Code written by: Dharmik
  This sketch trys to Connect to the best WiFi network based on a given list
  Find more on www.TechTOnions.com
*/

#include <WiFi.h>
#include <WiFiMulti.h>

WiFiMulti wifiMulti;

#define WiFi_timeout 10000  // 10sec Wifi connection timeout

const char* ssid0 = "TechTOnions";
const char* pass0 = "Dtirth123";

const char* ssid1 = "aaaaaaa";
const char* pass1 = "12345678";

const char* ssid2 = "Your SSID 2";
const char* pass2 = "Your Password 2";

const char* ssid3 = "Your SSID 3";
const char* pass3 = "Your Password 3";

void setup()
{
  Serial.begin(115200);
  delay(100);

  //Adding all WiFi credential to WiFi multi class
  wifiMulti.addAP(ssid0, pass0);
  wifiMulti.addAP(ssid1, pass1);
  wifiMulti.addAP(ssid2, pass2);
  wifiMulti.addAP(ssid3, pass3);

  Serial.println("Connecting Wifi...");

  //Connecting to the strongest WiFi connection
  if (wifiMulti.run(WiFi_timeout) == WL_CONNECTED)
  {
    Serial.println("");
    Serial.println("WiFi connected");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());  //print IP of the connected WiFi network
  }
  else  // if not WiFi not connected
  {
    Serial.println("WiFi not Connected");
  }
}

void loop()
{
  // if WiFi is not connected try again to connect with default timeout of 5sec
  if (wifiMulti.run() != WL_CONNECTED) {
    Serial.println("WiFi not connected!");
    delay(1000);
  }
}

How Code Works 

First, we need to initialize the required libraries. We will need WiFi.h and WiFiMulti.h. Both of these libraries are preinstalled with the ESP32 package.

    
#include <WiFi.h>
#include <WiFiMulti.h>

Now we will initialize wifiMulti as a new WiFiMulti class.

    
WiFiMulti wifiMulti;

We will define WiFi_timeoutWiFi_timeout; this will set the max timeout for connecting to the WiFi network. We have set it to 10000milli seconds (10sec). You can reduce or increase it if needed.

    
#define WiFi_timeout 10000  // 10sec Wifi connection timeout

For this guide, we have defined four different WiFi credentials you may have more or less in your case. Therefore we have defined all of them as const char* and named them as ssid0pass0 until ssid3pass3. You can use different naming if you like.

    
const char* ssid0 = "TechTOnions";
const char* pass0 = "Dtirth123";

const char* ssid1 = "aaaaaaa";
const char* pass1 = "12345678";

const char* ssid2 = "Your SSID 2";
const char* pass2 = "Your Password 2";

const char* ssid3 = "Your SSID 3";
const char* pass3 = "Your Password 3";

Note: Any of your SSID and Password lengths should not be greater than 31 and 64.

setup()

First, we will initialize the serial communication so we can see data in the Serial monitor. We have used a baud rate of 115200. And, adding little delay.

    
  Serial.begin(115200);
  delay(100);

Now, we will use the addAP function from library WiFiMulti to add all the WiFi credentials in the following manner. 

    
  wifiMulti.addAP(ssid0, pass0);
  wifiMulti.addAP(ssid1, pass1);
  wifiMulti.addAP(ssid2, pass2);
  wifiMulti.addAP(ssid3, pass3);

We have four different WiFi credentials; therefore, we need to use this function four times and pass it with varying WiFi credentials. If you have more or less WiFi networks, you can use this function accordingly.

Finally, we need to use the run function with the previous WiFi_timeoutWiFi_timeout defined. This function will take care of choosing the best WiFi network out of all. This function will check all the available networks with strengths and will choose the strongest among them.

    
  if (wifiMulti.run(WiFi_timeout) == WL_CONNECTED)
  {
    Serial.println("");
    Serial.println("WiFi connected");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());  //print IP of the connected WiFi network
  }
  else  // if not WiFi not connected
  {
    Serial.println("WiFi not Connected");
  }

If this function connects to WiFi within the specified timeout, we will print the IP address of the connected WiFi network.
And if not connected to any WiFi, we will serial print “WiFi not connected” in the serial monitor.

loop()

In the loop function, we will only check every time that the WiFi is connected or not. If it is not connected, it will try to connect WiFi with the default timeout of 5sec.

    
  if (wifiMulti.run() != WL_CONNECTED) {
    Serial.println("WiFi not connected!");
    delay(1000);
  }

That’s all we need to do to enable this cool feature of the ESP32. You can skip the last part of this guide. But, if you want to know what exactly this library is doing, stick around with us.

Let’s Dig Deeper

Let us understand what exactly this library is doing in the background. To do so, we will be enabling the verbose output.

To do so, go to Tools > Core Debug Level > Verbose

Arduino IDE selecting verbose output for ESP32

And now upload the code.

This way, the library will print all the additional data in the background to the serial monitor. And you will observe ESP32 will print lots of data in the Serial terminal.

The first thing that we will observe, the library has added all four SSID that we have passed with the addAP function.

ESP32 serial terminal vberbose output for connecting multiple wifi

Next, the library has scanned all the available WiFi networks that are in range. And as we can see that three networks are found.

The square brackets represent the WiFi channel of that particular SSID.

Auto connecting strongest wifi verbose output in ESP32 serial terminal

 We can see the first two SSID are in our code. That’s why they are marked as *

ESP32 Verbose scaned wifi network in serial monitor

And in a bracket, it is the RSSI value of all available WiFi networks. We know that the RSSI value closest to 0 has the strongest network strength. In our case, it is the SSID0 named as TechTOnions, which is -62, the strongest among the two available networks.

RSSI value of scanned WiFi network

Therefore it is connected with TechTOnions and will display the IP and MAC address of the WiFi network.

IP address of the connected wifi in arduino esp32 serial monitor

Wrapping Up

In this tutorial, you’ve learned how easily we can store multiple WiFi credentials to our ESP32 project and let ESP32 itself decide which network is best to use. This way, our ESP32 based project will always connect to the most robust available WiFi network based on the RSSI value.

We hope you learned something new today and will try it out. If you like our tutorial and want more such ESP32 based tutorials, consider subscribing to our weekly newsletter.
And don’t forget to leave us a comment after trying out this project with your ESP32.

Signal: ESP32 Send message and Image

Project Summary

This tutorial will cover how to use Signal bot API to send notifications and images from ESP32 to your signal account. At the end of this tutorial, we will use two buttons connected to ESP32.

The first button will send a message showing the total Button press count to your signal app. Another button press will send an image to your Signal app.

project overview for ESP32 with two buttons showing sending image and message to signal app

Here is the project breakdown:

It’s a simple project using API for interacting with the Signal app. You can use it in your IoT or any Home automation project based on ESP.

Watch the Video Tutorial

Introduction to Signal app

The Signal is a cross-platform centralized encrypted messaging service. It uses the internet to send a message such as an image, voice, video, etc. It is similar to a different messaging app like WhatsApp, but it focuses more on user privacy to enhance the overall user experience. Signal software allows us to use a bot to interact with them.

A bot is third-party software that runs on the signal app. You can interact with the bot, and the bot will interact with the signal app using a different bot API; it will act as a middle person. We can control our bot by sensing HTTPS requests to the bot API.

ESP32 will monitor the button press, and based on that, it will interact with the bot API, and it will send a message or an image to your Signal account.

Setting up a Signal bot

The first step will be to download the Signal app from google play or the app store. Skip if you have are already using a signal app.

Signal app installing from google play store

The bot that we will use in this project is known as Callmebot. Steps to add bot to your Signal app are as followed-

  1. Add this exact phone number +34 603 21 25 97 into your Phone Contacts. (you can name it as you like). Therefore we have saved this number as “Signal Bot.”
    Creating Contact number in Signal app for communicating signal bot
  2. From the Signal app, you have to send this exact message “I allow callmebot to send me messages” to the same bot number you saved in step 1.
    Allowing Signal bot to message and requesting API key for communication with signal app
  3. The bot will immediately reply with your API key. Copy that API key. We will use that key in our ESP32 code. 
    Signal bot replied with new API key on request.

After these three simple steps completion out Signal Bot is ready to interact with our ESP32, it’s that simple. 

Preparing Arduino IDE

To program ESP32 using Arduino IDE, we have to install the ESP32 board to Arduino IDE first. Follow our guide on.

Installing ESP32 in Arduino IDE

If you are not familiar with Arduino IDE then check our guide on-

❑ Getting Familiar With Arduino IDE

We will require an EasyButton.h library from evert-arias for the final example. This library takes care of button debouncing. For installing the library, follow these steps.

  1. Click here to download the latest release of EasyButton.h.
  2. Go inside Sketch > Include Library > Add .Zip Library.
  3. Browse the downloaded zip file from step 1.

For more details, you can check out EasyButton.h library Github Repository.

Parts Required

For this project, you will require the following parts.

  • ESP32 board or ESP8266

Additional requirement for a final example

  • Breadboard
  • 2x button
  • jumper or hookup wires.

Understanding Signal message sending API

Below is the API format to send a text message to the Signal app. Therefore we can use the HTTPS post method to send a text message to the Signal app using ESP32.

https://api.callmebot.com/signal/send.php?phone=[phone_number]&apikey=[apiKey ]&text=[message]

[phone_number]: Your Phone number, including the country code. Ex. +91 756 712 123

[apiKey ]:  Your API key that you received in Setting up a Signal bot step 3.

[message]: Text message you want to send ( all space ‘ ‘ need to be converter to ‘+’)

Example:

https://api.callmebot.com/signal/send.php?phone=+91756712123&apikey=598890&text=Hello+from+ESP32
Calling the above URL in any browser search bar, you will get “Hello from ESP32” as a message in the Signal app if your phone number and API key are correct.

Sending Message to Signal App with ESP32

The following code will send your message once on startup to the Signal bot using its API. Therefore you will receive one message to your Signal app when ESP32 powers ON or ESP32 reset.

ESP32 sending Hello message to Signal using Signal Bot and API

Following changes are required to use this code with your Signal app-

  1. Add your Wi-Fi credentials to the ssid and password variable.
  2. Add your API key to you to apiKey variable. (Same API key that you received by bot)
  3. Add your registered Signal app mobile number with country code to the phone_number variable.
 
/*
  Date: 07-05-21
  Code written by: Dharmik
  ESP32 sending a message to Signal messenger
  Find more on www.TechTOnions.com
*/

#include <WiFi.h>         //Including wifi.h library it will take care of all wifi related task
#include <HTTPClient.h>   //Including HTTPClient.h library to use all api

const char* ssid = "Replace me with your SSID";             //Add your WiFi ssid
const char* password =  "Replace me with your PASSWORD";    //Add your WiFi password

String apiKey = "222222";              //Add your Token number that bot has sent you on signal messenger
String phone_number = "+917561123123"; //Add your signal app registered phone number (same number that bot send you in url)

String url;                            //url String will be used to store the final generated URL

void setup() 
{
  Serial.begin(115200);

  WiFi.begin(ssid, password);              // Try to connect with the given SSID and PSS
  Serial.println("Connecting to WiFi");
  while (WiFi.status() != WL_CONNECTED) {  // Wait until WiFi is connected
    delay(500);
    Serial.print(".");
  }
  Serial.println();
  Serial.println("Connected to the WiFi network"); // Print wifi connect message

  // use message_to_signal function to send your own message
  message_to_signal("Hello from TechTOnions.");  // you send your own message just change "hello from TechTOnions" to your message.
}

void loop()
{
  //loop will do nothing for this example
}

void  message_to_signal(String message)       // user define function to send meassage to Signal app
{
  //adding all number, your api key, your message into one complete url
  url = "https://api.callmebot.com/signal/send.php?phone=" + phone_number + "&apikey=" + apiKey + "&text=" + urlencode(message);

  postData(); // calling postData to run the above-generated url once so that you will receive a message.
}

void postData()     //userDefine function used to call api(POST data)
{
  int httpCode;     // variable used to get the responce http code after calling api
  HTTPClient http;  // Declare object of class HTTPClient
  http.begin(url);  // begin the HTTPClient object with generated url
  httpCode = http.POST(url); // Finaly Post the URL with this function and it will store the http code
  if (httpCode == 200)      // Check if the responce http code is 200
  {
    Serial.println("Sent ok."); // print message sent ok message
  }
  else                      // if response HTTP code is not 200 it means there is some error.
  {
    Serial.println("Error."); // print error message.
  }
  http.end();          // After calling API end the HTTP client object.
}

String urlencode(String str)  // Function used for encoding the url
{
    String encodedString="";
    char c;
    char code0;
    char code1;
    char code2;
    for (int i =0; i < str.length(); i++){
      c=str.charAt(i);
      if (c == ' '){
        encodedString+= '+';
      } else if (isalnum(c)){
        encodedString+=c;
      } else{
        code1=(c & 0xf)+'0';
        if ((c & 0xf) >9){
            code1=(c & 0xf) - 10 + 'A';
        }
        c=(c>>4)&0xf;
        code0=c+'0';
        if (c > 9){
            code0=c - 10 + 'A';
        }
        code2='\0';
        encodedString+='%';
        encodedString+=code0;
        encodedString+=code1;
        //encodedString+=code2;
      }
      yield();
    }
    return encodedString;
}

You will see this message in your Signal app “Hello from TechTOnions.” once uploading is completed and ESP32 gets a proper Internet connection. Additionally, you will see sent ok message printed on the serial monitor.

ESP32 have successfully send message to Signal app therefore printing sent ok in serial monitor.

How code works

The first step will be to include a required library for the example.

  • WiFi.h library will take care of all wifi-related tasks like connecting to your Wi-Fi.
  • HTTPClient.h library used to post the API with HTTP requests.
    
#include <WiFi.h>         //Including wifi.h library it will take care of all wifi related task
#include <HTTPClient.h>   //Including HTTPClient.h library to use all api

Network Credentials

Insert your Wi-Fi network credentials. So that ESP32 can connect to your Wi-Fi network for Internet connection.

    
const char* ssid = "Replace me with your SSID";             //Add your WiFi ssid
const char* password =  "Replace me with your PASSWORD";    //Add your WiFi password

Signal Bot Credentials

Insert the API key that you received in Setting up a Signal bot step 3. Additionally, add your Phone number with the country code that your signal app is registered.

    
String apiKey = "222222";              //Add your Token number that bot has sent you on signal messenger
String phone_number = "+917561123123"; //Add your signal app registered phone number (same number that bot send you in URL)

setup()

First, we will initialize the serial communication so we can see data in the Serial monitor.

    
Serial.begin(115200);

Init the Wi-Fi

Initialize the Wi-Fi So that it can connect to your Wi-Fi network.

Note: If your Wi-Fi credentials are wrong, then ESP will be stuck in the infinite while loop.

    
WiFi.begin(ssid, password);              // Try to connect with the given SSID and PSS
  Serial.println("Connecting to WiFi");
  while (WiFi.status() != WL_CONNECTED) {  // Wait until WiFi is connected
    delay(500);
    Serial.print(".");
  }
  Serial.println();
  Serial.println("Connected to the WiFi network"); // Print wifi connect message

Finally, we will send a message to the Signal app by calling our user-defined function named message_to_signal. You can change the message that you want to send.

It will send “hello from TechTOnions.” if you do not modify the existing message.

message_to_signal (String message)

message_to_signal is our user-defined function that will send messages to Signal App.

Inside this function, it will generate the final url String used for HTTP GET request. The final url will consist of an API url with your phone number, API key, and your message in encoded form.

To encode the message, we will pass the message to the urlencode function.

We are finally calling the postData function to send the message.

    
void  message_to_signal(String message)       // user define function to send meassage to Signal app
{
  //adding all number, your api key, your message into one complete url
  url = "https://api.callmebot.com/signal/send.php?phone=" + phone_number + "&apikey=" + apiKey + "&text=" + urlencode(message);

  postData(); // calling postData to run the above-generated url once so that you will receive a message.
}

postData()

postData is another user-defined function used to send the URL using the HTTP GET method.

Initialize the new http object with HTTPClient. And begin the new http object with the final url build.

    
  HTTPClient http;  // Declare object of class HTTPClient
  http.begin(url);  // begin the HTTPClient object with generated url

Post the url by calling this POST function and save the HTTP response code in the httpCode variable.

    
httpCode = http.POST(url); // Finaly Post the URL with this function and it will store the http code

Now we will check the httpCode that we received, and if it is 200, POST was successful. Therefore printing “Sent ok.” in Serial monitor. If not 200, then printing “Error.” as POST is not successful.

Finally, we will end the http object by calling the end function.

    
  if (httpCode == 200)      // Check if the responce http code is 200
  {
    Serial.println("Sent ok."); // print message sent ok message
  }
  else                      // if response HTTP code is not 200 it means there is some error.
  {
    Serial.println("Error."); // print error message.
  }
  http.end();          // After calling API end the HTTP client object.

urlencode(String str)

This function is used to encode the standard URL because it is necessary to encode sending messages or URL when using HTTP GET request.

    
  String urlencode(String str)  // Function used for encoding the url
{
    String encodedString="";
    char c;
    char code0;
    char code1;
    char code2;
    for (int i =0; i < str.length(); i++){
      c=str.charAt(i);
      if (c == ' '){
        encodedString+= '+';
      } else if (isalnum(c)){
        encodedString+=c;
      } else{
        code1=(c & 0xf)+'0';
        if ((c & 0xf) >9){
            code1=(c & 0xf) - 10 + 'A';
        }
        c=(c>>4)&0xf;
        code0=c+'0';
        if (c > 9){
            code0=c - 10 + 'A';
        }
        code2='\0';
        encodedString+='%';
        encodedString+=code0;
        encodedString+=code1;
        //encodedString+=code2;
      }
      yield();
    }
    return encodedString;
}

For example,

If you want to send “Hello World“, it should be encoded as “Hello+World“.

And if you want to send the URL “https://www.techtonions.com/“, then the encoded URL will be like “https%3A%2F%2Fwww.techtonions.com%2F“.

loop()

For this example, the loop() function will be empty. You can add your code in the loop function. You can also send multiple messages by calling the message_to_signal again inside the loop.

Note:- Calling the message_to_signal function inside the loop without delay can crash the bot, so have some delay if you do so.

Understanding Signal Image sending API

Image sending API is similar to message sending API. Hence you can send any Image to the Signal app by HTTP get method by ESP32.

https://api.callmebot.com/signal/send.php?phone=[phone_number]&apikey=[apiKey ]&image=[image_url]

[phone_number]: Your Phone number, including the country code. Ex. +91 756 712 123

[apiKey ]:  Your API key that you received in Setting up a Signal bot step 3.

[image_url]: put any image encoded URL you like here (Only works for .jpg .gif .png)

Sending Image to Signal App with ESP32

In this example, we will send the Image to the Signal app from ESP32. For this example, we are sending the TechTOnions logo. Therefore you will receive our logo to your Signal app when ESP32 powers ON or ESP32 reset.

Sending image to Signal App using signal bot or API with ESP32

Following changes are required to use this code with your Signal app-

  1. Add your Wi-Fi credentials to the ssid and password variable.
  2. Add your API key to you to apiKey variable. (Same API key that you received by bot)
  3. Add your registered Signal app mobile number with country code to the phone_number variable.
 
/*
  Date: 07-05-21
  Code written by: Dharmik
  ESP32 sending image to Signal messenger
  Find more on www.TechTOnions.com
*/

#include <WiFi.h>        //Including wifi.h library it will take care of all wifi related task
#include <HTTPClient.h>  //Including HTTPClient.h library to use all api

const char* ssid =      "Replace me with your SSID";        //Add your WiFi ssid
const char* password =  "Replace me with your PASSWORD";    //Add your WiFi password

String apiKey = "222222";              //Add your Token number that bot has sent you on signal messenger
String phone_number = "+917561123123"; //Add your signal app registered phone number with country code (the same number that bot send you in url)  
String url;                            //url String will be used to store the final generated URL


void setup() {

  Serial.begin(115200);
  WiFi.begin(ssid, password);             // Try to connect with the given SSID and PSS
  Serial.println("Connecting to WiFi");
  while (WiFi.status() != WL_CONNECTED) { // Wait until WiFi is connected
    delay(500);
    Serial.print(".");
  }
  Serial.println();
  Serial.println("Connected to the WiFi network");  // Print wifi connect message

  //image_to_signal function will send your image to Signal app
  //Just you have to add your image url
  //it only works for .jpg .gif .png    // not working with .webp image format 
  image_to_signal("https://www.techtonions.com/wp-content/uploads/2021/05/New-Profile-picture-logo-big-250x250-1.jpg");
}

void loop()
{
  //loop will do nothing for this example
}


void image_to_signal(String img_url)  //user define function to send image to Signal App
{
  //adding all number, your api key, your image url into one complete url
  url = "https://api.callmebot.com/signal/send.php?phone="+ phone_number + "&apikey=" + apiKey + "&image=" + urlencode(img_url);
  postData(); // caling postData to run the above generated url once so that you will receive image.
}


void postData()     //userDefine function used to call api(POST data)
{
  int httpCode;     // variable used to get the responce http code after calling api
  HTTPClient http;  // Declare object of class HTTPClient
  http.begin(url);  // begin the HTTPClient object with generated url
  httpCode = http.POST(url); // Finaly Post the URL with this function and it will store the http code
  if (httpCode == 200)      // Check if the responce http code is 200
  {
    Serial.println("Sent ok."); // print message sent ok message
  }
  else                      // if response HTTP code is not 200 it means there is some error.
  {
    Serial.println("Error."); // print error message.
  }
  http.end();         // After calling API end the HTTP client object.
}

String urlencode(String str)  // Function used for encoding the url
{
    String encodedString="";
    char c;
    char code0;
    char code1;
    char code2;
    for (int i =0; i < str.length(); i++){
      c=str.charAt(i);
      if (c == ' '){
        encodedString+= '+';
      } else if (isalnum(c)){
        encodedString+=c;
      } else{
        code1=(c & 0xf)+'0';
        if ((c & 0xf) >9){
            code1=(c & 0xf) - 10 + 'A';
        }
        c=(c>>4)&0xf;
        code0=c+'0';
        if (c > 9){
            code0=c - 10 + 'A';
        }
        code2='\0';
        encodedString+='%';
        encodedString+=code0;
        encodedString+=code1;
        //encodedString+=code2;
      }
      yield();
    }
    return encodedString;
}

How code works

The code is all similar to the message sending code. We will require the same library for this code also.
You’ll need to add your Wi-Fi credentials, API key, and Phone number as described in the message send method.

    
#include <WiFi.h>        //Including wifi.h library it will take care of all wifi related task
#include <HTTPClient.h>  //Including HTTPClient.h library to use all api

const char* ssid =      "Replace me with your SSID";        //Add your WiFi ssid
const char* password =  "Replace me with your PASSWORD";    //Add your WiFi password

String apiKey = "222222";              //Add your Token number that bot has sent you on signal messenger
String phone_number = "+917561123123"; //Add your signal app registered phone number with country code (the same number that bot send you in url)  

setup()

Inside setup function serial begin and Wi-Fi init logic will be same, but we will not use the message_to_signal function; instead, we will use another user-defined function for the Image sending name as image_to_signal.

You need to send an image URL with this function, and it will send your Image to the Signal app.

    
  //image_to_signal function will send your image to Signal app
  //Just you have to add your image url
  //it only works for .jpg .gif .png    // not working with .webp image format 
  image_to_signal("https://www.techtonions.com/wp-content/uploads/2021/05/New-Profile-picture-logo-big-250x250-1.jpg");

image_to_signal(String img_url)

image_to_signal is our user-defined function that will send any image to Signal App whenever called.

Inside this function, it will encode the image URL by using the urlencode function used in the previous example. After that, we will generate the final URL, which will contain your phone number, API key, and encoded image URL.

Finally, calling the postData function to send the message.

    
void image_to_signal(String img_url)  //user define function to send image to Signal App
{
  //adding all number, your api key, your image url into one complete url
  url = "https://api.callmebot.com/signal/send.php?phone="+ phone_number + "&apikey=" + apiKey + "&image=" + urlencode(img_url);
  postData(); // caling postData to run the above generated url once so that you will receive image.
}

For this example, the loop() function will be empty. You can add your code in the loop function. You can also send multiple images by calling the image_to_signal again inside the loop.

Note:- Calling the image_to_signal function inside the loop without delay can crash the bot, so have some delay if you do so.

Signal message and Image on a button press

For this project, we will use two buttons connected with ESP32 GPIOs. We will use the above-mentioned message and Image sending functions in this example with a button interface.
We will send a message with the total number of button count when button1 is pressed. And we will send our TO logo as an image when button2 is pressed.

ESP32 breadboard circuit with two input buttons


This example demonstrates how you can integrate the user-defined functions into your IoT projects.

Circuit Diagram

Here is the simple schematic used for this project. It has two buttons tied to an ESP32 GPIOs. Button1 with GPIO23 and Button2 with GPIO22. We will use internal pullups for both switches.

ESP32 circuit diagram with two push button

ESP32 to Signal message and Image on a button press – Sketch

The following code will communicate to the Signal bot hence sending messages and images with buttons. If you understand this concept of using this function, you can easily integrate this code with your ESP32 IoT or Home automation projects i.e.
You can use a Door sensor switch with a Reed switch instead of buttons to get notified whenever a door is open/closed. Or maybe Pir sensor motion detection-based alerts.

Sending Button count and image messages to signal app with signal bot or API with ESP32

Following changes are required to use this sketch with your Signal app-

  1. Add your Wi-Fi credentials to the ssid and password variable.
  2. Add your API key to you to apiKey variable. (Same API key that you received by bot)
  3. Add your registered Signal app mobile number with country code to the phone_number variable.
  4. If you use different Button pins, then change btn1 and btn2 accordingly.
 
/*
  Date: 07-05-21
  Code written by: Dharmik
  ESP32 sending a message & image to Signal messenger on button press.
  Find more on www.TechTOnions.com
*/

#include <WiFi.h>         //Including wifi.h library it will take care of all wifi related task
#include <HTTPClient.h>   //Including HTTPClient.h library to use all api 
#include <EasyButton.h>   //Including EasyButton.h library for handling debouncing on button input
#define btn1 23           //define button 1 pin
#define btn2 22           //define button 2 pin
int button_count;          //it will store total number of button press count

const char* ssid = "Replace me with your SSID";            //Add your WiFi ssid
const char* password = "Replace me with your PASSWORD";    //Add your WiFi password

String apiKey = "222222";              //Add your Token number that bot has sent you on signal messenger
String phone_number = "+917561123123"; //Add your signal app registered phone number (same number that bot send you in url)

String url;                            //url String will be used to store the final generated URL


EasyButton button1(btn1);  // Button1 object for btn1
EasyButton button2(btn2);  // Button2 object for btn2

String send_message;

void setup() {

  button1.begin();  // Initialize the button1
  button2.begin();  // Initialize the button2

  // Add the callback function to be called when the button1 is pressed.
  button1.onPressed(onButton1Pressed);
  // Add the callback function to be called when the button2 is pressed.
  button2.onPressed(onButton2Pressed);

  Serial.begin(115200);

  WiFi.begin(ssid, password);              // Try to connect with the given SSID and PSS
  Serial.println("Connecting to WiFi");
  while (WiFi.status() != WL_CONNECTED) {  // Wait until WiFi is connected
    delay(500);
    Serial.print(".");
  }
  Serial.println();
  Serial.println("Connected to the WiFi network"); // Print wifi connect message

}

void loop()
{
  // Continuously read the status of the buttons
  button1.read();
  button2.read();
}

// Callback function to be called when button1 is pressed
void onButton1Pressed()
{
  button_count++;
  send_message = "Button count = " + String(button_count);
  Serial.println("button1 pressed sending");
  Serial.println(send_message);
  message_to_signal(send_message); // Send send_message to Signal app
}

// Callback function to be called when button2 is pressed
void onButton2Pressed()
{
  Serial.println("Button2 pressed send image");
  image_to_signal("https://www.techtonions.com/wp-content/uploads/2021/05/New-Profile-picture-logo-big-250x250-1.jpg");
}

void image_to_signal(String img_url)  //user define function to send image to Signal App
{
  //adding all number, your api key, your image url into one complete url
  url = "https://api.callmebot.com/signal/send.php?phone="+ phone_number + "&apikey=" + apiKey + "&image=" + urlencode(img_url);
  postData(); // caling postData to run the above generated url once so that you will receive image.
}

void  message_to_signal(String message)       // user define function to send meassage to Signal app
{
  //adding all number, your api key, your message into one complete url
  url = "https://api.callmebot.com/signal/send.php?phone=" + phone_number + "&apikey=" + apiKey + "&text=" + urlencode(message);

  postData(); // calling postData to run the above-generated url once so that you will receive a message.
}

void postData()     //userDefine function used to call api(POST data)
{
  int httpCode;     // variable used to get the responce http code after calling api
  HTTPClient http;  // Declare object of class HTTPClient
  http.begin(url);  // begin the HTTPClient object with generated url
  httpCode = http.POST(url); // Finaly Post the URL with this function and it will store the http code
  if (httpCode == 200)      // Check if the responce http code is 200
  {
    Serial.println("Sent ok."); // print message sent ok message
  }
  else                      // if response HTTP code is not 200 it means there is some error.
  {
    Serial.println("Error."); // print error message.
  }
  http.end();         // After calling API end the HTTP client object.
}

String urlencode(String str)  // Function used for encoding the url
{
    String encodedString="";
    char c;
    char code0;
    char code1;
    char code2;
    for (int i =0; i < str.length(); i++){
      c=str.charAt(i);
      if (c == ' '){
        encodedString+= '+';
      } else if (isalnum(c)){
        encodedString+=c;
      } else{
        code1=(c & 0xf)+'0';
        if ((c & 0xf) >9){
            code1=(c & 0xf) - 10 + 'A';
        }
        c=(c>>4)&0xf;
        code0=c+'0';
        if (c > 9){
            code0=c - 10 + 'A';
        }
        code2='\0';
        encodedString+='%';
        encodedString+=code0;
        encodedString+=code1;
        //encodedString+=code2;
      }
      yield();
    }
    return encodedString;
}

How Code Works

We will Install all necessary libraries for the code required. Now we will also use EasyButton.h library for easy debouncing of button used.

    
#include <WiFi.h>         //Including wifi.h library it will take care of all wifi related task
#include <HTTPClient.h>   //Including HTTPClient.h library to use all api 
#include <EasyButton.h>   //Including EasyButton.h library for handling debouncing on button input

We are defining button pins as btn1 and btn2. Additionally, we need the button_count variable to store total button counts.

    
#define btn1 23           //define button 1 pin
#define btn2 22           //define button 2 pin
int button_count;          //it will store total number of button press count

Now we require Wi-Fi credentials, your Signal API key, and phone number.

    
const char* ssid = "Replace me with your SSID";            //Add your WiFi ssid
const char* password = "Replace me with your PASSWORD";    //Add your WiFi password

String apiKey = "222222";              //Add your Token number that bot has sent you on signal messenger
String phone_number = "+917561123123"; //Add your signal app registered phone number (same number that bot send you in url)

We will generate button1 and button2 as a new object for EasyButton.

    
EasyButton button1(btn1);  // Button1 object for btn1
EasyButton button2(btn2);  // Button2 object for btn2

setup()

Inside Setup function now we will begin our two-button object. By default, the library will set it as Input with internal pullups.

    
  button1.begin();  // Initialize the button1
  button2.begin();  // Initialize the button2

Assigning callback function onButton1Pressed to button1 and onButton2Pressed to button2. It means that now whenever EasyButton detects one button press event, it will trigger this callback function.

    
  // Add the callback function to be called when the button1 is pressed.
  button1.onPressed(onButton1Pressed);
  // Add the callback function to be called when the button2 is pressed.
  button2.onPressed(onButton2Pressed);

Now initialize the serial communication with a baud rate of 115200, so we can see data in the Serial monitor.

    
  Serial.begin(115200);

Init the Wi-Fi

Initialize the Wi-Fi So that it can connect to your Wi-Fi network.

    
  WiFi.begin(ssid, password);              // Try to connect with the given SSID and PSS
  Serial.println("Connecting to WiFi");
  while (WiFi.status() != WL_CONNECTED) {  // Wait until WiFi is connected
    delay(500);
    Serial.print(".");
  }
  Serial.println();
  Serial.println("Connected to the WiFi network"); // Print wifi connect message

Note:- If your Wi-Fi credentials are wrong, then ESP will be stuck in the infinite while loop.

loop()

Inside the loop, we have to call the read() function of the EasyButton library. It will continuously monitor both buttons. And on a button press, it will trigger the callback function we defined in the setup function.

    
  // Continuously read the status of the buttons
  button1.read();
  button2.read();

onButton1Pressed()

Inside this callback function, we will increment the button_count variable, and we will send a button count message to the Signal app using the message_to_signal function that we explored before.

    
void onButton1Pressed()
{
  button_count++;
  send_message = "Button count = " + String(button_count);
  Serial.println("button1 pressed sending");
  Serial.println(send_message);
  message_to_signal(send_message); // Send send_message to Signal app
}

onButton2Pressed()

Inside this callback function, we will send an image to the Signal app using the image_to_signal function that we explore before.

    
void onButton2Pressed()
{
  Serial.println("Button2 pressed send image");
  image_to_signal("https://www.techtonions.com/wp-content/uploads/2021/05/New-Profile-picture-logo-big-250x250-1.jpg");
}

All remaining function we used for this example has discussed before.

Conclusion

The tutorial shows how easily you can use any third-party API with an ESP32 for interacting with the Signal app. Explore more and write in the comment section about your Signal IOT project using this method.

More projects that you may like reading.

❑ Get alerts on WhatsApp with ESP32 when a door opens.

Consider subscribing to our weekly newsletters for weekly updates on new IoT projects based on ESP32.