Arduino Screen Controller for Raspberry Pi Part 2 Hardware Prototype

A few months ago I setup a web browser based dashboard running on a Raspberry Pi, displaying weather, time and transit information.  It worked out well, but it’s success revealed another problem.  Turning the screen on and off multiple times a day was getting old.

So I did what any technically inclined person would do.  I decided to create a device to turn the screen on and off by responding to dramatic changes in ambient light.  The device would also provide a manual power toggle and button to refresh the browser.

This is part 2 of 3, describing how to use an Arduino to build a USB keyboard emulator to call the hot keys.

Although intended to be used with a Raspberry Pi, the screen controller can be used to emulate a USB keyboard and send any desired keystrokes.


  • Computer running the Arduino software


  • Arduino Leonardo
  • Micro to Standard A USB cable, to connect Ardunino
  • Breadboard, for prototyping
  • 2 switches
  • 1 light sensor
  • Wire to connect components



Like most hardware projects there is more then one way to implement the hardware.  The hardware list is the minimum requirements to build a successful prototype.

There are no resistors listed because the internal Arduino pull up resistors are being used, as a result there is a slightly higher current draw and the logic is slightly more complex.

NOTE: Be careful that whatever key strokes are sent by the device may be sent to the computer running the Arduino software, which my cause ‘undesired results’ and may cause ‘bad things.’

Wiring Diagram

Here is the wiring diagram, as mentioned there are no resistors as internal pull up resistors are being used.




The code is pretty straight forward, the state of the screen saved and the appropriate key presses will be sent.

Plugin and test on Raspberry Pi.

Comments are closed.