Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

How to Apply Brain waves to control an Appliance Using Relay (Part 9/13)

By Arpit jain

Brain waves to Control an Appliance Using Relay Motor

SUMMARY

Till now in the brain waves series, we have undertaken the experiments like GSM and alarm speaker. Now let us try further and move to more real time applications. It will be a good check on the reliability of the Brain wave module. 
 
In this article I am planning to go for some real time applications on Brain wave including Home Automation. This time I have tried to control an appliance using relay. Relay is just a switching device through which we can trigger both AC and DC appliance. Though it also depends on the maximum current that the relay can trigger and the total current our appliance needs.  I believe it will be nice to control home appliances just by thought and higher level of concentration. So let’s see more details about it.
 
Image Showing Home Appliances Controlled by Brain Wave
 
Fig. 1: Image Showing Home Appliances Controlled by Brain Wave
 
DESCRIPTION
 
As you know that we are getting the values of all the Brain wave types from our Arduino, our task here is just to find the wave which is most affected by alertness or concentration.  Alpha waves show us many variations according to our alertness.  So, we first check out the values of alpha waves at different alertness levels. I have tried my meditation level and then recorded them for testing purpose. While testing it on myself, I found that values of alpha waves cross 3 Lacs only when my concentration is highest. So I set the level of 3 Lacs in my arduino coding. We found out that alpha waves values from mindflex varies from 1 Lac to 10 Lacs and hence we set a level at 3 Lacs. Whenever the values were more than that we triggered the relay.
 
 
Block Diagram of MindFlex Brainwave Sensor based Home Automation System
Fig. 2: Block Diagram of MindFlex Brainwave Sensor based Home Automation System 
 

Hardware: Please find the attached circuit diagram of the connections that we need to establish. We have taken a pin from T pin of the mindflex sensor and connected that pin to the Rx pin of our Arduino UNO. Also, we have shorted the ground of both the Sensor and UNO by a wire. Please take special care while soldering anything to the Mindflex sensor as pins are very close to each other. After connection with the Mindflex, we just need to connect the relay to the arduino and then the appliance with that of relay. For more details about the Relay, you can check (here). Explaining it briefly, it has 5 pins out of which two are meant for supply of coil and remaining three are -Common pin , Normally connected pin and Normally open pin. When there is no supply to the coil, the common pin is connected to normally connected pin and when there is supply in the coil, the common pin gets connected with the normally open pin instead of normally connected. In our circuit, we have connected PIN12 of our arduino with the supply pin of relay. The other supply pin of relay is grounded.

Softwares : Let us come to the software part. We have been receiving   values from the sensor to our arduino via T pin. Once we have received the value at any particular point we can check if the values are above a certain point or not. Here in the following code, the value of the wave is stored in the variable num1 and then it is compared with 309999. When the values go above that, the PIN12 of arduino is triggered. 
 
Serial.print(“Val = “);
        Serial.println(num1);
         
        
       if (num1>309999)
       { if (digitalRead(12)==HIGH)
         {
           digitalWrite(12,LOW);
         }
         else if (digitalRead(12)==LOW)
         {
           digitalWrite(12,HIGH);
         }
         
       }
 
Few points to Note:
 
The sensor usually gives the strength from 60 – 80% due to its orientation and the spot where we place it. Try to keep the metal sensor exactly above your left eye.  I have also applied salt water at my forehead for better connectivity to the sensor.
 
The signal strength also disrupts about how we solder the wire to the T pin. Try to shield this wire and also make sure that the references probes are correctly connected. If you have any wire connected to the EEG pin of the sensor, please disconnect that wire as that will create much noise in the sensor values. Try this experiment and share your feedback. Stay tuned for our next experiment on operating dancing LEDs through brainwaves.
 

Project Source Code

###

//Program to 

// Arduino Brain Library - Brain Serial Test
 
// Description: Grabs brain data from the serial RX pin and sends CSV out over the TX pin (Half duplex.)
// More info: https://github.com/kitschpatrol/Arduino-Brain-Library
// Author: Eric Mika, 2010 revised in 2014
 
#include <Brain.h>
 
// Set up the brain parser, pass it the hardware serial object you want to listen on.
Brain brain(Serial);
//char a[400];
String a,a1;
int v = 0;
int z=0,output;
uint32_t num=0;
uint32_t num1=0;
void setup() {
    // Start the hardware serial.
    Serial.begin(9600);
     pinMode(12, OUTPUT);
     pinMode(11, OUTPUT);
     digitalWrite(12,HIGH);
}
 
void loop() {
    // Expect packets about once per second.
    // The .readCSV() function returns a string (well, char*) listing the most recent brain data, in the following format:
    // "signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma"    
    if (brain.update()) {
       // Serial.println(brain.readErrors());
       // Serial.println(brain.readCSV());
        //sprintf(a, "%c",brain.readCSV());
        a = brain.readCSV();
        v = a.indexOf(',');
        v = a.indexOf(',',v+1);
        v = a.indexOf(',',v+1);
        v = a.indexOf(',',v+1);
        z = a.indexOf(',',v+1);
        
        a1 = a.substring(v+1,z);
        num = a1.toInt();
         
        v = a.indexOf(',',z+1);
       
         
        a = a.substring(z+1,v);
         
        num1 = a.toInt();
        Serial.print("Val = ");
        Serial.println(num1);
         
        
       if (num1>309999)
       { if (digitalRead(12)==HIGH)
         {
           digitalWrite(12,LOW);
         }
         else if (digitalRead(12)==LOW)
         {
           digitalWrite(12,HIGH);
         }
         
       }
       // analogWrite(12,output)
        
        //brain.readCSV().toCharArray(a,200);
    }
}
 

###


Circuit Diagrams

Circuit-Diagram-MindFlex-Brainwave-Sensor-Home-Automation-System

Project Video


Filed Under: Electronic Projects

 

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • Introduction to Brain Waves & its Types (Part 1/13)

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • How to Draw/Display a BMP or PNG on 3.2" TFT Display with inbuilt ILI9341 IC
  • file edit
  • Making a ducted soldering fan?
  • 74HC595 creating Fake output
  • Pull up via GPIO

RSS Electro-Tech-Online.com Discussions

  • Need a ducted soldering fan for solder smoke extraction
  • Someone please explain how this BMS board is supposed to work?
  • How to search component to replace my burn RF inductor?
  • Question about ultrasonic mist maker
  • bluetooth jammer
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering