Cluster 1: Adventures in Embedded Computer Systems July 2008 Electrical Brain Stimulation Using Modulation of Pulse Width and Frequency of Light-Emitting.

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 8 Pulse Width Modulation (PWM)
Advertisements

Lab7: Introduction to Arduino
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
Microprocessor Motor Control Spring Introduction  Stamp projects Robots  Sensors  Motor control  Logic Rocketry  Reading acceleration (“g”
Programming Types of Testing.
Motor Control Lab Using Altera Nano FPGA
Automatic Holiday Light Display. Goal of Experiment Design an automatic light display in which a set of blinking lights (LEDs) turns on as the amount.
P08009 Audible Memo Board Phase II Friday, February 22, 2008 P08009: Audible Memo Board Phase II Sponsor: Dr. Hopkins Advisor: Professor Slack Jon GosligaElectrical.
Introduction.
Lecture – 7 Basic input and output
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Traffic Light Controller By: Candace Lee And Nayeon Kim Instructors: Rajesh Gupta, Choon Kim, Shirley Miranda, Bridget Benson, Arash Arafee Cluster 1:
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Pulse Width Modulation (PWM) LED Dimmer Circuit
LSU 06/04/2007BASIC Stamp Editor1 The BASIC Stamp Editor Programming Unit, Lecture 3.
Traffic Light Synchronization by: Avneesh Kohli, Eric Harmatz, and Govil Gupta.
Statement of Purpose: To program an incremental counter using the PSoC Designer 5.0, Imagecraft, the programming language C, the PSoCEval USB CY3214 circuit.
In this PPT, all the materials covered up for the PIC microcontroller set-up would be studied. Preliminary skills: Knowing of basic C grammar and basic.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Testbed: Exercises.
EMBEDDED WEB SERVER. CONTENT: 1.ABSTRACT 2.INTRODUCTION TO EMBEDDED SYSTEMS 3.INTRODUCTION TO EMBEDDED WEB SERVER 4.BLOCK DIAGRAM 5.POER SUPPLY 6.COMPONENT.
Tilt Controlled Vehicle Hardware In this project, I utilized two CY3209-ExpressEVK kits and one CY3214 PSoCEval USB kit. Software The source code for the.
Dean Brock, Rebecca Bruce and Susan Reiser, CCSC SE 2009 Using Arduino Material taken from Todbot blog Bionic Arduino Todbot blog Bionic ArduinoTodbot.
A Single Octave 32 kHz Auditory Output Device By: Erick Ruiz and Jeffrey Rollman Research Problems: -Can a PSoC device be programmed to allow for auditory.
Peripherals and their Control An overview of industrially available “peripheral devices” that use “pulse-width modulation” for information passing. Review.
Introduction to Interfacing Projects Nareen Khan.
Automatic Holiday Light Display. Goal of Experiment Design an automatic light display in which a set of blinking lights (LEDs) turns on as the amount.
Software Programmed in C 1. lightCycle: Function that cycles the lights when the CapSense is activated, cycles lights from Red to Green. 2. If, else: Determines.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
MCU: Interrupts and Timers Ganesh Pitchiah. What’s an MCU ?
Your brain is made up of billions of brain cells called neurons, which use electricity to communicate with each other. The combination of millions of neurons.
University of Wisconsin – Madison University of Wisconsin – Madison Engineering Projects In Community Service BIOFEEDBACK / STRESS MANAGEMENT May 9, 2001.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
INTRODUCTION TO COMPUTER CHAPTER N0 2 INPUT & INPUT & OUTPUT DEVICES OUTPUT DEVICES INSTRUCTOR: ADEEL ANJUM ADEEL ANJUM.
The George Washington University School of Engineering and Applied Science Department of Electrical and Computer Engineering ECE122 – 30 Lab 3: Layout.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
Jerk the Bear In order to explore the possiblities of the integration of capacitative sensors in consumer products, we implemented capsense technology.
The Software Development Process
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
RTLS. LOCATING / POSITIONING SYSTEMS A positioning system is a mechanism for determining the location of an object in space Interplanetary systems Global.
July 18, UCSD - R.A. de Callafon Short Intro to Micro Processors and I/O functions of our Kinetic Sculpture Control Box Raymond de Callafon.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class3/Lab 2.
A Single Octave 32 kHz Auditory Output Device. By: Erick Ruiz Jeffrey Rollman UCSD COSMOS Cluster 1-Adventures in Embedded Computer Systems August 1,
HARDWARE DEVICES TOBY WILSON. HARDWARE DEVICES InputOutputStorage KeyboardMonitorsExternal Hard Disk MicePrintersFlash Drives Graphics TabletSpeakers.
Closed Loop Temperature Control Circuit with LCD Display Mike Wooldridge ECE 4330 Embedded Systems.
BLDC Motor Speed Control with RPM Display. Introduction BLDC Motor Speed Control with RPM Display  The main objective of this.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Arduino Based DC Motor Speed Control
Embedded C- Language Lets Learn fundamentals !!. An Embedded system is combination of computer hardware and software, and perhaps additional mechanical.
ARM CORTEX (STM32) BASED MOTOR SPEED CONTROL SUBMITTED BY EDGEFX TEAM.
Application Case Study Christmas Lights Controller
Lets Learn fundamentals !!
ARDUINO BASED UNDERGROUND CABLE FAULT DETECTION
Application Case Study Security Camera Controller
Arduino Based Industrial appliances control system by decoding dual tone multi frequency signals on GSM / CDMA network. Submitted by:
Home automation using Arduino & ‘PIR sensor’
Val Manes Department of Math & Computer Science
REMOTE JAMMING DEVICE.
Using the BBC micro:bit to Create a Flood Warning System
Introduction to Arduino Microcontrollers
Programmable Logic Devices: CPLDs and FPGAs with VHDL Design
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
An Introduction to VEX IQ Programming with Modkit
Copier Jam Detector Design Problem
Introduction Software Hardware
UNIT 11: RC-SERVOMOTOR CONTROL
Traffic Light Synchronization
♪ Embedded System Design: Synthesizing Music Using Programmable Logic
Presentation transcript:

Cluster 1: Adventures in Embedded Computer Systems July 2008 Electrical Brain Stimulation Using Modulation of Pulse Width and Frequency of Light-Emitting Diodes By Jennifer Fang and Sidra Hussain Procedures 1. Obtain two CY8C LFXI boards. 2. First board: open a new chip-level project in the programmable-system-on-a- chip (PSoC) Designer 5 for the CY8C LFXI. Select “C” as the language to generate main. 3. Place a CSD in the project. Complete the CSD wizard depending on number of sliders and sensors to use. 4. Place an LCD module in the project. Assign the LCD to port Generate the library files. 6. In the pin layout, set the output drive for port 2, pins 0, 1, 2, and 3 to “pull down.” 7. Use if statements to determine which sensor is been touched. Change the value of a pin in port 2 depending on which sensor is touched. See source code. 8. Use a bar graph to track the options for frequencies of the blinking (beta, alpha, theta, delta, in that order by frequency high to low). 9. Compile, build, test, debug, and repeat. 10. Program the first board (either of the two work). 11. Wire port 0_5 to port 1_ Second board: open a new chip-level project in PSoC Designer 5 for the CY8C LFXI. Select “C” as the language to generate main. 13. Place two 16-bit pulse width modulators (PWM16) into the project. 14. Assign values in the PWM properties and schematic. 15. Place an LCD in the project. Assign it to port four. 16. Assign the output drive of port 2 pins 0, 1, 2, and 3 to “pull down.” 17. Generate library files. 18. Initialize variables and the LCD. 19. Read the value from port Use if statements do determine which state to set PWM to. See source code. 21. Set period and pulse width values for each state. Pulse widths should be a third of the period. See source code. 22. Set LCD position. Print state name and description on LCD. 23. Compile, build, test, debug, and repeat. 24.Connect port 2 pins 0, 1, 2, and 3 to each other on each board to each other. 25. Attach LEDs to goggles. Connect to output on board using wires. 26. Power the boards. Test device overall. Instructors Rajesh Gupta, Choon Kim, Shirley Miranda, Bridget Benson, and Arash Arfaee Background Electroencephalography, the basis of the brain stimulating technology, allows the brain's electrical vibrations to be measured and recorded. The frequencies of the vibrations for this project, ranging from about 0.5 to 30 Hz, have been classified into four states. Each state correlates with a different state of mind, and exposing the brain to these frequencies induces the brain into these states to bring about certain mental effects. The four states we use are delta, theta, alpha, and beta. Delta, which ranges from 0.5 to 4 Hz, is the dominant frequency during deep sleep. Therefore, research shows that being exposed to delta frequencies causes dream-like hallucinations. It also brings a feeling of calmness that can replace a few hours of sleep. Theta, which ranges from 4 to 8 Hz, is dominant during the first stages of sleep. This setting causes drowsiness or deep relaxation similar to meditation and is said to allow people to achieve the effects of Zen meditation in a matter of minutes rather than years. Alpha, which ranges from 8 to 14 Hz, relaxes and calms the user. Finally, beta, which ranges from 14 to 30 Hz, is dominant when a person is alert. Exposing the brain to one of these frequencies in the form of blinking lights or buzzing noises is a milder version of this technology than directly running a current to the brain. Hardware Our electrical brain stimulator, which we call Electropam, is a device that induces alertness, calmness, sleep, or dreams. The Electropam is a pair of safety goggles fitted with six light-emitting diodes connected to two programmable- system-on-a-chip (PSoC) CY3214 circuit boards. Each eye of the goggles has two red light-emitting diodes (LEDs) and one green LED affixed to the lens in a triangular pattern. The LEDs are connected to the breadboard of one circuit board using extended wires. That circuit board (B) is then directly connected to the second board (A) through wires linking the ports. The reason we chose to separate the boards is because the user modules (capacitive sensor, or cap-sense, and pulse width modulators, or PWMs) did not fit on the same chip when programming. Board A allows the user to select which state is currently on using the cap-sense slider, where every two sensors is one choice and four bars are drawn on board A’s liquid crystal display (LCD) for each state and the selected setting shown on board B’s LCD. Board B uses pulse width modulation to control the blinking of the attached LEDs. When a person then puts on the goggles for, on average, twenty minutes in the absence of noise, he or she will experience a calming sensation that varys based on which option has been selected. For the individual parts of the circuit, the main focus of this project includes the cap-sense slider and PWM. The cap-sense slider is made of a layer containing an electrical charge whose sensitivity is changeable. It detects a touch when a user’s finger approaches the sensors, transferring some of the electrical charge to the user and disrupting the electrical field. Because the input to the cap- sense must remove some electrical charge in order to be detected, objects such as styluses do not work on it, making a finger the most logical and accessible input choice. The PWM controls the frequency by changing the period and high time, which is the length of time the modulator is on. The actual implementation of the PWM is explained in the software. Full Setup Settings Beta-AlertnessAlpha-Calmness Delta-Deep Sleep Theta-Drowsiness Conclusions After programming, testing, and debugging, the LEDs all blinked at the proper rates, although delta’s blinking is hard to see just by looking at the LEDs because it is so much faster than the rest. The device was able to induce relaxation on the proper settings. Using a changing value for the period that is proportional to the desired frequency and setting the pulse width to the period divided by a constant resulted in the LEDs blinking at the appropriate speeds. In tests, extended use of Electropam was able to induce sleep. We conclude that a device can be programmed to change states of mind with light stimulation, although actual time for a visible effect to take place varied from person to person. A possible extension of the project is to program the device to produce a buzzing sound at the required frequencies. This addition would require using a second pulse width modulator to make the sound audible, but the combined effect of sounds and lights would reduce the necessary exposure time for relaxation and increase the effectiveness by helping block out excess noise. Introduction The technology behind this device interested us because this method is a way to safely bring about certain beneficial mental states with no known side effects. When designing this device, we used existing researched and tested frequency data for certain mental states to pick which settings to program. This electrical brain stimulator, which we named Electropam, would help people in today’s tense life to reduce stress by inducing a state of calm or help insomniacs induce sleep. Other frequencies for more states are available but were not included our project. Source Code #include #include "PSoCAPI.h" unsigned char capsense; int i; void main() { M8C_EnableGInt; LCD_1_Start(); LCD_1_Init(); LCD_1_Position(0,0); LCD_1_PrCString(" The Electropam "); PWM16_1_Start(); while(1) { capsense = PRT1DR; if(capsense) { if(capsense&0x01) { //beta(14) PWM16_1_WritePeriod(38781); PWM16_1_WritePulseWidth(12927); PWM16_1_Start(); LCD_1_Position(1,0); LCD_1_PrCString("Beta-Alertness "); } else if(capsense&0x02) { //alpha(9.5) PWM16_1_WritePeriod(26316); PWM16_1_WritePulseWidth(8772); PWM16_1_Start(); LCD_1_Position(1,0); LCD_1_PrCString("Alpha-Calmness "); } else if(capsense&0x04) { //theta(4.5) PWM16_1_WritePeriod(12466); PWM16_1_WritePulseWidth(4155); PWM16_1_Start(); LCD_1_Position(1,0); LCD_1_PrCString("Theta-Drowsiness"); } else if(capsense&0x08) { //delta(2.5) PWM16_1_WritePeriod(6925); PWM16_1_WritePulseWidth(2308); PWM16_1_Start(); LCD_1_Position(1,0); LCD_1_PrCString("Delta-Deep Sleep"); } } //end outer if } //end while } //end main Board B #include #include "PSoCAPI.h" void main() { int numPixels, i; numPixels = 0; LCD_1_Start(); M8C_EnableGInt; CSD_1_Start(); LCD_1_Position(0, 0); LCD_1_PrCString("Freq. Level:H->L"); CSD_1_InitializeBaselines(); CSD_1_SetDefaultFingerThresholds(); LCD_1_InitBG(0); while(1) { CSD_1_ScanAllSensors(); CSD_1_UpdateAllBaselines(); //detect if any sensor is pressed if(CSD_1_bIsAnySensorActive()) { if(CSD_1_bIsSensorActive(0) && CSD_1_bIsSensorActive(1)) { numPixels = 0; PRT0DR = 0x01; } else if(CSD_1_bIsSensorActive(2)) { numPixels = 10; PRT2DR = 0x01; } else if(CSD_1_bIsSensorActive(3)) { numPixels = 20; PRT2DR = 0x02; } else if(CSD_1_bIsSensorActive(4)) { numPixels = 30; PRT2DR = 0x04; } else if(CSD_1_bIsSensorActive(5)) { numPixels = 40; PRT2DR = 0x08; } else if(CSD_1_bIsSensorActive(6)) { numPixels = 50; PRT2DR = 0x10; } else if(CSD_1_bIsSensorActive(7)) { numPixels = 60; PRT2DR = 0x20; } else if(CSD_1_bIsSensorActive(8)) { numPixels = 70; PRT2DR = 0x40; } else if(CSD_1_bIsSensorActive(9)) { numPixels = 80; PRT2DR = 0x80; } else { numPixels = 0; PRT0DR = 0x01; } LCD_1_DrawBG(1, 0, 16, numPixels); } //end big if } //while } //end main Board A Software To design the Electropam, we used the PSoC Designer 5 software and chip-level programming. Our main code was written in C, as shown below in the source code. We used multiple if-else statements to determine which frequency and pulse width to apply to each setting. To control which mode the Electropam is on, we programmed the cap-sense slider on board A to send information to board B by storing the data in port 2 pins 0, 1, 2, and 3 and sending it to the respective pins of port 1 on board B. In the same board A code each if statement draws four bars per setting. In each if statement, we checked a separate pin using bitwise operations. The mask for the pin corresponding to the last sensor that was touched evaluates true. The control then passes to the body of the if statement where the frequency and pulse width are determined and set. To make the LEDs blink at a speed slow enough to be visible, we set the pulse width to a third of the period. The LCD is programmed to display which frequency is currently selected.