Video Fireplace for the Holidays
by Gadget Gangster in Circuits > Microcontrollers
7063 Views, 18 Favorites, 0 Comments
Video Fireplace for the Holidays
The Video Fireplace is based on the Propeller Platform USB - it connects to your TV, re-creating a warm, inviting fire that you can stoke and add wood to. Features include:
- Never runs out of wood Runs about 20 hours on 4xAA's or connect a power adapter to run continuously
- Your fire, your rules Customize with your favorite holiday music, it can store hundreds of songs
- Stoke away Stoke and 'Add Wood' buttons let you play with fire
- Perfect for any occasion Video stored on SD card can be changed to suit any other holiday
- No Cleanup Unlike burning 'real' wood, virtual wood burns without any ashes
- Safe Doesn't generate any heat or smoke
- Easy Compatible with any TV that has a composite video (i.e., RCA jack) connection
FAQ
The Propeller Platform merges fireplace video segments based on user input, and plays it back. When the user wants to add wood, videos flagged 'Wood-adding' get merged in. And when the user wants to stoke the fire, stoking videos get merged in. These videos are prepared beforehand — they're categorized, transcoded, and stored on a microSD card that serves as the video library for the Propeller. The result is a fairly seamless fire that the you can also interact with.
What if I don't like fire?
The video files can be changed to whatever you want. After we build it, I'll show you how to swap videos and customize how they're merged together.
Can I do anything else with it?
Yes! About half the Propeller Platform is idle during playback, and 21 I/O pins are free, so you could add Ethernet, a servo, a sensor, or anything else and use it while playing video. Or you could use a sensor or switch to change video streams — lots of possibilities.
What's the audio / video quality?
The resolution is 80x96 at about 25 frames per second. Audio playback is in mono. The Propeller is capable of much higher resolutions, but you'd probably have to take a different approach to transcoding and the code would need to run in assembly.
How long do the batteries last?
About twenty hours with four AA's. A higher capacity battery will extend playback, or you could use a power adapter. If you skip the voltage regulators and run 3.3V directly to the Propeller, you'll also extend run time.
How does it hook up to my TV?
Video signals are composite, a.k.a., through the yellow RCA jack. Almost every TV made has the Yellow - Red - White RCA jacks. The signal generated is NTSC. Experienced Propeller programmers could also change the output to VGA, an LCD panel, PAL, or other display type.
The project is open source, and uses several Propeller objects including fsrw, spudview, and rayman's audio player. I'll go over the program shortly, but here's the source if you're in a rush.
The Design
Audio and video playback are done completely on the Propeller, we just need to add the A/V connectors and two switches to allow the user to interact with the fire.
Audio
The Video Fireplace uses a ProtoPlus on top of the which has the audio and video circuit already laid out. But if you're building the project on a breadboard, For audio, I've connected it to pin 11, although I could have used any other pin. Here's the circuit;The small ceramic capacitor (.01uF) acts as a low pass filter and helps keep the audio sounding clean, but it's optional.
Video
Three pins on the Propeller work together to generate the composite video signal. The pins are connected together through three resistors, here's the circuit;P12 gets the 1.1k resistor, P13 gets the 560 ohm resistor, and P14 gets the 270 ohm resistor.
Switches
One switch lets you stoke the fire and the switch adds wood. I also use two resistors as 'pullups'. If you don't use pullups (called leaving them floating), the pin state can be unreliable, so it's best to connect the pin to a known state for when the switches are open.
That's it for the electronics, now I'll show you how to solder it together.
Preparation: Parts and Tools
Parts
You'll need a few parts to put together your Video Fireplace- Propeller Platform USB (Adafruit, Gadget Gangster)
- ProtoPlus (Adafruit, Gadget Gangster)
- 2x 10k ohm resistors (Jameco)
- 2x tactile switches (Jameco)
- Some spare hookup wire (Jameco)
- 2GB or smaller microSD card
- Battery box or power adapter
Tools
This project is great for beginners, there's just a little soldering and it takes less than 20 minutes to assemble. If you've never soldered before, there are a bunch of great instructables to guide you, like this one. You'll need a few tools:- Soldering Iron and solder. Leaded solder is easier to work with, and a 15-40 watt iron is just fine.
- Dikes. Diagonal cutters are used to trim the excess leads from components after soldering them down. I use a pair I got from Ikea for two bucks.
Make It: Switches
Insert the switches into the ProtoPlus as shown in the photo. Note that the pins on each switch are connected in pairs. When you depress the switch, both pairs get connected.
Make It: Resistors
When you solder the resistors, save the excess leads you trim off — we'll them in the next step.
Make It: Wires
Take a bit more wire and connect the 10k resistors to V33;
Finally, we'll use some of the extra wire from the resistors to connect the switches to P19 and P27 on the Propeller Platform;
It might be hard to see the wires against the board, so here's a huge version of the picture.
All done with the soldering iron! Now on to the software.
Make It: Programming
Windows
In Windows, I use the Propeller tool. Double click on the binary you downloaded and the Programming dialog will appear;Hit the 'load EEPROM' button and the Propeller Tool will update the Propeller Platform USB. If the Propeller Tool isn't the default program for .binary files, you can open the file inside the Propeller Tool using the File -> Open menu.
Mac
For Mac, BST is the usual choice. It's handy because the user interface is almost identical to the Propeller Tool. You can download it here - and don't forget to install the Parallax font. Unzip and double click — it will open and you can file -> open to the binary.Linux
BST is also available for Linux, setup is similar to Mac. First install the Parallax font, then download the linux version and unzip to your desktop. Make it executable by right clicking, or opening the terminal and using chmod u+x bst.linuxRegardless of your operating system, you should also grab the sourcecode, in case you want to tweak / change / modify the program. It's in a zip archive - the top object is 'video_fireplace_190.spin'.
Make It: Videos
Setting up your own video
To use your own videos, you'll need to transcode them for the Propeller Platform. Here's how;1. Download the video converter
Grab the file here and unzip into a new directory on your desktop. It includes everything needed to convert source AVI's into a format for the Propeller Platform.
2. Grab your source video
The converter only works with avi files. If your source video is in another container (mp4, divx, flv, etc.), you can use AVC to change it to an AVI . Copy the AVI to the same directory you unzipped the converter and rename it 'video.avi'.
3. Convert
Double click on 'Convert_AVI.bat', and it process your video. Once it finishes, a second dialog box will allow you to tweak the final conversion. You can change saturation, hue and black level to best suit your source video. When it completes, your final output file will be 'fro.pvf' located in the '/convert' subdirectory.
4. Copy
Copy frog.pvf over to your microSD card, then rename it based on when you want it to play;
- intro.dat : plays on boot-up, unskippable
- mloop.dat : plays after intro.dat and when the stoke or wood videos finish
- rejoice.dat and behome.dat alternately play when you hit the stoke button
- feliz.dat and winter.dat alternately play when you hit the wood button
Customizing Your Fireplace
Choosing a video
With video_fireplace_190.spin open in the Propeller Tool, scroll down to find the method filechooser, it's responsible for loading the selected video, and changing it when we want to play a different video. Here's the full code: PUB filechooser | i
i:=sd.popen(string("intro.dat"), "r")
repeat while playstop == 0
Repeat
IF videoselect == 2
i:=sd.popen(string("feliz.dat"), "r")
playstop := 0
repeat while (playstop == 0) AND (videoselect == 2)
videoselect := 1
IF videoselect == 3
i:=sd.popen(string("winter.dat"), "r")
playstop := 0
repeat while (playstop == 0) AND (videoselect == 3)
videoselect := 1
IF videoselect == 4
i:=sd.popen(string("rejoice.dat"), "r")
playstop := 0
repeat while (playstop == 0) AND (videoselect == 4)
videoselect := 1
IF videoselect == 5
i:=sd.popen(string("behome.dat"), "r")
playstop := 0
repeat while (playstop == 0) AND (videoselect == 5)
videoselect := 1
IF playstop == 1
playstop := 0
i:=sd.popen(string("mloop.dat"), "r")
repeat while (playstop == 0) AND (videoselect == 1)
IF videoselect == 8
i:=sd.popen(string("somevid.dat"), "r")
playstop := 0
repeat while (playstop == 0) AND (videoselect == 8)
videoselect := 1
Who decides what video to watch?
In the Video Fireplace, I have a spare cog run filepicker to watch the switches and change the value of videoselect. But you could plug in any other code — it just needs to signal to filechooser to load a different video by changing the value of videoselect.Next Steps
Use other inputs to change videos
The Video Fireplace uses two buttons to change videos, but you could use the input of a microphone, light sensor, realtime clock, or anything else. Maybe an audio visual alarm clock, or birthday candles that extinguish when you blow on the microphone?
Send the video to something other than a TV
Instead of sending the value of each pixel to a TV screen, why not send it to an LED matrix display, servos, or an array of stage lights with the Propeller Platform acting as the DMX master?
Make it portable
The batteries already last many hours, why not put your video on a portable LCD? There are touchscreen LCD displays for the Propeller Platform, or you could use any LCD panel that has a composite or VGA input.