### Resistor color code

A resistor is the most important electrical component in almost every electronic circuit, it can limit current to any load such as led, transistor, opamp, etc. We must read resistor color code if we want to know the resistive value, tolerance, temperature coefficient. Resistors have different color bands (3,4,5,6) the more color bands the more resistor's information.Now let's start with 3 bands resistor color code.

The above resistor has only 3 bands First digit, Second digit, and multiply. A 3 bands resistor color code has fixed +/-20% tolerance that means if color code value is 1,000 ohms the real life resistive value may be +/- 200 ohms.
4 band resistor color code

A 4 bands resistor color code has tolerance value color strip, the resistor on an above picture has 5% tolerance. This type of resistor uses in a regular circuit such as television,radio,washing machine.

5 bands resistor color code

A 5 bands resistor color codes have third digit color bands.
1(first digit) 0(second dig…

### Hello, today I will show you how to make an IR toggle switch with Arduino and a Mosfet, it has far more detection range than capacitive touch device and easy to build. The circuit is easy to use and use minimal components to make a job done, now let's start

Components list:
R1 = 100 ohms resistor
R2 = 470 Kilo-ohms resistor
R3 = 10 Kilo-ohms resistor
R4 =1000 ohms or 1 kilo-ohms
IR1 = infrared led
IRR1 = infrared receiver
led = low forward voltage led, you can find it on any electronic part store
Tube1 =Shrink tubing
1 x irf9540n p-type Mosfet

If you have the components I list ready, it's time to upload this code to your Arduino UNO r3

/* switch
*
* Each time the input pin goes from LOW to HIGH (e.g. because of a push-button
* press), the output pin is toggled from LOW to HIGH or HIGH to LOW.  There's
* a minimum delay between toggles to debounce the circuit (i.e. to ignore
* noise).
*
* David A. Mellis
* 21 November 2006
* little edit by easyandworkproject.xyz
*16 January 2018
*/

int inPin = 2;         // the number of the input pin
int outPin = 13;       // the number of the output pin

int state = LOW;      // the current state of the output pin *change it from high to low because the circuit turn on when connecting to a power supply
int reading;           // the current reading from the input pin
int previous = HIGH;    // the previous reading from the input pin

// the follow variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long time = 0;         // the last time the output pin was toggled
long debounce = 200;   // the debounce time, increase if the output flickers

void setup()
{
pinMode(inPin, INPUT);
pinMode(outPin, OUTPUT);
}

void loop()
{

// if the input just went from LOW and HIGH and we've waited long enough
// to ignore any noise on the circuit, toggle the output pin and remember
// the time
if (reading == HIGH && previous == LOW && millis() - time > debounce) {
if (state == HIGH)
state = LOW;
else
state = HIGH;

time = millis();
}

digitalWrite(outPin, state);