echo '' ;

Category Archives: Embedded

ESP8266 MQTT broker BONDAR

The ESP8266 can indeed be programmed to act as an MQTT broker, allowing it to handle messaging between different devices in a network using the MQTT protocol. Will Discuss “ESP8266 MQTT broker BONDAR”.

Get Start of ESP8266 MQTT broker BONDAR

Create an account

  • Create an account in here
  • Activate your iotcentral account

Download Bin FIle

Flash the Bondar Firmware

  • your ESP8266 starting from address 0x0. (Use esptool.py or ESP Flash Download Tool)
  • For Linus
    • sudo esptool.py -p /dev/ttyUSB0 –baud 9600 write_flash -fs 32m-c1 -fm dio -ff 40m 0x00000 bondar.bin

ESP8266 Configuration

  • ESP8266 will start as Access Point mode. and named as Bondar_XXXXXXXXX  . (Ex refer Below image : Bondar_2e3ae80cb19a ) and should use default password 12345678
  • Now connect that AP Network (Bondar_2e3ae80cb19a ) with your laptop or mobile.
  • Go to 192.168.4.1 in your browser and you will get a configuration page. Then enter your wifi Credential and your he user and password used on IoTCentral.eu
  • Reset the ESP8266 by Click button and also unplug and re-plug the power cable (I recommend you to unplug and then plug the power cable).
  • After Rest you can see when did soft web browser reset button

IoTCentral.eu Account Details

  • Login to your home page on IoTCentral.eu
  • You will see your allocated topic
  • Use allocated_topic/your_topics to connect to iotcentral.eu:1883 and /allocated_topic/your_topic to connect from your Wi-Fi network.

Note :   Always use your email address and the password used on IoTCentral.eu to publish and subscribe. In this way your data is protected and no one will get access to your data since the topic is secret and you are using your username and password to publish and subscribe to the cloud.


Embedded Interface – MCP23017

Microchip Technology manufactures the MCP23017, a popular integrated circuit (IC) frequently utilized to expand the input/output (I/O) capabilities of microcontrollers. This IC provides an easy way to add more digital I/O ports to a microcontroller using the I2C protocol. With the MCP23017, you can add up to 16 digital input/output pins to your microcontroller with just two I2C pins, which is quite efficient in terms of pin usage.

Read more: Embedded Interface – MCP23017

In situations where the microcontroller’s built-in GPIO pins prove insufficient for the task at hand, various electronic projects commonly employ the MCP23017. For instance, it finds application in hobbyist projects, industrial automation, and DIY electronics alike.

The MCP23017 enables the connection of multiple devices on the same I2C bus by featuring configurable pull-up resistors, interrupt capabilities, and a programmable hardware address. This versatility makes it a favorite among hardware hackers and embedded systems enthusiasts.

Features

  • 16-bit input/output port expander with interrupt output
  • 16 bit serial interface
  • Cascadable for up to 8 devices on one bus
  • 25mA sink/source capability per I/O
  • Supports 100kHz, 400kHz and 1.7MHz I2C™Compatible compatible modes
  • The address for MCP23017 (between 0x20 and 0x27)

Pin Details

INTA and INTB

  • There are two interrupt pins, INTA and INTB, that can be associated with their respective ports, or can be
    logically OR’ed together so that both pins will activate if either port causes an interrupt.

(IODIRA/B)

  • system master can enable the I/Os as either inputs or outputs by writing the I/O configuration bits
    IOCON.BANK – The MCP23X17 can beconfigured to operate in the 8-bit or 16-bit modes via “IOCON.BANK.”

Data Sheet

Examples

Reference Link

Next Topic

Embedded Interface 7 Segment (Add Soon)
Embedded Interface ADC (Add Soon)
Embedded Interface Button (Add Soon)
Embedded Interface EEPROM (Add Soon)
Embedded Interface LCD (Add Soon)
Embedded Interface LCD HD44780 (Add Soon)
Embedded Interface LED
Embedded Interface MCP23017
Embedded Interface Motor (Add Soon)
Embedded Interface PCF8574 and PCF8574A
Embedded Interface RTC (Add Soon)
Embedded Interface Switch
Embedded Interface Touch Kypad
Embedded Interface RGB LED (Add Soon)

Embedded Interface – EEPROM

EEPROM stands for Electrically Erasable Programmable Read-Only Memory. It’s a type of non-volatile memory that can store small amounts of data even when power is removed. EEPROMs are commonly used in applications where persistent storage of configuration settings or small amounts of user data is required, such as in microcontrollers, embedded systems, and electronic devices like USB flash drives and SD cards. Unlike traditional ROM (Read-Only Memory), EEPROM can be electrically erased and reprogrammed multiple times, making it flexible and suitable for applications that require frequent updates to stored data.

Feature

One prominent feature of EEPROM is its ability to be electrically erased and reprogrammed, allowing for multiple read-write cycles. This feature makes EEPROM ideal for storing data that may need frequent updates or modifications, such as configuration settings or user preferences in electronic devices. Additionally, EEPROMs typically offer low-power consumption, fast access times, and compatibility with a wide range of microcontrollers and electronic systems. Moreover, they often have a relatively high endurance, allowing them to withstand many read and write cycles before wearing out.

AT24C128 I²C EEPROM Feature

  • Voltage
    • Low Voltage (1.8v to 3.6v)
    • Standard Voltage (2.7V to 5.5V)
  • Memory
    • 128K (16,384 x 8)
    • 256K (32,768 x 8)
  • I²C Interface (Bi-Directional data transfer protocol)
  • Speed
    • 1MHz(5v)
    • 400KHz(2.7v, 2.5v)
    • 100kHz(1.8v)
  • High Reliablility
    • 1 Million write cycles of endurance
    • 40 years of Data Retention

EEPROM Datasheet

Next Topic

Embedded Interface 7 Segment (Add Soon)
Embedded Interface ADC (Add Soon)
Embedded Interface Button (Add Soon)
Embedded Interface EEPROM (Add Soon)
Embedded Interface LCD (Add Soon)
Embedded Interface LCD HD44780 (Add Soon)
Embedded Interface LED
Embedded Interface MCP23017
Embedded Interface Motor (Add Soon)
Embedded Interface PCF8574 and PCF8574A
Embedded Interface RTC (Add Soon)
Embedded Interface Switch
Embedded Interface Touch Kypad
Embedded Interface RGB LED (Add Soon)

ESP8266 Arduino-Core Tutorial – Web Server

TCP Server Listener

The below Arduino code will also create a server and Access Point in ESP8266 which will continuously listen for a connection.

Code

//www.ArunEworld.com

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>

const char *ssid = "ArunEworld";
const char *password = "Arun";

ESP8266WebServer server(80);

void handleRoot() 
{
    server.send(200, "text/html", "<t1>ArunEworld</t1>");
    server.send(200, "text/html", "<h1>ArunEworld : TCP WebServer Listener</h1>");
    server.send(200, "text/html", "<h2>You are connected</h2>");
}

void setup()
{
    delay(1000);
    Serial.begin(115200);
    Serial.println();
    Serial.print("Configuring access point...");
    WiFi.softAP(ssid, password);
    IPAddress myIP = WiFi.softAPIP();
    Serial.print("AP IP address: ");
    Serial.println(myIP);
    server.on("/", handleRoot);
    server.begin();
    Serial.println("HTTP server started");
}

void loop() 
{
    server.handleClient();
}

After uploading this sketch, you can find a new Access Point named “test” from your Laptop or PC.

Result


 

ESP8266 NodeMCU Project – Home Automation

Home automation is the process of controlling various devices and systems in your home through a centralized control system. With the advancement of technology, home automation has become more accessible and affordable for homeowners.The ESP8266 NodeMCU is a popular choice for home automation projects due to its built-in Wi-Fi capability and compatibility with various sensors and actuators. In this project, we will explore how to set up a basic home automation system using the ESP8266 NodeMCU.

Read more… →

Embedded Interface – RTC

Application

  • Whats-app
    • Every mobile has an in-build RTC. Whatsapp is taking current time from mobile system processor using RTC function and send to WhatsApp server. Once Receptive is online he will receive the  message with a timestamp

Next Topic

Embedded Interface 7 Segment (Add Soon)
Embedded Interface ADC (Add Soon)
Embedded Interface Button (Add Soon)
Embedded Interface EEPROM (Add Soon)
Embedded Interface LCD (Add Soon)
Embedded Interface LCD HD44780 (Add Soon)
Embedded Interface LED
Embedded Interface MCP23017
Embedded Interface Motor (Add Soon)
Embedded Interface PCF8574 and PCF8574A
Embedded Interface RTC (Add Soon)
Embedded Interface Switch
Embedded Interface Touch Kypad
Embedded Interface RGB LED (Add Soon)

Embedded Interface – RGB LED

PWM -Pulse width Modulation

RGB LED

 

Type of RGB LED


 

Next Topic

Embedded Interface 7 Segment (Add Soon)
Embedded Interface ADC (Add Soon)
Embedded Interface Button (Add Soon)
Embedded Interface EEPROM (Add Soon)
Embedded Interface LCD (Add Soon)
Embedded Interface LCD HD44780 (Add Soon)
Embedded Interface LED
Embedded Interface MCP23017
Embedded Interface Motor (Add Soon)
Embedded Interface PCF8574 and PCF8574A
Embedded Interface RTC (Add Soon)
Embedded Interface Switch
Embedded Interface Touch Kypad
Embedded Interface RGB LED (Add Soon)

Arduino Tutorial – Voltage Measurement

Circuit

 

Schematics

 

Code

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float voltage = sensorValue * (5.0 / 1023.0);
  // print out the value you read:
  Serial.println(voltage);
}

 

Arduino Interface – Buzzer

In the realm of Arduino Interface Buzzer, can bring your projects to life with sound. We’ll explore how to connect and control a buzzer, from simple beeps to complex melodies. Throughout this guide, we’ll cover wiring, coding, and examples, whether you’re new to Arduino or a seasoned maker. Let’s dive in and unlock the potential of Arduino buzzers together!

So, let’s embark on this sonic journey and unlock the potential of Arduino interfacing with buzzers!

uses of buzzers

Use CaseDescription
Alarm SystemsBuzzers are commonly used in alarm systems to provide audible alerts for security breaches or emergencies.
Timers and RemindersBuzzers in timers and reminders signal task completion or remind users of events.
NotificationsBuzzers in electronics notify users of messages, alerts, or events.
Industrial MachineryBuzzers in industrial machinery signal malfunctions, task completion, or safety alerts.
Games and ToysIn gaming, arcade machines, and toys, buzzers create sound effects, enhancing the experience.
DIY ProjectsMakers use buzzers in DIY projects like interactive installations, instruments, or home automation.

Application of Buzzer

ApplicationDescription
Alarm SystemsBuzzers in security systems offer audible alerts for intrusions or emergencies.
Timer and Reminder SystemsBuzzers signal task completion or remind users of appointments in timers and reminders.
Industrial MachineryIn industry, buzzers in machinery signal errors, task completion, or safety alerts.
Home AppliancesBuzzers in appliances like microwaves, washers, and dishwashers signal cycle end or errors.
AutomotiveIn cars, buzzers signal seatbelt warnings, parking alerts, or low fuel levels.
Games and EntertainmentBuzzers enhance gaming experiences in consoles, arcades, and interactive toys with sound effects.

Circuit Diagram

Read more… →

Arduino Interface – UART(Serial)

This tutorial is “Arduino Interface UART(Serial)”. The Universal Asynchronous Receiver-Transmitter (UART) is a fundamental component in microcontroller communication, enabling data exchange between devices. In the realm of Arduino, mastering UART opens doors to interfacing with a plethora of sensors, actuators, and other devices.

Read more: Arduino Interface – UART(Serial)

In this guide, we’ll delve into the basics of UART communication with Arduino. Whether you’re a hobbyist embarking on your first Arduino project or an experienced developer seeking a refresher, this tutorial aims to demystify UART and equip you with the knowledge to integrate it seamlessly into your projects.

Let’s embark on this journey to unravel the intricacies of UART communication with Arduino, from understanding the principles behind UART to implementing it in your own circuits and code.

Use cases

The Arduino UART (Serial) interface offers a wide range of uses across various projects and applications.

ApplicationDescription
Sensor IntegrationInterface with various sensors like temperature sensors, IMUs, GPS modules for data collection.
Wireless CommunicationEstablish wireless links using Bluetooth, Wi-Fi, or Zigbee modules for remote control & IoT.
Display OutputCommunicate with LCDs, OLEDs to present information in projects like digital clocks, weather stations.
Data LoggingLog data to external storage devices for long-term recording in environmental monitoring, tracking systems.
Human-Machine InterfaceCommunicate with external devices like keypads, RFID readers for user interaction in systems.
Control InterfacesControl motors, relays, servo motors for robotics, automated systems, or interactive installations.
Debugging and Serial CommunicationUse for debugging, real-time monitoring, and data transfer between Arduino and PC.
Interfacing with Other DevicesCommunicate with other microcontrollers like Raspberry Pi, ESP8266, enabling collaborative projects.

Print Hello World in Serial terminal

Code

void setup() 
{
  Serial.begin(9600);
  while (! Serial); // Wait untilSerial is ready - Leonardo
  Serial.println("ArunEworld : Hello World");
}
 
void loop() 
{
 
}
Read more… →

Arduino Interface – RGB LED

The Arduino microcontroller platform’s versatility in interfacing with various components has earned it renown, making it a go-to for electronics and DIY projects. This tutorial is about “Arduino Interface RGB LED”. One exciting application is controlling RGB (Red, Green, Blue) LEDs to create a spectrum of colors, perfect for beginners and enthusiasts alike.

Read more… →

Arduino Interface – LED

This article is a continuation of the series on “Arduino Interface – LED” and carries the discussion on Turn ON/OFF, and blinking of LED in the Arduino Environment.

  • LED (light-emitting diode): LED is a simple diode that emits light in a forward bias
  • Arduino: is an open-source, board that has a Microchip ATmega328P microcontroller on it.

Pre-Request

  • PC
  • Arduino IDE setup or web-based IDE

Components Required

  • LED – 1 Nos,
  • Resistor, 220 Ohm – 1Nos
  • Breadboard (Optional: If required)
  • Arduino UNO
  • Jumper wires

Turn On/Off LED

The program simply turns ON and OFF LED with some delay between them.

  • For Turn OFF LED – Set digital pin Low digitalWrite(LED_BUILTIN, LOW);
  • For Turn ON LED – Set digital pin high digitalWrite(LED_BUILTIN, HIGH);

 

Read more… →

Embedded Interface – Switch

 

Slide Switch

 

Rotary Switch

 

Push Switch

These are either normally on (Push-to-break0, or normally off(Push-to-make). They can be latched, So they stay pressed down after you remove your finger, like the switches on a torch.

 

Micro Switch

 

Reed Switch

These are magnetically activated


 

Next Topic

Embedded Interface 7 Segment (Add Soon)
Embedded Interface ADC (Add Soon)
Embedded Interface Button (Add Soon)
Embedded Interface EEPROM (Add Soon)
Embedded Interface LCD (Add Soon)
Embedded Interface LCD HD44780 (Add Soon)
Embedded Interface LED
Embedded Interface MCP23017
Embedded Interface Motor (Add Soon)
Embedded Interface PCF8574 and PCF8574A
Embedded Interface RTC (Add Soon)
Embedded Interface Switch
Embedded Interface Touch Kypad
Embedded Interface RGB LED (Add Soon)

ESP32 ArduinoCore Interface – OW (DS18B20)

The ESP32 ArduinoCore Interface for OneWire (OW) communication protocol is a crucial aspect of interfacing with digital temperature sensors like the DS18B20. This interface allows the ESP32 microcontroller to communicate with one or more DS18B20 temperature sensors using the OneWire protocol.

Read more: ESP32 ArduinoCore Interface – OW (DS18B20)

Components

ComponentDescription
ESP32 MicrocontrollerA powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities.
DS18B20 Temperature SensorsDigital temperature sensors manufactured by Maxim Integrated, known for high accuracy readings.
OneWire LibraryProvides functions for communication over the OneWire bus, essential for interfacing with DS18B20 sensors.
DallasTemperature LibrarySimplifies communication with DS18B20 sensors by providing high-level functions and features.

Code

#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 22
#define TEMPERATURE_PRECISION 12 // Lower resolution

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

int numberOfDevices;
DeviceAddress tempDeviceAddress;

void setup(void) {
  Serial.begin(115200);
  Serial.println("Dallas Temperature IC Control Library Demo");
  sensors.begin();
  numberOfDevices = sensors.getDeviceCount();
  Serial.print("Locating devices...");
  Serial.print("Found ");
  Serial.print(numberOfDevices, DEC);
  Serial.println(" devices.");
  Serial.print("Parasite power is: ");
  if (sensors.isParasitePowerMode()) Serial.println("ON");
  else Serial.println("OFF");
  for(int i=0;i<numberOfDevices; i++) {
    if(sensors.getAddress(tempDeviceAddress, i)) {
      Serial.print("Found device ");
      Serial.print(i, DEC);
      Serial.print(" with address: ");
      printAddress(tempDeviceAddress);
      Serial.println();
      Serial.print("Setting resolution to ");
      Serial.println(TEMPERATURE_PRECISION, DEC);
      sensors.setResolution(tempDeviceAddress, TEMPERATURE_PRECISION);
      Serial.print("Resolution actually set to: ");
      Serial.print(sensors.getResolution(tempDeviceAddress), DEC);
      Serial.println();
    } else {
      Serial.print("Found ghost device at ");
      Serial.print(i, DEC);
      Serial.print(" but could not detect address. Check power and cabling");
    }
  }
  delay(5000);
}

void printTemperature(DeviceAddress deviceAddress) {
  float tempC = sensors.getTempC(deviceAddress);
  Serial.print("Temp C: ");
  Serial.println(tempC);
  Serial.print("Temp F: ");
  Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit
}

void loop(void) { 
  Serial.print("Requesting temperatures...");
  sensors.requestTemperatures();
  Serial.println("DONE");
  for(int i=0;i<numberOfDevices; i++) {
    if(sensors.getAddress(tempDeviceAddress, i)) {
      Serial.print("Temperature for device: ");
      Serial.println(i,DEC);
      printTemperature(tempDeviceAddress);
      delay(3000);
    }
  }
}

void printAddress(DeviceAddress deviceAddress) {
  for (uint8_t i = 0; i < 8; i++) {
    if (deviceAddress[i] < 16) Serial.print("0");
    Serial.print(deviceAddress[i], HEX);
  }
}

Code Explanation

Code SectionExplanation
#include <OneWire.h>Includes the OneWire library for communication with devices using the OneWire protocol.
#include <DallasTemperature.h>Includes the Dallas Temperature library for interfacing with Dallas/Maxim temperature ICs.
#define ONE_WIRE_BUS 22Defines the GPIO pin (pin 22) where the OneWire data wire is connected to the ESP32.
#define TEMPERATURE_PRECISION 12Defines the resolution for temperature readings (12 bits for lower resolution).
OneWire oneWire(ONE_WIRE_BUS);Initializes a OneWire object with the specified GPIO pin.
DallasTemperature sensors(&oneWire);Initializes a DallasTemperature object using the previously created OneWire object.
int numberOfDevices;Declares a variable to store the number of temperature devices found on the bus.
DeviceAddress tempDeviceAddress;Declares a variable to store the address of a found temperature device.
void setup(void)Begins the setup function, which is called once when the program starts. Initializes serial communication and the sensor library.
Serial.begin(115200);Starts serial communication with a baud rate of 115200.
sensors.begin();Initializes the Dallas Temperature library.
numberOfDevices = sensors.getDeviceCount();Retrieves the number of temperature devices found on the OneWire bus.
for(int i=0;i<numberOfDevices; i++)Loops through each temperature device found on the bus.
sensors.getAddress(tempDeviceAddress, i)Retrieves the address of the i-th device and stores it in tempDeviceAddress.
sensors.setResolution(tempDeviceAddress, TEMPERATURE_PRECISION);Sets the resolution of the temperature device to the defined precision.
void printTemperature(DeviceAddress deviceAddress)Declares a function to print the temperature of a device with the given address.
void loop(void)Begins the loop function, which runs continuously after setup.
sensors.requestTemperatures();Requests temperature readings from all connected devices on the bus.
for(int i=0;i<numberOfDevices; i++)Loops through each temperature device found on the bus.
printTemperature(tempDeviceAddress);Prints the temperature of the i-th device.
void printAddress(DeviceAddress deviceAddress)Declares a function to print the address of a device.

Functionality of

  1. Initialization: The interface initializes the OneWire communication by defining the GPIO pin to which the OneWire data wire is connected. It also initializes the DallasTemperature library, which simplifies communication with DS18B20 sensors.
  2. Device Detection: Upon initialization, the interface detects the number of DS18B20 sensors connected to the OneWire bus. It retrieves the unique address of each sensor and sets their resolution if detected.
  3. Temperature Reading: The interface periodically requests temperature readings from all connected DS18B20 sensors. It then retrieves the temperature data and converts it to Celsius and Fahrenheit scales for further processing or display.

NEXT

Arduino-Core Get Start (Soon)
ESP32 Arduino Core Interface
ArduinoCore Interface Basics
ArduinoCore Interface WiFi
ArduinoCore Interface – LED
ArduinoCore Interface ADC
ArduinoCore Interface DS18B20
ESP32 Arduino Core Projects
ArduinoCore Project – WebServer
Others
Arduino-Core Sitemap
Arduino-Core All Post