In this quick guide I tell you how to make a small LED flicker in all kinds of frequencies and duty cycles. You can look into the flickering LED and test yourself if you are susceptible to flicker. You could isolate the frequencies that trigger you. Then you could confront doctors with your findings. Or you can test your flicker detecting equipment for how well it actually detects.
What you need:
- Raspberry Pi
- PIN LED
- 330 Ohm resistor ("330R")
- some cables to connect everything, preferably male-female jumper wires
The Raspberry Pi is the most expensive item on this list. All other items are pretty cheap.
What to do:
Get Raspbian from https://www.raspberrypi.org/downloads/ and put it onto an SD card (MicroSD for current Raspberries). If you need help I can expand this section.
If you do not want to look at the Raspberry's video output (for me it is worse than Windows), enable SSH by creating an empty file called "SSH" on the fat32 boot partition (it is the first, smaller one). You can then connect the Raspberry with a cable to your LAN and log in via SSH, e.g. by using the software "PuTTY" (https://www.chiark.greenend.org.uk/~sgtatham/putty/) . Linux/Unix users just type "ssh firstname.lastname@example.org". Whatever your Pi's LAN IP is. You can find out by looking into your router's web interface. The username is "pi", the password is "raspberry".
Follow the instructions at http://abyz.me.uk/rpi/pigpio/download.html to download, compile, and install the software we need to create hardware PWM. It is a lot faster than any of the software PWM methods you can find all over the Internet.
Connect everything to the breadboard.
To understand how a breadboard works and how exactly you should connect the parts, have a look at this short tutorial: https://thepihut.com/blogs/raspberry-pi-tutorials/27968772-turning-on-an-led-with-your-raspberry-pis-gpio-pins
The section "The Code" which tells about python code is not needed.
Type "sudo pigpiod" to activate the daemon we need for the software to work. To have it running automatically upon boot,
type "sudo systemctl enable pigpiod" put the command into /etc/rc.local (see https://www.raspberrypi.org/documentation/linux/usage/rc-local.md).
Now you can make the LED flicker, which is actually pretty easy:
pigs hp 18 1 500000
This makes the LED flicker at 1 Hz and 50% duty cycle. Which means it has power for half a second, 1 times a second. "18" is the GPIO pin our circuit is connected to. Just remember to always add 4 zeroes to your percentage. http://abyz.me.uk/rpi/pigpio/pigs.html#HP
You can use this setup to drive the flicker frequency up to multiple MHz. The above link says up to 30 MHz are possible.
To make sure the red and green status LEDs do not bother you, you can turn them off at boot by putting the following two lines into /etc/rc.local (as root):
echo 0 > /sys/class/leds/led0/brightness
echo 0 > /sys/class/leds/led1/brightness