This protocol describes how to perform optogenetic experiments for controlling gene expression with red and far-red light using PhyB and PIF3. Included are step-by-step instructions for building a simple and flexible illumination system, which enables the control of gene expression or other optogenetics with a computer.