Light Inducing Seizure Warning System
by TechMartian in Circuits > Assistive Tech
1168 Views, 4 Favorites, 0 Comments
Light Inducing Seizure Warning System
In 1997, a Pokemon episode was banned since the flashing lights in the episode caused seizures in many Japanese Children. Inspired by this event, this is a photosensor mount on someone's glasses to detected the light sources in front of a subject that could be seizure inducing and send a warning signal to a user by buzzer.
BoM
* Arduino
* Photosensor
* Buzzer
Tools:
* Hot glue gun and hot glue
* Soldering Iron and solder
Soldering
Solder a voltage divider onto the photoresistor as shown above.
* Solder a 10kΩ resistor onto one of the terminals.
* On this same terminal, solder a wire.
* Solder another wire onto the other pin of the photresistor
Wiring
Follow the table below for the connections between of the photosensor and the buzzer to the Arduino
I/O | I/O pin | Arduino Pin |
---|---|---|
Photosensor | 1 | A0 |
Photosensor | 2 | GND** |
Buzzer* | 1 | 9 |
Buzzer* | 2 | GND** |
* Order of pins do not matter for the buzzer
** The Arduino board has at least 3 GND pins
Code and Upload
Upload the following code to the Arduino.
//cosntants for the pins where sensors are plugged into.
const int sensorPin = 0; const int buzzPin = 9;
unsigned long minute1; float time1;
//Set up some global variables for the light level an initial value. int dark; // initial value int lightVal; // light reading
void setup() { // We'll set up the LED pin to be an output. dark = 300; //we will take a single reading from the light sensor and store it in the lightCal //variable. This will give us a prelinary value to compare against in the loop }
void loop() {
lightVal = analogRead(sensorPin); // read the current light levels
//if lightVal is less than our initial reading withing a threshold then it is dark.
while (lightVal > dark) { // still sitting tone (buzzPin, 1000, 100); delay (100); noTone(buzzPin); } }
}