DIY – Blog eTechPath https://blog.etechpath.com Fri, 21 Apr 2023 13:02:53 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://blog.etechpath.com/wp-content/uploads/2017/08/BrandLogo12-150x150.png DIY – Blog eTechPath https://blog.etechpath.com 32 32 DIY OLED Weighing Scale using 10kg Loadcell with HX711 and Arduino Uno https://blog.etechpath.com/diy-oled-weighing-scale-using-10kg-loadcell-with-hx711-and-arduino-uno/ https://blog.etechpath.com/diy-oled-weighing-scale-using-10kg-loadcell-with-hx711-and-arduino-uno/#respond Fri, 21 Apr 2023 13:00:06 +0000 https://blog.etechpath.com/?p=1240 Introduction:

In this tutorial you will learn how to interface HX711 loadcell amplifier board with Arduino uno and getting output on i2c oled display. Also, we will learn how to add calibration push button to zeroing the scale.

Loadcell:

Load cell is a sensor which converts mechanical force into electronic signal. Where the mechanical force can be tension, pressure, compression or torque. There are many types of load cells are available in the market which can be used as per required application. In this example we are going to use strain gauge load cell for converting mechanical force into electrical signal.

Loadcell consist of several resistive strain gauge sensor elements which changes its resistance when the load is applied and gives output in milli volts when input or excitation voltage is applied to it.
This milli volt output is then amplified to voltage signal to make it compatible with controllers to read and convert to load units.

Things You Will Need:

  • Arduino Uno
  • 10kg Loadcell
  • HX711 ADC amplifier board
  • i2c OLED display

Circuit Diagram:

Code:

Example 1: In this example we will use arduino serial window to get output values from the loadcell.

/**
 *
 * Interfacing 10kg loadcell and HX711 amplifier board with Arduino Uno
 * Author: Pranay Sawarkar
 * Website: www.eTechPath.com
 * Link: https://blog.etechpath.com/diy-oled-weighing-scale-using-10kg-loadcell-with-hx711-and-arduino-uno/
 * 
 *
**/

#include <Arduino.h>
#include "HX711.h"

// HX711 circuit wiring
const int Dout_Pin = 2;
const int SCK_Pin = 3;
const int pb1 = 4;
int tarepb = 0;
int newread = 0;
#define CalFactor 235.5    //enter your calibration factor here

HX711 scale;

void setup() {
  Serial.begin(115200);
  scale.begin(Dout_Pin, SCK_Pin);
  pinMode(pb1, INPUT_PULLUP);
  
  Serial.println("Initialization..."); 
  
  scale.set_scale(CalFactor);
  scale.tare();
  delay (200);
  Serial.println("Ready");
  delay (100);
}

void loop() {
  
  tarepb = digitalRead(pb1);
  delay(10);
  if (tarepb == LOW) 
  {
    scale.tare();
    Serial.println("TareDONE");
  }
  else
  { 
  newread = scale.get_units(5);
  Serial.println("Weight: ");
  Serial.println(newread);
  delay(10);
   }
}

Circuit Diagram:

Example 2: In this example we will interface oled display with the existing circuit and print loadcell output values on it.

/**
 *
 * DIY Weighing scale using 10kg loadcell and HX711 amplifier board with Arduino Uno and OLED display
 * Author: Pranay Sawarkar
 * Website: www.eTechPath.com
 * Link: https://blog.etechpath.com/diy-oled-weighing-scale-using-10kg-loadcell-with-hx711-and-arduino-uno/
 * 
 *
**/

#include <Arduino.h>
#include <U8g2lib.h>
#include "HX711.h"

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif

//select your oled display type and size
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
//U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

// HX711 circuit wiring
const int Dout_Pin = 2;
const int SCK_Pin = 3;
const int pb1 = 4;
int tarepb = 0;
int newread = 0;
#define CalFactor 235.5   //enter your calibration factor here

HX711 scale;

void setup() {
  Serial.begin(115200);
  u8g2.begin();
  scale.begin(Dout_Pin, SCK_Pin);
  pinMode(pb1, INPUT_PULLUP);
  
  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_6x10_tf);
  u8g2.drawStr(0, 20, "Initializing...");
  u8g2.sendBuffer();
  
  scale.set_scale(CalFactor);
  scale.tare();
  delay (500);
  u8g2.clearBuffer();
  u8g2.drawStr(0, 20, "Ready");
  u8g2.sendBuffer();
  delay (100);
 
}

void loop() {
  
  tarepb = digitalRead(pb1);
  delay(10);
  if (tarepb == LOW) 
  {
    scale.tare();
    u8g2.clearBuffer();
    u8g2.drawStr(0, 20, "Tare Done");
    Serial.println("TareDONE");
    u8g2.sendBuffer();
  }
  else
  {
  
  newread = scale.get_units(5);
  Serial.println(newread);
  delay(10);

      u8g2.clearBuffer();
      u8g2.setFont(u8g2_font_6x10_tf);
      u8g2.drawStr(0, 20, "Weight: ");
      u8g2.setCursor(45, 20);
      u8g2.print(newread);
      u8g2.sendBuffer();
      delay(10);
    
   }
}

Prototype:

]]>
https://blog.etechpath.com/diy-oled-weighing-scale-using-10kg-loadcell-with-hx711-and-arduino-uno/feed/ 0
Interfacing SHARP 2Y0A21 Distance Sensor with Arduino https://blog.etechpath.com/interfacing-sharp-2y0a21-distance-sensor-with-arduino/ https://blog.etechpath.com/interfacing-sharp-2y0a21-distance-sensor-with-arduino/#respond Tue, 21 Feb 2023 08:44:53 +0000 https://blog.etechpath.com/?p=1201 Introduction:

In this tutorial, I will explain how to interface SHARP 2Y0A21 infrared distance sensor with Arduino board and display the output in serial monitor.

SHARP 2Y0A21

SHARP 2Y0A21 sensor works on infrared technology, it consists of a transmitter and a receiver diode which calculates the distance between the sensor and the target by measuring time interval between transmitted and received wave.

SHARP infrared distance sensor
SHARP 2Y0A21 Sensor Specifications:
  1. Working voltage: 4.5 – 5.5 Vdc
  2. Distance measuring range: 10cm – 80cm (10cm dead band)
  3. Output type: Analog (voltage)
  4. Output: 0 to 3.1v (3.1v at 10cm to 0.3v at 80cm)
  5. Operating Temperature: -10 to +60 °C (Storage: -40 to +70 °C)

Circuit Diagram:

Code:

//SHARP 2Y0A21 IR Distance Sensor Test (10-80cm) 
// Author: Pranay Sawarkar
// www.eTechPath.com

#define sensor A2 

void setup() 
{
  Serial.begin(9600);
}

void loop() 
{
  float volts = analogRead(sensor)*0.0048828125;
  int distance = 30*pow(volts, -1.173);
  delay(1000); 
  
  if ((distance >=10)&&(distance <=80))
  {
    Serial.print("Distance:");
    Serial.println(distance);
    Serial.print("Volts:");
    Serial.println(volts);   
  }
  else
  Serial.println("Out of range");
}
]]>
https://blog.etechpath.com/interfacing-sharp-2y0a21-distance-sensor-with-arduino/feed/ 0
Interfacing TFT LCD ILI9163C & DHT11 Temperature Sensor with STM32F103 32bit Microcontroller https://blog.etechpath.com/interfacing-tft-lcd-ili9163c-dht11-temperature-sensor-with-stm32f103-32bit-microcontroller/ https://blog.etechpath.com/interfacing-tft-lcd-ili9163c-dht11-temperature-sensor-with-stm32f103-32bit-microcontroller/#respond Sat, 23 Feb 2019 08:21:48 +0000 https://blog.etechpath.com/?p=662 About:

In this project i will teach you how to interface ILI9163C TFT LCD  color display module with STM32F103 Arm cortex microcontroller to display DHT11 temperature sensor value.




ILI9163C : It is a 1.44″ color TFT display with SPI interface. This tft comes very cheap but has lot of impressive futures and support very high speed SPI transfer of about 40Mhz. Available in two variants in market, one with the  black pcb and other one with the red pcb. In this project we will use black pcb.

STM32F103: A 32bit arm cortex high speed microcontroller. This is a very cheap, fast & advanced alternative to Arduino and can be program using Arduino IDE with simple USB bootloader. In this project we will use Black Pill STM32F103 board with USB bootloader.

DHT11: A very famous and widely used temperature & humidity sensor. This sensor uses resistive type NTC temperature measurement component with high performance 8bit microcontroller to provide calibrated digital signal output. It has measurement range of 0 to 50 degree Celsius.




Circuit Diagram:

 



Code:

 /* 
* Project: Interfacing TFT LCD ILI9163C & DHT11 Temperature Sensor with STM32F103 32bit Microcontroller 
* Author: Pranay SS, eTechPath 
* Website: www.etechpath.com 
* Tutorial Link: 
* Video Link: 
*/
  
  
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <TFT_ILI9163C.h>
#include <Fonts/FreeSerifItalic9pt7b.h>
#include <dht11.h>
#define RST PB5
#define DC PB6
#define CS PB7


dht11 DHT11;

#define DHT11PIN PC13

// Definition of colours
#define  BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0  
#define WHITE   0xFFFF

float xh = 0;
float yh = 0;
int zh; 


TFT_ILI9163C tft = TFT_ILI9163C(CS, DC, RST);  

void setup() {
  tft.begin();
  tft.drawRect(5,70,118,20,WHITE);
  tft.setCursor(22,79);
  tft.setFont(&FreeSerifItalic9pt7b);
  tft.setTextColor(RED);  
  tft.setTextSize(1);
  tft.print("eTechPath");
  tft.setFont();
  tft.setCursor(10,91);
  tft.setTextColor(WHITE);
  tft.print("www.etechpath.com");
  
}

void loop(){

    int chk = DHT11.read(DHT11PIN);
  if(zh != chk)
  {tft.fillRect(00,15,128,8,BLACK);}
  tft.setCursor(5, 5);
  tft.setTextColor(WHITE);  
  tft.setTextSize(1);
  tft.println("Sensor Status");
  Serial.print("Read sensor: ");
  switch (chk)
  {
    case DHTLIB_OK:
        tft.setCursor(10, 15);
        tft.println("OK");
        Serial.println("OK ");
        break;
    case DHTLIB_ERROR_CHECKSUM:
        tft.setCursor(10, 15);
        tft.println("Checksum Error");
        Serial.println("Checksum error");
        break;
    case DHTLIB_ERROR_TIMEOUT:
        tft.setCursor(10,15);
        tft.println("Time out error");
        Serial.println("Time out error");
        break;
    default:
        tft.setCursor(10,15);
        tft.println("Unknown error");
        Serial.println("Unknown error");
        break;
  }

  float x = DHT11.humidity;
  float y = DHT11.temperature; 

  if (xh != x)
  {tft.fillRect(70,30,30,8,BLACK);
  tft.setCursor(5,30);
  tft.print("Humidity = ");
  tft.print(x);
  tft.println(" (%)");}
  if (yh != y)
  {tft.fillRect(46,50,30,8,BLACK);
  tft.setCursor(5,50);
  tft.print("Temp = ");
  tft.print(y);
  tft.print(" (C) ");}
  Serial.print("Temperature = ");
  Serial.print((float)DHT11.temperature);
  Serial.print(" (C) ");
  delay(500);
  xh = x;
  yh = y;
  zh = chk;
}





Project Images:

Note: Follow bellow tutorial if you want to know, how to burn USB bootloader in STM32 black-pill board.




 

]]>
https://blog.etechpath.com/interfacing-tft-lcd-ili9163c-dht11-temperature-sensor-with-stm32f103-32bit-microcontroller/feed/ 0
How to Control MAX7219 LED Matrix with ESP8266 WiFi Module https://blog.etechpath.com/how-to-control-max7219-led-matrix-with-esp8266-wifi-module/ https://blog.etechpath.com/how-to-control-max7219-led-matrix-with-esp8266-wifi-module/#comments Sat, 02 Dec 2017 00:40:20 +0000 https://blog.etechpath.com/?p=496 About this Project:
In this project we will learn how to interfacing ESP8266 module with MAX7219 matrix display to scrolling text message from web user interface. We will use Arduino IDE to program ESP module in this project. I am using MajicDesigns MD_MAX72xx library for running this project, also the code is very similar to included example in the library with some improvements in web user interface html code.




Components:

  1. MAX7219 8×8 LED Matrix
  2. ESP8266 Node MCU
  3. USB Cable for programming and power

Circuit Diagram:

Steps: 

      1. Connect the circuit as shown above.
      2. Install Arduino IDE form arduino website. After that install ESP8266 board and library in Arduino IDE.
      3. Download and install MD_MAX7219 Library from download section for driving MAX7219 matrix. For using this library you will need to edit MAX72xx.h file for configure the type of LED matrix you are using. In this project we are using FC-16 Chinese module.
      4. Download code ino file from download section and open it with Arduino IDE.
      5. You will need to edit WiFi network SSID and Password inside your code before flashing it in ESP module.
        const char* ssid = "your SSID";                   // edit your wifi SSID here
        const char* password = "your Password";            // edit your wifi password here
      6. Select board to NodeMCU and flash the code in ESP module.
      7. Power up the circuit and you will see IP address of your ESP module allocated by your WiFi network on Matrix display. (watch video)



    1. Now open that IP address in any browser connected in same network. And you will see web user interface to enter text.
    2. For detailed procedure of configuring WiFi module with your home network and using web interface, please watch embedded YouTube video linked at the bottom of this page.

Code:

//Link: https://blog.etechpath.com

#include <ESP8266WiFi.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

#define	PRINT_CALLBACK	0
#define DEBUG 0
#define LED_HEARTBEAT 0

#if DEBUG
#define	PRINT(s, v)	{ Serial.print(F(s)); Serial.print(v); }
#define PRINTS(s)   { Serial.print(F(s)); }
#else
#define	PRINT(s, v)
#define PRINTS(s)
#endif

#if LED_HEARTBEAT
#define HB_LED  D2
#define HB_LED_TIME 500 // in milliseconds
#endif

#define	MAX_DEVICES	4

#define	CLK_PIN		D5 // or SCK
#define	DATA_PIN	D7 // or MOSI
#define	CS_PIN		D8 // or SS

// SPI hardware interface
//MD_MAX72XX mx = MD_MAX72XX(CS_PIN, MAX_DEVICES);
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW  //edit this as per your LED matrix hardware type
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// Arbitrary pins
//MD_MAX72XX mx = MD_MAX72XX(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

// WiFi login parameters - network name and password
const char* ssid = "your SSID";                   // edit your wifi SSID here
const char* password = "your Password";            // edit your wifi password here

// WiFi Server object and parameters
WiFiServer server(80);

// Global message buffers shared by Wifi and Scrolling functions
const uint8_t MESG_SIZE = 255;
const uint8_t CHAR_SPACING = 1;
const uint8_t SCROLL_DELAY = 75;

char curMessage[MESG_SIZE];
char newMessage[MESG_SIZE];
bool newMessageAvailable = false;

char WebResponse[] = "HTTP/1.1 200 OK\nContent-Type: text/html\n\n";

char WebPage[] =
"<!DOCTYPE html>" \
"<html>" \
"<head>" \
"<title>eTechPath MAX7219 ESP8266</title>" \
"<style>" \
"html, body" \ 
"{" \
"width: 600px;" \
"height: 400px;" \
"margin: 0px;" \
"border: 0px;" \
"padding: 10px;" \
"background-color: white;" \
"}" \
"#container " \
"{" \
"width: 100%;" \
"height: 100%;" \
"margin-left: 200px;" \
"border: solid 2px;" \
"padding: 10px;" \
"background-color: #b3cbf2;" \
"}" \          
"</style>"\
"<script>" \
"strLine = \"\";" \
"function SendText()" \
"{" \
"  nocache = \"/&nocache=\" + Math.random() * 1000000;" \
"  var request = new XMLHttpRequest();" \
"  strLine = \"&MSG=\" + document.getElementById(\"txt_form\").Message.value;" \
"  request.open(\"GET\", strLine + nocache, false);" \
"  request.send(null);" \
"}" \
"</script>" \
"</head>" \
"<body>" \
"<div id=\"container\">"\
"<H1><b>WiFi MAX7219 LED Matrix Display</b></H1>" \ 
"<form id=\"txt_form\" name=\"frmText\">" \
"<label>Msg:<input type=\"text\" name=\"Message\" maxlength=\"255\"></label><br><br>" \
"</form>" \
"<br>" \
"<input type=\"submit\" value=\"Send Text\" onclick=\"SendText()\">" \
"<p><b>Visit Us at</b></p>" \ 
"<a href=\"http://www.eTechPath.com\">www.eTechPath.com</a>" \
"</div>" \
"</body>" \
"</html>";

char *err2Str(wl_status_t code)
{
  switch (code)
  {
  case WL_IDLE_STATUS:    return("IDLE");           break; // WiFi is in process of changing between statuses
  case WL_NO_SSID_AVAIL:  return("NO_SSID_AVAIL");  break; // case configured SSID cannot be reached
  case WL_CONNECTED:      return("CONNECTED");      break; // successful connection is established
  case WL_CONNECT_FAILED: return("CONNECT_FAILED"); break; // password is incorrect
  case WL_DISCONNECTED:   return("CONNECT_FAILED"); break; // module is not configured in station mode
  default: return("??");
  }
}
uint8_t htoi(char c)
{
  c = toupper(c);
  if ((c >= '0') && (c <= '9')) return(c - '0');
  if ((c >= 'A') && (c <= 'F')) return(c - 'A' + 0xa);
  return(0);
}
boolean getText(char *szMesg, char *psz, uint8_t len)
{
  boolean isValid = false;  // text received flag
  char *pStart, *pEnd;      // pointer to start and end of text
  // get pointer to the beginning of the text
  pStart = strstr(szMesg, "/&MSG=");
  if (pStart != NULL)
  {
    pStart += 6;  // skip to start of data
    pEnd = strstr(pStart, "/&");
    if (pEnd != NULL)
    {
      while (pStart != pEnd)
      {
        if ((*pStart == '%') && isdigit(*(pStart+1)))
        {
          // replace %xx hex code with the ASCII character
          char c = 0;
          pStart++;
          c += (htoi(*pStart++) << 4);
          c += htoi(*pStart++);
          *psz++ = c;
        }
        else
          *psz++ = *pStart++;
      }
      *psz = '\0'; // terminate the string
      isValid = true;
    }
  }
  return(isValid);
}
void handleWiFi(void)
{
  static enum { S_IDLE, S_WAIT_CONN, S_READ, S_EXTRACT, S_RESPONSE, S_DISCONN } state = S_IDLE;
  static char szBuf[1024];
  static uint16_t idxBuf = 0;
  static WiFiClient client;
  static uint32_t timeStart;

  switch (state)
  {
  case S_IDLE:   // initialise
    PRINTS("\nS_IDLE");
    idxBuf = 0;
    state = S_WAIT_CONN;
    break;
  case S_WAIT_CONN:   // waiting for connection
    {
      client = server.available();
      if (!client) break;
      if (!client.connected()) break;
#if DEBUG
      char szTxt[20];
      sprintf(szTxt, "%03d:%03d:%03d:%03d", client.remoteIP()[0], client.remoteIP()[1], client.remoteIP()[2], client.remoteIP()[3]);
      PRINT("\nNew client @ ", szTxt);
#endif
      timeStart = millis();
      state = S_READ;
    }
    break;
  case S_READ: // get the first line of data
    PRINTS("\nS_READ");
    while (client.available())
    {
      char c = client.read();
      if ((c == '\r') || (c == '\n'))
      {
        szBuf[idxBuf] = '\0';
        client.flush();
        PRINT("\nRecv: ", szBuf);
        state = S_EXTRACT;
      }
      else
        szBuf[idxBuf++] = (char)c;
    }
    if (millis() - timeStart > 1000)
    {
      PRINTS("\nWait timeout");
      state = S_DISCONN;
    }
    break;
  case S_EXTRACT: // extract data
    PRINTS("\nS_EXTRACT");
    // Extract the string from the message if there is one
    newMessageAvailable = getText(szBuf, newMessage, MESG_SIZE);
    PRINT("\nNew Msg: ", newMessage);
    state = S_RESPONSE;
    break;
  case S_RESPONSE: // send the response to the client
    PRINTS("\nS_RESPONSE");
    // Return the response to the client (web page)
    client.print(WebResponse);
    client.print(WebPage);
    state = S_DISCONN;
    break;
  case S_DISCONN: // disconnect client
    PRINTS("\nS_DISCONN");
    client.flush();
    client.stop();
    state = S_IDLE;
    break;

  default:  state = S_IDLE;
  }
}
void scrollDataSink(uint8_t dev, MD_MAX72XX::transformType_t t, uint8_t col)
// Callback function for data that is being scrolled off the display
{
#if PRINT_CALLBACK
  Serial.print("\n cb ");
  Serial.print(dev);
  Serial.print(' ');
  Serial.print(t);
  Serial.print(' ');
  Serial.println(col);
#endif
}
uint8_t scrollDataSource(uint8_t dev, MD_MAX72XX::transformType_t t)
// Callback function for data that is required for scrolling into the display
{
  static enum { S_IDLE, S_NEXT_CHAR, S_SHOW_CHAR, S_SHOW_SPACE } state = S_IDLE;
  static char		*p;
  static uint16_t	curLen, showLen;
  static uint8_t	cBuf[8];
  uint8_t colData = 0;
  // finite state machine to control what we do on the callback
  switch (state)
  {
  case S_IDLE: // reset the message pointer and check for new message to load
    PRINTS("\nS_IDLE");
    p = curMessage;      // reset the pointer to start of message
    if (newMessageAvailable)  // there is a new message waiting
    {
      strcpy(curMessage, newMessage); // copy it in
      newMessageAvailable = false;
    }
    state = S_NEXT_CHAR;
    break;
  case S_NEXT_CHAR: // Load the next character from the font table
    PRINTS("\nS_NEXT_CHAR");
    if (*p == '\0')
      state = S_IDLE;
    else
    {
      showLen = mx.getChar(*p++, sizeof(cBuf) / sizeof(cBuf[0]), cBuf);
      curLen = 0;
      state = S_SHOW_CHAR;
    }
    break;
  case S_SHOW_CHAR:	// display the next part of the character
    PRINTS("\nS_SHOW_CHAR");
    colData = cBuf[curLen++];
    if (curLen < showLen)
      break;
    // set up the inter character spacing
    showLen = (*p != '\0' ? CHAR_SPACING : (MAX_DEVICES*COL_SIZE)/2);
    curLen = 0;
    state = S_SHOW_SPACE;
    // fall through
  case S_SHOW_SPACE:	// display inter-character spacing (blank column)
    PRINT("\nS_ICSPACE: ", curLen);
    PRINT("/", showLen);
    curLen++;
    if (curLen == showLen)
      state = S_NEXT_CHAR;
    break;
  default:
    state = S_IDLE;
  }
  return(colData);
}
void scrollText(void)
{
  static uint32_t	prevTime = 0;
  // Is it time to scroll the text?
  if (millis() - prevTime >= SCROLL_DELAY)
  {
    mx.transform(MD_MAX72XX::TSL);	// scroll along - the callback will load all the data
    prevTime = millis();			// starting point for next time
  }
}
void setup()
{
#if DEBUG
  Serial.begin(115200);
  PRINTS("\n[MD_MAX72XX WiFi Message Display]\nType a message for the scrolling display from your internet browser");
#endif
#if LED_HEARTBEAT
  pinMode(HB_LED, OUTPUT);
  digitalWrite(HB_LED, LOW);
#endif
  // Display initialisation
  mx.begin();
  mx.setShiftDataInCallback(scrollDataSource);
  mx.setShiftDataOutCallback(scrollDataSink);
  curMessage[0] = newMessage[0] = '\0';
  // Connect to and initialise WiFi network
  PRINT("\nConnecting to ", ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    PRINT("\n", err2Str(WiFi.status()));
    delay(500);
  }
  PRINTS("\nWiFi connected");
  // Start the server
  server.begin();
  PRINTS("\nServer started");
  // Set up first message as the IP address
  sprintf(curMessage, "%03d:%03d:%03d:%03d", WiFi.localIP()[0], WiFi.localIP()[1], WiFi.localIP()[2], WiFi.localIP()[3]);
  PRINT("\nAssigned IP ", curMessage);
}
void loop()
{
#if LED_HEARTBEAT
  static uint32_t timeLast = 0;
  if (millis() - timeLast >= HB_LED_TIME)
  {
    digitalWrite(HB_LED, digitalRead(HB_LED) == LOW ? HIGH : LOW);
    timeLast = millis();
  }
#endif
  handleWiFi();
  scrollText();
}

Downloads:

  1. Arduino IDE
  2. ESP8266 Arduino Library
  3. MajicDesigns MD_MAX7219 Library
  4. Code.ino

Video:

How to solve mirror image and orientation problems of matrix display if you are using old MD_MAX72xx library.

]]>
https://blog.etechpath.com/how-to-control-max7219-led-matrix-with-esp8266-wifi-module/feed/ 34
How to control RGB LED wirelessly using ESP8266 WiFi web interface https://blog.etechpath.com/how-to-control-rgb-led-wirelessly-using-esp8266-wifi-web-interface/ https://blog.etechpath.com/how-to-control-rgb-led-wirelessly-using-esp8266-wifi-web-interface/#comments Tue, 21 Nov 2017 22:59:50 +0000 https://blog.etechpath.com/?p=476 About:

In this project we are going to control 1 watt RGB full color LED diode using WiFi module ESP8266-01. You can use any WiFi enabled device to access web interface to control this RGB LED. Watch video at the bottom of this page.




Things you will need: 

  • 1W RGB LED
  • ESP-01  WiFi module
  • 10Ω Resistance
  • ASM1117 3.3v  (or any 3.3v voltage source)
  • USB to TTL converter (for programming esp-01)
  • Momentary push button (optional)
  • Android / Apple / Windows  Phone or any WiFi enabled Laptop / Desktop (to control RGB LED)

Circuit Diagram for programming ESP-01 : 

esp-01_circuit

Steps :

    1. Connect the circuit on breadboard as shown in above circuit diagram for programming ESP-01 WiFi module. You must use only 3.3v logic setting in TTL device.
    2. In this tutorial we will used Arduino IDE to download code into ESP module. So, install Arduino IDE and add supporting board manager and ESP library into it. (Download links are given in download section)



  1. Download and save source code on your computer and open it up using Arduino IDE.
  2. Connect USB to TTL module to your computer.
  3. Open Arduino IDE – Select board ‘Generic ESP8266 Module’ – Select Port of your TTL device (Here’s How to)
  4. Open downloaded code.ino file into arduino and upload the code into ESP module by pressing upload button.
  5. After uploading, Disconnect the ESP module from USB-TTL module and connect it to RGB LED as shown in bellow diagram.

Circuit Diagram for connecting RGB LED:

Steps: 

    1. Connect the final circuit as shown in above diagram and power it up using 5v battery or wall adapter.
    2. ESP module will boot up and LED light will show fade effect in all three colors at startup.



  1. Then open your device WiFi in discovery mode and you will see a new WiFi access point, named as RGB in discovery list.
  2. Connect that WiFi access point, Open any web browser in that device and open ip address 192.168.1.1 , thats it, you will see a colorful RGB control screen to control your wireless RGB LED.
        Note: Do not feed more than 3.3v to ESP-01 module

Source Code : 

/* RGB web server with ESP8266-01 (ESP-01)
* There are only 2 GPIOs available in ESP-01: 0 and 2
* but RX and TX can also be used as: 3 and 1
* Wiring Circuit 
* 0=Red (GPIO0) D3
* 2=Green (GPIO2) D4
* 3=Blue (GPIO3) Rx
* www.etechpath.com
*/

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

const char *ssid = "RGB";
//Uncomment below line if you wish to set a password for ESP wifi network...
// const char *password = "87654321";  

const byte DNS_PORT = 53;
IPAddress apIP(192, 168, 1, 1);   //IP address of your ESP 
DNSServer dnsServer;
ESP8266WebServer webServer(80);

//Webpage html Code
String webpage = ""
"<!DOCTYPE html><html><head><title>RGB control eTechPath.com</title><meta name='mobile-web-app-capable' content='yes' />"
"<meta name='viewport' content='width=device-width' /></head><body style='margin: 0px; padding: 0px;'>"
"<canvas id='colorspace'></canvas>"
"</body>"
"<script type='text/javascript'>"
"(function () {"
" var canvas = document.getElementById('colorspace');"
" var ctx = canvas.getContext('2d');"
" function drawCanvas() {"
" var colours = ctx.createLinearGradient(0, 0, window.innerWidth, 0);"
" for(var i=0; i <= 360; i+=10) {"
" colours.addColorStop(i/360, 'hsl(' + i + ', 100%, 50%)');"
" }"
" ctx.fillStyle = colours;"
" ctx.fillRect(0, 0, window.innerWidth, window.innerHeight);"
" var luminance = ctx.createLinearGradient(0, 0, 0, ctx.canvas.height);"
" luminance.addColorStop(0, '#ffffff');"
" luminance.addColorStop(0.05, '#ffffff');"
" luminance.addColorStop(0.5, 'rgba(0,0,0,0)');"
" luminance.addColorStop(0.95, '#000000');"
" luminance.addColorStop(1, '#000000');"
" ctx.fillStyle = luminance;"
" ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);"
" }"
" var eventLocked = false;"
" function handleEvent(clientX, clientY) {"
" if(eventLocked) {"
" return;"
" }"
" function colourCorrect(v) {"
" return Math.round(1023-(v*v)/64);"
" }"
" var data = ctx.getImageData(clientX, clientY, 1, 1).data;"
" var params = ["
" 'r=' + colourCorrect(data[0]),"
" 'g=' + colourCorrect(data[1]),"
" 'b=' + colourCorrect(data[2])"
" ].join('&');"
" var req = new XMLHttpRequest();"
" req.open('POST', '?' + params, true);"
" req.send();"
" eventLocked = true;"
" req.onreadystatechange = function() {"
" if(req.readyState == 4) {"
" eventLocked = false;"
" }"
" }"
" }"
" canvas.addEventListener('click', function(event) {"
" handleEvent(event.clientX, event.clientY, true);"
" }, false);"
" canvas.addEventListener('touchmove', function(event){"
" handleEvent(event.touches[0].clientX, event.touches[0].clientY);"
"}, false);"
" function resizeCanvas() {"
" canvas.width = window.innerWidth;"
" canvas.height = window.innerHeight;"
" drawCanvas();"
" }"
" window.addEventListener('resize', resizeCanvas, false);"
" resizeCanvas();"
" drawCanvas();"
" document.ontouchmove = function(e) {e.preventDefault()};"
" })();"
"</script></html>";
void handleRoot() 
{
// Serial.println("handle root..");
String red = webServer.arg(0); // read RGB arguments
String green = webServer.arg(1);  // read RGB arguments
String blue = webServer.arg(2);  // read RGB arguments

//for common anode
analogWrite(0, red.toInt());
analogWrite(2, green.toInt());
analogWrite(3, blue.toInt());
//for common cathode
//analogWrite(0,1023 - red.toInt());
//analogWrite(2,1023 - green.toInt());
//analogWrite(3,1023 - blue.toInt());
webServer.send(200, "text/html", webpage);
}
void setup() 
{
pinMode(0, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);

analogWrite(0, 1023);
analogWrite(2, 1023);
analogWrite(3, 1023);
delay(1000);
WiFi.mode(WIFI_AP);
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
WiFi.softAP(ssid);
dnsServer.start(DNS_PORT, "rgb", apIP);
webServer.on("/", handleRoot);
webServer.begin();
testRGB();
}
void loop() 
{
dnsServer.processNextRequest();
webServer.handleClient();
}
void testRGB() 
{ 
// fade in and out of Red, Green, Blue
analogWrite(0, 1023); // Red off
analogWrite(2, 1023); // Green off
analogWrite(3, 1023); // Blue off

fade(0); // Red fade effect
fade(2); // Green fade effect
fade(3); // Blue fade effect
}
void fade(int pin) 
{
for (int u = 0; u < 1024; u++) 
{
analogWrite(pin, 1023 - u);
delay(1);
}
for (int u = 0; u < 1024; u++) 
{
analogWrite(pin, u);
delay(1);
}
}

 





Downloads:

  1. Code.ino
  2. Arduino IDE
  3. ESP8266 Board link for IDE board manager
  4. ESP8266 Arduino Library

 

]]>
https://blog.etechpath.com/how-to-control-rgb-led-wirelessly-using-esp8266-wifi-web-interface/feed/ 6
Simple POV display using Attiny2313 https://blog.etechpath.com/simple-pov-display-using-attiny2313/ https://blog.etechpath.com/simple-pov-display-using-attiny2313/#respond Fri, 08 Sep 2017 22:33:05 +0000 https://blog.etechpath.com/?p=283 Component List:

  • IC1           :     ATtiny2313P
  • LED1-8  :     Diffused LED  (use any color of your choice )
  • R1-R8     :     200Ω
  • R10         :     10KΩ
  • VCC        :      5V Power Supply

 

Circuit Diagram :

pov_display_attiny2313

( Note: In circuit diagram, programming pins are not shown. Take out ISP pins for ATtiny2313 and flash the code using ISP programmer. or simply make your own ISP programmer.   USB ASP AVR universal USB programmer  )



Downloads :

Firmware files    ( .c  | .hex  |  make )

Image to hex Converter tool

]]>
https://blog.etechpath.com/simple-pov-display-using-attiny2313/feed/ 0
USB ASP AVR Microcontroller Universal USB Programmer https://blog.etechpath.com/usb-asp-avr-microcontroller-universal-usb-programmer/ https://blog.etechpath.com/usb-asp-avr-microcontroller-universal-usb-programmer/#respond Fri, 08 Sep 2017 20:54:11 +0000 https://blog.etechpath.com/?p=270 About:

USB ASP is stand alone USB programmer for Atmel AVR microcontrollers, It mainly consist of atmega8 micro controller and some supportive components. Works with multiple platforms including linux, MacOS, & windows. This programmer is originally build by Thomas Fischl under GNU GPL 2 licence.

In this post, we will see how to make this programmer using atmega8. You can also use atmega88 or atmega48 instead of atmega8, firmware files for both is attached at download section at the bottom.

 

 

Components List: 

  •  IC :             Atmega8
  • C1, C2 :      18 pF
  • C3:              100 nF
  • Q2:             12MHz  cristal
  • R1 :             10K
  • R6, R2 :     68 Ω
  • R3:             270 Ω
  • R4, R5  :    390 Ω
  • R7 :             1.5 KΩ
  • J1, J2, J3 :       Jumper
  • D1 :                   3mm Red LED
  • D2 :                  3mm Green LED
  • K4 :                  USB male pcb mount

 

Circuit Diagram :

usb_asp_avr_programmer_circuit

usb_asp_isp_hidder_connection

 

Steps: 

  1. Download firmware rar file form download section and unrar the files in folder, it consist of three hex files for atmega8, atmega48 & atmega88. Select one hex file for your microcontroller and flash it in using another working programmer.
  2. You have to change the fuse bits for external crystal as bellow,
    atmega8  HFUSE=0xc9   LFUSE=0xef
    atmega48  HFUSE=0xdd  LFUSE=0xff
    atmega88  HFUSE=0xdd    LFUSE=0xff


    (Note: Put jumper J2 ON, at the time of programming firmware in ASP microcontroller  )


  3. once you are done with the flashing and fuse bit setting, install the USB drivers for your windows. (Drivers are attached at download section)
  4. For installing drivers, Connect USB ASP to your computer (Put jumper J2 OFF ). When windows ask for a driver, choose downloaded win-drivers folder. And it will install drivers to your computer automatically.
  5. Unplug USB asp and plug it again and windows will detect it. Now you can use ASP programmer to program AVR microcontrollers. AVRDUDE or eXtreme Burner GUI are easy to use software’s for USB ASP, Download it from the links given bellow.

 



Software

 

Downloads:

 

]]>
https://blog.etechpath.com/usb-asp-avr-microcontroller-universal-usb-programmer/feed/ 0
How to operate home appliances wirelessly using ESP8266 and android phone https://blog.etechpath.com/how-to-operate-home-appliances-wirelessly-using-esp8266-and-android-phone/ https://blog.etechpath.com/how-to-operate-home-appliances-wirelessly-using-esp8266-and-android-phone/#respond Fri, 08 Sep 2017 01:37:04 +0000 https://blog.etechpath.com/?p=236 Required Components: 



  1. NodeMCU or any ESP8266
  2. Relay Module
  3. 128×64 OLED display (Optional)
  4. Android Phone

Circuit Diagram :

 

Source Code:

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <Adafruit_GFX.h>
#include <ESP_Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

 

#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif

const char* ssid = "xxxxxxx"; //replace xxxxxxx with your wifi ssid
const char* password = "xxxxxxx"; //replace xxxxxxx with your wifi password

ESP8266WebServer server(80);

const int output1 = 14;
const int output2 = 12;
const int output3 = 13;
const int output4 = 15;

boolean device1 = false;
boolean device2 = false;
boolean device3 = false;
boolean device4 = false;

void handleRoot() {
//digitalWrite(led, 1);
//server.send(200, "text/plain", "hello from esp8266!");
//digitalWrite(led, 0);

String cmd;
cmd += "<!DOCTYPE HTML>\r\n";
cmd += "<html>\r\n";
//cmd += "<header><title>ESP8266 Webserver</title><h1>\"ESP8266 Web Server Control\"</h1></header>";
cmd += "<head>";
cmd += "<meta http-equiv='refresh' content='5'/>";
cmd += "</head>";

if(device1){
cmd +=("<br/>Device1 : ON");
}
else{
cmd +=("<br/>Device1 : OFF");
}

if(device2){
cmd +=("<br/>Device2 : ON");
}
else{
cmd +=("<br/>Device2 : OFF");
}

if(device3){
cmd +=("<br/>Device3 : ON");
}
else{
cmd +=("<br/>Device3 : OFF");
}

if(device4){
cmd +=("<br/>Device4 : ON");
}
else{
cmd +=("<br/>Device4 : OFF");
}

cmd += "<html>\r\n";
server.send(200, "text/html", cmd);
}

void handleNotFound(){

String message = "File Not Found\n\n";
message += "URI: ";
message += server.uri();
message += "\nMethod: ";
message += (server.method() == HTTP_GET)?"GET":"POST";
message += "\nArguments: ";
message += server.args();
message += "\n";
for (uint8_t i=0; i<server.args(); i++){
message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
}
server.send(404, "text/plain", message);

}

void setup(void){
pinMode(output1, OUTPUT);
pinMode(output2, OUTPUT);
pinMode(output3, OUTPUT);
pinMode(output4, OUTPUT);

digitalWrite(output1, LOW);
digitalWrite(output2, LOW);
digitalWrite(output3, LOW);
digitalWrite(output4, LOW);

Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.println("");

 

// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
//display.begin(SSD1306_SWITCHCAPVCC, 0x3D); // initialize with the I2C addr 0x3D (for the 128x64)
display.begin(SSD1306_SWITCHCAPVCC, 0x78>>1); // init done

display.clearDisplay(); // Clear the buffer.

display.setTextSize(2);
display.setTextColor(WHITE);
//display.setTextColor(BLACK, WHITE); // 'inverted' text
display.setCursor(0,0);
display.println(" ESP8266");

display.setTextSize(3); //Size4 = 5 digit , size3 = 7 digits
//display.setTextColor(BLACK, WHITE); // 'inverted' text
display.setTextColor(WHITE);
display.setCursor(0,18);
display.println("Control");

display.setTextSize(1);
display.setTextColor(WHITE);
//display.setTextColor(BLACK, WHITE); // 'inverted' text
display.setCursor(0,52);
display.println("Version 0.1");

display.display();
delay(2000);

display.clearDisplay();

display.setTextSize(2);
display.setTextColor(WHITE);
//display.setTextColor(BLACK, WHITE); // 'inverted' text
display.setCursor(0,0);
display.println("Connecting");

// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");

display.print(".");
display.display();
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());

display.clearDisplay();
display.setTextSize(1); display.setTextColor(WHITE);
display.setCursor(0,0); display.println(ssid);
display.setTextSize(2); display.setTextColor(WHITE);
display.setCursor(0,18); display.println(WiFi.localIP());
//display.setCursor(0,36); display.println(WiFi.localIP());

display.display();

if (MDNS.begin("esp8266")) {
Serial.println("MDNS responder started");
}

server.on("/", handleRoot);

server.on("/status1=1", [](){
server.send(200, "text/plain", "device1 = ON");
digitalWrite(output1, HIGH);
device1 = true;
});

server.on("/status1=0", [](){
server.send(200, "text/plain", "device1 = OFF");
digitalWrite(output1, LOW);
device1 = false;
});

server.on("/status2=1", [](){
server.send(200, "text/plain", "device2 = ON");
digitalWrite(output2, HIGH);
device2 = true;
});

server.on("/status2=0", [](){
server.send(200, "text/plain", "device2 = OFF");
digitalWrite(output2, LOW);
device2 = false;
});

server.on("/status3=1", [](){
server.send(200, "text/plain", "device3 = ON");
digitalWrite(output3, HIGH);
device3 = true;
});

server.on("/status3=0", [](){
server.send(200, "text/plain", "device3 = OFF");
digitalWrite(output3, LOW);
device3 = false;
});

server.on("/status4=1", [](){
server.send(200, "text/plain", "device4 = ON");
digitalWrite(output4, HIGH);
device4 = true;
});

server.on("/status4=0", [](){
server.send(200, "text/plain", "device4 = OFF");
digitalWrite(output4, LOW);
device4 = false;
});

server.onNotFound(handleNotFound);
server.begin();
Serial.println("HTTP server started");
}

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

Steps:

    1. Build up the circuit as shown in circuit diagram.
    2. Download source code from download section, edit downloaded code and input your home router’s SSID and Password in the code.
      const char* ssid = "xxxxxxx"; //replace xxxxxxx with your wifi ssid
      const char* password = "xxxxxxx"; //replace xxxxxxx with your wifi password
    3. Compile and upload the source code in NodeMCU or any ESP8266 you are using. You can use Arduino IDE to upload the code.



  1. Once your uploading process is completed, power up the circuit and reset the ESP once.
  2. Now ESP will connect to your router and it will show IP address of your ESP in OLED display.
  3. Install android application in your phone and open it, application link is given bellow in download section.
  4. Input IP address shown in OLED display and port i.e 80 in application page and hit connect button.
  5. Now you can operate relay from your phone and can connect any appliances to these relays. (consider relay amps rating )

 

Note: You can not use direct 5v relay in this project, because NodeMCU control output is only 3.3v which is not enough to trigger 5v relay. That is- why we are using relay  module to work on this project.

 



Downloads:

esp8266_relay_control.ino

Android application

Circuit diagram

]]>
https://blog.etechpath.com/how-to-operate-home-appliances-wirelessly-using-esp8266-and-android-phone/feed/ 0
DIY pendrive size WiFi repeater using ESP-01 ESP8266 module. https://blog.etechpath.com/diy-pendrive-size-wifi-repeater-using-esp-01-esp8266-module/ https://blog.etechpath.com/diy-pendrive-size-wifi-repeater-using-esp-01-esp8266-module/#comments Thu, 07 Sep 2017 19:38:19 +0000 https://blog.etechpath.com/?p=214 About:

In this project i am going to explain you how to build your own WiFi repeater to extend your home WiFi signal strength. This device is very easy to make and very handy to use. You can use this device at school, college, office or Cafe to extend the WiFi signal without buying expensive WiFi modems from the market.




Components you will need:

  1. ESP-01 or NodeMCU
  2. ASM1117 3.3V voltage converter IC
  3. Male USB connector
  4. USB-UART adapter for programming ESP-01
  5. Android or iOS phone to configure settings.

Circuit Diagram for Programming ESP-01 : 

esp-01_circuit

 

 

Steps: 

    1. Connect ESP-01 to UART adapter as shown in above diagram.
    2. Download firmware files form the bottom of the page, We will flash these files to ESP-01 using ESP flash tools.
    3. Firmware files are in rar folder, So unrar firmware files first and then open ESP flash download tools.
    4. Browse downloaded firmware files into given location as shown in bellow picture and write down where do you want flash the particular file, i.e select 0x00000.bin file and then write location to flash @0x00000 after that select 0x10000.bin file and locate it to 0x10000. (refer bellow screenshot for example)esp8266_repeater_diy
    5. select COM port and hit START button. (If you dont know how to use flash tool, Check this link on Getting started with ESP8266 to flash ESP-01)
    6. After flashing firmware to esp-01, disconnect the circuit and connect USB male port to ESP-01 as given in bellow circuit diagram.ESP-01_Repeater
    7. Now you can power this circuit using any 5v USB wall adapter. So power up this circuit and follow the further steps for configuring WiFi AP settings.
    8. Download Telnet Client Terminal application in your phone. Download links are given in download section at the bottom of this page.



  1. Power up the circuit, default device will create open access point with name MyAP without any password and default IP will be 192.168.4.1, Open WiFi settings in your phone and connect this open access point.
  2. Open Telnet Client Terminal in your phone and add two fields as IP: 192.168.4.1 and Port: 7777, hit connect button.
  3. If everything is ok, terminal will show connected. write command show and hit enter. It will show the current name and password of device STA and AP as shown in bellow screenshot.
  4. Use these commands to update the username and password of your STA and AP.
  • set ssid XXXXXXXX    (your home router SSID)
  • set password XXXXXXXX   (your home router password)
  • set ap_ssid  XXXXXXXX   (new access point name)
  • set ap_password  XXXXXXXX   (new access point password)
  • save    (save configuration)
  • reset   (reset device)
  • show     (this will show updated setting of your device, i.e your routers and access point  username and password)
  • quit     (terminates current remote session)

You are now done with the repeater configuration, reset the ESP once and it will connect your home router with updated ssid and password at the same time it will create an access point with your new access point name and password.



Downloads:

Firmware

ESP Flash Download Tools v3.4.4

Telnet Client Terminal  (Android) (iOS)

 

]]>
https://blog.etechpath.com/diy-pendrive-size-wifi-repeater-using-esp-01-esp8266-module/feed/ 1
How to convert your wired headphones into Bluetooth headphone https://blog.etechpath.com/how-to-convert-your-wired-headphones-into-bluetooth-headphone/ https://blog.etechpath.com/how-to-convert-your-wired-headphones-into-bluetooth-headphone/#respond Sun, 03 Sep 2017 22:40:29 +0000 https://blog.etechpath.com/?p=189 About:
In this projects we are going to use XS3868 Bluetooth module to convert our wired headphones to wireless one. XS3868 is based on OVC3860 RF transceiver. OCV3860 is low voltage single chip Bluetooth RF transceiver providing Bluetooth stereo solution. OVC3860 is a 2.4GHz transceiver with Bluetooth V2 baseband and can transfer 20bit high quality audio codec. OVC3860 is fetured with inbuilt power management and support advance lithium ion batteries with switch regulator.
This device can be program through serial port using AT commands, we will see this chapter later on how to program XS3868 using serial adapter.




Required Components:

  1. XS-3868 Bluetooth module.
  2. Good quality Headphones (wired).
  3. 10k resistor.
  4. 47uF capacitor.
  5. 3mm LED.
  6. 3.7v  Lithium ion battery.

Tools:

  1. Soldering ion
  2. Soldering paste
  3. Soldering tin wire

Wiring Diagram:

xs3868_bluetooth_headphone




My Prototype:

DIY_XS3868_Bluetooth_Headphone            

 

 


]]>
https://blog.etechpath.com/how-to-convert-your-wired-headphones-into-bluetooth-headphone/feed/ 0