MRETV - Video, Stereo Sound and much more from a standard Arduino !

Now Updated for Arduino 1.6.6 November 2015 !

Use only two resistors and two diodes to generate full screen video. Text 47 x 29 of 8x8 characters, double the vertical resolution (47x57) in experimental interlace modes. Use pixel level graphics with a virtual graphics coprocessor controlling font, screen resolution, vertical and horizontal centering, raster index and pixel size with single scan line resolution. ASCII read and write access of screen characters, screen print strings, decimal, hex or binary. Built in simple scrolling terminal service. Video generation has been done before, but not like this. FULL DUPLEX serial still available while generating video.
Two more resistors and two capacitors will add Stereo playback of Audio samples. One shot or continuous operation. Sound samples are used in real time from progmem and a sound sequencing example is provided. Both Audio and Video are generated automatically in the background with no intervention once started.
Two more resistors and you can now connect a PS/2 keyboard or mouse (the kind before USB). Read raw key input or ASCII chars, let keys merge into the serial stream automatically. Set the keyboard LEDs and send commands to control mouse reporting.
Code examples include Ponguino, a simple terminal, a player piano, a ShootEmUp, use your Arduino as an external video card and some technical examples. Too good to be true? Watch the video then grab your soldering iron!

Step 1: Introduction

Now Updated for Arduino 1.6.6 November 2015 !

What is MRETV ?

MRETV is a few very simple circuits and a simple to use software interface that allows an Arduino to generate Video and Stereo Sound in the background while your sketch executes as normal. Your Arduino plugs directly into the A/V inputs of your TV, VCR, or projector. MRETV also has built in support for other peripherals like keyboards and mice.

Which Arduino's does MRETV work with?

MRETV has been tested and works with Arduino boards using 168, 328, and 2560 CPU's. With the Mega 2560 software serial Tx has a small hardware limitation.

Who can build MRETV?

Any Arduino user. Even if you have never built hardware before, the audio and video circuits are so simple they make a perfect first project. People with moderate experience can build them in about 5 minutes, and probably already have the parts.

How easy is it to program with MRETV?

You can set a string, make 1 function call, and the string shows on your TV. Changing the contents of the string changes the text showing on your TV (in real time without calling any function.)

Why use MRETV ?

An Arduino user interface often involves a few buttons or switches. Indicators commonly range from LEDs to 80 character displays. These can be a large part of the time and cost in a build. MRETV replaces these with a screen of 1 to over 1000 characters, stereo sound and a full PC keyboard. It can be built quickly and cheaply using only 6 resistors 2 diodes and 2 capacitors in total for all 3 circuits (video / stereo audio / keyboard).

What resources does MRETV use ?

The smallest footprint is about a 1.5k sketch using about 35 bytes of RAM, including interrupt stack use, plus 1 byte of RAM for each character location on screen (1 or more locations). The screen character space can be dual purposed. Video uses an 8 bit timer and two IO pins. Audio uses an 8 bit timer and two IO pins. The software serial Tx stream is provided on another IO pin if needed (Rx works on the standard pin). CPU usage varies with visible screen area but is self limiting about at about 80%. A small active screen uses under 10% of the CPU cycles, with a large screen plus audio around 50% is common. Key library structures and routines are redefined each compile for efficiencies. MRETV can be turned on and off ( 0% CPU).


I have truly enjoyed reading about, constructing, and learning with Instructables. I want to take this opportunity to thank all those who have shared with me, and those who made the sharing possible. You have solved my problems, fed me, inspired me, and shown me how to do what I thought was impossible. As part of that thanks I offer the MRETV debut to the Instructable community.

This Instructable is a Build and Introduction rather than an exhaustive explanation of MRETV. You will quickly have both sound and video from your Arduino. You will have some games to play, and some useful utilities. More importantly you will have a full featured library to use sound, video and more in your own sketches. If there is interest future tutorials on the software interface are possible, it has more depth than can be explored here. Since even this build and introduction covers a lot of material, I suggest you first make the video and sound circuits then take a break and spend some time with the software examples. You can use a terminal program like 'Putty' to explore until you build the keyboard (PS/2) circuit. After making the keyboard circuit you will have all the major parts of MRETV (to use examples like Ponguino and Diode Calibration you need to build some sensors.) Please do not redistribute this Premiere Release of MRETV yet, wait till the bugs become documented features.

I have tested many versions of this project connecting to many different devices and never caused any harm to the Arduino or the other device. Most TV's hold the MRETV signal much better than the capture card I used to make the videos. Due to its simplicity, most of the time, newly built MRETV hardware works the very first try. However ...

Build and use at your own risk. I assume absolutely no liability of any kind for anything you ever do related to MRETV.

Go ahead and watch the second video then let's get building.

I am not sure if I cmpletely follow you. Are you saying you can connect to the Video in RCA plug OR to S-video?
Yes, you can do both (but only one at a time.) First build the RCA plug video circuit, and then build the RCA to S-Video adapter for use with TV's and other equipment that allow an S-Video connection.
thank you
This is amazing. I really can't believe you can make Arduino do all that at the same time. You've managed to cram almost all the features of Raspberry Pi into arduino(maybe only ethernet left?)! <br>Your intro page text could be made a bit more easy to understand, because it's hard to imagine that all this can be done and the intro page text is a bit vague about where we get the video and audio out. At first I thought this is an instructable for making arduino compatible hardware called MRETV using LCD screens, speakers etc. You can make it clearer that it works for standard TV sets. And a picture of the circuit with live display on TV will be awesome! I'll try it out soon. Thanks for sharing this :-)
Thanks for your patience, I have finally added the video of the hardware being connected and used as you suggested. It's at the end of the 'Bugs and Bouquets' section, the MKV version is best.
Thank you for your enthusiasm ! Build it and you will believe. I almost called the Instructable 'Rusty Nail Pi' , you know the folk tale about soup? <br> <br>Excellent advice on the intro. I'll try to address it.
This seems amazing. I hope to have time to play a bit with. <br>I'd like to know if it's dedicated to some TV standard like NTSC or PAL?
Thanks! if you build it you won't be disappointed. The polarity of the sync makes it NTSC like, but its a stretch to say its 'dedicated to a standard'. I worried at first but it turns out TV's are very forgiving about what they will display.
hi! nice work man! I've sent you a personal message, please answer it when you have the time. thanks in advance!
Thanks, I enjoy doing it. Your reply is done, sorry for the delay (a few bad memory locations in the wetware these days).
Outstanding job!
Thank you! That's high praise coming from the Spork man.
Wow! <br> <br>I think I've just found my next kid's project! A pretty basic PCB &amp; we have a pongduino console for about a fiver! <br> <br>Would love to hear some of the theory on how you generate the video signal. It wouldn't even occur to me to try! <br> <br>Fabulous project!
Do you ever feel like the Ponguino paddles keep getting smaller ? I've played my son, some day I'm going to make a game I can win...
One extra thought - would it be better (for a TV that has it) to drive the luminance line of an S-video input rather than using a composite input? That would avoid any of the signal being interpreted as unintended colour information. <br> <br>Once again though: great project.
Ugifer... look what you made me do to my S-Video cable. I mean it, the new picture and note in the video section of this Instructable. Talk about crowd sourcing, what a great idea! You can just call me E
Great! Glad to be of service (however minor). <br> <br>That's the great thing about Instructables - there are so many people with good ideas and sometimes they see something that can be done in a different way. Sometimes they will even take a project you though was exhausted and put a completely new slant on it &amp; come up with something great. <br> <br>I meant it when I said I might base my next project on making a simple games console around this project - obviously I'll let you know &amp; post an 'ible if I do. <br> <br>Cheers - and thanks for the mention! <br> <br>Ugi
The best thing about Instructables, for me, is learning. If I had understood how much I would learn while making this Instructable I would have done it much sooner. <br> <br>E
Wow, excellent work, really inspiring!
Thank you ! Inspiration, its an honor to pay it forward here where its most deserved.
This is so spectacularly simple I'm amazed. I've been building with Arduinos for years now and nothing like this ever dawned on me as possible. Great job on an excellent Instructable --one of the very best I've ever seen. Thanks so much!
Thank you, your words are too kind.
PS/2 sockets are had by taking a heat gun to an old motherboard.
Indeed they are there, and sometimes difficult to get off. Thanks for the tip about the heat gun.
This is awesome. My mind is buzzing with ideas on how to incorporate this into simple test fixtures that offer much more than LEDs as a user interface. Thanks for such a great job in presenting this! <br>
Thanks, it will be what others do with MRETV that will make my effort worth while. The presentation keeps getting better, thanks again to all my editors out there !
This is a game changer, like a 4th SID channel, like fragment shaders, like dHTML. This is the dawn of a new age.
Thanks ! I was trying to think outside the bag. It became a game changer for me in a trivial way. Even when my project does not use MRETV, being able to temporarily debug/test with a dedicated screen full of data and keyboard helps a lot. I seem to do a lot of 'testing' some days.
Amazing project! It is by far the coolest project I have found on the Arduino scene! I'm willing to give it a try! Great job Mr. E! ;-)
Thank you, for your very kind words, it does represent a lot of work. Its been my development skeleton for a couple of years so is even fairly stable.
<p>How to display decimals (floats)?</p><p>I do not find</p><p>Thank you</p>
<p>I need some help. I understanfd the principle, but the coding is beyond me. I am trying to write the code so that when there is a keypress, it does something. so basically :&quot;if a is pressed, do this&quot; If anyone would be willing to give me an easy tu understrand example of this, that would be great. thanks!</p>
<p>Hi Mr. E, i am trying to use your code to send the keyboard characters over Serial and i only sometimes receive the character, it is the right one but i need to hit like 10 characters before it works and then another 10 hit, and only 1 or 2 characters appear on the serial terminal. I don't want it to send the serial information that it received i.e. the command: Video.writeS(Video.read()); instead of Video.writeS(chin);</p><p>This is my code:</p><p>#include &lt;MrETV.h&gt;</p><p>#ifndef default_extensions </p><p>#error Please define 'default_extensions' in arduino\libraries\MRETV\MRETV.extensions , See comments at start of sketch</p><p>#endif</p><p>#include &quot;textfont.h&quot; // readable font</p><p>#ifdef __AVR_ATmega168__</p><p>#define asciibufsize 22*40</p><p>#else </p><p>#define asciibufsize 25*46</p><p>#endif</p><p>#define mergstreams on</p><p>uchar asciibuf[asciibufsize];</p><p>void setup(){</p><p>#ifdef __AVR_ATmega168__</p><p> Screen.begin(textfont,asciibuf, 22*8,40,34,52,1);</p><p>#else </p><p> Screen.begin(textfont,asciibuf, 25*8,46,22,20,1);</p><p>#endif</p><p> Video.readS();</p><p>}</p><p>void loop() {</p><p> uchar chin;</p><p> if((chin=Video.readS())){</p><p> Screen.render(chin);</p><p> Video.writeS(Video.read());</p><p> }</p><p>}</p><p>I am very impressed on your work to, great work. Nice and compact to.</p><p>I have gone into the code and changed a small amount just to add a cursor.</p>
<p>I use Arduino Uno, is it still possible for me to make this. (I am still a little new to Arduino.)</p>
<p>Yes, the Uno works well with MRETV. Enjoy.</p>
Hello Mr E <br> <br>I have just stumbled upon these guys: http://nootropicdesign.com/hackvision/ <br>Seems like they do a similar thing but without using the UART, which I suspect means that your version will be much less processor-hungry. <br> <br>Have you encountered their projects? I was just wondering whether they could be run on the MrETV &quot;platform&quot;. <br> <br>Ugi
The site says resolution of 136x96 pixels and Mono audio, it uses TVOUT. MRETV resolution goes beyond 376 X 324 and the audio is stereo or mono, so you should be able to port the games but it will not be real easy, the interfaces are different. Yes MRETV is less processor-hungry, but their system is game only so it makes sense if they use 100% processor time. MRETV gives you different abilities and expendability for pennies using your standard Arduino, (although my PAL version in not released publicly yet).<br><br>E
Hi! Can I use it to the serial output of my arduino in it? like on a computer with the IDE, this would be useful for on-the-field testing
Yes, MRETV can be used as a terminal (with sound) on a serial port. Note that serial TX moves to a different pin while RX stays the same as normal.
I require the highest of fives.
Thanks !, I think ? 5^5 of spades ...?
You know like high five-ing someone, like give me five.
I thought that might be it, but with no hands its hard to high 5 back. (and yes, I know there is an Instructable to solve that). All your comments here at Instructables have always made sense, and many good points. Thanks again for the high complement.
Brilliant Instructable. Excellently done! Well I was aware of many of the functions you described it is quite something to see it all written up in your article. It is a comprehensive write up; thought provoking and nicely put together. You deserve recognition
Thank you, you are too kind as well, and I certainly don't claim many original ideas. On the other hand ALL the code is new and original, this is its premiere release. ( I also believe real time generation of the raster on an Arduino and talking PS/2 protocol with 8 bit SPI hardware is unique to this work.)
This is very cool. For the time-strapped people like me it would be great if you offered a ready-to-go kit for sale. Maybe do a Kickstarter project? Any chance you will do an HDMI version at some point?
I didn't include any board layouts since its easy to build the circuits right onto the back of the plugs, if there is interest a kit is possible. As far as HDMI, let me finish my Color, 3D, 5.1 surround sound version first. (sort of joking...)
Wow, excellent work, really inspiring!
Wow, excellent work, really inspiring!
Does it work with ethernet?

About This Instructable




Bio: I learned to program in Sanskrit at the School of Hard Knocks.Later I home schooled myself in the new 'Morse' coding language. My teacher ... More »
More by Mr. E:Arduino as a Proximity Detector MRETV - Video, Stereo Sound and much more from a standard Arduino ! 
Add instructable to: