Selvam J. Practice With ESP32 Project... 2022
Selvam J. Practice With ESP32 Project... 2022
Selvam J. Practice With ESP32 Project... 2022
ESP32 PROJECT
ESP8266, loT Project, Crypto Project, Arduino Coding,
Actuator node, PIR Sensor Projects and more
PRACTICE WITH ESP32
PROJECT
ESP8266, loT Project, Crypto Project, Arduino
Coding, Actuator node, PIR Sensor Projects and
more
By
Jansa Selvam
TABLE OF CONTENTS
GET STARTED WITH THE ESP32
WHAT IS ESP32
ESP32 - MICROCONTROLLER HARDWARE AND SOFTWARE
TAKING THE ESP32 FOR A SPIN
IOT CONCEPTS PART 1
INTRODUCTION TO CAYENNE
GETTING STARTED WITH CAYENNE SETUP
DASHBOARD OVERVIEW
IN-DEPTH UNDERSTANDING OF THE CAYENNE MQTT ESP
LIBRARY
CAYENNE AND TROUBLESHOOTING
IOT WEATHER MONITORING SYSTEM THEORY
CONFIGURATION AND IMPLEMENTATION
EVENTS AND TRIGGERS
ACTUATOR NODE
END TO END IMPLEMENTATION
INTRODUCTION TO THINGSPEAK
GETTING STARTED WITH THINGSPEAK SETUP
DASHBOARD OVERVIEW
IN-DEPTH UNDERSTANDING OF THE THINGSPEAK API
OVERVIEW AND INTEGRATION OF IFTTT
CAPSTONE PROJECT 2 WEATHER STATION
CONCLUSION
FIRST GRAPHICS TEST
SHOW XBM FILES
MORE CRYPTOS
RELOAD DATA
SUGGESTION FOR A 3D PRINTED CASE
ASSEMBLY
GET STARTED WITH THE
ESP32
How to get started with the ESP32 microcontroller from Shanghai-based
company Espressif. Over the last few years, the ESP32 has become a very
popular microcontroller amongst makers and electronics hobbyists, but also
in the industry.
There are several reasons for this. It has built-in Wi-Fi and Bluetooth. It is
incredibly powerful. It is cheap as unit prices for a single-core version start
at around 1.5 euros and dual-core versions cost about 3 euros. There are
many low-cost development boards available, and there is plenty of good
documentation. Good documentation is important and Espressif has made a
huge effort to make the ESP32 accessible to makers as well as professional
users. Besides good documentation Espressif also provides development
tools like the compiler and libraries for free.
Arduino core for the ESP32
build passing ¥O ESP32 Arduino CI passing
Contents
• Development Status
• Installation Instructions
• Decoding Exceptions
• Issue/Bug report template
• ESP32Dev Board PINMAP
The ESP32 is probably the first and maybe the only microcontroller that
was launched with support for Arduino. The wireless capabilities of the
ESP32 are what its users will mention first, but it has much more than that.
The device comes with many peripherals like SPI, I2C and UART, but also
CAN, which is called TWAI, which stands for Two-Wire Automotive
Interface, it has LED and motor control support, PWM, I2S for audio,
analogue in- and outputs, infrared remote control, timers and counters,
Ethernet, SDIO for memory cards, touch sensing support and it even has a
built-in a Hall magnetic field sensor. Even though this long list is
incomplete, there are two things the ESP32 does not have. First of all, it
does not have USB, and secondly, it does not have Flash memory. Well, this
is not entirely true, there are versions that have built-in Flash but most
don’t. Most ESP32-based boards and modules have external Flash memory
even though it may be built into the chip. Confusing? Just don’t worry
about it and remember that most ESP32 boards have 4 MB of Flash
memory.
At the heart of the ESP32 are one or two Xtensa LX6 32-bit processor cores
clocked at up to 240 MHz. The ESP32 started out as a dual-core device, but
today single-core versions exist too. Actually, the ESP32 has one more
processor core which is intended for low-power operation. It will be clear
by now that the ESP32 is a versatile device that can be used in a wide
variety of applications. The internet of things is, of course, one of them.
And this is accentuated by support for popular cloud service providers.
Apart from cloud support, Espressif has tons of repositories on GitHub with
example code and demo applications. Besides the libraries from Espressif,
ESP32 users have published lots of code too, making it quick and easy to
get an application up and running. So, this is great to get started. But before
you can start creating your own applications, you must install a
development system or toolchain. There are several options, but here we
will limit ourselves to MicroPython, AT Commands, Arduino, and ESP-
IDF, and in that order. MicroPython is a stripped-down version of Python
that runs on microcontrollers. With MicroPython you can program the
ESP32 in Python. As many people already know Python, this is quite
practical. The ESP32 does all the Python stuff itself, so no other tools or
programs are needed. The only thing you must do is program the ESP32
with the MicroPython firmware and this can be done with Python. For this
you need, of course, Python but you probably already have that installed
since you are interested in Python. If not, install it first. Then you must
install esptool, the tool to load a program into the flash memory of the
ESP32 board. Download the MicroPython version suitable for your ESP32
board from the MicroPython website. To be sure, first erase the ESP32.
Then program the firmware. After programming launch a serial terminal to
bring up the REPL prompt. Type help() to see if things work. If they do,
you are all set for ESP32 application development with MicroPython. AT
Commands date back to the nineteen eighties. They consist of short text
based commands beginning with “AT” sent over a serial link to a target
where they are executed. The target used to be a modem and the commands
let you control the modem and send and receive data.
rHEbbir 1ФЯ
Hop
jmmands and
ESP-AT Overview
Enter ‘0’ in the address field and do not forget to check the box in front.
Make sure that DoNotChgBin is checked too. Select the COM port and set
the speed to something fast. Finally, click the Start button and wait until
programming is finished. ESP-AT uses a second serial port for the AT
commands. To try it with a computer you need a serial-to-USB converter
and open a second serial terminal to enter the AT commands and see the
responses. Make sure to terminate commands with a return AND a line
feed: CR+LF. Now you can use the ESP32 as a Wi-Fi or Bluetooth add-on
for another microcontroller. A third way to work with the ESP32 is with the
Arduino IDE.
Contents
• Development Status
• Installation Instructions
• Decoding Exceptions
• Issue/Bug report template
• ESP32Dev Board PINMAP
This gives you access to the huge collection of libraries and applications
developed for Arduino. Basically, it turns the ESP32 into an Arduino board
with Wi-Fi and Bluetooth, simplifying application development quite a lot.
Note that the ESP32 Arduino Core can also be used with for instance
Platform IO. Setting up the Arduino IDE for ESP32 is easy. It starts by
adding a repository to the Boards Manager of the Arduino IDE. You do that
in the IDE’s Preferences window. Then open the Boards Manager, search
for the ESP32 package and install it. You can now choose an ESP32 board
from the Boards menu. As there are many possibilities, chances are that
your board is listed here. If it isn’t, don’t worry, just choose the first entry
and then customize it from the Tools menu. The default values will work in
most cases. You can now try out the examples or write your own program
like I did to blink an LED with an ESP32 Pico Kit board.
The most advanced way for ESP32 application development is ESP-IDF.
This gives you full control over everything, but it is also the most
complicated. Luckily, installing it is easy, especially on Windows as a nice
installer package is available. Application development is done in a Bash
terminal or command prompt window, but an Eclipse plugin is available
too. A project is built in a few steps. After creating a project folder, you
must set the target chip and configure the project with the 'menuconfig' tool.
Then build it, which takes a while the first time, and upload the executable
to the board. If you specify the 'monitor' option, a serial terminal will open
that displays program status. We will stop here. Summarizing, I have shown
you four ways to get started with the ESP32 microcontroller from Espressif,
from simple AT commands and MicroPython to Arduino and C/C++
programming with the full-fledged ESP-IDF environment.
WHAT IS ESP32
What is ESP32? Features of ESP32, How to choose the right ESP32 board
Why choose this board for IoT applications you should have heard enough
about the ESP32 chip and from its specification it looks like a chip of the
future which will help you build anything. Espressif has always been at the
peak of the IoT market after releasing its game changing chip, the
ESP8266.
The two cores are named Protocol CPU or Pro CPU and Application CPU
or APP CPU. The PRO CPU is responsible for handling Wi-Fi, Bluetooth
and other internal peripherals like SPI, I2C, ADC and more. The APP CPU
handles the application code. The differentiation is done using Espressif's
internal development framework, commonly known as the ESP IDF The
ESP IDF is an official software development framework for the chip. Other
implementations such as the Arduino IDE for ESP32. are also based on the
ESP IDF. The ESP32 uses TCP/IP, 802.11 WLAN MAC protocol This
means that the ESP32 can communicate with most of the WiFi routers out
there when used in client mode.
ESP32 also supports WiFi direct. WiFi direct is a good option for peer-to-
peer communication without the need for an access point.
WiFi direct is easier to set up and configure and generally has higher data
transfer speeds as compared to Bluetooth. This feature potentially helps to
develop ESP32 projects from a phone or tablet that supports Wi-Fi direct.
Along with its WiFi capabilities, The ESP32 also supports the latest BLE
Bluetooth 4.0 and the classic Bluetooth. This makes it a great fit for
designing devices that work with both existing and new phones in the
market. The BLE makes it possible to consider the ESP32 as a right
candidate in the making of smartwatches or wearables, health based
sensors, beacons and more. If you want to learn more about BLE, Security
is a big issue, hindering the progress of IoT. The ESP32 is built, keeping
this in mind, it consists of a cryptographic hardware accelerator. The
cryptographic hardware accelerator is a core processor designed specifically
to perform computationally intensive cryptographic operations far more
efficiently than the general-purpose CPU. This ensures that the security
implementations are efficient.
Some of the development kits available in the market are ESP Wroom 32
DevKit, Adafruit Huzzah 32, SparkFun ESP32 Thing. Lolin 32. So how do
you know which ESP32 board is suitable for you? While selecting an
ESP32 board there are various aspects to consider. The most important
thing is to check out the PIN configuration. You need to have proper access
to the board pin out or else you will use the board incorrectly. The second
important thing is to check if the ESP32 board has a proper USB to UART
interface and a voltage regulator circuit. Most of the development boards
will have these features in built in them. It will make your project
development smoother. A boot and reset button on the board with a couple
of LEDs to indicate particulars always help in debugging battery connectors
and battery management is a very useful feature in the IoT domain. And
some ESP32 development boards also come up with battery connectors for
Lipo batteries. Finally, you should always keep in mind the application you
want to use the ESP32 board. Some boards have extra features such as an
OLED display, a built-in LoRa module or a camera.
With the ESP32, you can interface a wide range of sensors and actuators to
make home automation projects like a door sensor or a smart water pump.
You can also manage devices securely and remotely due to its WiFi and
Bluetooth connection capabilities. Furthermore, using cloud services like
Amazon AWS in conjunction with the ESP32 will give you an edge on
making solutions for complex problems.
Power LED On-board Red LED
The board has access to 30 GPIO pins and it has on board debugging
buttons and on board SMD LEDs. It also has a proper USB to UART port
which can flash the code and can be used for power.
The project is designed in such a way that irrespective of the type of ESP32
board used, the projects and the code will work seamlessly.
ESP32 - MICROCONTROLLER
HARDWARE AND SOFTWARE
So the ESP 32 is the next generation chip from the ASPA. 266 was
announced about a year and a half ago and it's been available. Patchouli for
about the last three months. this picture is a module that incorporates the
ASP 32 with some of the supporting components to make it go. So you can
solve to that down onto a PCB. That's the ESP w room 32. And that's what
we used on Iotas. actually, I should also mention here that, especially if
we're kind enough to donate the SPW rooms that we have on those boards,
which was great because they kind of hard to get hold of at the moment.
CPU
• Dual Core 32-bit Xtensa processors
• 240MHz each
• 600DMIPS in total
• Hardware floating point
• Seven stage pipeline
• DSP & crypto acceleration
• Ultra Low Power coprocessor
Similar CPU to the ASPA 2 66. the main processor in the ESP 32 is also an
extensive 32 bit processor. It's a little bit beefed up. It's a jewel core. The
cause can run it up to 240 megahertz. H I think the calculation is 600
drystone rips of processing power as hardware flooding point. It has a fairly
large CPU fetch pipeline. So it's got a seven stage pipeline, which is
unusual in microcontrollers, but it's usually microcontrollers that have to
run at 240 megahertz that's to do with how many instructions can be queued
up in the pipeline to run on the CPU and it's necessary to get good
performance at high clock rate. If your memory is not particularly fast. So
to compare this to sort of previous generation chips, the NIPT IVR has a
two-stage pipeline. 4 86 desktop CPU has a five stage. there are some extra
instructions for doing some DSP, like operations you can do in
multiplication and division in a single cycle. and there's some, built-in, it's
actually not in the CPU, but there's some support for accelerating,
cryptographic operations, because that was one of the things on ESPN 266.
If anybody tried to bring up a TLS connection or something, it was pretty
slow. So you can save power by doing that. The ultra low power one is a
hundred design from expressive, so it doesn't use an established instruction
set. there's a very simple assembler for it available to them. And there's
going to be a bin new tales, like normal JCCA assembler available soon. So
it'd be able to program with that. One of the things to mention about the
CPU's is that, there are actually quite a lot of these kinds of wifi modules or
wifi devices, or particularly network devices that use a Juul CPU in a little
package for an embedded device. Usually one of the CPU's is reserved for.
The network stack and the wifi and you can't usually program it.
It's a closed black box and the other CPU is available. One of the unusual
things about ASP 32 is that you can put your code to run on both processes
as you want. So you can choose to have wifi on one core and your stuff on
the other core, or you can choose to put everything on one core. And if
you've got one particular bit of a central code, you can put that on the other
core, or you can have a task scheduled on both of the calls as you sort of
want.
Storage
• 520KB SRAM + 16KB low power retained RAM
• Up to 16MB external flash
So there's a lot of flexibility there in how you decide to use. Mina storage
has gone up. Anybody who worked with ASPA 266, especially if you use
like a language like Lula or JavaScript, or even Python, somebody used to
running out of memory, you kind of write the code you wanted and you'd
run out of memory and then you'd spend the next day shrinking it so that it
had run without using too much memory.
Wireless
• WiFi - 802.1 Ib/g/n/e/i (2.4GHz)
• Bluetooth v4.2 BR/EDR and BLE
So that limit has gone up quite a lot. You have a half a megabyte of
memory. You can have quite a lot of external flash and. Say from
experience. That's pretty nice. You don't have to kind of worry about your
overheads quite as much as you did before the chip still does wifi built in,
has the Adelaide two 11 BJ and N that the ADA ESPN 266 had, so it was
82 11 E, which is a real-time media streaming extension for doing real-time
signaling the wifi also now supports, HT 40. So you can push more,
throughput over the network. but the really big improvement in wireless is
that there's also Bluetooth. So please just 4.2 does classic Bluetooth and
Bluetooth, low energy at the moment. I think there's only software support
for a BLE, but there is going to be classic support for a classic Bluetooth.
Analog
• 12-bit Analog-to-Digital Converters (18 channels)
• 2x8-bitDAC
• lOx capacitive touch pins
• Temperature sensor
• Sigma-Delta Modulation (lOch)
I believe like audio networking, profiles, all that kind of thing. And you can
run the wifi stack on the Bluetooth stack at the same time. Another thing
that kind of probably, if anybody used an ASPA 266, it didn't have a lot of
analog features for like reading voltages and stuff like that. They had 180
say that could rate up to 1.1 volt.
I/O Peripherals
• "GPIO Matrix", remap I/O to different pins
• "Interrupt Matrix", remap/share/split interrupts
• 4x SPI buses (3 easy to reuse)
• 2x I2S buses
• 2x I2C buses
• 3x serial UARTs
• lx SD/MMC card host
• lx SDIO slave
again, it's, kind of annoying sometimes, cause you only had a few pins.
Certain peripherals had to be on certain pins. So you couldn't use all
combinations. There's a GPI matrix crossbar. So you can choose where you
want to put your pins. you don't have to look at the data sheet necessarily
and say, okay, I can only use these two pins as these three pins for SBI. I tell
you, I allocating their, you can say, well, I want to use these pins. Cause
that's easier because I want to use that other thing for some. As an interrupt
matrix as well, which is more of an internal feature to share and trumps
between the cause and allocate the interrupts. Lots of flexibility. There
there's a lot of ways to plug in connect things to ASP 32 that's by bus,
forced by buses, which three are fairly easy to use.
And one of them is tricky. There's, two I two S buses. That's an audio data
bus that was on the ASPA 2 66, but it was hard to use. and the I two S has a
bunch of extra features. So. You just kind of, misuse it to do some other
things. Like there's a demo project where somebody hooked up a camera,
with a parallel interface and read all of the ports through the IQs interface.
there's two hardware. I squared C buses. I squared C is a really common
way to connect sensors to a microcontroller. for example, the Iotas has, I
think, and I squared saved bus with full things on it. They, pressure and
temperature and humidity sensor has an expanded pin. There's, an IRS deck
that you can figure out.
It's something else that I can't think of right now. yeah, the serial bullets,
basically all of the IO that you could want. this has done to sound a little bit
like a, late night television spiel, but there really is more, a lot of stuff got
thrown in here is this canvas interface for automotive connections. There's
an infrared transmitter and receiver for talking to sort of, this is supposed to
be just for talking to sort of televisions and things like that. Sending I R
remote credits, but it also kind of happens. What it is, is an engine for
sending any stream of digital on and off pulses as a strain.
And there's actually a whole lot of places that that's useful. So somebody's
already taken that remote control and device and worked out a way to drive
a Neo pixel type WDS 20 I 12 LA days from it. So you can just it in a
stream of pulses and program. Those, and that is a lot easier than on a 266
again, where you had to do that with software and software timing. And it
was a little bit finicky deal hack. One of the other ones. there's various ways
to make pulses for LA days. And murders is an ethernet interface. So you
can have a wifi, Bluetooth AceNet internet of things, device, if that's what
you want. there's a whole sensor, although I don't think there's software for
the whole sensor yet.
a lot of people asking where can they can get this thing. if you came along
today, then you've got the IOT. So you have one already to take time. you
can get them from sort of the usual online places where you bought . I think
a lot of people have had bad experiences with Ali express and some of the
other pre-orders there was some vendors that took pre-orders and never
shipped. but that situation is hopefully over now.
What else is new?
• Out with the SDK, in with the esp-idf
■ Apache License
■ Mostly open source
■ Active on github
■ https://github.com/espressif/esp-idf/
■ http://esp-idf.readthedocs.io/
• Technical Reference Manual
So that kind of is a real whirlwind tour of the hardware side. There's just so
many phages. You kind of can't get into that much depth on the mall. but
there's also quite a lot new on the software side, which I think is really
exciting. the old days had two SDKs, there was a nano SSD. Where you
sort of write your program, kind of like Arduino and you use callbacks to
do networking. And there was a real time operating system. One where you
could have multiple tasks and they could communicate with each other and
then built on top of those. There were a lot of other ways to program at like
Arduino and, smearing and various other interfaces. The new chip, because
it's has dual calls already. So has concurrency always uses a real-time
operating system. we named to avoid confusion. We've named that ESP
IDF, which is the IOT development framework, really just because we
didn't want to have yet another SDK. There were so many SDKs, it's under
the Apache license, everything above the wifi layer is open source.
So you can go and get it on, get up. we plan to open source. There's still a
few, a few little bits that are still in binary around that because we haven't
moved it out yet. But the plan is to really only leave the low-level wifi.
Connectivity, which is quite, it's quite chip specific to begin with, and quite
proprietary in binary. And we want to put the rest under an open-source
license and we're using GitHub pretty actively. we pushed to get hub from
our internal get servers. Every couple of days, we accept four requests. We
try to interact with people as best as we can and, and be good, good hub
citizens. And there's also a technical reference manual, which was
conspicuously missing on a 266. So the hardware is actually. there are some
chip chapters that are still missing or coming, but it's being added to every
month or two. And you can go and look up actually what the peripheral
does, what the register map is, all of that information that you didn't get
with ESPN 266, necessarily. So using this plan, if you're gonna use your
patio after program and you have to, how do you actually go about during
this, the chip, as you probably realized, there's a lot more complicated than
the 8 266 there's lots of stuff.
FreeRTOS
• Tasks
• Queues
• Semaphores
• Mutexes
Drivers
Ethernet, WiFi, Bluetooth Low Energy, GPIO, ADC, DAC,
I2S, I2S, SPI, LED Controller, Remote Control (IR),
Capacitive Touch, SD/MMC Host, Sigma-Delta
Modulator, Timers, UART, Crypto (Arbitrary Precision
Integer Ops, AES, SHA).
More soon
schedule the tasks and talk to each other and do basic computing. It doesn't
really give you anything for interacting to the outside world. It's kind of just
a pure, computing kind of set of instructions. So the other restriction is
drivers on his PRTF has drivers already in it for these peripherals and other
peripherals of more or less on their way stuff is landing every couple of
days. So most of the major features in hardware have a driver that you can
use rather than having to poke at the hundred.
And also examples. There's plenty of examples there. if you think that
there's an obvious bit of functionality that doesn't have an example, let us
know, and we'll write an example for it. So you can take the example card
and play with that. And if you look in the ASPI DF examples, directory,
that's where the examples of the project are.
Other Options
• Arduino
• MicroPython
• Lua (NodeMCU)
• JavaScript
e
w Pnct
rWol
• Erlang
There are also a bunch of other programming options. If you're brand new
to embedded, then Adriano is very popular and very good in very.
Straightforward way to work with, microcontrollers, including ASP 32, you
can also use the Arduino libraries in ASPI DF, because they built on top of
it. And that's something that the Ayatollahs software is using. And I think
mosque's going to talk a little bit more about strategies for joining those two
together. So you can't even take, Iotas has a couple of Arduino libraries
written for the Arduino environment that it just pulls in and users, in the
ASPI DF environment. So it gives you a one. To match things up.
There's a micropolitan port that we're going to hear about later this
afternoon, the nerd MCU project, which ran a law on night, 2 66 is up and
running on the ASP 32. There are a few JavaScript program projects. I'm
not actually across where all of those are at. the bottom two I put with lines
through them because that's my wishlist for things I want to run on ASP
32, rust is. A very interesting language for embedded. Unfortunately, you
can't run rust unless you have LLVM support for your platform and extends
it. Doesn't have LOVM support yet. so hopefully some people will get
interested in adding LLVM support for extensor and then all kinds of
interesting things might happen. the other one is really more, I don't know
anybody else who shares this idea, but I really liked systems programming
and Erlang, some time ago. A lot of airline concepts map to real-time
always concepts.
Go to this website from the link and select the appropriate version for your
OS. Then download the software now double click on the .exe file and it
will open a dialogue box. In case of Mac OS, it will be a different type of
extension file. Click on OK and proceed further as you would install any
software. After installing the Arduino IDE, you will have the development
environment in front of you.
iketth.marlOa | Afduino 1.8.13
Now check the tool section where you will find the board section. If you
select Arduino boards manager option, a dialog box will pop up, showing
you a list of boards that come preinstalled. From Arduino version 1.6.2 all
Arduino AVR boards are preinstalled. However, for other microcontrollers,
as in our case the ESP32, we will have to install it separately. The Arduino
board manager makes it pretty easy to install and Arduino core for the
ESP32. If you try searching for the ESP32, you will not find it, this is
because you need to install a third party core for the ESP32, which is
developed by espressif.
To do this, go to file and then preferences in Mac. You can find this option
by going to Arduino and then preferences. You will find a field called the
additional Boards manager URLs.
epeatedly:
Settings Hetwork
Sketchbook location:
Browse
Compiler warning:
-------- 1-- =—=—
Ihtxps://dl.e^preasif.com/dl/package esp32 index,
[ | Display line m
dried
OK Cancel
The field needs a specific type of file. This is a file written in JSON format
which needs to be entered to fetch the list of third party cores. Now you can
click on Ok to exit the preferences window.
© Boards Manager X
run
Type All v ESP32
bv Espressif Systems
Boards included in this package:
ESP32 Dev Module, WEMOS LoLm32, WEMOS Dl MINI ESP32,
More Info
1.0.5 V; Install
Close
If you check for ESP32 in the board manager now. You can see that the
packages include the ESP32 development module, which has the Arduino
core for the ESP32. This will help us make the ESP32 compatible with the
Arduino IDE You can download and install any release you want, but you
should download the latest version as it includes bug fixes and updates for
the latest issues. To check for all the releases for the ESP32 Arduino core,
Now install and wait for it to download and install the packages once
installed close to boards manager window.
О sketch_marlOa | A/dunc 1АВ
If you go to tools and scroll down to check for the boards, you will find the
ESP32 dev module. Now you are all set to program the ESP32. This is the
Arduino Development Environment. Arduino makes it very easy to write
code. It does most of the work for you from importing libraries to
configuring boards, pointing out errors and much more.
void loopO {
// put your main code here, to run repeatedly
}
The Arduino programming language is a set of C and C++ functions that
run every time you call the program In Arduino, the program you run is
called a sketch. This is what gets uploaded to the microcontroller. board.
You must have noticed that two functions are already on your IDE. These
are functions that get called whenever you compile and run an Arduino
sketch. The first one is the setup function. The setup function is used to
initialize variables, libraries declare PinModes, etc. This runs only once in
the program, now coming to the loop function. This is where you write your
actual code. This function keeps on running the instructions inside it in a
loop. It is basically an infinite loop. Let's look at a simple example to print.
Hello World on the Arduino IDE Serial monitor. First connect the ESP32 to
any of your computer's USB ports using the USB to micro USB cable to
start programming, you need to select the correct serial communication port
also referred to as the com port in the Arduino IDE.
hie Edit Sketch Tods Help
A .* Fo”nal i fr -1 I |
Archive Sketch
,,,. . - Fim Encoding & Reload
Port "COM3"
Get Board mro
Programmer >
Bum Bootloader
For Mac users The file, which maps to this port is the USB Serial port.
Once you have selected the com port, you can upload a blank sketch to
check if the sketch is being uploaded correctly.
To do this select upload here you will find your debug messages after
hitting the upload button. You will also get information about the memory
your whole code and variables are using. If you have successfully uploaded
your code to the ESP32, you will get this message.
Now, let's get back to our example. First, you have to set the baud rate to
115200, which tells the ESP32 to exchange messages with the serial
monitor at the data rate of 115200 bits per second.
Here, the println prints the text to be displayed on a new line. each time. We
have used a delay of two thousand milliseconds or two seconds. After you
upload the program to the ESP32 press the serial monitor icon here, Set the
serial monitor to the same baud rate you have mentioned in the code, you
will now be able to see your print statement text.
Now let us try interfacing and blinking an LED using the ESP32. First
contact the positive leg of the LED to pin 2 , of the ESP32 with the 220
Ohm resistor in between and connect the negative terminal of the LED to
the ground of the ESP 32.
O LEO.BIinkl Arduiiw 1.8.13
void setup О {
pinMode(led, OUTPUT);
)
void loop() {
digitalwrite(led, : ) ;
delay(1000);
digitalwrite(led, LOW);
delay(1000);
Let's checkout the code. First, we will initialize a variable for pin 2 as
stated. Here we are setting as output here the digitalwrite sets the pin in our
case pin 2 to high or low. The delay will help us to blink the LED at an
interval of one second. Now, upload the sketch, you will be asked to save
the file first, once uploaded, you will see the LED blinking.
Pin 2 is also the pin to access the onboard LED on the ESP32, you will see
the onboard LED and the LED you connected, blinking simultaneously. The
onboard LED on the ESP32 The two can be used as a test LED to debug
certain code errors. we have covered the following topics software
requirements, installing and setting up the Arduino IDE, working with
serial monitor, interfacing LED and blinking the LED section summary. In
this section we have covered the following topics.
IOT CONCEPTS PART 1
we will cover the following topics, primary building blocks of loT, loT data
lifecycle, case study.
Now that you have a basic understanding of IoT, it is time to get into the
details. If you pay close attention an IoT systems basic task is to connect the
virtual world or the digital world with the physical world. IoT allows things
or objects in the physical world to interact with the virtual world that is
cloud services, platforms and applications through communication
networks, enabling them to exchange information with each other. In
context to the Internet of things, Any object of the physical world or virtual
world with a unique identity that is integrated with the communication
network is called a thing. A thing can be a physical thing or a virtual thing.
However, the term devices, when used, always refers to a physical thing. A
simple example of a physical thing can be a temperature sensor. Cloud
services, APIs and software applications are a few examples of virtual
things. Since these technologies exchange and process data on their own
and have their own identity, they are considered as things. So what comes to
your mind when you think about IoT? sensors, lights, Bluetooth, Wi-Fi,
cloud Right? You are absolutely right. And like you, each organization has
its way of defining and implementing the Internet of Things. Nevertheless,
the basic building blocks of IoT remains the same whatsoever.
-> Direct communication
► Indirect communication
Let us take a look at the primary building blocks of loT 1. loT devices, 2.
gateways, 3. communication network 4. cloud or server, 5. IoT application.
Any device or equipment capable of communicating with other devices
connected to the Internet, which is equipped with sensors and actuators to
collect static or dynamic information and can act upon it, can be classified
as an IoT device. As you know, we will be using the ESP32 board for
building IoT applications in this project. Similarly, most of the IoT devices
are built using embedded boards with wireless capabilities. These boards
come with the microcontroller or a processor on board RAM and ROM and
digital and analog GPIO pins.
These boards can be easily stacked upon other boards, sensors and actuators
to form an loT device.
Some of the other famous IoT boards are Raspberry Pi, Banana Pi, Arduino
and many more. Let us get an insight into Gateways.
Now Suppose one of your loT devices uses Bluetooth for communication
while another device can only send or receive data using Wi-Fi. The
problem is similar when you are trying to communicate with the person
who cannot speak or understand your language. In such cases, we need a
gateway for protocol conversion, just like a translator to facilitate smooth
communication between the devices. Now the communication network has
to make it possible for the devices to interact with each other. It allows IoT
boards stacked with sensors and actuators to communicate with web or
cloud servers or even allows them to communicate with each other. The
communication network is generally the typical Internet network with
different layers such as the physical layer, link layer, network layer,
transport layer, application layer and communication protocols operating at
different layers. Bluetooth, Wi-Fi, SigFox, MQTT, REST and CoAP are
some of the communication network protocols.
The data now goes to the cloud or server for storage, apart from storage, the
cloud also performs data mining and analytics to derive useful information.
It is also responsible for managing the connected devices and networks. The
cloud can also communicate with other private or public cloud services to
enable an IoT application. The IoT application is the part where we feel the
presence of IoT and automation, the application does the processing,
mining and analysis of the cloud data. The loT application is the piece of
software at the cloud server that extracts data, manipulates it to derive
useful insights and manages to send insight to the target IoT devices
securely.For example, an IoT application developed for home automation
will process data from sensors and send necessary commands from the
cloud to operate home appliances.
All the while talking about IoT. It is the data that flows through the system.
The word data in the IoT world is of utmost importance. Since the data is
generated from various sources, it is crucial to ensure that it is processed as
per specific tasks.
IoT data flows through many layers, unlike traditional data, which flows
through fixed boundaries. So now let us take a look at the data lifecycle in
IoT 1. creation. The process of data creation should be in context with the
problem statement and should not generate unnecessary data. According to
the needs the data can be generated using various sensors taken from the
web or even location data. 2. collation - the raw data collected should be
organized and structured according to the system's need. or organization.
Factors such as frequency mode of data collection, batch real time, near real
time or real time data need to be considered during this process. 3. storage -
the storage mechanism in an IoT system should be scalable and
accommodate and allocate growing data, but at the same time it should be
cost effective. As we are dealing with high amounts of data in fewer time
intervals. Generally, bigdata based solutions are preferred to store IoT data.
4. cleansing It is obvious that not all data collected is of use. Most of the
time Only some parts or parameters of the data need to be used for a
particular task. Generally, critical parameters are confined to not make the
data irrelevant for any other use case. 5. processing - the processing logic
should consider the use case and the data characteristics. For example, in
retail industry, data regarding consumer behavior patterns can be processed
according to the operation period. That is a holiday season or year end. 6.
retention - once the data is used, it is preferred to only hold on to the
relevant data or data that may come to use in the future, keeping
unnecessary data will take up storage space, thereby increasing the cost. 7.
archival - In this phase, the data that is no longer active but important is
moved out of the production system to long term storage systems. This
data, though, can be brought back to use at any time when needed.
Data
Deleted
Data Copied
Older than
Data Newer N Days
than N-l Days Data Purged
Not Purged
Archive Data
The MQTT protocol comprises three key elements subscriber, publisher and
Broker. The publisher publishes to topics, and the subscribers subscribe to
the topics they want. However, the publisher or the subscriber never contact
each other directly as they don't even know the other exists. The connection
between the publisher and subscriber is handled by a third component
known as the broker. The broker filters all messages and distributes them
correctly to the subscribers. You can understand the concept easily if you
consider the youtube platform as a broker, the content creators, as the
publishers, and we who watch the content as subscribers. ZigBee, it is one
of the most important IoT communication protocol and has significant
advantages in complex IoT systems. Like Bluetooth, ZigBee also has a
wider user base due to its low power operation, high security, robustness
and high scalability.
Sensors The development in the field of sensors has also boosted the loT
industry. Modern sensors can detect changes in a wide range of specific
parameters like pressure, temperature and communicate that to the cloud or
gateway.
Nowadays, microscopic sensors made using micro electromechanical
systems can be easily embedded into clothing and other smart devices.
Digital twin. The concept of digital twin evolved from the idea of having a
digital form of an engineering sketch or graphic. In the context of IoT a
Digital twin is a digital representation of a physical operation or a system.
The twins are designed so as to simulate real world use cases in a digital
space. It can be constructed so as to receive input from sensors which
gather data through a real world counterpart. This allows the team to
simulate the physical object in real time in the process, thus offering
insights into the performance and potential problems. This technology is
heavily used in the automotive and healthcare sectors. Additionally, rapid
growth in technology such as big data, communications and analytic
software have also had their impact on the growth of IoT.
INTRODUCTION TO CAYENNE
we will learn the following topics in Introduction to Cayenne getting started
with Cayenne part 1 getting started with Cayenne part 2 In-depth
understanding of Cayenne MQTT library setting up IoT projects on
Cayenne and troubleshooting. What is Cayenne? How Cayenne works?
Why Cayenne? Supported hardware, library support. Now that you are clear
with your IoT concepts, it is time for some hands on experience. Let us start
by learning about Cayenne. So what is Cayenne? Cayenne is the first of its
kind. Drag and drop IoT project builder that helps developers connect and
host their connected device projects quickly.
This drag and drop feature removes the ambiguity in hardware
programming. It not only makes it possible to build programs using drag
and drop, but it also standardizes the connection of devices such as sensors
and actuators and make sure that the drivers are in place. You can say that
Cayenne was designed for IoT. It can control hardware remotely. It can
display sensor data and also store and analyze this data. This seems a bit
complex, right? You might be wondering how does Cayenne work?
Cayenne has three major components, the app, the online dashboard cloud
and the agent.
After you set up an account on the Cayenne platform, you will set up your
device. After this, you can use the drag and drop feature of this platform to
control everything. It has options to display CPU, RAM, storage and any
other quantity a specific sensor can measure.
Of course, you have to wire up your circuit. That is no way a software can
do this. You cannot use a sensor that Cayenne does not support, but the
range of sensors supported is enough for most of the projects.
You can also get direct access to GPIO pins. So why do we need to use
Cayenne.
The simple yet effective build of the Cayenne platform makes it a great
option for IoT project building. Also in the project building phase of any
product, the first step is building the prototype using the Cayenne's drag and
drop feature. You can easily build a prototype of your project.
As Cayenne takes care of everything from building a program to
standardizing the connections of devices. It saves a lot of time and
resources while giving you a comprehensive insight into the project.
Cayenne allows you to quickly design, prototype and visualize IoT
solutions. Thus, Cayenne is best suited for rapid prototyping.
Originally, the Cayenne platform only worked with the Raspberry Pi.
However, now it is developed and expanded. Let us take a look at the
hardware that the Cayenne platform supports.
Cayenne supports single board computers such as the Raspberry Pi
microcontrollers such as the Arduino and ESP32 are also supported.
The light switch and the motors switch are some of the actuators supported
by the platform.
Cayenne, also has support for LoRa WAN devices and extensions for PWM
analog and digital inputs.
Along with hardware, Cayenne also has a good amount of library support.
Cayenne is used by both beginners and experts and based on this Cayenne
has made some libraries available.
For beginners, the Arduino MQTT library is introduced. This library can be
used with the Arduino IDE and boards such as the Arduino UNO, ESP8266
and the ESP32.
For intermediate users The mbed MQTT library is also available. It can be
used in conjunction with the mbed IDE. The embedded C MQTT library
and the C++ MQTT Library are available for advanced users with more
features. These libraries also include support from the Cayenne team to
update and customize. support for new boards.
Cayenne is a cloud based end to end IoT solution that not only offers you
the greatest tools and library support, but also handles the difficult part of
device management of the actual IoT hardware and software, thereby
making it the right platform to get started with while learning IoT and for
rapid prototyping.
GETTING STARTED WITH
CAYENNE SETUP
we will cover the following topics, create a Cayenne account, choose the
device, what is meant by bring your own thing, Installing Cayenne MQTT
ESP Library on Arduino IDE . Now that you have an overview of the
Cayenne platform, let us set up your Cayenne account.
Let's go to the Cayenne website now. Here you will be asked for your email
address and password.
However, you first need to create an account with Cayenne. Click here to
register. Now, note down the email address and password you will need to
log in later. Once you have created your account, you need to go to my
devices Cayenne login page. Now enter your email address, password and
then login.
Firstly, you will be asked to choose your device which you want to interface
and work on. As you can see, there is already pre-built support for
Raspberry Pi, Arduino and LoRa, but you will not find the ESP32 here. You
will need to manually add the ESP32 as a device using the Cayenne MQTT
API.
Now, click here, as you can see, there are a number of official SDKs
available for MQTT support.
C OiWI ihihfll (WOev X + □
Cayenne
* ЛжотнГй* л>КМис«
03
Embedded С О ®
Сн О ф
NodeJS О
The Arduino MQTT SDK is one of them. The Cayenne MQTT Arduino
Library contains functions and codes that could easily connect you to the
Cayenne IoT dashboard. It has support for Arduino microcontroller boards
as well as other ESP8266 and ESP32 based development boards. You can
click here to access the GitHub page for the same.
Now let's get back to the Arduino IDE and see how we can install the
Cayenne MQTT ESP library. First, you need to go to tools and then click
manage libraries This will open up the library manager.
О Library Manager
run repea ---------------------- , --------------------------- ,--------- .--------------------------------------------------------------------------------------------------------------------
Type All vj Topic All v Cayenne,
CayenneLPP a
by Electronic Cats
CayenneLPP Arduino Library. Compatible with Cayenne Low Power Payload.
More info
CayenneLPPdec
by German Martin
CayenneLPP data decoder Library to decode CayenneLPP encoded data to a JSON array. It is useful when you want to use this format to
communicate sensors with your own gateways without using TTN.
More info
by myDevices
Connect a device to the Cayenne dashboard using MQTT. The Cayenne MQTT Arduino Library provides functions to easily connect to the
Cayenne loT project builder. This library bundles the Eclipse Paho MQTT C/C++ client library for MQTT support.
http://www.cayenne'mydevices.com/
More info
nri_esp32
by Francois Riotte___________________________________________________________________________________________________________________ '
Close
Now search for Cayenne. You will find the Cayenne MQTT Library.
О Library Manager
un repea - --------- , f------------ .-----------------
Type All '■s Topic All v Cayenne
CayenneLPP
by Electronic Cats
CayenneLPP Arduino Library. Compatible with Cayenne Low Power Payload.
More info
CayenneLPPdec
by German Martin
CayenneLPP data decoder Library to decode CayenneLPP encoded data to a JSON array. It is useful when you want to use this format to
communicate sensors with your own gateways without using ttn.
More info
CayenneMQTT
by myDevices
Connect a device to the Cayenne dashboard using MQTT. The Cayenne MQTT Arduino Library provides functions to easily connect to the
Cayenne loT project builder. This library bundles the Eclipse Paho MQTT C/C++ dient library for MQTT support.
http://www.cayenne-mydevices.com/
More mfo
rm_es{>32
by Francois Riotte
Close
Now install the latest version of this library. Once installed, you are now
ready to program the ESP32 to connect it to Cayenne.
DASHBOARD OVERVIEW
we will cover the following topics, adding your device, dashboard
overview, what projects, devices and widgets? What are events and
triggers? Now that you have set up your own account. Let's get started with
a small project using Cayenne and the ESP32.
You will also be needing a PIR sensor, if you want to learn about the PIR
sensor and how it works. We recommend you to go through this before
proceeding. First, let's complete the hardware connection part for the
project. The PIR sensor has three pins, the VCC, the ground and the data
out pin. It also consists of two potentiometers through which we can adjust
the sensors delay time and sensitivity Using Jumper wires please connect
the VCC pin and ground pin of the PIR sensor to the VCC pin and ground
pin of the ESP32 respectively.
To connect the data out pin You can use any GPIO pin, but for now we will
be using the GPIO pin 4. Connect the data out pin of the PIR sensor to the
GPIO pin 4 of the ESP32.
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard,
char username[] = "MQTT_USERNAME";
char password!] = ”MQTT_PASSWORD”;
Char clientID[) = "MQTT_CLIENTID";
#define SENSORPIN 4 // Do not use digital pins 0 or 1 since those conflict with tr
#define VIRTUAL_CHANNEL 1
Ticii H t1
Now let's check and understand the code. This here is used to print the
general Wi-Fi status. We will then be importing the MQTT ESP32 library
into the code. It contains functions that enable you to send and receive data
from Cayenne. The next step is to enter your Cayenne credentials, go back
to your Cayenne account and click here.
Now enter your Cayenne credentials in your code accordingly. The client
ID is used to differentiate between different clients connected to Cayenne.
fdefine CAYENNE—PRINT Serial // Comment this out to disable prints and save space
iinclude <CayenneMQTTESP32.h>
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard
char username[] - "MQTT_USERNAME";
char password[] = "mqtT_password
char clientiD[] = "MQTT_CLIENTID";
idefine SENSOR_PIN 4 // Do not use digital pins 0 or 1 since those conflict with the use of Serial
jdefine VIRTUAL CHANNEL 1
void setup()
<
pinMode(SENSOR_PiNr input);
Serial.begin(9600);
Cayenne.begin(username, password, clientID, ssid, wifiPassword)
You will also need to provide your Wi-Fi credentials. Here we have defined
Pin 4 as the sensor pin, and a virtual channel to which the data will be send
in Cayenne. Now here we initialize the serial Baudrate as 9600. This is
needed to connect Cayenne using Cayenne's username, password, client-ID,
Wi-Fi SSID Wi-Fi password.
void loop и
{
Cayenne.loop();
checkSensor();
)
void checkSensor()
{
unsigned long currentMillis = millisf);
// Check sensor data every 250 milliseconds
if (currentMillis - previousMillis >- 250) {
// Check the sensor state and send data when it changes,
currentstate = digitalRead(SENSORPIN);
Serial.print("Motion; ") ;
Serial.printin(currentstate);
if (currentstate != previousState) {
Cayenne.virtualWrite(0, currentstate, "digitalsensor", "d");
previousState — currentstate;
}
previousMillis = currentMillis;
)
)
Now we include the Cayenne dot loop function here to execute all the
Cayenne functions repeatedly. The check sensor function is used to sense
data from the sensor and print it accordingly. Now the check sensor
function is where you read and write the data from the sensor. Here we
check sensor data every 250 milliseconds. Now here we read the sensor
data from the data out pin and print it to the Serial Monitor in Arduino IDE.
Here we check the sensor state and send data when it changes to Channel
Zero.
Now that you are familiar with the code, save it and click on the upload
button. Click on the serial monitor. It will display the IP address and
connection status of your device. It will then display if motion is detected or
not. Zero signifies that there is no motion detected, while one signifies that
motion is detected. If the serial monitor displays that your device is not
connected or does not show any output values always check if you have
entered all the credentials correctly and you have made the proper
connections in the circuit.
Now go back to Cayenne. Your device will be connected and you will
notice channel zero on your dashboard. Click on the plus sign on the top
right corner of the channel. This will add the channel to your dashboard.
Now click on the setting options. here. Here, choose the widget to motion
detector.
Now if you check whenever the motion is detected, the Channel 0 will
show you an animation. Now click here. This will show you a chart about
when motion was detected. You can download the chart data. Now that you
have practically used Cayenne. Let's check onto the dashboard and various
components of Cayenne. The Cayenne dashboard is the main screen where
you can setup, customize, monitor, manage and control your connected
devices.
At the top right corner of the Cayenne dashboard, you can see some
options. The create apps option will take you to a page. If you want to
partner with my devices to create a commercial product. The community
option takes you to the Cayenne community where you can post your
queries in context to Cayenne. You can also find solutions through queries
other people may have asked. Cayenne has a very active community. The
Docs option will take you to a page where all the documentation regarding
Cayenne is posted. Everything from hardware, Cayenne cloud API to
Cayenne MQTT API is mentioned here. Lastly, the user menu gives you
your account related information and options.
Exactly below the user menu You can see the settings option where you can
configure and reset the dashboard.
In the same blue bar you will see two options overview and data. The
overview option pictures your project as a whole where different channels
can be placed. The data option gives you an insight into the data collected
in the project. You can see a summary of all the devices connected and the
channels present in them on the left hand side. Still, you can find many
terms on the dashboard, which may be unclear. So What are projects,
devices and widgets? The projects feature allows you to use widgets from
any combination of connected devices into one custom dashboard called a
project. Each project has its own set of features that you can set up.
Cayenne uses widgets to visualize devices, their data, status and actions.
Every device, sensor and actuator added in Cayenne has one or more
widgets associated. Depending on the hardware capabilities. Widgets can be
rearranged on your dashboard simply by using the drag and drop feature of
Cayenne. To move a widget place your mouse or finger at the top middle
area of the widget, then tap and move the widget where you want it on your
dashboard.
Subscriber
Publisher
Publisher
Subscriber
As you have studied about MQTT in the previous, you may remember three
important terms publisher, broker and subscriber in MQTT. In Cayenne the
Cayenne Cloud acts as a broker who manages various sensors, actuators
and client devices that wish to send and receive data using the Cayenne
Cloud. Cayenne MQTT is straightforward and easy to use. Offering several
ways to send data to Cayenne. Cayenne offers three options to use MQTT. 1
Use the Cayenne MQTT libraries 2. Use raw MQTT API functions. 3. Use
HTTP to push MQTT data.
As we have already installed and used the MQTT library. Using one of the
Cayenne MQTT libraries is one of the easiest ways to start using MQTT
with Cayenne.
О ESP32 I Arduino 1В.13
//♦define CA¥ENNE_DEBUG
♦define CAYENNE_PRINT Serial
♦include <CayenneMQTTESP32.h>
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard,
char username [] = "MQTTJJSERNAME";
char password[] = “MQTT PASSWORD”,'
char clientID[] = "CLIENT ID";
void setup () {
Serial.begin(9600);
Cayenne.begin(username, password, clientID, said, wifiPassword);
J
void loop() {
Cayenne.loop();
}
DNS Resolver
Suppose you enter the same client ID. Only one of the devices will be
connected and the other device will disconnect. This happens because from
Cayenne's perspective, it seems like the devices credentials have been
compromised and might be a part of DDoS attack. Now let's get back to the
example. VWe have set the baud rate to 9600 and the Cayenne.begin
function is used to connect to the Cayenne platform.
Now we include the Cayenne.loop function, which executes all the Cayenne
functions repeatedly. Now the Cayenne out default function is where you
write the data to the client. It is used to publish data in messages to the
Cayenne broker and update the channel. The channel is where your actual
data gets displayed. Here we will try to publish our messages to respective
channels on Cayenne. We will be sending the time elapsed since the
program started running to Channel 0. This is done using the millis()
function, which returns the time in milliseconds. We have used the
celsiusWrite() function to display temperature on the dashboard. We have
manually passed a value of 22 degrees to the first channel. For the second
channel we will be using the luxWrite() function, which denotes the
luminosity. Lastly, we will be using the virtualWrite() function again to
publish value to Channel three. Here we have also specified the type of
sensor and the unit of measurement.
The general parameter format for the virtualWrite() function is this. If you
need the full list of data type supported by the Cayenne, you can refer to
this community page.
Q Starch Otvices
Also, if you look closely, you will see this message at the bottom. It shows
the date and the time at which the last data packet was received. Now, you
might notice one thing. We have sent data to Channel one, two and three
manually, but for Channel 0, it receives data about every fifteen seconds.
The reason is that the Cayenne Out default function is designed to run every
fifteen seconds. Hence, the MQTT messages are received every fifteen
seconds to Cayenne. Currently Cayenne MQTT messages are rate limited to
sixty messages per minute. If messages are published above this rate, it may
cause the messages to be dropped or the device to disconnect automatically.
Due to the ease of use and reliability the Cayenne MQTT ESP library is a
dependable method to start MQTT with Cayenne.
CAYENNE AND
TROUBLESHOOTING
we will cover the following topics API method explanation, Set up for any
IoT projects troubleshooting. you must have got a basic understanding of
how to use the Cayenne MQTT library with the ESP32.
// WiFi network info.
char ssid[] = "ssid";
char wifiPassword[] = "wifiPassword"
// Cayenne authentication info. This should be obtained from the Cayenne Dashbc
char username[] = ”MQTT_USERNAME"
char password[] = "MQTT_PASSWORD"
char clientID[] = ”CLIENT_ID";
void setup() {
Serial.begin(9600) ;
Cayenne.begin(username, password, clientID, ssid, wifiPassword)
)
void loop() {
Cayenne.loop();
}
To use the Cayenne MQTT ESP library to its full potential we should know
some key functions we have used the Cayenne.begin() function. This is a
setup function. We specify our Wi-Fi SSID and Wi-Fi password along with
the MQTT credentials from the Cayenne page.
This function is used to start communication with the Cayenne dashboard
using MQTT. We had also used the Cayenne.loop() function. This function
helps to send data to Cayenne continuously.
Cayenne.loop();
}
II Default function for processing actuator commands from the Cayenne Dashboard.
II You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel
CAYENNE_IN_DEFAULT()
{
CAYENNE_LOG("Channel %u, value %s", request.channel, getValue.asString()) ;
//Process message here. If there is an error set an error message using
After this, the first step is to configure your device on Cayenne. To do this,
you need to move to the Cayenne dashboard and add a new and device
widget option. Then you should select your device, which will guide you to
a page with all the necessary credentials needed to connect the device.
Always check beforehand if the device is compatible with Cayenne.
0 Library Manager
Type Al * TapK M
Cayvmaeqn
by inyiwvkr* Vernon 1-3-O IMSTA11 f D
Г oruwrt a 4r>kr To lb* Cev»*-* davMmard v|l*« HQTT. IM £*»♦<-■>* «?TT */*>» I fXOvrd** кхк««4 «, e«**r (««*« 10 (h* C*r»VW* IpT pVOfKt hM<. ТЫ» ЦкГ( ЬчГкА») lb» Id0«« F«hoMqTT CAn <W« ■***> hx »*qn «ЧДОЛ
http:?/www латanr>*•п*г4е*лс«*xooV
yauuflU
SalKt «чгасл - . i
ГТ» eapli
ISP 32 port ol the Ardulno IbcTMnpMtehvMA Ithrary. Supports FWtcc WA Lora 32 board*
I ГН ИViler!
bv Fra*cofc Rlott*
MSStaeb I »”><" H*ad*l* port af ii ■brary. fa«p4rt* wab LaraWan M«4>*
You need to check if you have installed the necessary libraries needed for
Cayenne, if not install them. You are now ready to connect the device to
Cayenne. You can now code, according to the library functions, to establish
a connection with the Cayenne. Before sending the data You can either
configure the channel according to the data or mention some specific code
lines to do this for you.
S myDevicesloT/Cayenne-MQTT-ESP
< > Code 1J Issues П Pull requests 0 Actions El Projects J Security 1^ Insights
jburhenn Fix pointer dereferencing. a3697&9 on Feb 16, 2019 066 commits
examples Add Enterprise WiFi support to standard WiFi client 2 years ago
README.md
Buttons to
Control Device
If you wish to control your remote device through Cayenne first, you will
have to connect the actuator to your IoT board. Moreover, install the
necessary libraries. You then need to create your Cayenne dashboard with
widgets like sliders to send data to your device to control it remotely. This
electronics domain pertaining to embedded systems that deals with the
hardware and software is not easy as it looks. Each one of us may face
different problems while developing a project. We will now cover some of
the basic troubleshooting methods to use to solve your issues.
For the software part, always install the latest version of the library as it
contains bug fixes from the previous one.
Cayenne is very user friendly and has a simple GUI. Unless you make a
mistake in connecting your devices, Cayenne will not give you errors.
Always connect the device properly following the necessary steps. Make
sure to copy and paste your Cayenne credentials properly.
For the hardware part. Firstly, check for your circuit connections if you
have connected your device, sensor and actuator to the proper pin as
mentioned in your code.
Use proper jumper wires and good breadboards to avoid loose connections,
you can check if the jumper wire is not broken by using a multimeter.
Always check your sensor or actuator beforehand. Some sensors may be
broken and will not produce output even if they are receiving proper power.
VCC 5-12VDC
OUT (3.3V TTL)
GND
Distance Adjust
As pressure changes with altitude and the BME280 sensor is very accurate
with its measurements, we can use the BME280 to also measure altitude.
Altitude can be calculated by using this formula where P is measured
pressure from the sensor and P0 is the reference pressure at sea level.
Level Shifter
The BME280 sensor module needs up to 3.3V to power up and has a built
in LM 6206 3.3V voltage regulator. These two features make it possible for
the BME280 to interface with any microcontroller of your choice.
Now let's interface the sensor to the ESP32. First, let's take a look at the
pinout diagram of the BME280. The sensor module only consists of 4 pins,
the VCC, the ground, the Serial clock and the serial data pin.
Now connect the VCC of the sensor to the 3.3 V power supply pin of the
ESP32. Connect the ground of the sensor module to the ground of the
ESP32. Connect the Serial clock pin of the module to GPIO22 of the
ESP32. GPIO 22 also acts like an SCL pin, or serial clock pin for the I2C
data transfer. Similarly, connect the serial data pin of the sensor module to
GPIO 21 of the ESP32. Always recheck your connections before
proceeding to avoid any damage to the sensor as well as the ESP32.
CONFIGURATION AND
IMPLEMENTATION
we will cover the following topics Cayenne device management and
dashboard configuration, installing sensor libraries, code configuration and
explanation, project implementation, visualization.
Now that you have interfaced the BME280 sensor with the ESP32. Let's
check out how to send sensors data using the ESP32 to the Cayenne
dashboard. You will need to login to your Cayenne account to get
information about your credentials.
As we have already connected the ESP32 to the Cayenne dashboard, you
can reuse its credentials. All you need to add a new device, as we did in the
previous section.
Let's first install the necessary sensor libraries, open your Arduino IDE, go
to tools, manage libraries and now search for BME280. You need to install
the Adafruit BME280 library. When you click on install a dialog box,
asking you to install missing dependencies will appear, click on install all.
This will install the Adafruit BME280 library and also the Adafruit Unified
Sensor Library. The Adafruit Unified Sensor Library is an abstraction layer
library used by many sensor libraries.
We are now ready to code. Let's check out the code to send the sensor data
to Cayenne. This is used to print out the debug messages like the
connection status, topic number and channel number and actually data
itself. Now this here is used to print out the general Wi-Fi credentials and
the port number to which the client is connected. You can comment both of
these if you do not wish to print debug messages and general Wi-Fi status
here we import the Cayenne MQTT Library for the ESP32, it contains
functions that will enable you to send data to Cayenne as well as receive
data. Here we have imported the two libraries we just installed. The
Adafruit BME280 library contains functions to read the sensor data. This
here is used to create an instance of the sensor. Now here you need to enter
your Wi-Fi credentials. Here you need to enter your Cayenne authentication
information like the username, password and client ID.
О lxn*_«ymw|Afdu«no 1-8.13
Fite Edit SiMth Tools Help
IOOE1DQ
| t У. -fir- $
void setup() {
| Serial.Login<9600)r|
Cayenne,begin(username, password, clientID, ssid, wifiPassword);
fame.begin(0x76);
)
I
void loop<) (
Cayenne.loop();
}
Cayenne.celsiusWrite(1, bme.readTemperature());
Cayenne.virtualWrite(2, bme.readFressure()/ 100.OF, *bp", ’’pa");
Cayenne.virtualWrite(3, bme.xeadfiumidity(), "rel_hum',r "p");
// Default function for processing actuator commands from the Cayenne Dashboard.
// You can also use functions for specific channels, e.g CAYENNE IN(1) for channel 1 commands.
Now here we initialize the serial baud rate as 9600. This is, as you know, is
needed to connect with Cayenne. This initializes the I2C interface with the
given I2C address and checks if the chip ID is Correct. It then resets the
chip using a soft reset and waits for the sensor for calibration. Here we are
using the bme.read() functions to read the sensor data for particular
quantities. The Cayennewrite() functions are then used to send the data to
the Cayenne dashboard. Now save your code and click on the upload
button.
After the code is done. Uploading Open your Cayenne Dashboard. You will
have 3 channels displaying the published data. Click here to add them to
your dashboard. You can now monitor your data.
You can also check the charts for each channel and also a spreadsheet of all
your published data.
hstory | myDevKes Ca:. X
Timestamp » Device N...T Channel T v Sensor Warne T Sensor ID T S Data Туре т ; Unit € Values
2021-03-27 4:43:49 es₽32 3 Channel 3 fiai 5346O-8eed-11 eb- b767*3-, rel_hum P 33.125
2021-03-27 4:43:49 esp32 1 Channel 1 68ee3eb0 -Seed -11 eb-883t-6-. temp C 33.970001220703
Now, let's check out the code here. We have defined the virtual channel as
zero and an actuator pin 4. Here we have set up the actuator pin output.
After connecting to Cayenne here, we will take input from the Cayenne and
write the value to ESP32 to make it glow. Now save and upload the code.
Open your Cayenne dashboard. We know how to add a new widget to your
dashboard.
Click on Add New and the select device widgets. Now click on Custom
Widgets, select the button controller widget and fill in the necessary details
for the widget.
Now click on Add Widget, you will now have a LED control widget on
your dashboard,
you can now control your LED with the controller widget. Now we need to
schedule an event, click on Add New and select event, a dialog box will
appear to create a new event, fill in the necessary information. We will
choose the action to turn on the LED at the specified time. Now click on
save, an event will show up on the calendar. At the specified time, your
LED will glow up. Using the event scheduling feature You can automate all
the devices, sensors and actuators connected to Cayenne. Along with event
scheduling feature in Cayenne you can also automate a task if a certain
event occurs. This has the term triggering in-Cayenne. Simply put, if an
event takes place, a trigger response action will also take place. To
understand the feature better, let's move on to a small project. We will try to
send a notification to your email or mobile phone every time the
temperature goes beyond a certain threshold. We will use our already pre
built project where we have sent the sensor data collected by the BME280
to Cayenne. Make the necessary circuit connections and upload your code
to the ESP32. Now go to the Cayenne dashboard. You will see 3 channels
as usual displaying your sensor data.
С «р?2 - O»*«view | С X
С Л Myww»jnydevk«xo<n'cayr^/cf«hb<Mid/d(^ice/b6bWlO-aeff-iieb-8a3c-638^<M423d
Now click on Add New and select trigger. Give your trigger a name and
then drag and drop your connected device in the IF box.
You will now have an option to select triggers, click on the drop down
menu and select channel 1. We have selected Channel One as this channel is
responsible for the temperature data from the sensor Set the threshold value
according to your use case. Now click on setup notifications. Add your
email and mobile number here and click on save you have successfully
created a trigger for an event in Cayenne.
<5 «р32 - Ortrview | m»O#vic« С. X M €i>*nrw Ncrtifkaton - thubhan X
С й maiLgoogle.conVmailAVO/^nbWFMfcgirwliGmmtrWZGFMMJgMpfclqmPHGfV
+ Campebe
IQ О C C c
lome -
□ Inbox
□
★ Starred Cayenne
€
О Snoozed
Meet
» New meeting
0 My meetings
Channel 1
has reached the threshold value of
32
No i«enl chtPs
start a new me This is connected to esp32.
Cavonno Dashboard
Every time the temperature is more than the threshold value, you will get a
notification mentioning the same. You can also get details about the event
trigger here. Using the event trigger option gives you an effective yet
simple way to implement your IoT Project summary.
ACTUATOR NODE
we have seen how a trigger notification can be sent using Cayenne. Now we
will introduce a new ESP32 in our weather monitoring system. You have to
follow the same steps to set up the new ESP32 with Cayenne.
Click on Add new device widget and click. Bring your own thing.
Use the MQTT credentials from this page to add a second ESP32, you can
try toggling on and off an LED to check if your device is connected.
Don't you think we should add a display to the system? Yes, we surely will
be adding one.
But first, let's get to know more about the display. The 16x2 LCD is one of
the more standard alphanumeric displays.
They are extremely common and one of the fastest ways to have your
project show status messages. As the name suggests, the liquid crystal
display display 16 characters per line and there are two such lines . Each
character is displayed in a 5x7 matrix, the 16x2 LCD is capable of
displaying 224 different characters and symbols.
So how does the LCD work? The LCD has two registers, namely command
and data. The command registers stores various commands given to the
display. The data registers stores data to be displayed. The process of
controlling the display involves putting the data that form the image of what
you want to display in the data registers, then putting instructions in the
instruction register.
Gadgeteer interface Contrast ADJ 12C interface
The LCD then displays white characters on a blue background. The contrast
of the LCD can also be adjusted by adjusting the potentiometer.
Let's do a small project to understand how the 16x2 LCD works. First, let's
make the circuit connections one main advantage of using the 16x2 I2C
LCD is that you will not run out of pins on your microcontroller. As the I2C
communication interface is used, we will have to connect only four pins for
LCD. They are VCC, ground, SCL and the SDA pins.
Connect the VCC of the LCD to the 5V power supply of the ESP32.
Connect ground of the LCD to the ground of the ESP32. Now connect the
SCL pin of the LCD to GPIO 22 and the SDA pin of the LCD to GPIO 21.
You can refer to the circuit diagram in the resources.
Edit &tic* Toon Help
вОВЭН
•include <LiquidCrystal_I2C.h>
■ ilewubU h<K4/lia 1CD llbruv. Hut» H an «л«1М«>Ь LCD Itrar» far ВД447ЙО piled LCD ilptipi to» 4*1 tovMuKr WО«Sad Or the
hd*478O *xar, dass, when corrbned wth an hdMTBO Mbrarr yo HtKiasi, is compact*» "th the API ЛлсМпаИ» cd the Arduvo LKUBdCrvstal
// delay(lOOO);
API tocboni, tw» t<j иИ fron» the LCD. And abUr to tonf&rt the LCD cmunjrd ечеоАог tmng hdldТЮ ctxienUv »K«ude* vo
Icd.setCursor(5# 1) ; subclasses for Arck«oci йг«с pn control, Qc о>рал<№ backpacks, and LCDs with nabve i2c юси1ме. keywords: hd44? BO kd i?r dtscAar
ГчШ?ЙФ_1Х..рг1.ЛгТ40 MllVWJfCXdlKMdGrrtal (Ш Per» hern.ЪТО dsxVXctor» НС1И7 ftodak» CUie5€C8₽-T2J
// print message NTCU2W25£CPe
led, print ("Learner'’)
Now let's install the 16x2 LCD library, open your Arduino IDE and click on
tools and click manage libraries. This will open your library manager now
search for Liquid Crystal I2C library and click on install.
We are now ready to code. Let's check out the code now.
First we have important the liquid crystal I2C library we just installed. Here
we have set the I2C address and numbers of columns and rows in our LCD.
Now we will initialize the LCD and turn on the backlight of the LCD. That
is the blue background light. As we set the cursor to type anything on your
computers. Similarly, here we have set the cursor to the sixth character on
the first row. Using this, we will print our message. Similarly, we will print
another message in the second row also Now save and upload your code.
You will now see the display message you have printed on your LCD if you
cannot see the messages clearly and just the contrast of the LCD
accordingly using the inbuilt potentiometer.
Now that we have an idea of how to use the 16x2 LCD, we need to
integrate it into our Weather monitoring system now. However, Cayenne
has a drawback, you cannot directly interface and LCD with the Cayenne
platform, nor can you send data from one device to another directly. You
can check out the link in the resources for a discussion regarding this on the
Cayenne community page. The Thing Speak IoT platform service that we
will look in the next section does not have this issue.
END TO END
IMPLEMENTATION
we mentioned a limitation of Cayenne and how we cannot directly interface
the LCD with Cayenne. However, we have figured out a way around this to
implement our end to end project successfully. You must be wondering how
we will be doing it. We will use the LED control widget from Cayenne.
This will provide us with the binary values from Cayenne. We can then
code our LCD to display notifications based on these values.
Let's get into the practical implementation of the project to understand the
concept and working of our system more clearly. As you did in the last
project, we have already added the second ESP32 into the system. Let's add
a button control widget, go to add new devices and widgets. Now click on
the custom widget icon and select button controller widget, filling the
necessary details and then click on Add Widget. You will now have a button
controller widget on your dashboard.
Now let's take out the code here. We have imported the necessary libraries
and defined the I2C address of the LCD. Now we will enter all the
necessary credentials needed to connect to Cayenne and your Wi-Fi. Here
we have defined a virtual Channel zero and an actuator pin four. This
actuator pin will control the LED and can be used for debugging. It is OK
even if you do not use the LED actuator pin.
♦include <CayenneMQTTESP32.h>
♦include <LiquidCrystal_I2C,h>
Id.quidCrystal_I2C led (0x27, 16, 2);
// Cayenne authentication info. This should he obtained from the Cayenne Dashboard.
char username □ = "MQTTJJSERNAME”;
char password!] = "MQTT_PASSWORD”;
char cllentID[] = "MQTTCLIENTID”;
♦define VIRTUALCHANNEL 0
♦define ACTUATOR_PIN 4 // Do not use digital pins 0 or 1 since those conflict with the use of Serit
void setup()
I
Serial.begin (9600);
//pinMode(ACTUATOR PIN, OUTPUT) ;___________________________________
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
// initialize LCD
led.init();
II turn on LCD backlight
1 r-H Ьдг-Ш .-,ы-11 :
Here We will connect to Cayenne and initialize our LCD here. We will get
values from Cayenne.
void loop()
Cayenne.loop();
Now is the interesting part based on these values. Based on these values
received, we will now program the LCD to display notifications
accordingly. So here whenever the value received from the Cayenne will be
one or in other words, the button controller widget will be on, then we will
display the word danger on our LCD. Now, when the value received from
Cayenne will be zero, then we will display the word normal. Now save and
upload this code to the second ESP 32.
Now let's come to the hardware part. Connect the first ESP32 to the
BME280 sensor and upload the code, which sends sensor data to Cayenne.
Now connect the second ESP32 with the LCD. Your hardware side is now
good to go. Now open your Cayenne account. Here We have to set triggers
accordingly. Go to add new, triggers now drag and drop your first ESP32 to
the if box. Now set the trigger. We will set the trigger for temperature like
this. We are selecting Channel one as Channel One is responsible for
temperature values, select sensor above. This implies that the triggered
action will take place if the sensor value is above the specified value.
Now drag and drop your second ESP32. Now select action and click on
LED and select the on option. Here we have created a trigger where each
time the temperature goes above the threshold, it will trigger a little button
controller widget to go on and thereby displaying danger on our LCD. To
automate the system fully, we will have to add another trigger.
For this Go to the trigger option from add new and drag and drop your first
ESP32 and input the same threshold value as before. But now, instead of the
sensor above select sensor below and for the second ESP32 select LED off.
This will automate the system to display the text as normal whenever the
system has not crossed the threshold value.
Now, power both the ESP32 and you have your own weather monitoring
system.
INTRODUCTION TO
THINGSPEAK
we will cover the following topics. What is Thing Speak? How does Thing
Speak work? Thing Speak versus Cayenne, supported hardware, library
support. Now that you have used Cayenne and you have an overall idea of
developing a project, let's dive in a little deeper and learn more about Thing
Speak, which is an another IoT service platform. Now you may be
wondering what is Thing Speak?
Thing Speak is an open source IoT analytics platform that allows you to
aggregate, visualize and analyze live data streams in the cloud. Thing Speak
provides instant visualization of the data posted by your connected devices,
Thing Speak has the ability to execute Matlab code through which you can
perform online analysis and processing of data as soon as it comes in. Thing
Speak is a go to option to build prototypes and proof of concept loT
systems that require analytics.
Once the data is in the respective channel, you can analyze, visualize or
even calculate new data as per the data received. You also have an option to
interact with social media, web services and even other devices. We have
already used Cayenne to develop an IoT system. So why do we need Thing
Speak ? Each of these platforms have their pros and cons. Cayenne's Drag
and drop feature makes it very easy to use for prototype building. However,
as we saw in our IoT weather monitoring system, we had to develop a
workaround to interface the LCD. This makes Cayenne only suitable for
beginner level projects.
Thing Speak is a little more advanced and more suitable for those who can
write code for functions. Due to this, Thing Speak can be extensively used
for high end IoT applications. Thing Speak also offers data analytics with
math works, which is an additional feature that Cayenne lacks.
One more advantage of Thing Speak is that it is compatible with more
hardware as compared to Cayenne.
Thing Speak is compatible with the wide variety of boards and can send
sensor data from devices such as Arduino, Raspberry Pi and Beagle bone.
You can also connect other hardware devices to communicate with Thing
Speak. The only thing you need to keep in mind is that they should support
protocols such as TCP/IP, HTTP or MQTT.
0 GrwuD- x + - О X
ThingSpeak Communication Library for Arduino, ESP8266 Э sfan31 Afan Ahmaj Khan
and ESP32
This library enables an Arduino oi Other Compatible hardware to write or read data to or from ThingSpeak, an Open Languages
data platform for the Internet of Things with MATLAB analytics and visualization.
• с+» июхчь
Hardware specific examples are found here. But to give you an idea of usage examples for writing and reading with an
ESP&266 are shown below. Complete documentation in also shown below
ThingSpeak offers free data storage and analysis of time-stamped numeric Or alphanumeric data. Users can access
ThingSpeak by visiting http://thingspeak.com and ci eating a ThingSpeak user account
ThingSpeak stores data in channel- Channels support an unlimited number of timestamped observations (think of
these as rows in a spreadsheet). Each channel has up to в fields (think of these as columns in a speadsheet}. Check out
this video for an overview.
Channels may be public, where anyone can see the data, or private, where only the owner and select users can read
the data Each channel has an associated Write API Key that is used to control who can wife to a channel. In addition,
private channels have one or more Read API Keys to control who can read from private channel An API Key is not
required to read from public channels. Each channel can have up го в fields. One field is created by default
Tou can visualize and do online analytics of your data on ThingSpeak using the built in version of MATLAB, or use the
desktop version of MATLAB to get deeper historical insight. Visit https7/www.mathworks.com/hardware-
stipport/thingspeak.html to learn more.
Libraries and examples for Particle devicescan be found here: https://github com/mathworks/thingspeak-particle
Installation
in the Arduino IDE, choose Sketch/lnclude library/Manage Libraries. Click the ThingSpeak Library from the list, and
.................................................................................. ..............................................................................................
The ESP32 can be easily connected to Thing Speak using its very own
Thing Speak. h library. This library enables the ESP32 and other compatible
hardware to read and write data from Thing Speak>
examples Pushing 2.0.0 for IhingSpeak Communication Library for Arduino 4 months ago thingspeak.com
extras/test Pushing 2-0.0 for IhingSpeak Communication Library for Arduino 4 months ago Щ Readme
Releases 16
В gitignore Pushing 2.00 for IhingSpeak Communication Library for Arduino 4 months ago
Ct README.md Pushing 2.0.0 for IhingSpeak Communication Library lor Arduino 4 months ago
В libnuy,properties Pushing 2,0,0 for IhingSpeak Communication Library for Arduino 4 months ago
No packages pubnited
Contributors 2
README md
rpurser47 Rob Parser
Now you will be asked for the email. If you already have a Math works
account, sign in with it or click on create one, fill in all the necessary details
and create your Thing Speak account. Note down the email address and
password. You will need it later to log into your account.
After you have logged in, you'll see a blank window with some options on
the screen. One of the important options that you need to know about is the
new channel option. A channel is where you send your data to store.
Channels store all the data that a T hingspeak application collects. Each channel includes
eight ftetds that can hold any type of data, plus three fields for location data and one for
status data. Once you collect data in a channel, you can uw Thingspeak apps to anaiy« and
Channel Settings
Percentage complete: Calculated based on data entered into the various fields of a
channel. Enter the name, description, location, URL, video, and tags to complete your
channel.
Field#: Check the box to enable the field, and enter a field name. Each ThingSpeak
channel can have up to в fields.
Metadata: Enter information about channel data, including JSOM, XML, or CSV data,
Tags: Enter keywords that identify the channel. Separate tags with commas.
Link to External Site: If you have a website that contains information about your
ThingSpeak channel, specify the URL.
° Latitude: specify live latitude position in decimal degrees. For example, the
latitude of the city of London is Si .5072.
° Longitude: Specify the longitude position in decimal degrees. For exam pie, the
longitude of the city of London is-0-1J75-
о Elevation: Specify the elevation position meters. For example, the elevation of
(he city of London is 35.052-
Now click on the new channel button. Here you will see various options
that can be filled. Each channel includes a name and description you can
personalize according to you. There are eight fields available where data
can be pushed.
Latitude: Specify the latitude position in decimal degrees, tor екатрПе. the
latitude of the city of London is 51.5072.
о Longitude: Specify the longitude position in decimal degrees. For example, the
longitude of the city of London is’0.1275.
° Elevation; Specify the elevation position meters. For example, the elevation of
the City of London is 35.052.
Video URL: if you have a YouTube** or Vinveo* video that displays your channel
information, specify the full path of the video URL.
Link to GrtHub: if you store your f hingspeakcode ooGitHuo*, specify the Gittt ub
Link to External Site leposilory URL,
See Get Started wi Ih ThingSpeak" for an example of measuring dew point from a weather
station that acquires data from an Arduino* device.
Learn More
Additionally, more options are available, including YouTube URL or
GitHub URL, which can be specified. Now under a name to your channel
select field one and click on the same channel option.
You have now successfully created a channel. To read or write data from
this channel. You will need API keys. Now you may be wondering what is
an API and what are these API keys.
So an API is an acronym for application program interface. It is a software
intermediary which allows two applications to talk to each other. Each time
we use an app like Facebook to send messages or to check weather
conditions on your smartphone, you are using an API.
To understand more about how an API works, let's take a familiar example.
Consider yourself sitting at a restaurant with the menu of choices to order
from. The kitchen is a part of a system that will prepare your order.
However, the critical link is the waiter who communicates your order to the
kitchen and brings the ordered food to your table. The waiter is like an API
that takes your request to the system and responds back to you. In our
example. The request is food. Now to read and write data from your These
API keys are sixteen digit codes that provide with appropriate read and
right permissions to your channel. You will have separate, read and write
API keys.
Click on API keys here you will find the read and write API keys. Let's now
write data to a channel, copy the write a channel from here and paste it in
your browser.
Q АИ Keys - ThingSpeak k>T X New Tab X + “OX
<--><> 0 Guest •
ft httpj,7/»p<,thing»p«ak<om/update ’api.key-EA3Y6<OSQAUP5GJQ&fieTd 1 = [\
Learn more
You can change the data to be posted. Now press enter this will post your
data to field one of your channel Here you can see the data posted.
To increase the security aspect of your system. You can generate new API
keys.
DASHBOARD OVERVIEW
we will cover the following topics. Dashboard overview, features of Thing
Speak. Now that you have setup your Thing Speak account lets, get to know
more about Thing Speak the dashboard and other features of Thing Speak.
Just like Cayenne, you can export all the data from a particular channel or a
particular field in the channel. Thing Speak offers us to export this data in
three formats JSON, XML and CSV format. Now let's see the other options
of the dashboard. As our channel is private, we can only view it in the
private view and not in the public view. However, you can share your
channel data with certain users or make it public for everyone else to see.
Using the sharing feature here. You can update all the channel settings here.
All the settings that were available for you when you created the channel
are available here. You will have all your information regarding the API
keys here.
Here you have options to import and export data from the particular channel
at a specified time. You can mention it in the options. Now let's check some
other features of Thing Speak.
Here You can check all the channels that you have created. The free Thing
Speak account allows you to have four channels at a time. You need to
upgrade to a higher license to get more channels available for you. The
channel options also show all the channels you have watched and all the
public channels available on Thing Speak.
Thing Speak has provided us with some apps. These apps can be used to
analyze and transform data or trigger an action. These apps include Matlab
analysis and Matlab visualization.
Q Apps - MATLAB AfliMis - Tlw, X +
C ft ihejgspwkxOrtVappVmatlabjsnaiywVTccnpletcrt e<*°
QThings peak ’ Channels ■» Apps • Support» Commercial Use
Templates: Templates
MATLAB Analysis templates provide sample MATLAB code for analysing data and writing
• Custom (no starter code) it to a ThingSpeak channel 11 you are new to MATLAB, you tan learn interactively at
MATLAB AcJderriy.
Get data from a private channel
Examples- Sample code to analyze and transform data • I .••I di* Iki 60 minutes, and writ*
the results to a new channel.
Calculate and display average humidity ■ II .iilci update channel by writing to a new channel at
regular intervals.
Calculate wind chill and update channel
• Remove outliers from wind speed data over the past six hours, and write
Remove outliers from wind speed data data to a new channel
Convert temperature units * Convert timperal । :<■ 1 ahrcnhcft to Celsius, and write the results to
a new channel
Calculate high and low temperatures ■ ,i’.e high and low L ; "ir past 24 hours, and write rhe
data with timestamps to a new channel
Read Channel to Trigger Email
• Trigger Email by analyring daily soil moisture values,
Replace missing values in data • Replace missing values in data ol a weather channel and dean the data using a
list-wise deletion algorithm. Then display the missing values, or write data to a
Analyze text for the most common color new channel.
* Analyrt text for the m«t common color । equeMed on the public Cheedighto
1 Rea d I ive we b data fo r vessels at the port of Boston
channel, and write the data to a new channel
Scrape web temperature data These examples scrape data from websites:
T hW wrtK/le ul«cooki« to improve your user етереенгпег, peruciato* content and adc, and лпаГу/^ wvbsHe traffic. Йу continuing Io use Chis website, you concent to
иг I»» of cookies. Please w mu Privacy Policy to Iram more about cookies and hew to change your settings.
Matlab analysis can be used to explore data, convert data to different units
and build data models. Sample codes for the same have been provided here.
Q Apps • MATIAS Vrsuakuirons X + ~ O X
О A thkngepwkctwn/apfM/rnatlab^_vtiuatoatlo*4/lemptef*s Guest -
Use HAT LAB Visualization templates to get started with interactive line plots. Vou can
* Custom (no starter code) pan and resize ThingSpeaк MATLAB plots. You can also hover over data points Io get
пик i nformatipn.
Create a filled area 2-D plot
Visualize directional data with compass plot This exam pie reads 33 hours of traffic data from a public channel and displays
averaged data for each hour.
Use area plot to compare traffic data sets * Compare Temperalure Data from Three Different Days in a line plot. This
example reads three 24 hour segments ol temperature data from a public
Compare temperature data from three different days
channel
Plot temperature and wind speed on two different y-axes * Plot Temperature and Wind Speed on Two Differ ent Axes to simultaneously
view two different variables- This example reads temperature and wind speed
Visualize correlation between temperature and humidity data from a public channel and createsa plot with multiple yam.
• i । ■
Crerte using measurements from a public channel
ГПи wiOvtr us« cookies to improve ypur user ccjwSence. регыиикхе content and Ude, and лплГулс website traffic. By continuing to use this website, you consent to
w ни of cookies Иеасе set mu Privacy Policy to leant more about cookies and how to charter your settings.
The Matlab visualizations app can be used to plot and visualize data from a
particular channel. Various templates and sample codes to explore and
visualize the data are given here.
С • |hingspwk<om/c^nrtds
Documentation
Examples
• Arduino
• Arduino MKR1000
• ESP8266
• Raspberry Pi
•
Upgrade
Need to send more data faster?
Upgrade
This website uses cookies tn improve your user experience, personalize content and ads, and analyze website traffic. By continuing to use this website, you consent to our
Discussions
Moreover, Thing Speak has an amazing and active community. You can
post your queries and also learn from other queries and answers here.
IN-DEPTH UNDERSTANDING
OF THE THINGSPEAK API
we will cover the following topics, how MQTT works in Thing Speak.
Overview of API Methods of the PubSub Client Library, installing PubSub
client Library. You have already studied the MQTT protocol, how it works
and we have also used it in Cayenne. But how does MQTT work in Thing
Speak? As you know, MQTT is the most common protocol used in IoT
systems to connect low level devices and sensors. MQTT is used to pass
short messages to and from a broker. Around late 2016 Thing Speak
introduced an MQTT broker so that devices can send MQTT messages to
Thing Speak. These messages can include anything like the current
temperature at your office collected by a sensor. Thing Speak then takes the
message and stores its content to the desired Thing Speak channel. So why
do we use MQTT? As we know in IoT applications, data from various
sources needs to be collected and sent over the network.
However, there is added complexity as IoT devices need remote monitoring
and have limited network bandwidth as MQTT is a lightweight
communication protocol and does not stress much over the device it is
reliable to send data. MQTT is bidirectional and maintains stateful session
awareness in comparison to the traditional request response model, MQTT
uses the publish subscribe model for communication.
This helps the device to use the available bandwidth to its full potential.
The light weightness and efficiency of MQTT make it possible to increase
the amount of data being monitored or controlled significantly. All these
factors make it a good fit and a go to option for IoT applications. So how
does MQTT work?
The MQTT broker is the central point of communication and it is
responsible for dispatching all the messages between senders and rightful
receivers.
Subscriber
A client is any device that connects to the broker and can publish or
subscribe to topics to access the information. A topic contains the routing
information for the broker. Each client that wants to send messages
publishes them to a certain topic, and each client that wants to receive the
messages subscribes to a certain topic. The broker then delivers all the
messages with the matching topic to the appropriate clients.
Thing Speak has an MQTT broker at at URL mqtt.Thing Speak.com at port
1883.
Source port 350, destination port 23
Port 23
Server
CONNECT
username = any
password = MQTT_API_KEY
\<---------- connack--------------- - ThingSpeak
MQTT Client L____ subscribe _____ > M QTT вгокег
(Publish) L_____ SUBACK____________ \ mqtt. thingspeak,com:1883 /
RECEIVE MESSAGE *
To use MQTT with ESP32. We will be using the PubSub Client library.
Using this library we can do simple publish subscribe messaging with the
server that supports MQTT.
0 GtiHub- knoiMiy/puiMubcliS! X +
f- -> C • grthutwom/knolieary/pubsiibclaont
•= README md
Compatible Hardware
The library uses the Arduino Ethernet Client api for interacting with the underlying network hardware. This means it
Just Works with a growing number of boards and shields, including:
• Arduino Ethernet
• Arduino YUN - use the included Yunciient in place of Ethernctetient , and besure to doa Bridge.beginf) first
• Arduino WiFi Shield - if you want to send packets > 90 bytes with this shield, enable the n^Trjw trahsfer size
define in PubSUbClient.h.
• Intel Galileo/Edison
• ESP8266
• ESP32
The library cannot currently be used with hardware based on the ENC28J6O chip - such as the Nanode or the
Nuefectronics Ethernet Shield. For those, there is an alternative library available,
License
C 2021 GitHub. Inc. Terrm Privacy Securrty Status Docs Ccntecl GflMub Prkrng API Training Elcg About
The library is compatible with the number of boards and shields, including
Arduino, Intel Gallileo, ESP8266 and ESP32. The library consists of
constructors and functions which are used in conjunction to program the
device. According to need. Constructors are used for configuration and
setting up the device. They initialize client instances. Various functions are
also available which carry out operations to connect, disconnect, publish
and subscribe to the MQTT. broker. The library provides some examples
and source codes to get started with the library.
However, the library has some limitations. They are as follows. 1. it can
only publish QoS 0 messages. It can subscribe at QoS 0 or QoS 1. 2. The
maximum size, including the header is 256 bytes by default. 3. The keep
alive interval is set to 15 seconds by default. 4. the client will use version
3.1.1 of MQTT by default. To know more about the library and its functions
in detail.
Now let's install the PubSub Client Library in our Arduino IDE. To install
the library, open your Arduino IDE, now go to tools and select manage
libraries. The library manager will now appear on your screen. Search for
PubSub Client. Now install the latest version of this library, we have
successfully installed the PubSub Client Library and are ready to use it to
program our ESP32.
we will cover the following topics, setting up the network, API key and
MQTT configuration, example code overview, example code
configurations, project implementation, troubleshooting and best practices.
Until now, we have covered all the basics of the Thing Speak API. We have
also had an overview of MQTT and the PubSUb Client Library. Let's put all
of this to use and build a small project. We will be developing a project to
detect motion using a PIR sensor. We will then send the data collected to
Thing Speak using the MQTT protocol.
We will be connecting the ESP32 to the Internet and then using the MQTT
protocol with the PubSub Client library. We will be using the port 1883 and
the mqtt.Thing Speak.com server. These details are needed to connect to the
correct MQTT broker. We will also need the MQTT password or the MQTT
API key as specified in your Thing Speak account. To get the MQTT API
key.
Click on your account icon on the top right corner then select my profile.
Here you will find your MQTT API key. Note it down We will also need
the Write API key for a channel to publish the data to a particular channel.
To get the Write API. Create a new channel. Fill in the necessary details
like the name and select 2 fields to publish. Now click on the Save Channel
button. After you have created a new channel, go to API keys.
Here you will find your write API key. Note it down. We have now
configured and have all the necessary credentials. Let's first check the
hardware part for this project. As we are using the PIR sensor, it needs a 5 V
supply.
So we will connect the VCC of the PIR sensor to the VIN of the ESP32. We
will then connect the ground of the PIR sensor to the ground of the ESP32.
Now we have to connect the data out pin from the PIR sensor to GPIO 4 of
the ESP32. You can connect it to any of the GPIO pins. But keep in mind to
make the necessary changes in the code.
Now let's take the code. First, We will include the two libraries which are
needed, the Wi-Fi library and the PubSub Client Library. Remember, in
Cayenne we had installed a Cayenne library which was responsible for
connecting to your Wi-Fi network. But in our case now we will use the Wi
Fi library to connect to our Wi-Fi. Next, we will define a variable sensor pin
to GPIO 4 as we have connected the data out pin of the PIR sensor to GPIO
four of the ESP32. We will now provide all the credentials necessary to
connect to the Internet and MQTT broker. Here we have specified the Wi-Fi
network SSID and password. Next, we have mentioned a user name. You
can use any user name of your choice. Next, we have mentioned the MQTT
API key you got earlier from your Thing Speak Accounts profile page. We
will now mention the Write API key of the channel. The Channel ID, which
you can find at the top, also needs to be mentioned here. We have given all
the numbers and alphabets for random generation of client ID. This is
needed to make the MQTT connection.
Here We have initialized the WiFi and PubSub Client library. Now we need
to mention the server we need to connect to. In our case, it is the Thing
Speak MQTT server. Here we have initialized the last connection time
variable to zero and set the time to post data to our Thing Speak channel to
twenty seconds. Now we need to set up all other parts and configure the Wi
Fi connection. First we set pin 4 as input and set the baud rate to 9600. Here
we have connected to our wi fi using the SSID and password using the
credentials given before. Next, we have provided the port to connect to the
MQTT Broker.
Next we will connect to the MQTT Broker And for this we will generate
random client ID every time to connect. We need to generate a random
client idea every time, as if you use a generic client ID that someone else
may also have the same client ID. If this happens, your device will not be
able to connect to the broker. If any issue occurs during connection, we will
also program the device to reconnect to the broker every five seconds.
We will now generate the payload stream, which will carry your data to the
Thing Speak channel channel. Here We will read the data from the PIR
sensor and set the counter for every time the data is collected. Here we will
create a data string to send to Thing Speak. Here We will create a topic
string of the data to send to Thing Speak. Remember in the last project
where I mentioned about the topics string to publish, we have followed the
same format. We will then use this topic string to publish the data, to Thing
Speak.
Here in the void loop. We have used functions to continuously call the loops
to connect to the server and simultaneously publish values. Now save and
upload the code.
You can open your serial monitor to check the data which is being
published.
Now, check your Thing Speak account. You will see your Channel one
Publishing the values one or zero one denotes that the motion is detected
while zero denotes that motion is not detected. Your Channel two will show
the count for every entry as you know IoT is a tough domain because of the
involvement of both hardware and software parts. You should consider
some basic troubleshooting methods and practices so that you do not have
problems implementing projects. First of all, you should always install the
latest version of libraries you want to use. This is mandatory as the library
publisher fixes bugs and issues that may be present in the previous library
version. Most of the time, the latest library versions are better than the
previous ones. Now, do you remember that we introduced a counter in our
project. This is done to have a track of how many times the data sent and if
our system is correctly working with Thing Speak. You can comment out
the counterpart. Even then, the system will do the task assigned to it.
Moreover, you should always use proper jumper Wires and breadboards to
make connections. As many times there are issues with loose connections.
You should also check your connections properly and connect the devices
and sensors to the proper pins. Also check your sensor beforehand. It may
so happen that your sensor is broken and will not output any data even
when a proper power supply is given. Keeping some of these points in
mind, you will be able to develop an IoT system with ease.
OVERVIEW AND
INTEGRATION OF IFTTT
we will cover the following topics. What is IFTTT and why do we need it
with Thing Speak, setting up an IFTTT account, integrating IFTTT into
example code implementation In the previous project, we send our sensor
data to Thing Speak.
We can clearly see that the graph for motion detection shoots to one
whenever the sensor detects motion. However, it is not feasible to keep an
eye on the graph 24/7. How can we automate the system? Yes, we can
surely automat it and send alerts to us whenever required. Remember in
Cayenne we use the inbuilt trigger notification feature Similarly, we can
automate Thing Speak to send an email notification every time motion is
detected. This is where IFTTT comes into action, so what is IFTTT? IFTTT
has its name derived from the programming conditional statement If this
then that. IFTTT was found in 2010 and launched in 2011. The company
provides a software platform that connects apps, devices and services from
different developers in order to trigger one or more automation. There are
various apps that can be used to update Google sheets, create reminders and
send notifications according to your need. According to IFTTT at the
moment. There are more than 90 million applet connections. So why do we
need IFTTT? In Cayenne we use the inbuilt trigger and notification function
in order to send updates.
Thing Speak does not have any direct feature to send notifications on a
trigger, but it has other apps like ThingHTTP and React, which can be used
in conjunction with IFTTT to automate our systems.
IFTTT is available as an application for both Android and iOS. This makes
it easy to use and we can create instant applets to automate our systems.
Let's get started with IFTTT and set up your account. first. Go to the IFTTT
website. Please find the link to the website in the resources of this project.
Now click on the get started option on the top right corner. You can either
sign up with your Apple, Google or Facebook ID. You can even sign up
manually by clicking here. It will then ask you for your email ID and a
password to be created. Once your account is created, log into your account.
You will arrive at the homepage. Now, let's integrate IFTTT with things be
to send trigger notifications whenever the PIR sensor detects motion. Now
click on Create at the top right corner you will be directed to a new page
that displays if this then that. Here we have to set our triggers and
notifications. Click on this now. Search for Web hooks, click on Web hooks
and select the receiver web request, complete the trigger fields and enter a
name for the event. Now click on the create trigger option. You have now
set that trigger.
Now we need to set the resulting action, go for notifications and e-mail
option. You will have to enter the e-mail you wish to send the email to.
бй)
The data is completely optional, and you can also pass vaiuei, values, and values as query parameters or form variables. This content will be
passed on to the action in your Applet.
Here you can find your URL with your key to post or get a Web request,
now you have all the necessary credentials to use IFTTT with Thing Speak.
Now, go to the Thing Speak web page, click on apps and go to the
ThingHTTP. Here enter a suitable name and copy and paste the URL from
web hooks documentation here.
«pps i rnrign i i и Kequesi isjuir ton
Host
Example
Send an HTTP GET reauest and oarse the resoonsenirse
Do not forget to add your event name in the URL.
SB Wrthcoks worts bene* with IF Appj - React - Пцмзрелк lol
React Name
T hingHT г I
This website ui« cookies to improve your user experience, pessonatue content and ads, and analyae website traffic. By continuing to use this website, you consent to
our use of cookies. Please see our Privacy Policy to leam more about cookies and how to change your settings.
Now, again, go to Apps and use the React app, click on the new react, give
an appropriate name and change condition typed to numeric. Now select the
channel where we are publishing the sensor data and select the appropriate
field. Now select greater then and put the value as zero. This means that
whenever motion is detected and the value is published, it will trigger our
applet. Now select Thing HTTP and the action to be performed and click on
save react. We are now done with all the setup for automating our system.
Here you need to make the same connections with your PIR sensor and
ESP32 and run the same code which we did in the last project. This will
publish the data. Additionally, whenever motion is detected and the value
one is sent to Thing Speak, the Thing Speak app react will send this
information to ThingHTTP, which will pass this to IFTTT through the URL
we have already mentioned.
И Webhooks worts bene with if • x E] Аи» - Re*n - Пчпд5и«к loT X | 1ч Gm*l - from Googie X M the event <iirned'nwnofl_irn>j X + OX
The event named *'motion_trigger“ occurred on the Maker Webhooks service 'n<«*«
□
★
Inbox
||
snoozed
Sent
Drafts
What: motionjrigger
When: April 17.2021 at 01:09PM
Extra Data:,.,
e
v More
Meet
» New meeting
И My meetings
Hangouts
Shubham -
No recent cI»ms
Slarl a new aw
IFTTT will then send an email notification to us mentioning about motion
being detected.
CAPSTONE PROJECT 2
WEATHER STATION
we will cover the following topics IoT architecture comparison, configuring
devices, interfacing the sensor and actuator. Now that we have worked with
Thing Speak and IFTTT, you must have an idea of developing projects
using the Thing Speak API. You may have also noticed the difference in
building projects with Cayenne and with Thing Speak. In general You may
have noticed that the architecture is overall the same and the only difference
is in the API and how it functions. Let's compare our weather station
project.
We have the BME280 sensor which measures temperature, humidity and
pressure. Moreover, as you know, we are also able to calculate and measure
altitude.
We have interfaced this sensor with the ESP32. The ESP32 is responsible
for connecting to the Internet and sending all the data measured by the
BME280 sensor, using the MQTT protocol to the respective cloud either
Cayenne or Thing Speak. We then read the data from the cloud using
another ESP32 and display notification on an LCD.
While Cayenne is easy to use, the Drag and Drop feature especially can be
used for prototype building. However, due to some limitations on
interfacing and the nature of Cayenne, it is suitable only to build beginner
level projects.
Thing Speak is more complex and more suitable for those who can write
code. Due to this, Thing Speak can even be used for high end applications.
Other apps such as React, Thing Tweet and ThingHTTP and their
integration with mathworks bring in additional features that can be used to
develop high end IoT applications. Now let's get started with building the
weather station, using Thing Speak. First, we will configure both the
ESP32s and keep all the credentials needed in hand. First, we will create a
new channel where we will publish the data measured by the BME280
sensor.
Channels store all the data that a T hmgSpeak application collects. Each channel includes
eight fields that can hold any type of data, plus three fields for location data and one for
status data. Once you collect data in achannel.you can use ThingSpeak apps to analyte a
visualire it.
Channel Settings
Percentage complete: Calculated based on data entered into the various fields of a
channel. E nter the name, description, location, uRi, video, and tags to complete your
channel.
Field»; Check the box to enable the field, and enter a field name, Exh ThingSpeak
channel can have up to в fields.
Metadata: Enter information about channel data, Including JSON, XML. or CSV data,
Tags: Enter keywords that identify the channel. Separate tags with commas.
Link to External Site: If you have a website that contains information about your
Things peak channel, specify the URL.
f Latitude Specify live latitude position in decimal degrees. For example, the
latitude of the city of London is 51.5072.
о Longitude: Specify the longitude position in decimal degrees. For example, the
longitude of the city of London is-0.J J75-
c • lhingspMl«0rtVchanfti4VB63?60/priv*i<sf'O*' Gu«i
We will add the numeric display and the Gauge display Widgets. Now go to
API keys and note down both the read and write API keys.
Q API Keys - iiiirqSaeak lor x + -OX
c a ih*ngspMl«o<iVchanoclVl363?8Q/apa_lteys
E^j Things peak “ channels▼ лрр$- Support - Commercial Use Hawn Use Hrtoolow
weather station
Channel ID: 1363280
Author: mwaQOOO®218S8GO
Access: Private
Private View Public View Channel Settings Sharing APJ Keys Import / Export
|£ШЛ • Write API Key: Use this key to write datato a channel, if you feel your key has
been compromised, Click Generate New Write API Key,
• Read API Keys: Use this key to allow other people to view your private channel
feeds and charts. Click Generate Mew Read API Key to generate an additional
read key for the channel.
Read API Keys • Mote: Use this field to enter information about channel read keys. For example,
add notes to keep track of users with access to your channel.
*** I 2HH1AOP0GILZGH8D
API Requests
Write a Channel Feed
Note
GET http*://api,thln(*p«ak.coe/(ijKiate>*pS_i:»y«ev¥W3TX)7YH4YY4*fi«k
T his website uses cookies to improve your user еч>егrcnce, personalue content and ads, and analyze website traffic. By continuing to use this website, you consent to
our use of cookies. Please see our Privacy Policy to team more about cookies and how to change your settings.
You will need the right API key to publish data to the channel while you
need the read API key to subscribe and get data from the channel.
O My Prctae - ThiikjSpeak lot x + -OX
My Profile Help
DEO •
•
User API key is required to create and manage channels using the Mi SI ARIL
MQ1T API key is required to subscribe to channel topics usinc.:'
API Requests
API Keys
Get Channel List
USCWIKW XVH9EAS0V4FPWA
GET http*://epi.thing*pe*k.cce/chaone1*.jtow?ap1_кеу*ХГН9ЕДЬОУаЕРТЫ’Д
Create a Chapngj_____________________________________________________
Delete a Chanrwl
This website uses cookies to improve your user erperience, persona:ue content and s, and analyze website traffic. By continuing to use this website, you consent to
our use of cookies. Please see our privacy Policy to learn more about cookies and how о change your setting*. *
You will also need thee MQTT API key from the My profile option here.
Now we will make connections and complete the hardware part of the
project, first we will connect the BME280 Sensor to one of the ESP32.
Connect the Vin of the BME280 sensor to the 3.3 V pin. of the ESP32. Now
connect the ground of the sensor to the ground of the ESP32. Now connect
the serial clock or SCL pin of the sensor to GPIO 22 of the ESP32. This pin
also acts as the SCL pin for ESP32. We will now connect the SDA or serial
data transfer pin of the sensor to GPO 21 of the ESP32. You are now ready
with your hardware for the publish side of the weather station.
Now we need to connect the LCD with the second ESP32, which will
receive data from Thing Speak and display notifications accordingly. First,
we will connect the Vin of the I2C module of the LCD to the Vin of the
ESP32. Remember, we need a 5 V supply for LCD and a 3.3 V supply for
the BME280. Now connect the ground pin of both the actuator and the
ESP32. As we are using the I2C module, we will connect the Serial data pin
of the module to GPIO21 of the ESP32 and we will connect the Serial clock
pin of the module to GPA 22 of the ESP32. We are now done with the
connections for the subscribe side of the weather station. Now our hardware
is ready and we need to make the necessary software changes to run our
weather station successfully.
we will cover the following topics. Configuring Thing Speak and IFTTT,
code configuration and explanation, implementing trigger notification for
the 16x2 LCD, end to end IoT project implementation. We have taken care
of all the hardware parts and configured our devices to implement the end
to end project. Now let's check the software part. First we will configure our
IFTTT and Thing Speak according to our needs. First, let's check. IFTTT.
Go to your IFTTT account and create a new applet, you will now arrive at
the if this then that page. We have to now select the trigger and action for
sending notifications. Now let's select the input action. Click on the word
this. Enter Webhooks in the search field and select the web hooks card.
After you select web hooks as the trigger, click on receive a Web request
card to continue. Complete the trigger fields. Enter an event name and then
click on Create Trigger. Now to select the resulting action, click on the
word that. Now search from email and select the send me an email card.
Now click on Create Action and then continue. Click on Finish to create the
applet. Now, go to my services from here. Click on Web hooks and then
documentation. You will need the URL from the documentation. Now let's
configure Thing Speak, go to your Thing Speak account and then go to
ThingHTTP from here. Here enter a suitable name and copy and paste the
URL from webhook documentation here. Do not forget to add your exact
event name in the URL.
React Marne: tnter a un ique name tor your React.
Condition туре Condition Гуре: select a condition type corresponding with your data. A channel
can hold numeric sensor data, text, strings, status updates, or geographic
location information.
Test Frequency Test Frequency Choose whether to tert your condition every time data enters
the channel w on a periodic basis.
Condition: Select a channel, a field and the condition for your React.
II channel
Action: Select ThingTweet, ThingHTTP, or MATLAB Analysis to run when the
condition is met.
Options: Select when the React runs.
1 (Temperature]
ThingHTTP
Now again Go to apps and use the react app. Click on new react, give an
appropriate name and change condition type to numeric. Now select the
channel where we are publishing sensorZ data and select the appropriate
field. Now select the greater than option and put in the value. According to
you, this means that whenever the temperature value goes above the
threshold value, it will trigger your applet.
Now select the ThingHTTP and the action to be performed and click on,
save react. We are now done with all the setup for automating our system.
Now let's take the code for our project. First, we will check the publish side
of our project. Here We have included two libraries, the Wi-Fi and the
PubSub Client Library. They are responsible for connecting to the Internet
and to send data to Thing Speak using MQTT. In the next step, we include
the Adafruit libraries for the BME280 sensors.
Here we have created an instance for the sensor. Now we will provide all
the necessary credentials to connect to Thing Speak. First We have provided
Wi-Fi SSID and password. Next, we have mentioned the MQTT API key ,
Write API Key and channel ID. This is needed for the random generation of
the client ID. Here We have initialized both the Wi-Fi and PubSub client
library. Now we will mention the server to which connection needs to be
established. Here We have set our posting interval to twenty seconds. Here
We have set the baud rate to 9600 and initialized the sensor with
appropriate I2C address.
Here we will generate a new client ID each time to connect to the server.
We have also written code to reconnect to the server every five seconds in
case any issue occurs.
Here we are reading the sensor data. We are using float values to get
accurate measurements from the sensor. Here we are creating a data string
to send to Thing Speak. Here We have created a topic string and published
data to the Thing Speak channel feed. We are using the format provided by
Mathworks to create the topic string.
// Setting Callback.
MQTT_CE.IENT.setcallback (callback) ;
// Serial.printin(payload, int);
// Serial.printin(length)i
// Serial.printin("
Here we have set a callback. This function is responsible for actions. when
the data is received here. We have converted the character input string to
integer values.
Now we will set the action so as to display the text warning and above limit
whenever the temperature is above the specified value. If the temperature is
below the specified value, we will print the word normal.
The void loop is responsible for the connection to the Internet and to check
subscriptions. Here we have written a function to reconnect to the broker in
case of any issues.
You can also check the subscribe side of the ESP32 and the serial monitor.
Q saiior - Ttw>ij5pwk. ют x rn th? even: <ч*п« weeiner.stf * + -OX
4- С Й rnaigoegl«IconVm^lAi/0/*>nbQx/FMfcgxwltZtSUKV&l>wtfglcdftw&b№M$
□ Inbox
The event named “Weather station" occurred on the Maker Webhooks service ,,,bo* ■ X <5 G5
* Starred Webhooks vta IFTTT
|Q mt »
wm> Vnwttyfc $11 PM (5nwnut« *90) ■&■ «4 :
о
О Snoozed
What: Weather-Station
> Sent
When: April 20. 2021 at 05:11 PM
о
Б Drafts
Extra Data: ,..
* More
Meet
» New meeting
0 My meetings
LBiuCKOEC ir<xn irew гчпймчхч a S91 m to mgraoe у<хи Final
Hangouts
IFTTT
Sian a new one
IFTTT *-
Enable desktop notifications for Makerdemy Mail OK No thanks isly powerful
For creators g
It will display the received value. If the received value is more than the
specified value You will receive an email stating the same.
The LCD will also display the appropriate message according to the values
received.
CONCLUSION
Though we have briefly covered all the phases in developing an IoT system.
As this domain is vast, there are endless possibilities to work on.
Since we have come to the end of the project, let's have a recap of all the
concepts learned until now. The project began with getting to know about
the microcontroller we used in this project. Not only did we learn about the
features of the ESP32, we also had a discussion about what factors to
consider and how to select the appropriate microcontroller. Next, we had an
overview of the hardware specifications of the ESP32. We also brushed up
on the Pin out diagram for the development board. We concluded that
ESP32 is one of the best suitable boards for IoT development due to its
features.
Then we set up our device and the development environment and got a
basic overview of using the ESP32 and the Arduino IDE in conjunction.
In the next section we learned about IoT in depth. We started right from
why IoT Systems are needed and went on to learn about the various parts of
an IoT system.
The basic architecture of an IoT system includes IoT devices, gateways,
communication networks, cloud or a server and IoT applications. We also
had an overview of how the data flows in an IoT system.
We then looked over to the management side of IoT. We covered topics like
how device management takes place, how data is handled and what to do
after collecting the data from the IoT device. Some of the important
concepts, such as data analytics and data visualization and the integration of
an IoT system, were discussed in the following section. Some of the
important developments in the IoT domain have been the addition of
different communication protocols for data transfer. We also discussed the
security aspects of IoT and its integration with artificial intelligence.
We then briefly discussed the newer technologies that have developed and
spearheaded the growth of IoT cloud computing and edge computing. In the
next section, we got an overview of Cayenne and set up our Cayenne
Account.
Cayenne is one of the easiest project builders to develop a proof of concept
and end to end projects. The drag and drop feature of Cayenne makes it
easy, even for a beginner to develop into an IoT projects.
TEST_1
Channel ID: 1357036
Author: mwaQ000022185860
Access; Private
Private View Public View Channel Settings Sharing API Keys Data Import / Export
Help
API keys enable you to write data to a channel or read data from a private channel, API
keys are auto generated when you create a new channel.
API Requests
Write a Channel Feed
Note
GET httpsi//api .thingspoak.coe/u<>dato7*₽£_l:oy=EAay6COSQAUP5<.1(jtfi*Jc
This website uses cookies to improve your user experience, personalue content and ads, and analyse website traffic. Ry continuing io use this website, you consent to
our use of cookies. Please see our Privacy Policy to leant more about cookies and how to change your settings
In the next section we checked upon Thing Speak, which is another IoT
platform. We also discussed the pros and cons of using both Thing Speak
and Cayenne. The different API keys and channel IDs can be used to read
and write data to a particular channel.
React Матс Enter a unique name for your React.
Condition Type: Select a condition type corresponding with your data. A channel
can hold numeric sensor data. text, strings, status updates, or geographic
location information.
Test Frequency, choose whether to test your condition every time data enters
the channel or on a periodic basis.
Condition: Select a channel, a field and the condition for усни React.
Action: Select ThingTweet, ThingHTTP, Or MATLAB Analysis to run when the
condition is met.
Options: Select when the React ru os.
Additionally, apps from Thing Speak like the ThingHTTP and react can be
used in conjunction with IFTTT to send notifications to your email. You can
also use other apps from IFTTT to create a customized a trigger action plan
for your IoT system. We then developed a weather station using the
BME280 sensor and things speak this time. We did not have the use a
workaround to make our system work. After completing projects in both
Cayenne and Thing Speak, you may have noticed a difference in using the
IoT platforms. Then we learned about the important concepts of IoT, such
as the architecture data flow in an IoT system and the different technologies
that can be introduced in an IoT system. Next, we moved on to get that
introduction to the Drag and Drop Project builder called Cayenne. We then
implemented the capstone project, which is a weather station using Cayenne
and with all the concepts learned before. Finally we implemented the
second capstone project using the BME280 and Thing Speak. This helped
us to learn about the difference between the two IoT platforms.
v
№ Al v Терк Al v jflfli
M<x« Iffp
U8g2
b-fotar .raw 1.31-2 INSTALLED
KwctattHCD, (MED ud -Ink I ibrery, 0<iphv rwtroW; SSD13O5, $501304, SS013OT, SSO1316, SSD1370, SSD133 2,
SSD1323, SSD1377, SSD 1329, SSDl&M, 5501802, SHUM, SH1102, SH1IU8. SHI 122, TM«. RAW 5, LUM I, PCDB344,
PCF8812, HX133<J, KIWI. UC1 MH, UC1608, KI 010, К1Ш, IK 1817, KIMI, К1701, ST7511, ST7518.5П5М, ST75W,
5Г15Л, Sim, 51/588,5T75756, ST7532O, ИГ7534, SI7W0, IST301», ISUWO, ЮЯЦ К5МЦ КЯИ1, HD44107, TW2,
5E01 HO, $M1№ IUS20. НЛХ7215. Шкш ПС, $₽l, MoNcIrcm до, фдо ind e№ litov. *
UBglib- Supp<xl*d $501305. SSDIM SSD13W, S5O1316- $501320, $301322, 5501325, SSD1327.
$501325,5501605. 5501W7.SMI 106,5*11107- SHILOC. SHI 122. Ж ЧЛбЗЗЗ LC7531. PCD8544, KF08:2. HXL230.
UC1WL K1W4 KIWI. JCiM Klitl. КШ7, K1HB. UC170L ST7511. ST732B. 5Т75Ю. ST73B7 ST7371,5T73BS
ST7368. ST7J256, ST7332&. NT7534. ST792D. LS12O2D, 1ST7920, LD7O32, <30108.150711 HMI102. T79S2. SED1520,
S8NIW1.113B20. HAX7219. Stjpcrtte iflUrfMen I2C, SPI. hullfl. UTF8- >700 Ы108x8 dw output.
Then we are searching. Hit enter. And here's the desired library you ate a
too. And by Oliver, this is what we want. Click on install. Maybe you have
also installed some more referenced libraries. So just click OK. And then
when you have installed the whole library, there should be an undergrad file
example.
When you. Go a little bit down in the menu, then you should have a new
and trim you eight h two. Then we go to full buffer. And also we go to
graphic artists file example. You hate to flip off a graphic artist.
A new sketch is opened, and what you now can see is that we only need one
library, this library and this library is the only library would we use for
making the whole graphic, the whole bitmap and string showing on the
display? So it's growing a little bit down and then we see a lot of
constructions to start the right and proper only display. I'm using on one 28s
multiply. 64. I have to search to white one.
Q Grilled - 0
ООП90
So and here we have the proper one. It's cards known M A, C e to see him,
and then we are switching gears. The clock was twenty two, I think, yes, 20
to him and where the data was twenty one. And this is our constructor.
And that's it, that's all what we have to set up for the first graphic artists,
and when I scroll a little bit down, you can see here a lot of the
constructors, yeah, a lot of function, which we are using afterwards in our
project, for example, how you can draw a frame, how you're making disc
circles and other frame, how you use a string.
That's of course what we are using. You can also make the direction, change
the direction, the line thickness. You can draw triangles. What's that ASCII
symbols?
Also, using X-ray pages, then you can use also and that's what you are, of
project using some bitmap files or in this case, it's expenses for showing
some drawings.
And also, we can overlay drawing and text. This is also what we are using
later bitmap overlay, of course, scoring a little bit more down that he gets to
know what's there.
OK, and that's the drawing function. OK. Let us compile the first graphic
tests and connects our. Just be sorted through to the computer. While the
host country is compiling. Switching back. Don't forget to.
I1 (карьеры | Art** 1AI4 thirtybrtJittli’Mfll «.33
It frtrt Otfch T«h tWp
FnincwirqiFclMl
itatei/)
WilOl IWHHA FfTW
E5*32$lrtih[>iUl'4lca
aw stated?)
ESMMStathDuiilftort
Jpkjlfewd'IISXtr
Wtitqvwy'SMHj'
1«*k< 'JW FWIMOTJL. М1ВДГ
teujpwTOublrf-
CtUjlMt TtoM'
W₽ Vtntni Marnw/
fftbta; •flnfc'
b<4*wt 'Ch*W tbs*« oom]'
it*t Mtwon CHtWrt'
Err.* FlrA (MySlMtA’
& Suptcrt *M SSL (iF*tn (BrfHUHtf
MMlt 'ISl (KM » Ш №M фШксф'
4₽v3i UAcres Uxpy'.rert-iwraiw lUJAPTONEKT
Set up to ride the rides boards, I'm using to search too. And also, don't
forget to use the prop comports.
So the comparison was successful, and then I'm uploading the sketch to my
ECP search tool.
It's finished uploading, I'm resetting it change. To the tabletop, and now
what we see is the graphic test.
So we see different lines, we see triangles also some texts. How many rows
you can display, some unique codes. And this is what we are, of course
using is the pigment overlay. So some expand photos, you also can animate
the whole thing. And then it started all over again. So when you can see this
test example, you have white everything in the right way and we're ready to
go and make some code for ourselves.
First of all, I created a new sketch and also a new photo. And in this folder
I've also implemented insert a new file. It's called my old age. And when
you open the main file, also distort, each file will be opened.
And in this my old age, I'm pasting all the graphic data insights and in the
main data in the main exam and saying data I make can include statement
with my all on the edge. And as the name says, we including the WHO code
inside this file. So this gives us some way to structure the whole code a
little bit more in the proper way. This is to host coach Justin Silver begin
and then delay. That's all.
So the first thing what we are going to do now is we are open, a graphic
program where you can edit some pixel graphics and I'm made as I made in
your document with 50, with 50 in the higher. And now you can insert any
kind of pixel graphic as you want. I use and bitcoin being in and. Be aware
of the contrast in the foreground and in the background, because our display
is very simple, and so I only have one color display. I think there are also
two color display in this size, but here I only use a black foreground and in
white background safeties two in JPEG.
And then we are open. For example, this online convert image converted or
cheap, cheap to expand, it's become very real at the end of 2021, but any
other convert will do it the same, then trick and drop the chip. Click on
Convert and I think it's already downloaded and you got here on file. So I'm
not using to expand file. I click on Edit with no bid, for example, and there
is what we want. We copy. The defiant switch back to our Arduino and.
Paced the whole information from the new local insights to my older age,
but I'm now doing is I'm hoping to.
The first thing because we need a concert unsigned Char, and we are calling
this an PTZ and also the Brookman is important to use. So always use this
structure that we got with to espouse. So due to no errors when you are
displaying this kind of information or this kind of graphics. So this was the
first step converting the JPEG to an experiment, including into a separate
file.
Now we're switching back to our main file and we are starting with
including our library u et je to dot h. And also the constructor what we used
in the graphic tests just copy and paste to construct a line. And that's it for
the whole part, which was the library.
And then we are starting to. In the in the set up with our approach to
showing, it's at the expense, first of all, we are making a begin of
collaboration and then we are clearing out all of the existing content on it
with clear buffer and then we are sitting in front because the first thing what
we all want to do is now we want to write something on the display. We are
setting the bits mode, the bitmap mode on false. That means that we have
an transparent background so that we can also make an overlay of this when
we are already had so. This one I've used from the example, from the
graphic tests, and now we are once we are one to do some strings, you
eighty two point two raw. SDR and then we are setting up to expand the
way access to exclusive 128 pixels in my case and the y axis have 64 pixels,
so I'm using thirty five to thirty am kind of in the middle of the of the
display. And then I want to show unloading text, but it's not very easy
because we are have to convert this one to a string and then give them in
character, so we have to convert it to an C string.
So then the last part, the last points to show it on the display is sent buffer
with this statement. We are actually converting all these statements before
and sending to the display. Then we're making a delay because we are in the
testing phase from maybe two or three seconds and now we are clearing the
whole. Disappear once again, because now we want to display our new
generated BTC file. Therefore, we're switching back and now we are using
you to point to raw extreme. X x y x is then the size of the image, I have set
it up to a 50 to 50. And the name of the. Of the file and this is called Pizzey.
OK. Then. So last month we send it sent buffer loop. Nothing to do for me,
because this is just the first test, if we have it converted in the right way,
then take a look in the compiler.
If we misspelled something looks good, then use be connected. Upload the
sketch.
MORE CRYPTOS
we're adapting to CoinGecko API so that we fetch more cryptos and
descriptors, we are going to try to display on the alert with ensemble and
also list current price. So let's start with adapting the CoinGecko.
You are therefore switching back to the CoinGecko side. And what I'm now
adapting is the ideas. We are also making Ethereum and Dogecoin into the
ideas comma separated without any space euros and USD, and also to
include last updated is true click and executes and then we can
see the new Jason three objects with you were used to and last updated
elements, each of them. Looks very good to me. We are copying the request
you are switching back to the Arduino and replacing the euro with.
The new one, this was the first step and the next step we can see here that
we have starts the Bitcoin USD price in a local variable.
That's not good for our next purpose. Therefore, we are going to the top of
my wife team and making some global very. That means that we have
access to these variables outside the function. Bitcoin used to, Ethereum
used to and also use steam.
And we are making the same this year because maybe you want to also
visualize the euro's. And Long and Deutsch Euros, but not.
So then going back to our group to date on Ether, I'm used to is DOC. Um.
Let me throw on, I was misspell it. USDA and the same with Dutch. I'm not
sure. Greetings to Mr. Elon Musk. Dogecoin, you, Steve. And we are
printing out. Coins loaded, so so far, so good, we just adopted the new rule,
making some.
Global variables going back to our main data and therefore we're making
some quick and dirty. Visualization just for debugging purpose.
So I'm making a small delay here, and then we are going to the loop. First
of all, we are setting up some global awesome local barriers as interchange
for our visualization epsilon starting point soon. And then we starting with
clearing the buffer and then we are throwing our first expen file. It's called
or it's on the exposition zero y five. It's for the size 550 and as we did
before. It's in my wallet. It's called BTC. Then we're setting the funds. It's in
smaller funds. And now we can draw on string a G to dot draw string. We
are sitting in the very X and Y, and then we are posting the BTC USD price.
But as we did before, we have to convert it to a string because now it's and
long and not a string. We cannot pass the string. It's needed as and
character. OK. Then we have to send it. To send Buffon and for testing
purposes, we made him delay from 2000.
That means two seconds out of a match. Just give a look. If we have
compiled everything right? And then, as I said, for testing purposes, the
next one item, I've already converted a picture from Ethereum. And then I
sitting in each, huh? And the third one was two seconds. DeLay Dutch. If I
called it Dutch. Let's see. Kate Snow, BTC, Dutch. OK, so and then also
centered around making Italy, what we've done here is just visualizing the
data, the information we're making. We don't make any new requests. So
this is just visualization. We are fetching the data in the first set up and then
we are only making this stuff.
OK? Composes the compiler says no errors. Let us upload the file.
Turning on the other camera, and it's also interesting, though, is this
ceremony time switching on the ceremony time then connecting to WiFi?
Coins are loaded. And now we are seeing here, Ethereum. Bitcoin.
Dogecoin. Very nice.
So in our loop, we are displaying no. And XM and be fine and also and
string this the current oh, there are those colonies with the price of
Ethereum. Here's the mistake Dogecoin. And then we also have an incorrect
dot com price because it should somewhere, you know, 20 cents, I think.
RELOAD DATA
I'm sure that you're familiar with the concept of blinking without delays. So
in a general speaking, the delays are not really good for your program's
structure in court because when you see delays, the whole program stands
still until the delay time is over.
That means you input, for example, a five delay of five seconds of delay.
The program standstill one second to three four five and then execute to the
rest. When we are using the concept of blink without delays when you're
working with families. The loop is running blue, blue, blue, blue and each
loop is checked. If the condition millis are rated in the interval and when the
condition is true, then it executes to the code and afterwards it can also
execute auto parts of the court.
So when you are new to the concept of blink without malice, go to
examples to digital and go to blink without delay. For example.
We are now implementing the blink without delay in our concepts, in our
program codes, and therefore we need to declare eight new variables.
Previous models and the interview the previous minister has at the very first
beginning zero and the interval is set to 25 seconds.
Then jumping through, jumping to the loop. Now we are getting rid of the.
Candy. Because now we're going to using the new concepts. So what we're
going to do is we are first declaring in the loop a certain area that is called
current and. And this release is set to run time. So that means how long is
the program running? So we are printing for a deeper purpose. The current
release out of the ceremony time and now we are making an if statement. If
the current release, minus two previous movies created, then the interview.
Then. Make our main logic. So let us go through this code once more. We
we're not finished, we have to set back the current the previous meetings,
so. Tick, tock, tick. OK, we are starting to program the current malaise the
previous Mills is set to zero at the interval sets to 25. We have the first,
second to second, third, fourth, fifth, second. So for example, a fifth second
five minus zero is not greater than 25. It's a false set of code is not executed.
The loop goes foot on the gas foot. On the 10th 12th, the concert took a 13
seconds hit. When we are now into 25 seconds, twenty five point one minus
sidra is greater than the interval set to 25 seco nds. Yes, it's true. It's now
our main logical code would be executed, but the previous release is set to
the current release. So the next loop we are now at the twenty seventh,
second twenty seven minus 25, which we know on the set. Here are two
seconds and two seconds are not. That then sets the two the twenty five
seconds to the interval. We are thirty five seconds. Thirty five minus twenty
five from the previous Milly's is not great to the interval. You see, this is a
very simple way that we can. Yeah, making delays without delay
statements, but we are working with the M.E. statement so.
And now for further purpose, I would say we are I'm convinced this current
mill is setting and also that we see at the very first beginnings
such data I would recommend to delay one thousand and sell. Zero. That we
start with bitcoin.
SUGGESTION FOR A 3D
PRINTED CASE
I would like to give you an idea and how you can implement or build your
own 3-D case for the scripted Typekit project. So I've made a small case,
and I will guide you through the main idea of this case. First of all, there is
and proper fit for the all display. And you can see there is a little deepening.
So that's the only display fits perfectly in, and there's also here one more
parts to small plates, which fits perfectly into into this deepening. So that's
the all it can't be fallout of the housing. There is also on some parts on the
backside. I have found breakout boards and Michael was people. It's
because it's I think it's it's it's mix and really pretty case when the USB port
is in the middle, not just somewhere above or on underneath the topic on
the case. And also to use certitude as you can see it.
And also the USP 80 to sixty six has enough room in this case. Of course,
this shouldn't be soldered in the final product, but you get the idea. So let's
take a closer look on the finished product.
So here is to all display displaying the site wall and you can see it's.
Perfectly fits into there is a small plates. And I get it out. Which holds the
display. Also, you can see the micro USB port. The breakout port and
decide where it's a little uplifting pilot so that it's it's really it perfectly fits
on to the case and you can screw the sidewall with these tiny screws with
two centimeters in length. Also perfectly fits into these tiny holes. And then
you have a good looking case which looks very nicely in small, perfectly to
your desk. So that's a short summary on how I would give you an idea how
to. You can implement, replicate and switch 3D printed case for your trip to
tinker projects.
ASSEMBLY
So this is one of the last means of design project, and now I'm soldiering
altogether.
If she departs from the case and also the components, so I'm going from the
Micro Use Be Breakup Board, from the music scene to the arena, on the
grounds to the older, you know, and from the Arduino, do you want me? I
am connecting the four pings, as we did before to the whole display. Then
I'm all together on the side. All are connected to the main case and then we
have a finished product.
So, yeah, let's do camera one for a while so that you get a good overview of
how I'm sitting all together and then I'm looking forward to seeing maybe in
another class.
THE END