Sunday, 14 June 2015

Gesture Controlled Robot Ardunio

Gesture Controlled Robot Ardunio 

////gesture.ino
const int ap1 = A0;
const int ap2 = A1;
int sv1 = 0;      
int ov1 = 0;  
int sv2 = 0;    
int ov2= 0;
void setup()
{
  // initialize serial communications at 9600 bps:
  Serial.begin(9600);
  pinMode(13,OUTPUT);
  pinMode(12,OUTPUT);
  pinMode(11,OUTPUT);
  pinMode(10,OUTPUT);
}
void loop()
{
  analogReference(EXTERNAL);    //connect 3.3v to AREF
  // read the analog in value:
  sv1 = analogRead(ap1);          
   ov1 = map(sv1, 0, 1023, 0, 255);
  delay(2);                    
  sv2 = analogRead(ap2);          
 ov2 = map(sv2, 0, 1023, 0, 255);
    delay(2);                

  Serial.print("Xsensor1 = " );                      
  Serial.print(sv1);    
  Serial.print("\t output1 = ");    
  Serial.println(ov1);  

  Serial.print("Ysensor2 = " );                      
  Serial.print(sv2);    
  Serial.print("\t output2 = ");    
  Serial.println(ov2);  

  if(analogRead(ap1)<514 &&analogRead (ap2)<463) // for backward movement
  {
    digitalWrite(13,HIGH);
    digitalWrite(12,LOW);
    digitalWrite(11,HIGH);
    digitalWrite(10,LOW);
  }
  else
  {
    if(analogRead(ap1)<486 &&analogRead (ap2)>508) // for left turn
    {
      digitalWrite(13,LOW);
      digitalWrite(12,HIGH);
      digitalWrite(11,HIGH);
      digitalWrite(10,LOW);
    }
    else
    {
      if(analogRead(ap1)>512 &&analogRead (ap2)>560) // for forward
      {
        digitalWrite(13,LOW);
        digitalWrite(12,HIGH);
        digitalWrite(11,LOW);
        digitalWrite(10,HIGH);
      }
      else
      {
        if(analogRead(ap1)>550 &&analogRead (ap2)>512)//for right turn
        {
          digitalWrite(13,HIGH);
          digitalWrite(12,LOW);
          digitalWrite(11,LOW);
          digitalWrite(10,HIGH);
        }

        else
        {
          digitalWrite(13,HIGH);
          digitalWrite(12,HIGH);
          digitalWrite(11,HIGH);
          digitalWrite(10,HIGH);
        }
      }
    }
  }
}

Saturday, 13 June 2015

The different between HC-03 HC-04 HC-05 HC-06

The different of HC-03/HC-04/HC-05/HC-06


The modules with the HC-03 and HC-05 firmware are the Master and Slave integrated Bluetooth serial modules with firmware which allows you to modify master and slave mode at any time. HC-03 are industrial grade products, HC-05 are commercial grade products.
The modules with the HC-04 and HC-06 firmware are the modules which are factory set to be Master or Slave modules. Master and slave mode cannot be switched from the factory setting. HC-04 is an industrial grade product, HC-06 is a commercial grade product.
The modules with the HC-09 firmware are replacements for the HC-06 and HC-07 modules.
The modules with Linvor firmware are the same as the HC-06 firmware modules (see above).

TPS-00641Bluetooth Modem

Bluetooth Modem

Bluetooth Modem

Tuesday, 9 June 2015

Difference between 8051 PIC and AVR Micrcontrollers

Difference between 8051,PIC and AVR Micrcontrollers 
microcontroller (sometimes abbreviated µCuC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of Ferroelectric RAMNOR flash or OTP ROMis also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications.

you'll have to study the architecture of all the 3 micros in question to know exact differences, but briefly we can distinguish between the 3 as:

8051 - 8 bit micro based on CISC architecture ( Complex Instruction Set Computer)

PIC - 8 bit micro based on RISC architecture ( Reduced Instruction Set Computer)

AVR - 8 bit micro based on RISC architecture ( Reduced Instruction Set Computer)


there are also 16bit and 32 bit micros from the same family

invention wise, 8051 is the forefather ( date of birth = 1985), next cam PIC s and then came the AVRs.


its essential to learn 8051 to be able to learn other micros. if we come to instruction set of these micros :

8051 has 250 instructions which take 1 to 4 machine cycles to executive
PIC has nearly 40 instructions which are mostly 4 cycles instructions
AVRs have 140 instructions whcih are mostly 1 cycle based

if we come to speed factor:

1 machine cycle in 8051 (normal) divides the clock freq. by 12 ( some derivatives divide by 6 and by 1 also)

1 machine cycle in PIC divides the clock freq by 4

1 M.C in AVRs divides the clock freq by 1

for eg: if we use 12 Mhz Xtal in all the 3 micros then the speed of execution will be as follows:

8051 = 12Mhz /12 = 1 Mhz i,e = 1 million instructions per second
PIC = 12Mhz/4 = 3 Mhz i,e = 3 million instructions per second
AVR = 12Mhz/1 = 12 MHz i,e = 12 Million instructions per second

so you can clearly see the that AVR executes more no:of instructions per given time and can be considered as the fastest among the 3.

also 8051 consumes more power than the other two and PIC consumes the least power.

Both PIC and AVR are RISC based but their instruction Sets are entirely different.

from Programming ( i,e writing code ) point of view : 8051s are easy to code , next come PIcs and last comes AVRs.

8051 has very powerful instruction set, it has commands which do more complex calculations, it also has got strong arithmetic logic unit which makes computation simple.

whereas PICs and AVRs have simple single instrcutions and the programmer has to tell (dictate) each and every step to achieve the final outcome.

for eg:

you would be surprised to know that normal AVRs do not have Multiplication instruction.

in 8051 Assembly we can simple use the instruction : MUL A,B

but in AVR you have to write some 20 lines of code to multiply two resgisters or values.

similiarly division also : in 8051 we have DIV A,B but in AVR again you have to write some 20 lines of code.

There is no ADD instruction in AVRs, in 8051 we can Compliment a port bit or a bit variable by using CPL instruction but in AVR we don't have this instruction.

in 8051 we can easily access the individual port bits but in AVRs we don't have this freedom.

8051 is still in use bcoz of its simplicity and popularity and lowest cost.

AVRs and PICS are costly and come with many on chip peripherals like : hardware SPI, ADC, I2C, USART , Analog comparator, internal RC oscillator, in-system programmablity etc.

also if see vendor support: 8051 are manufactured by over 50 companies whereas PIC & AVRs are manufactured only by their parent companies i,e microchip and Atmel.

for eg: if you are using a particular variant of AVR and Atmel discontinues it then you'll have no other choice than to shift to another variant offered by Atmel which may be costly and need program changes.

but with 8051 you can run the code in any 8051s manufactured by so many companies.

i hope my answer has given you enough insight into the topic.

Monday, 8 June 2015

16f877 A/D channel asm hex files

Search on www.onlineTPS.com



;**********************************************************
;*  This program configures the A/D Module to convert on
;*  A/D channel 6 (the potentiometer) and display the
;*  results on the LEDS on PORTB.
;**********************************************************

list p=16f877
include "p16f877.inc"
goto Start


Start
;-----------INTIALISATION-------------------------------
BSF STATUS, RP0 ;
BCF STATUS, RP1;
movlw  b'11111111';
movwf TRISC
clrf PORTB ;Clear PORTB
clrf TRISB
clrf    PORTC
movlw B'01000000' ;Fosc/8, A/D enabled
movwf PIE1
movlw B'00000000' ;Left justify,1 analog channel
movwf ADCON1 ;VDD and VSS references
BCF STATUS,RP0;
movlw B'01101001' ;Fosc/8, A/D enabled
movwf ADCON0
;-------------ADC CHECK PROGRAM-----------------------
Main

bsf ADCON0,GO ;Start A/D conversion

Wait
btfss PIR1,ADIF ;Wait for conversion to complete
goto Wait

swapf ADRESH,W ;Swap A/D result nibbles
movwf PORTB ;Write A/D result to PORTB
clrf PORTB

WaitPush ;Pause while switch is pressed
btfsc PORTD,2 ; CHECK DIP SWITCH8
goto WaitPush
goto Main ;Do it again

;----------------------------THE END-------------------
end

Friday, 29 May 2015

SWG AWG Wire Gauge diameter Resistance Calculator

SWG-AWG  Wire Weight-Resistance Calculator

220px-Wire_gauge_(PSF).png (220×217)

*Helpful Charts

See also

American Wire Gauge - Untinned copper wires


AWG standard notationNominal diameterCross-section area,
mm X mm
Running weightRunning resistance
mminchg/mlb/1000 ftohm/mohm/1000 ft
102.6000.10245.30946.7731.430.00330.999
112.3000.09064.15537.0924.920.00411.260
122.0500.08073.30129.4219.770.00521.588
131.8300.07202.63023.3315.680.00662.003
141.6300.06422.08718.5012.430.00832.525
151.4500.05711.65114.679.8580.01043.184
161.2900.05081.30711.637.8180.01324.016
171.1500.04531.0399.236.2000.01665.064
181.0200.04020.8177.324.9170.02096.385
190.9120.03590.6535.803.8990.0268.051
200.8130.03200.5194.603.0920.03310.15
210.7240.02850.4123.652.4520.04212.80
220.6430.02530.3252.891.9450.05316.14
230.5740.02260.2592.291.5420.06720.36
240.5110.02010.2051.821.2230.08425.67
250.4550.01790.1631.440.96990.10632.37
260.4040.01590.1281.140.76920.13440.81
270.3610.01420.1020.9080.61000.16951.47
280.3200.01260.0800.7200.48370.21364.90
290.2870.01130.0650.5710.38360.26881.83
300.2540.01000.0510.4530.30420.339103.2
310.2260.00890.0400.3590.24130.427130.1
320.2030.00800.0320.2850.19130.538164.1
330.1800.00710.0250.2260.15170.679206.9
340.1600.00630.0200.1790.12030.856260.9
350.1420.00560.0160.1420.095421.086331.0
360.1270.00500.0130.1130.075681.361414.8
370.1140.00450.0100.0910.061301.680512.1
380.1020.00400.0080.0710.047592.128648.6
390.0890.00350.0060.0560.037742.781847.8
400.0790.00310.0050.0450.029933.5431080.0
AWG standard notationmminchCross-section area
mm X mm
g/mlb/1000 ftohm/mohm/1000 ft
Nominal diameterRunning weightRunning resistance
Adjusted average wire diameter is calculated from the formula, as follows:

Wednesday, 27 May 2015

Valve_Radio_Receiver HAM and free resource

Simple Water Level Indicator cum Alarm


Get Electronics component online In India Visit www.onlineTPS.com

 http://onlinetps.com/shop/images/banners/logo_plane.pngGet Electronics component online In India Visit www.onlineTPS.com


http://onlinetps.com/circuit/water%20level%20indicator.GIF 


Simple Water Level Indicator cum Alarm

Resistance at LED side is 1.5 K ohms