DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • How Java Servlets Work: The Backbone of Java Web Apps
  • Upgrade Your Hobbyist Arduino Firmware To Work With STM32 For Wider Applications
  • Types of Bot Traffic on a Public Internet Website
  • Java Z Garbage Collector (ZGC): Revolutionizing Memory Management

Trending

  • Can You Run a MariaDB Cluster on a $150 Kubernetes Lab? I Gave It a Shot
  • AI Speaks for the World... But Whose Humanity Does It Learn From?
  • The Evolution of Scalable and Resilient Container Infrastructure
  • Using Java Stream Gatherers To Improve Stateful Operations
  1. DZone
  2. Data Engineering
  3. IoT
  4. Running a Web Server on SOC (System on Chip)

Running a Web Server on SOC (System on Chip)

This post will give introduction to ESP32 and how you can use it in your IoT projects.

By 
Jawad Hasan Shani user avatar
Jawad Hasan Shani
DZone Core CORE ·
Jun. 05, 20 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
11.3K Views

Join the DZone community and get the full member experience.

Join For Free

IoT devices are gaining popularity with every single day. The specialist hardware is becoming standardized and the specialized software is getting abstracted away with the ability to compose our applications using higher-level frameworks. One example of that device is ESP32 and in this post I will give a brief introduction to it. Though the demos shown here are very basic but you can see its potential. Lets start. 

Introduction to ESP32

Created by Espressif Systems, ESP32 is a low-cost, low-power system on a chip (SoC) series with Wi-Fi and dual-mode Bluetooth capabilities for a wide-range of applications. You can purchase it easily for the cost of approx. 8-10 Euro. 

Highlights

  • Robust Design: capable of functioning reliably in industrial environments, with an operating temperature ranging from –40°C to +125°C.
  • Ultra-Low Power Consumption: Engineered for mobile devices, wearable electronics and IoT applications.
  • Hybrid Wi-Fi & Bluetooth Chip: Can perform as a complete standalone system or as a slave device to a host MCU. ESP32 can interface with other systems to provide Wi-Fi and Bluetooth functionality through its SPI / SDIO or I2C / UART interfaces.

Characteristics

  • The ESP32 is dual core, this means it has 2 processors.
  • It has Wi-Fi and bluetooth built-in.
  • It runs 32 bit programs.
  • The clock frequency can go up to 240MHz and it has a 512 kB RAM.
  • It also has wide variety of peripherals available, like: capacitive touch, ADCs, DACs,
  • UART, SPI, I2C and much more.

Programming Environments

The ESP32 can be programmed in different programming environments. You can use:

  • Arduino IDE
  • Espressif IDF (IoT Development Framework)
  • Micropython
  • JavaScript
  • LUA

I am going to use Arduino IDE for the demos in this post but very much interested in trying out Micropython as well. For setting up the development environment, please check the official website (link in the references section).

Demos

You can do a lot of interesting things using this board. Links in the references section will provide you a lot of interesting projects which you can do. I am going to build two very simple applications as follows:

  • Blink LED (hello world for micro-controllers)
  • ESP32 Web Server

I am using Arudino for these. All the sample code is available on the git repo and you can download the sketches and check it.

If you are new to Arudino, then you can read some of my earlier posts on that topic as well.

Demo 1: Blink LED

The following sketch, once uploaded to the board will make an LED blink. Wiring is very typical for this demo and I have already explained that setup in one of my earlier post, you can read on this link. Only thing different is the device used, instead of Arduino, now we are using ESP32.

Demo 2: ESP32 WebServer

Again, You can download all the code for this part from the repo on this link. Its pretty boiler-plate. However I will show you the UI and output.

The web-server is running on ESP32 and you can use a browser to access the UI and ON/OFF LEDs using GPIOs on device. Instead of LED you can control something else as well with small modifications.

Code

Partial code shown here. Builtin WiFi module is used as well:


Web UI and Wiring

Both LEDs Are OFF

Initially both LEDs are off and UI shows those as follows:

One LED Is ON

By clicking on the button you can turn ON the LED.

Both LEDs Are ON

Here is how it looks when both LEDs are on:

Summary

This was a short introduction to ESP32. I found this device capable and there is a good community behind it. You can use it easily in your IoT projects. People have done very interesting things with it and you can find more about it online. You can download the code for above mentioned demos from this git repo. If you have some question, feel free to ask in comments. I will share with you my other projects using this device. Till next time, happy coding.

References

  • https://www.espressif.com/en/products/socs/esp32/overview
  • http://esp32.net/
  • https://randomnerdtutorials.com/
  • https://github.com/espressif/esp-iot-solution/
Web server arduino CHIP (programming language) LEd

Published at DZone with permission of Jawad Hasan Shani. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How Java Servlets Work: The Backbone of Java Web Apps
  • Upgrade Your Hobbyist Arduino Firmware To Work With STM32 For Wider Applications
  • Types of Bot Traffic on a Public Internet Website
  • Java Z Garbage Collector (ZGC): Revolutionizing Memory Management

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!