| Video Fireplace |
| All News -> Projects |
| Written by Nicholas McClanahan |
| Thursday, 27 October 2011 17:22 |
|
Spend chilly winter evenings relaxing in front of the Video Fireplace!
The Video Fireplace connects to your TV, re-creating a warm, inviting fire that you can stoke and add wood to. Features include:
I built the Video Fireplace because I enjoy the Christmas morning 'Yule Log' show on T.V., but didn't really like the music or the commercials. Here's how to build your own. FAQHow does it work? The DesignAudio 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. AudioThe 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; VideoThree 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.SwitchesOne 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. PartsYou'll need a few parts to put together your Video Fireplace
We also have a kit available that includes everything you need except the Propeller Platform USB and SD card. ToolsThis 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:
I recommend leaded solder, especially if you're just starting out. Leaded solder is easier to work with, melts at lower temperatures, and results in better connections, particularly when you're inexperienced. Leaded solder is also poison, so don't put it in your mouth and wash your hands after soldering. The flux smoke aren't nearly as toxic, but they irritate my nose, so I try to avoid breathing them in. AssemblySwitchesFirst, assemble the ProtoPlus: it's a pretty quick build and the instructions are right here. Once that's done, we'll add two switches to it; one to stoke and the other to add wood.
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. Resistors
Add the two resistors as shown in the photo. These will act as 'pullups', it will keep the Propeller Platform pin at a reliable state when the switch is open. WiresWith some hookup wire, connect the center buss on the ProtoPlus to Ground. 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. SoftwareHere's the binary. Download it to your desktop, plug in your Propeller Platform and turn it on. WindowsIn 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. MacFor 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. LinuxBST 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.linux VideosNow that your Propeller Platform is programmed, we need to set up the videos. Let's start with the videos I've created: download them here and unzip to the root of your microSD card. Finally, insert the SD card into your Propeller Platform, turn it on, and enjoy the show! Setting up your own videoTo 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;
You can customize the code to make your videos play any way you want, too! In addition to swapping videos, you can change how and when they play by customizing the code. First, download the sourcecode and unzip it to your desktop. The main program is video_fireplace_190.spin — open it up in the Propeller Tool. Choosing a videoWith 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
When each video finishes, it sets videoselect to 1, so mloop.dat starts playing, but we could have somevid.dat play a different video by changing the last line from videoselect := 1 to whatever video we'd like instead. 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 StepsYou've made a Video Fireplace that you can customize and interact with, but why stop there? There's plenty of available horsepower on the Propeller Platform, so you can integrate video playback with many different projects all on the same board. A few ideas; |


P12 gets the 1.1k resistor, P13 gets the 560 ohm resistor, and P14 gets the 270 ohm resistor.





