Introduction: The Matrix Effect With Arduino and TV
Remember the movie The Matrix? Of course, who can forget that one!
Remember the code-falling-down-the-screen effect from the movie? Very unique!
Are you interested in creating a similar effect with an Arduino and a TV?
Follow me.
What you will need:
1 Arduino (You need ATMega328 for this project. ATMega168 will run out of memory!)
1 TV (Any standard TV works as long as it has an RCA input . Current market LCD TVs might not work.)
1 RCA Cable
1 breadboard (Half-size works)
1 1K Ohm Resistor
1 330 Ohm Resistor (470 Ohm also works)
1 Potentiometer (To control the speed of the falling code. More info in step 2.)
I've made this instructable keeping in mind readers who are absolute rookies. You can also refer to it if you just want to learn to connect a TV to an arduino. Also, please excuse my crappy camera. I will be uploading better pictures soon.
Before we begin, here's a preview of the final product. Compare the project video with a clip from the movie itself.
Now, let's put this together.
Step 1: Place the Resistors
Plug in the two resistors as shown. We want one single output from both of them.
Step 2: Place the Potentiometer
The potentiometer will be used to control the speed of the falling code. It gives a nice interactive touch to the project. Here's how to connect it:
A pot has 3 pins. One of them is output and the rest two are hot and ground (picture 1). Polarity doesn't matter in case of hot and ground pins; you can use them either ways. Place the potentiometer as shown in picture 2.
Step 3: Attach the RCA Cable
You need only one RCA cable. Whether you choose red, white or yellow cable doesn't matter.
1. Cut off the plug from one end and expose the ground and hot wires inside. Hot is the center and ground is the outside. Attach them to two wires as shown in picture 1.
2. The hot wire goes to the single output from the two resistors. The ground goes to GND pin on arduino which the potentiometer shares with the cable since both of them have a ground. Take a look at pictures 2 & 3.
3. Plug the other end of the RCA cable into your TV's video input (yellow color).
Step 4: Attach the Arduino
Now we bring all the pins to the Arduino.
1. In picture 1 you see three pins. The ground pin GND will be shared by the potentiometer and the RCA cable. For the remaining two pins (Sync & Video) you need to figure out which one goes where on your type of arduino. Picture 2 will guide you with that. Sync goes next to 1K resistor and Video goes next to 330 ohm resistor. Picture 3 shows Sync & Video connected on my arduino.
2. The potentiometer ouput is analog and goes to pin A0 on arduino. Potentiometer's hot pin can either go to 5v on Arduino or to digital pin 2. I used digital pin 2 (picture 4).
3. Picture 5 includes all of the above together.
Step 5: Install the TVout Library
1. Thanks to the good folks over at MIT, we have a friendly environment to work with while programming an arduino for a TV. Here's the download page. Please download TVoutBeta1.zip, older versions will not work with my program.
2. After you've downloaded, extract all the files to Arduino\libraries\ folder.
3. Open the Arduino software and check if the library is visible under examples (picture 1). If it is, the library was properly installed.
Step 6: Upload the Program
Download the program and upload it to your arduino.
Attachments
Step 7: Watch It Happen!
Turn on your TV, tune to AV channel and see if it works. If it doesn't, check Sync & Video pins on the Arduino. Sometimes you have to switch them around. Try different pairs from picture 2 of step 4. A few switches and it should work.
Enjoy The Matrix effect! Turn the potentiometer to speed up or reduce the falling speed. Watch as the random letters come together to display THE MATRIX in the middle of the screen. Here's what it should look like:
Step 8: What You Can Try Next
The only main thing that lacks in my project is a green color display like in the movie. This probably needs opening up the TV. I did not attempt that because not only I did not have enough time, but also because I am not good at electrical stuff.
Warning: Old TVs have large capacitors that store charge for long periods. There is a risk of serious injury due to electrocution. Seek expert advice before you attempt to open your TV.
I'd be happy to see a green color display if anyone makes it. Thanks for reading this instructable.
9 Comments
11 years ago on Introduction
I can't get it to work, there is always some problem. First it was unrecognized stuff and then error compiling, and now more unrecognized stuff. HELP!!!
Reply 11 years ago on Introduction
You might be missing the required TVout library. In step 5 I describe where to download it from and which one to download. The picture in step 5 shows how to verify the library was installed correctly. If you still have problems, uninstall and reinstall Arduino software and the TVout library. Even better if you can clean your registry with a safe registry cleaner to erase driver conflicts.
11 years ago on Introduction
looks like a computer vomited code on a tv, but dang that looks good man!
12 years ago on Introduction
It doesn't look like it reaches down all the way o_o
Reply 11 years ago on Introduction
i agree but would there be a way to have the letters erased from the bottom of the screen so it looks like a endless stream
Reply 11 years ago on Introduction
Its been a while since I wrote the program for this project so I don't recall exactly how, but I do remember thinking it is easy to make the code go all the way down. I just looked at the program to refresh my memory and one thing I can suggest is to modify the two for loops such that they wont iterate until y[a] > 96 (104 being the max vertical value of the screen).
In the current program, the two for loops iterate too often which is why the code doesn't get a chance to go all the way down, all the time. Modify them to wait until a line being printed reaches its max vertical value (i.e. y[a] exceeds 96) and it should work. I'd appreciate feedback on this suggestion if you try it out.
11 years ago on Introduction
Tried to figure out how to wire everything to get my Arduino to work with Tvout, but couldn't get it to work until I found this instructable with pictures of the wiring. Finally got it to work and then ran your matrix code. Looks good, if not a bit retro, which is even cooler.
12 years ago on Introduction
Hey I was just trying to do this TV out thing and I'm having trouble getting any kind of signal out of my arduino. I'm using a Diecimila with a ATmega168. Did you use a 168 or did yours have an ATmega328 or something else? One of the examples from the TVout library gave me an out of memory error so I'm thinking that's it.
Tom
Reply 12 years ago on Introduction
Hey Tom,
You spotted out an important detail I've forgotten to list here. You're right, I used a ATmega328 for this project, ATmega168 does not have enough memory for TVout. I will update my instructable. Thanks for the comment!