Thursday 14 April 2016

ESP 8266 Series:



Latest Addition




Short Description of  ESP8266 Series Features:

1. ESP-01: PCB antenna, through matching, open about 400 m distance to do, easy to use.
2. ESP-02: SMD package for submission limit, the antenna can be drawn with the IPX header casing.
3. ESP-03: SMD package, built-in ceramic antenna technology, all available IO leads.
4. ESP-04: SMD package, customers can customize the type of antenna, flexible design, all the IO leads.
5. ESP-05: SMD package, only leads to serial and RST pin, small external antenna.
6. ESP-06: Bottom mount technology, all the IO port leads with metal shielding shell can be too FCC CE certification, it is recommended to use.
7. ESP-07: Semi-hole chip technology, all IO leads, with metal shielding shell can be too FCC CE certification, IPX can be an external antenna, built-in ceramic antenna can also be used.
8. ESP-08: with the ESP-07, the different forms that customers can define their own antenna.
9. ESP-09: Ultra-small size package, only 10 * 10 mm, four-layer board technology 1M byte!.
10. ESP-10: SMD interface, narrow-body design, 10 mm wide, suitable for light with controller.
11. ESP-11: SMD interface, ceramic antenna, small size.
12. ESP-12: very stable, easy to use.


Stable ESP 8266-12





ESP 8266 -01 wifi Module Pinout




Tuesday 12 April 2016

ESP 8266- 01






















This board is from Ai-Thinker Technology Co. Ltd.

What is this ESP8266-01

It's a wireless SOC
It has GPIO, I2C, ADC, SPI, PWM and some more
It's running at 80MHz
64KBytes of instruction RAM
96KBytes of data RAM
64KBytes boot ROM
It has a Winbond W25Q40BVNIG SPI flash
It's a RISC architecture
The core is a 106micro Diamond Standard core (LX3) made by Tensilica
The ESP8266 chip is made by Espressif
Modules bearing this chip are made by various manufacturers


Features:

802.11 b/g/n protocol
Wi-Fi 2.4 GHz, support WPA/WPA2
Super small module size (11.5mm x 11.5mm)
Integrated 10-bit ADC
Integrated TCP/IP protocol stack (ipv4 only at the moment)
Integrated TR switch, balun, LNA, power amplifier and matching network Integrated PLL, regulators, and power management units
+20dBm output power in 802.11b mode
Supports antenna diversity
Deep sleep power <10uA, Power down leakage current < 5uA
Integrated low power 32-bit MCU
SDIO 2.0, SPI, UART, I2C
STBC, 1x1 MIMO, 2x1 MIMO
A-MPDU & A-MSDU aggregation & 0.4µs guard interval
Wake up and transmit packets in < 2ms
Standby power consumption of < 1.0mW (DTIM3)
Operating temperature range -40C ~ 125C
Specification
802.11 b/g/n
Wi-Fi Direct (P2P), soft-AP
Integrated TCP/IP protocol stack
Integrated TR switch, balun, LNA, power amplifier and matching network
Integrated PLLs, regulators, DCXO and power management units
+19.5dBm output power in 802.11b mode
Power down leakage current of <10uA
Integrated low power 32-bit CPU could be used as application processor
SDIO 1.1/2.0, SPI, UART
STBC, 1×1 MIMO, 2×1 MIMO
A-MPDU & A-MSDU aggregation & 0.4ms guard interval
Wake up and transmit packets in < 2ms
Standby power consumption of < 1.0mW (DTIM3)

Description:

ESP-01 ESP-8266 is an ideal choice for hobbyist to start experimenting with IOT. The dimension of this module is 25mm x 15mm, with simple pin connections (standard 2×4 pin headers), using serial TX/RX to send and receive Ethernet buffers, and similarly, using serial commands to query and change configurations of the WiFi module.

ESP8266 ESP-01 Serial WIFI Transceiver Module is a cheap and easy way to connect to internet via WIFI to any microcontroller platforms like Arduino. You can use AT commands to connect to WiFi networks and open TCP/IP connections (without need to have TCP/IP stack running in microcontroller).

The module(ESP-01) can work with AT command when used with Arduino, USB to TTL adaptor (FTDI USB module is recommended). Additional power supply might be needed to power up the board.With GCC toochain and SDK availability opportunities with ESP8266 as a IOT device is endless.

Tuesday 30 September 2014

About Devolopment Board


  1. 1.AVR Development board with All ICs
  2. 2.Microcontrollers: Atmega16, Atmega8
  3. 3.LCD 16x2
  4. 4. Seven Segments 4 numbers
  5. 5. RTC battery
  6. 6. Buzzer
  7. 7. Two Relays
  8. 8. Eight DIP Switch
  9. 9. Eight 5mm LEDs
  10. 10. 4 x 4 Keypad
  11. 11. Two Serial Ports
  12. 12. Temperature Sensor LM35
  13. 13. Power adapter 12V, 1A
  14. 14. Single pin female connectors: 20 
  15. 15. Serial Cable
  16. 16. USB Cable
  17. 17. AVR USB Programmer

Sunday 31 August 2014

DC MOTOR CONTROL By IR-Remote using PWM AtMega8

Note:-click to-AtMega 8 datasheet

Introduction
To control the speed of DC motor where precision and protection are essence, we use a technique called PWM (pulse width modulation) to control the speed of DC motor.We can achieve speed control of DC motor using mechanical or electrical techniques but they require large size hardware to implement but Micro controller based system provides easy way to control the speed of DC motor.We will use ATmega8 controller to produce PWM wave. By varying the width of this PWM wave, we can control the speed of DC motor. In ATmega8 controller, timer1 and timer2 have PWM mode. 

PWM Based DC Motor Speed Control using Microcontroller Circuit Principle:
The heart of this project is ATmega8 controller. These controllers 

consist of 2 PWM modes. Now we will see   how to generate 

PWM wave using timer2 PWM mode.
Before writing the program to the PWM mode we need to know 

the register description of all the registers that are used for PWM mode.
TCCR2 (Timer Counter Control Register):

In Timer 2, we have different modes like CTC mode, normal mode,

phase correct PWM mode, Fast PWM 
mode,etc.Among all of these modes, we have to select FastPWM mode.
From the above figure, it is clear that
For Fast PWM mode,
            WGM21=1    WGM20=1
To select PWM mode
TCCR2 |= (1<<WGM21)| (1<<WGM20);
Again in PWM mode we have two modes one INVERTING and 

other is NON – INVERTING.
To select non-inverting mode,
    COM21=1     COM20=0
    TCCR2 |= (1<<COM21);
 To select inverting mode,
COM21=1,    COM20=1
TCCR2 |= (1<<COM21)| (1<<COM20);
After that we have to select prescaler value.
            CS22        CS21       CS20                Description
               0              0               0                    No clock source
               0              0               1                     clk/1
              0              1                0                     clk/8
              0              1                1                     clk/32
              1              0               0                      clk/64
              1              0               1                      clk/128
              1              1               0                      clk/256
              1              1               0                      clk/1024
   To set the prescaler to 8,
CS22=0     CS21=1       CS20=0
TCCR2|= (1<<CS21);
OCR2 (Output Compare Register):
            OCR2 register contains an 8 bit value that is continuously compared with counter value.

PWM Program:

//********************************************************
// *********** PWM DC MOTOR CONTROL with IR *************
//********************************************************
//Controller: ATmega8 (1MHz internal Crystal)
//Compiler: ICCAVR
//Author: bidyut das, Chennai
//Date: FEB 2013
//********************************************************
//this program uses two of the three PWM channels (OC1A & OC1B)
//of the ATmega8, for controlling speed & direction of DC motor
//The remote of Sony TV was used for sending IR codes

#include <iom8v.h>
#include <macros.h>
#include "PWM_main.h"

//*********************************************************************
//   Initializing functions for ports, timer0 & timer1
//*********************************************************************  
void port_init(void)
{
 PORTB = 0x00; 
 DDRB  = 0x06; //PWM pins OC1A & OC1B defined as outputs
 PORTC = 0x00; 
 DDRC  = 0x20; //LED for IR detection indication
 PORTD = 0x00; 
 DDRD  = 0x01; //LED, for testing purpose
}

//timer0 init
void timer0_init(void)
{
    //8-bit timer for measuring delay between IR pulses
TCCR0 = 0x03; //CLK / 64
TCNT0 = 0; //reset the timer
}

//TIMER1 initialize - prescale:1
//PWM Frequency: 1KHz
void timer1_init(void)
{
 TCCR1B = 0x00; //stop
 TCNT1H = 0xFC; //setup
 TCNT1L = 0x18;
 OCR1A  = COUNTER_LOWER_LIMIT;
 OCR1B  = COUNTER_LOWER_LIMIT;
 ICR1H  = 0x03;
 ICR1L  = 0xE8;
}

/**************************************************************************
* Interrupt Service Routine for INT0
* Executed whenever a remote code is detected
**************************************************************************/
#pragma interrupt_handler int0_isr:2
void int0_isr(void)
{
unsigned char count, code, address;
unsigned int IR_input;
TCNT0 = 0;
while(!(PIND & 0x04));
count = TCNT0;
if(count < 30)  //to verify start pulse (2.4 ms long)
{
 delay_ms(20);
 ENABLE_INT0;
 return;
}
 
PORTC |= 0x20;
IR_input = read_IR ();
code = (unsigned char) ((IR_input & 0xff00) >> 8);
address = (unsigned char) (IR_input & 0x00ff);
motorControl ( code, address );
PORTC &= ~0x20;
delay_ms(250);
}

//*********************************************************************
//Function to read IR message from the detector
//Return value contains code in upper byte and address in lower byte
//*********************************************************************  
unsigned int read_IR (void)
{
    unsigned char pulseCount=0,  code = 0, address = 0, timerCount;
unsigned int IR_input;
 
while(pulseCount < 7)
{
  while(PIND & 0x04);
  TCNT0 = 0;
  
  while(!(PIND & 0x04));
  pulseCount++;
 
  timerCount = TCNT0;
 
  if(timerCount > 14)
     code = code | (1 << (pulseCount-1));
  else
 code = code & ~(1 << (pulseCount-1));  
}

pulseCount = 0;
while(pulseCount < 5)
{
  while(PIND & 0x04);
  TCNT0 = 0;
  
  while(!(PIND & 0x04));
  pulseCount++;
 
  timerCount = TCNT0;
 
  if(timerCount > 14)
     address = address | (1 << (pulseCount-1));
  else
 address = address & ~(1 << (pulseCount-1));  
}
 
IR_input = (((unsigned int)code) << 8) | address;
 
return(IR_input);
}

//****************************************************************************
//Function to control motor speed & direction depending onthe IR code rceived
//Argumets are the code and address values received from IR detector
//****************************************************************************  
void motorControl (unsigned char code, unsigned char address)
{
static unsigned char counter, dir, dir1;
 
if (address != 1) //detect only TV remote, other signals rejected
  return;

if((code == 16) || (code == 17)) //Channel+ or Channel- button is pressed
     {
        if(code == 16)  //Channel+
       dir = 0;
    else    //Channel-
       dir = 1;
 
      if(dir != dir1)  //change direction
      {
         STOP_MOTOR;
      delay_ms(500);
  
  if(dir == 0)
         set_FORWARD;
  else
     set_REVERSE;
    
      START_MOTOR;
  dir1 = dir;
         }  
     }  
 
 if(code == 18) //Volume- button pressed
     {
         if(counter >= COUNTER_UPPER_LIMIT) //if speed is already maximum, don't do anything
            counter = COUNTER_UPPER_LIMIT;
    else
   counter += STEP_SIZE;   //increase speed by a fixed step
     
    OCR1A = counter;
    OCR1B = counter;
     }
 
if(code == 19) //Volume+ button pressed
     {
         if(counter <= COUNTER_LOWER_LIMIT) //if speed is already minimum, don't do anything
            counter = COUNTER_LOWER_LIMIT;
    else
   counter -= STEP_SIZE;   //reduce speed by a fixed step
     
    OCR1A = counter;
    OCR1B = counter;
     }
 
     if(code == 9)  //'0' button pressed
     {
         OCR1A  = COUNTER_LOWER_LIMIT;
         OCR1B  = COUNTER_LOWER_LIMIT;
    STOP_MOTOR;  
     }
 
 if(code == 0)  //'1' button pressed
     {
         OCR1A  = COUNTER_LOWER_LIMIT;
         OCR1B  = COUNTER_LOWER_LIMIT;
 
TCCR1A = 0x81;
    START_MOTOR;  
     }
}
//************************************************************
//*** call this routine to initialize all peripherals
//************************************************************
void init_devices(void)
{
 //stop errant interrupts until set up
 CLI(); //disable all interrupts
 port_init();
 timer0_init();
 timer1_init();

 MCUCR = 0x02;
 GICR  = 0x40;
 TIMSK = 0x00; //timer interrupt sources
 SEI(); //re-enable interrupts
 //all peripherals are now initialized
}

//************************************************************
//***** FUNCTION FOR SOFTWARE DELAY OF 1 mSEC (appx.) ******* 
//************************************************************
void delay_ms(int miliSec)  //for 1 Mhz crystal
{
  int i,j;
  
  for(i=0;i<miliSec;i++)
    for(j=0;j<100;j++)
{
 asm("nop");
 asm("nop");
}
}

//*******************************************************
// ************  MAIN FUNCTION  *************
//*******************************************************  
void main(void)
{
 init_devices();
  
 while(1); //infinite loop, waiting for interrups from IR detector

}

//******************************  END  ***************************************

Circuit Diagram:
           


Model Car