Go Down

Topic: Video Greeting Card - Arduino Style! (Read 3331 times) previous topic - next topic


Sep 15, 2010, 07:03 am Last Edit: Sep 15, 2010, 07:30 am by focalist Reason: 1
My wife is taking a short business trip this week, and to score points, I imported the tv_out library and connected up the output resistors into a plug for  a broken portable DVD player, which accepts NTSC video in, but disk transport is shot.  Happily it also runs on 9v, so I can run the whole rig from one adapter.  For the circuit, you simply need a 330 ohm resistor from d8 and 1k ohm resistor from d9- connect both of them to the center conductor, and the shell to ground, for most connectors to video displays.  For specific info, I'd recommend reading up on the actual library.  VERY nice, if a tiny bit twitchy


In any case, left it running for her to find when she gets up in the morning... a cute sendoff that she'll get a kick out of and brag up to her office friends...I know what side my bread is buttered on!!  The whole thing takes all of five minutes to rig up-  score some spouse points (just remember to substitute your OWN NAME at least...)

Laugh all you want.. I'll get the payoff for the corniness of it...


Code: [Select]

#include <TVout.h>

TVout TV;

void setup() {

void loop() {

 TV.print_str(0,0,"      Hi Honey! ");
 TV.print_str(0,16," I just wanted to ");
 TV.print_str(0,32,"Say that I Love You");
 TV.print_str(0,48," and that I'll miss");
 TV.print_str(0,64,"        you! ");
 TV.print_str(0,0,"      MWAH!!!");
 TV.print_str(0,16,"  (Smooches)...");
 TV.print_str(0,32,"  (Snuggles)...");
 TV.print_str(0,0,"    I Love You!");
 TV.print_str(0,16,"     @@@   @@@ ");
 TV.print_str(0,24,"    @@@@@ @@@@@ ");
 TV.print_str(0,32,"     @@@@@@@@@ ");
 TV.print_str(0,40,"      @@@@@@@  ");
 TV.print_str(0,48,"       @@@@@ ");
 TV.print_str(0,56,"        @@@");
 TV.print_str(0,64,"         @ ");
 TV.print_str(0,80,"    Love, Paul");


Nite guys!


Laugh all you want.. I'll get the payoff for the corniness of it...

Seems like a great idea to me.



Awww... how sweet.

Normally I'd just say goodbye when she brings up my breakfast before leaving. ;)


Sep 15, 2010, 03:00 pm Last Edit: Sep 15, 2010, 03:11 pm by focalist Reason: 1
Heheh.. worked perfectly.  She loved it.  She'll be back Friday night and has already texted that I should prepare for a romantic evening, so to speak..


Since I'm using a BoArduino from adafruit, it's even smaller than a standard arduino.  Plugs directly into breadboard- though I plan to pick up an "actual" Arduino (and a Mega also) at some point when I've got a little play cash about, I'm loving the breadboarding ease of the BoArduino I must admit.  Less wires means less places to go wrong.  I'm using the AT328 version, no USB onboard (so you use serial/TTL converter)- draws very little power.

I power it with a 9v battery, when not plugged in, though for maximum duration I'd probably use 4xAA.  The BoArduino has a 7805 voltage regulator, so it'll be happy with anything from 5v to around 12v without too much worry.  If you used a Nano, the design would be even smaller, maybe you could power with lithium cells.

In any case, the little beast works with any NTSC input- so with some simple code you can have a little "teleprompter" or Ninja Video Feed Hijack for all of $15.. think walking into Best Buy, plugging it into a huge Plasma screen, and walking away while it cycles.

Someone set them up the bomb?  Let go every Zig. For great justice.



Sep 15, 2010, 03:08 pm Last Edit: Sep 15, 2010, 03:32 pm by focalist Reason: 1
Additional thought:  I may modify the code to make this a "real" project.  All I'd really need to add is Serial input (to "record" the message) and store the messages in flash so it retains the data during poweroff.  That way you could connect via serial (even terminal program or serial monitor in IDE), dump in your message, and be ready to go.

LED blinkies are popular in the colleges around here, I think making a simple NTSC video text generator that is essentially disposable might have some really cool Guerilla Art potential..  probably best to create a markup language for the input, so that delays could be set, inverts could be done for effect, and graphics could be incorporated.

Last but not least, as long it meets the memory required and can be clocked at a workable rate, I would assume this could be ported over to even smaller, cheaper Atmel chips like ATTINY.  Just how small a package could you fit 4x button cell, ATTINY, and a RCA plug into?



Where did this TV library come from?  I do not see it listed on the Libraries page.

I suppose these days, as NTSC rides off into the sunset, we'll need one with HDMI output.  Is this feasible?  (I have no idea how HDMI works.)  Maybe with fancy 3D character renderings, too. :-)


Sep 16, 2010, 01:14 pm Last Edit: Sep 16, 2010, 04:45 pm by focalist Reason: 1
You can find it in the "playground", under the Output section.

It's a very easy to use and cute library.  It does cause a few conflicts here and there, especially other libraries that want to have d8-d10 to themselves- but most things work great.  I'd recommend this mainly for AT328 if you are gong to have extensive code.. it does eat a bit of memory.

I'm currently working the interface for a camera controller using this, and switching back and forth between the arduino video and video the camera outputs (previews, etc) and piping that to the screen.

this is such a simple build that you can do it for a gag.. have fun!

By the way, this should also work for PAL, simply change it in code.. if the library supports it, which I think the current version does.


Sep 16, 2010, 05:13 pm Last Edit: Sep 16, 2010, 05:19 pm by focalist Reason: 1
Anyway-- does anyone know where I can find the music (like notes..midi?) for the Zero Wing opening?  The first "text" sketch I did, which led to this "card", was the Zero Wing opening sequence, better known as "All Your Base Are Belong To Us."

I now feel the need to complete the thing, with music.  I've already discovered there is a conflict with the text-to-speech library (pin 10 output, but prolly could be remapped) which would give me CATS... but, what the hell... MAIN SCREEN TURN ON!

Ha ha ha ha ha!


I have a feeling this isn't going to be much fun.

You can download the Zero Wing music at

But that's VGM format. Maybe you could write a player for that... but if you must have MIDI then I've heard theres a VGM -> Midi converter out there. How good it is, I don't know.


Sep 16, 2010, 10:33 pm Last Edit: Sep 16, 2010, 11:13 pm by focalist Reason: 1
Anyway, gonna rewrite the sketch so it accepts text input from the serial port.. making it a nice little "teleprompter" or video dongle.   Once I started thinking about it, a barebones arduino (chip, regulator, resonator is pretty close to all that's needed) that functions as a serial-to-videotext generator/marqee for under $10 is a damn cute project..

I think it's already been done, but if not, I see a one-chip serial terminal with ntsc out in the not too far future...

Here's a gallery with the setup running...


There is a serial terminal demo sketch in the most recent version of the library(not released in a zip file, get it from the source section of the google code page).  If you want to use it please be aware of the fact the video pin changed to digital pin 7 for higher output resolution support; the sync pin stays the same and cannot be changed.


Sep 17, 2010, 11:04 pm Last Edit: Sep 18, 2010, 03:27 am by focalist Reason: 1
Okay, so now I am running into problems... it seems the TVout Library does not play nice with Serial communications, causing dropped characters from the input.  I assume this is because of an interrupt issue.

Once TV rendering has begun, serial data transfers become unreliable.  The idea was to accept data in via serial and display- but you can't do both.  Pausing the rendering does nothing to improve.

You said you had a term program working? what am I doing wrong here?

Code: [Select]

#include <TVout.h>

TVout TV;
char indata[256]="test";
int i,cnt,foo,t;

void setup()  {
//  TV.begin(_NTSC,128,96);

void loop()
 if (cnt>0) {
     for (t=0; t<=foo-1; t++) {
 Serial.print(" bytes: ");
// TV.print_str(0,0,indata);

or is there something else going on?

If I remove the commented out render references, serial data gets garbled and lost.  pause_render() does not change anything.  Thoughts?


Looks like it is indeed a lib/serial conflcit involving interrupts.  However, the new version of the lib to be released will address these issues.  Since the lib isn't quite ready for "prime time" per the author, In the meantime, I'll work on a workaround.. which will be forward compatible.  Just know that the new lib will make my workaround kind of obsolete...

Go Up