| Reference | Downloads | Github

Light flickering stimuli on LED bulb programmed by PsychoPy?

I am trying to create a critical flicker fusion experiment using PsychoPy. I will need to create a basic circuit with an LED light which flickers on and off at a given rate (i.e. 1000 times per second). I do not currently know how to use the software to program a light to do this, and then set up an experiment which will collect behavioral data on PsychoPy.
Participants would be given two stimuli, one after the other. This will be one light which is flickering at an extremely fast pace (35 cycles per second, on/off) and a light which is steady. The participant would have to select which light is flickering. If they get this correct, they would be given the next stimuli (faster flickering light if correct, and slower, if incorrect). This would be a standard staircase procedure.

Has anybody done anything similar to this? I would appreciate any input. Thank you.

For the circuit, you need some software to hardware interface. The easiest to get started with that is to use the popular Arduino microcontroller board. There is an enormous number of tutorials online to to get the results you want.

Shows how to send commands to the board and receive a response:

Shows how to blink an LED on/off, you can get the flicker frequency you want by adjusting delay times:

The Arduino is programmed using a C-like language, however, lots of the functionality for serial communication is built into an easy to use library. There are alternative boards out there that can be programmed with Python that deliver similar results like CircuitPython (

To communicate with the board via PscyhoPy, you can send command strings using the example Triggering from Serial port. From builder, you may need to use a “code component” to run the necessary commands (

1 Like