Introduction: FPGA Timed Universal Remote (IR)
Has your roommate ever left the TV on late at night? Have you ever wanted to limit how long you watch TV? Well this device will help control your TV and make sure it turns off in a timely manner.
With your own FPGA board, IR Sensor and LED, along with some simple electrical components, you can create a timer that turns your TV off after a set amount of time. With some tweaking and personal investment, this device can act as your very own universal remote to mess with your friends or unknowing TV observers. Each component of our project is also useful on its own such as the IR send and receive module or the hours/minutes/seconds timer.
With that in mind, we recommend a little reading on IR signals to familiarize yourself with how they work: https://learn.sparkfun.com/tutorials/ir-communication
If you’re still up for the task then let’s get started!
Step 1: Getting Started
For our project, please acquire the following components:
- 1 Basys™3 Artix-7 FPGA Board (https://www.digilentinc.com/basys3)
- 1 breadboard
- 1 Infrared device with remote (We used an Insignia 40-inch LCD TV)
- 1 ~300-Ohm resistor
- 5 breadboard wires (sided with pins)
- 1 IR LED and sensor (We used these: http://www.amazon.com/gp/product/B00EFOQEUM)
You will also need the Vivado Design Suite ((http://www.xilinx.com/products/design-tools/vivado... to use the IP used to read the IR signal in the system. Other VHDL tools may be used with some modification in the ircontrol module.
Step 2: Circuit Setup
Use the attached diagram to setup the IR LED and Sensor circuit.
Your input device, the IR Sensor, will look for small changes in the IR light it sees, and vary the voltage to reflect these changes. The analog-to-digital converter in the ircontrol module will convert this voltage change to a digital signal that can be saved for later use. The sensor we used, and many like it, are designed specifically for these kinds of signals, so it's very accurate at detecting the signal.
Your output device, the IR LED, will flash according to the signal send to it after the timer is up.
Step 3: VHDL Setup
This project has several different modules that work together to make it work:
ircontrol: Uses a state machine to record and play the signal at at the appropriate times. Inside this module is a block of ram that is controlled by an address and write options. The state machine controls these two signals to record / read from memory.
sseg_dec: This module was created by Bryan Mealy and functions as a decoder to the 7 segment display. The file can take binary or BCD and converts it to appropriate seven segment values and contains a clock divider to display the numbers on the 7 segment display appropriately.
clk_div: This file was also created by Bryan Mealy and can be found several times throughout our project. The clock divider is capable of slowing down the frequency of the on board clock, 100Mhz for the Basys 3 board. This clock divider is used for the display anodes, IR sensor and LED, and the timer clock.
timer: The timer first requires the user to set the amount of hours and minutes that will be first displayed on the seven segment display of the Basys3 and later will be counted down. The left and right buttons choose the amount to increment the total time in seconds by; 60 for minutes, 600 for tens of minutes, 3600 for hours, and 36000 for tens of hours. The up and down buttons increment the total time by whatever value is selected by the left and right buttons. This total time is then converted from seconds to hours, minutes and seconds and then sent to a display driver that converts the time to a seven segment display. When the middle button(set) is pressed, the user can no longer affect the time and the total time decrements by one every second using the clk_div module. When the total time becomes zero, the timer outputs a “done” signal that tells the ir control to replay the previously recorded ir signal.
Attached above is a black box diagram that is a high level representation of how this circuit works.
Step 4: Usage Instructions
First, you are going to need to hook up and power on the Basys3 board.
When the board is done being programmed by the bitstream file on the flash drive, it is ready to record your remote signal. Press any button on the remote and system will record it.
Next, you will need to set the timer on the board. The time can range from 99 hours and 59 minutes to 0 seconds. After this time is up, the decide will be turned off.
To set the timer, you will need to use the buttons located on the Basys3 Board. The left and right buttons will select which anode to increment, and the up and down buttons will increment the selected anode. The middle button will set the time and start the timer.
Now sit back, relax and fall asleep. Once the timer is finished, the signal will play and perform the desired function.
Step 5: Possible Improvements
- Whichever anode is selected in the timer set part of the can be made to oscillate between displaying no segments and displaying the segments from the display driver. This will make the user interface more intuitive since the user will be able to easily identify which anode is selected.
- The actual circuit could use some tweaking. We burnt out several LED’s and a button while making this project. The IR LEDs are very sensitive and are only rated for a few milliamps. A fast-switching transistor-run circuit may be more feasible.
Step 6: Citations/Extra Info
The modules "sseg_dec" and "clk_div" were both created by Bryan Mealy, a Professor at Cal Poly, San Luis Obispo. These modules were provided to us in our CPE 133 Digital Design class taught by Andrew Danowitz.
This project was created as a Final Project for CPE 133 Digital Design at Cal Poly, San Luis Obispo. This project taught us about the real life applications of FPGAs in a fun and creative way.
7 years ago
Cool way to make an IR remote.