Showing posts with label electronics circuits. Show all posts
Showing posts with label electronics circuits. Show all posts

Thursday, 26 March 2015

brain wave controled robot with mindwave headset

 brainwave controled robot

In this tutorial we discuss about how to control ur robot with ur brain
 components need 
  • arduino board (i used arduino uno)
  • driver ic (l293d)
  • mind wave head set
  • dc motor
  • battery
  • robot chasis
  • pc or laptop(must have bluetooth)
software needed
  • arduino ide
  • mindwave mobile
  • communication bridge
steps,,,
  • install mindwave mobile on your pc
  • install arduino ide
make the body of robot
         


the green coloured board is the motor driver module ,u can buy it as it is or make this with the l293d 

connect the driver with the 9,10,11,12 pins of arduino 



now your robot is ready , 
now you can control your robot with your attention,,,!!!!! is it cool?????
for that u want the mindwave headset



         switch on ur head set and pair it with ur computer or laptop, the name of the device is mindwavemobile
  • open mind wave mobile on your pc
then u will get a window like this

select brainwave visualiser



make sure ur headset is turned on,, ten place it on ur head
then u can see ur attention level and meditation level
                              according to this attention level u can control ur robot speed,,
more your attention more your speed.
                       for that open arduino ide and paste the code below
int i;
int x;
void setup() { 
 pinMode(13,OUTPUT);
  pinMode(9, OUTPUT);   
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
pinMode(12,OUTPUT);
Serial.begin(9600);

}
void loop() 

{ if(Serial.available())
{
  x=Serial.read();
if(x<30)
{
for(i=255;i>4;i--)
{digitalWrite(13,LOW);
  delay(10);
   analogWrite(10,i);
   analogWrite(11,i);
}
}
   if(x>30)
{
for(i=5;i<256;i++)
{digitalWrite(13,LOW);
  delay(10);
   analogWrite(10,i);
   analogWrite(11,i);
}}
}}

connect arduino with your pc
upload this sketch to arduino board

after this open the communication bridge ,,

select ports for ur neurosky and arduino.you can find the ports from the device manager

click done .
now u can see ur robot speed is changing according to your attention level.
u can see the graphical representation also.
 now start fighting with your friends,,, check who have more attention.



Wednesday, 19 November 2014

light intensity sensor using arduino

 * led will glow according to the intensity of light
components required
  • arduino uno
  • ldr
  • led
  • 10k resistor
  • wires
code
 


int sensorPin = A0;  
int ledPin = 13; 
int ledPin2 = 12;
int ledPin3= 11;
int ledPin4= 10;
int p = 0; 

void setup() {
  // declare the ledPin as an OUTPUT:
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);  
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3,OUTPUT);
  pinMode(ledPin4,OUTPUT);
}

void loop() {
  // read the value from the sensor:
  p = analogRead(sensorPin);    
  // turn the ledPin on
  Serial.println(p);
if(p<820) 
  {
    digitalWrite(ledPin,p);
    digitalWrite(ledPin3,HIGH);
    digitalWrite(ledPin2, HIGH);
    digitalWrite(ledPin4,HIGH);
  }
  else
  {
   
    
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin3,HIGH);
    digitalWrite(ledPin4,HIGH);}
    if(p<850) //
    { }
    
    else
    { digitalWrite(ledPin3,LOW);
    digitalWrite(ledPin2, LOW);
    digitalWrite(ledPin, LOW);
    digitalWrite(ledPin4,HIGH);
    
 
  }
  if(p>870)
  {digitalWrite(ledPin4,LOW);
  digitalWrite(ledPin,LOW);
  }
}
  
connections
  • connect the led to the arduino board pins(13,12,11,10)
  • connect a 10 k resistor in series with the ldr,
  • connect the free end of resistor to the +5v pin of arduino
  • connect the free end of ldr to ground
  • connect the a0 pin to the ldr 
  • connect all the -ve terminal of led to ground
  • connect arduin to pc 
  • run the code


 
 
 TIP:- u can change the values according to ur surroundings
       :- open serial monitor for viewing the ldr values.( tools->serial monitor)

Saturday, 15 November 2014

simple 7 segment display driver using arduino uno

simple 7 segment display driver using arduino uno
                  Here is a simple code for arduino for driving a 7 segment display.
                     
     arduino 

                                                                                                      disply
   
                          code



            int timer = 500;           // The higher the number, the slower the timing.

void setup() {
  // use a for loop to initialize each pin as an output:
  for (int thisPin = 0; thisPin < 14; thisPin++)  {
    pinMode(thisPin, OUTPUT);    
  }
}

void loop() {
  // loop from the lowest pin to the highest:
  for (int thisPin = 0; thisPin < 14; thisPin++) {
    // turn the pin on:
    digitalWrite(thisPin, HIGH);
    delay(timer);                
    // turn the pin off:
    digitalWrite(thisPin, LOW);
 delay(timer);  
  }

  // loop from the highest pin to the lowest:
  for (int thisPin = 7; thisPin >= 2; thisPin--) {
    // turn the pin on:
    digitalWrite(thisPin, HIGH);
    delay(timer);
    // turn the pin off:
    digitalWrite(thisPin, LOW);
  }
}

Here this code uses for loop for the selection of o/p pins and also for the state of each pin
steps

  • connect the ground and vcc of the display to the grnd and the +5v pin of arduino respectively.
  • connect the a,b,c,d,e,f, pin of ur display to the output pins(1-13) of arduino. ( u can connect it in any order as u like)
  • connect ur arduino to ur lap or pc
  • coppy the lnk above and paste it to the arduino Ide
  • upload the programme 

Friday, 24 October 2014

flex sensor with aurdino

 flex sensor with  aurdinoundefined
On this tutorial, we will use the Arduino to read a flex sensor. The flex sensor is a device that changes its resistance proportional to its form, like this:
If the sensor is straight, it outputs 30k, it is flexed, 50k. With an Arduino board, make this circuit:
The resistor makes a voltage divider to make the reading possible. The analog input A0 is our signal.
Open the Arduino IDE and upload the following code. This code shows how many degrees the sensor is flexed.
// Flex sensor test program
// Mike Grusin, SFE, 2011
// This program is free, use it however you wish!
// HARDWARE:
// Make the following connections between the Arduino and the flex sensor
// Note that the flex sensor pins are interchangeable
// Sensor pin - GND
// Sensor pin - Analog In 0, with 10K resistor to +5V
// INSTRUCTIONS:
// Upload this sketch to your Arduino, then activate the Serial Monitor
// (set the Serial Monitor to 9600 baud)
void setup()
{
    // initialize serial communications
    Serial.begin(9600); 
}
void loop()
{
    int sensor, degrees;

    // read the voltage from the voltage divider (sensor plus resistor)
    sensor = analogRead(0);

    // convert the voltage reading to inches
    // the first two numbers are the sensor values for straight (768) and bent (853)
    // the second two numbers are the degree readings we'll map that to (0 to 90 degrees)
degrees = map(sensor, 768, 853, 0, 90);
    // note that the above numbers are ideal, your sensor's values will vary
    // to improve the accuracy, run the program, note your sensor's analog values
    // when it's straight and bent, and insert those values into the above function.

    // print out the result
    Serial.print("analog input: ");
    Serial.print(sensor,DEC);
    Serial.print(" degrees: ");
    Serial.println(degrees,DEC);

    // pause before taking the next reading
    delay(100); 
}
Upload the code and open the serial monitor to see the results.
That's it!

Tuesday, 14 October 2014

Simple Mobile Jammer

Simple Mobile Jammer Circuit Diagram:

Mobile Jammer Circuit Diagram
Simple Mobile Jammer Circuit Diagram

Cell Phone Jammer Circuit Explanation:

  • If you understand the above circuit, this circuit analysis is simple and easy. For any jammer circuit, remember that there are three main important circuits. When they are combined together, the output of that circuit will work as a jammer. The three circuits are
    1. RF amplifier.
    2. Voltage controlled oscillator.
    3. Tuning circuit.
  • So the transistor Q1, capacitors C4 & C5 and resistor R1 constitute the RF amplifier circuit. This will amplify the signal generated by the tuned circuit. The amplification signal is given to the antenna through C6 capacitor. Capacitor C6 will remove the DC and allow only the AC signal which is transmitted in the air.
  • When the transistor Q1 is turned ON, the tuned circuit at the collector will get turned ON. The tuned circuit consists of capacitor C1 and inductor L1. This tuned circuit will act as an oscillator with zero resistance.
  • This oscillator or tuned circuit will produce the very high frequency with minimum damping. The both inductor and capacitor of tuned circuit will oscillate at its resonating frequency.
  • The tuned circuit operation is very simple and easy to understand. When the circuit gets ON, the voltage is stored by the capacitor according to its capacity. The main function of capacitor is to store electric energy. Once the capacitor is completely charged, it will allow the charge to flow through inductor. We know that inductor is used to store magnetic energy. When the current is flowing across the inductor, it will store the magnetic energy by this voltage across the capacitor and will get decreased, at some point complete magnetic energy is stored by inductor and the charge or voltage across the capacitor will be zero. The magnetic charge through the inductor will decreased and the current will charge the capacitor in opposite or reverse polarity manner. Again after some period of time, capacitor will get completely charged and magnetic energy across the inductor will be completely zero. Again the capacitor will give charge to the inductor and becomes zero. After some time, inductor will give charge to capacitor and become zero and they will oscillate and generate the frequency.
  • This circle run upto the internal resistance is generated and oscillations will get stop. RF amplifier feed is given through the capacitor C5 to the collector terminal before C6 for gain or like a boost signal to the tuned circuit signal. The capacitors C2 and C3 are used for generating the noise for the frequency generated by the tuned circuit. Capacitors C2 and C3 will generate the electronic pulses in some random fashion (technically called noise).
  • The feedback back or boost given by the RF amplifier, frequency generated by the tuned circuit, the noise signal generated by the capacitors C2 and C3 will be combined, amplified and transmitted to the air.
  • Cell phone works at the frequency of 450 MHz frequency. To block this 450MHz frequency, we also need to generate 450Mhz frequency with some noise which will act as simple blocking signal, because cell phone receiver will not be able to understand to which signal it has been received. By this, we can able to block the cell phone signal from reaching the cell phones.
  • So here in the above circuit, we generated the 450 MHz frequency to block the actual cell phone signal. That’s what the above circuit will act as a jammer for blocking the actual signal.

Sunday, 17 August 2014

Simple combination lock

Simple combination lock


PARTS AND MATERIALS
  • 4001 quad NOR gate (Radio Shack catalog # 276-2401)
  • 4070 quad XOR gate (Radio Shack catalog # 900-6906)
  • Two, eight-position DIP switches (Radio Shack catalog # 275-1301)
  • Two light-emitting diodes (Radio Shack catalog # 276-026 or equivalent)
  • Four 1N914 "switching" diodes (Radio Shack catalog # 276-1122)
  • Ten 10 kΩ resistors
  • Two 470 Ω resistors
  • Pushbutton switch, normally open (Radio Shack catalog # 275-1556)
  • Two 6 volt batteries
Caution! Both the 4001 and 4070 ICs are CMOS, and therefore sensitive to static electricity!
This experiment may be built using only one 8-position DIP switch, but the concept is easier to understand if two switch assemblies are used. The idea is, one switch acts to hold the correct code for unlocking the lock, while the other switch serves as a data entry point for the person trying to open the lock. In real life, of course, the switch assembly with the "key" code set on it must be hidden from the sight of the person opening the lock, which means it must be physically located elsewhere from where the data entry switch assembly is. This requires two switch assemblies. However, if you understand this concept clearly, you may build a working circuit with only one 8-position switch, using the left four switches for data entry and the right four switches to hold the "key" code.
For extra effect, choose different colors of LED: green for "Go" and red for "No go."


CROSS-REFERENCES
Lessons In Electric Circuits, Volume 4, chapter 3: "Logic Gates"


LEARNING OBJECTIVES
  • Using XOR gates as bit comparators
  • How to build simple gate functions with diodes and a pullup/down resistor
  • Using NOR gates as controlled inverters


SCHEMATIC DIAGRAM


ILLUSTRATION


INSTRUCTIONS
This circuit illustrates the use of XOR (Exclusive-OR) gates as bit comparators. Four of these XOR gates compare the respective bits of two 4-bit binary numbers, each number "entered" into the circuit via a set of switches. If the two numbers match, bit for bit, the green "Go" LED will light up when the "Enter" pushbutton switch is pressed. If the two numbers do not exactly match, the red "No go" LED will light up when the "Enter" pushbutton is pressed.
Because four bits provides a mere sixteen possible combinations, this lock circuit is not very sophisticated. If it were used in a real application such as a home security system, the "No go" output would have to be connected to some kind of siren or other alarming device, so that the entry of an incorrect code would deter an unauthorized person from attempting another code entry. Otherwise, it would not take much time to try all combinations (0000 through 1111) until the correct one was found! In this experiment, I do not describe how to work this circuit into a real security system or lock mechanism, but only how to make it recognize a pre-entered code.
The "key" code that must be matched at the data entry switch array should be hidden from view, of course. If this were part of a real security system, the data entry switch assembly would be located outside the door, and the key code switch assembly behind the door with the rest of the circuitry. In this experiment, you will likely locate the two switch assemblies on two different breadboards, but it is entirely possible to build the circuit using just a single (8-position) DIP switch assembly. Again, the purpose of the experiment is not to make a real security system, but merely to introduce you to the principle of XOR gate code comparison.
It is the nature of an XOR gate to output a "high" (1) signal if the input signals are not the same logic state. The four XOR gates' output terminals are connected through a diode network which functions as a four-input OR gate: if any of the four XOR gates outputs a "high" signal -- indicating that the entered code and the key code are not identical -- then a "high" signal will be passed on to the NOR gate logic. If the two 4-bit codes are identical, then none of the XOR gate outputs will be "high," and the pull-down resistor connected to the common sides of the diodes will provide a "low" signal state to the NOR logic.
The NOR gate logic performs a simple task: prevent either of the LEDs from turning on if the "Enter" pushbutton is not pressed. Only when this pushbutton is pressed can either of the LEDs energize. If the Enter switch is pressed and the XOR outputs are all "low," the "Go" LED will light up, indicating that the correct code has been entered. If the Enter switch is pressed and any of the XOR outputs are "high," the "No go" LED will light up, indicating that an incorrect code has been entered. Again, if this were a real security system, it would be wise to have the "No go" output do something that deters an unauthorized person from discovering the correct code by trial-and-error. In other words, there should be some sort of penalty for entering an incorrect code. Let your imagination guide your design of this detail!

LED sequencer

LED sequencer


PARTS AND MATERIALS
  • 4017 decade counter/divider (Radio Shack catalog # 276-2417)
  • 555 timer IC (Radio Shack catalog # 276-1723
  • Ten-segment bargraph LED (Radio Shack catalog # 276-081)
  • One SPST switch
  • One 6 volt battery
  • 10 kΩ resistor
  • 1 MΩ resistor
  • 0.1 µF capacitor (Radio Shack catalog # 272-135 or equivalent)
  • Coupling capacitor, 0.047 to 0.001 µF
  • Ten 470 Ω resistors
  • Audio detector with headphones
Caution! The 4017 IC is CMOS, and therefore sensitive to static electricity!
Any single-pole, single-throw switch is adequate. A household light switch will work fine, and is readily available at any hardware store.
The audio detector will be used to assess signal frequency. If you have access to an oscilloscope, the audio detector is unnecessary.

LEARNING OBJECTIVES
  • Use of a 555 timer circuit to produce "clock" pulses (astable multivibrator)
  • Use of a 4017 decade counter/divider circuit to produce a sequence of pulses
  • Use of a 4017 decade counter/divider circuit for frequency division
  • Using a frequency divider and timepiece (watch) to measure frequency
  • Purpose of a "pulldown" resistor
  • Learn the effects of switch contact "bounce" on digital circuits
  • Use of a 555 timer circuit to "debounce" a mechanical switch (monostable multivibrator)


SCHEMATIC DIAGRAM

Sunday, 27 July 2014

RAIN DETECTOR

RAIN DETECTOR

Schematic

This is the schematic of the Rain Detector


Part
Total Qty.
Description
Substitutions
R111K 1/4 W Resistor
R21680 Ohm 1/4 W Resistor
D111N4001 Silicon Diode
BZ1112V Buzzer
S11SPST Switch
SCR11C106B1 SCR106CY
SENSOR1See Notes
MISC1Board, Wire, Case, PC Board (For Sensor)

Thursday, 24 July 2014

ACCELEROMETER CONTROL USING ARDUINO-PRGM CODE AND SCHEMATIC


Here are the pin connections for the configuration shown above:
Breakout Board PinSelf-TestZ-AxisY-AxisX-AxisGroundVDD
Arduino Analog Input Pin012345
Or, if you're using just the accelerometer:
ADXL3xx PinSelf-TestZOutYOutXOutGroundVDD
Arduino PinNone (unconnected)Analog Input 1Analog Input 2Analog Input 3GND5V

Code

/*
 ADXL3xx
 
 Reads an Analog Devices ADXL3xx accelerometer and communicates the
 acceleration to the computer.  The pins used are designed to be easily
 compatible with the breakout boards from Sparkfun, available from:
 http://www.sparkfun.com/commerce/categories.php?c=80

 http://www.arduino.cc/en/Tutorial/ADXL3xx

 The circuit:
 analog 0: accelerometer self test
 analog 1: z-axis
 analog 2: y-axis
 analog 3: x-axis
 analog 4: ground
 analog 5: vcc
 
 created 2 Jul 2008
 by David A. Mellis
 modified 30 Aug 2011
 by Tom Igoe 
 
 This example code is in the public domain.

*/


// these constants describe the pins. They won't change:
const int groundpin = 18;             // analog input pin 4 -- ground
const int powerpin = 19;              // analog input pin 5 -- voltage
const int xpin = A3;                  // x-axis of the accelerometer
const int ypin = A2;                  // y-axis
const int zpin = A1;                  // z-axis (only on 3-axis models)

void setup()
{
  // initialize the serial communications:
  Serial.begin(9600);
  
  // Provide ground and power by using the analog inputs as normal
  // digital pins.  This makes it possible to directly connect the
  // breakout board to the Arduino.  If you use the normal 5V and
  // GND pins on the Arduino, you can remove these lines.
  pinMode(groundpin, OUTPUT);
  pinMode(powerpin, OUTPUT);
  digitalWrite(groundpin, LOW); 
  digitalWrite(powerpin, HIGH);
}

void loop()
{
  // print the sensor values:
  Serial.print(analogRead(xpin));
  // print a tab between values:
  Serial.print("\t");
  Serial.print(analogRead(ypin));
  // print a tab between values:
  Serial.print("\t");
  Serial.print(analogRead(zpin));
  Serial.println();
  // delay before next reading:
  delay(100);
}