loading

Christmas card with inbuilt retro video game for under $10

FeaturedContest Winner
Picture of Christmas card with inbuilt retro video game for under $10
100_1356.JPG
Hello all and welcome to my second Christmas related project.

Have you ever received a really boring Christmas card? Have you ever sat there and thought to yourself "If only there were a little video game on this card that I could play..." Well ponder no more because that card is here!

This instructable will show you how to make your very own retro video game Christmas card which can be made for less than $10. All you need is some time, some soldering know how and roughly $10 in your wallet.

Please view this youtube video to get the main idea of this project:


There are essentially two main parts to building this project.

1. Soldering all the parts to the vero board (experimenters board)
2. Making the card itself (this is where you can get creative)

The game is titled "Santas Scramble" and is played within 64 pixels on an 8x8 LED matrix display. You play santa (a red dot) who is frantically flying around the world in order to get all of the presents delivered to the children in time for Christmas, the only problem is that he has flown into a dangerous maze. Your job is to steer santa up and down the screen in order to avoid the oncoming obsticles. Be careful, the further you get through the game, the faster it gets. If you crash then it is - GAME OVER -

There are two different designs below and I must apologise for my lack of arts and crafts ability. My strong point is the electronics side of things...

Anyway - lets get started shall we!

 
Remove these adsRemove these ads by Signing Up

Step 1: Gathering together the required parts.

Picture of Gathering together the required parts.
soldering_equipment.jpg
As stated in the introduction, there are essentially two main parts to this instructable.

1. Building the electronic circuit
2. Constructing the card


Here is what you will need for the electronic circuit:

- 1 x pic 16f648a microcontroller
- 1 x 7442 (1 of 10 decoder IC)
- 2 x cr2032 batteries
- 2 x cr2032 battery holders
- 1 x 32 hole by 23 hole piece of veroboard / strip board
- 2 x push buttons
- 1 x 8x8 bi-colour LED matrix display
- 9 x 150 ohm resistors 1/4 watt
- 2 x 10k ohm resistors 1/4 watt
- length of enamel wire (the really thin wire with a coating of enamel for insulation)
- shorter length of single core wire

- Soldering iron
- Solder
- scalpel (or sharp knife)
- solder wick (optional but handy if you make a soldering error)
- Flux (optional but helps with soldering)

- pic microcontroller programmer

here is what you will need for the card:

- paper (all sorts of colours to make it more interesting)
- thin cardboard
- thick corrugated cardboard (the cardboard that packing boxes are made from)
- glue stick
- double sided tape
- sticky tape
- scalpel (or sharp knife)
- scissors
- what ever else you can think of to make a nice looking card



Handy Hints:

-
Pay a visit to sure electronics webstore where you can buy a lot of 10 Led matrix displays for around $8.60 this makes them 86c each!

- ebay is a great place to buy electronic components. Make sure you do a worldwide search since postage is normally quite cheap for lightweight components.

- Head on over to microchip.com and sign up to their online store. Then you can buy parts directly from them. For example here in Australia it would cost me $10 for a 16f648a microcontroller. But if I buy them from microchip they are just over $1.

- You can also request free samples from microchip. I think you can get about 6 free samples a month. This has been very handy for me in experimenting with different chips.




Step 2: Program the microcontroller

Picture of Program the microcontroller
At this stage, you will want to program your microcontroller with the santas scramble game hex file. There are many different programmers out there so I will not be able to explain the exact process.

You can download the hex file from the bottom of this page.

Simply open the hex file in your programming software and burn it to the microcontroller. Then you are ready to commence construction!

Step 3: Cut the board to size.

Picture of Cut the board to size.
The veroboard (strip board) will need to be cut to 32 holes by 23 holes.

Please see the photo below for reference.

Note that the tracks are aligned vertically.

Step 4: Soldering all the components onto the board.

Picture of Soldering all the components onto the board.
100_1268.JPG
100_1299.JPG
I like to solder in everything in one big hit. Then from there we can cut the necessary tracks and solder our enamel wire to form a complete circuit. (which will be covered in the following two steps)

But for now, lets just solder in the components. Have a look at the photo's below for the location of each component. One item to note is the 8x8 LED matrix. You must insert it the correct way otherwise it won't work. See the third photo for a close up.

Also you should note that both the microcontroller and the 7442 IC are mounted such that pin 1 is to the bottom left.

You can see both the top (component side) and the reverse (solder side) of the board.




Step 5: Cutting the veroboard tracks

Picture of Cutting the veroboard tracks
100_1270.JPG
As it is, we have shorted out all of our IC's legs from top to bottom as well as the resistors, buttons and LED matrix. We need to cut a whole heap of tracks in order to make sure that we are not shorting out any of the components.

Please refer to the photo's below for a look at where to cut the tracks. The first photo shows where the tracks have been cut by red ovals. The second photo is exactly the same just with the ovals removed for clarity.


Step 6: Study the Schematic.

Picture of Study the Schematic.
16f648a.PNG
7442.PNG
You can download the schematic below. Have a look at it since you will need to match the circuit you are building, to this schematic.

It is very likely that some of the components that you will be using will not match my components exactly (E.G the led matrix and push buttons) so it is important that you study the schematic diagram and as long as you wire together yours accordingly, you will be just fine!

Here is a direct link to the original full size schematic:
http://www.instructables.com/files/orig/F9A/MK4K/G3KY0ONB/F9AMK4KG3KY0ONB.png

I have also included the pinouts for the pic16f648a microcontroller and the 7442 decoder IC.

Power is provided by two CR2032 batteries connected in series (I.E the -ve of one battery is connected to the +ve of the second thus providing you with 6volts to power the circuit. This 6volts connects to the GND and VCC connections indicated in the schematic provided.


Step 7: Completing the circuit with enamel wire.

Picture of Completing the circuit with enamel wire.
100_1276.JPG
100_1287.JPG
Enamel coated wire is fantastic for veroboard projects.

The enamel coated wire comes in many guages, but I prefer to use .25mm thick enamel wire. This can be bought in little reels at most electronic stores or online.

Even though the wire looks like it is not coated (insulated) it actually is - with a very fine varnish so it is fine for the wires to touch each other (I.E. they wont short each other out.) Before you can solder these wires on though - you must first strip the ends. The easiest way to do this is to put a blob of solder on your soldering iron and then place the end of the wire into the molten blob, this will melt off the tip of the enamel wire which will give you a 'stripped' end ready to be soldered to the board.

The first photo shows strands of wire ready to be 'stripped' the second photo shows those same wires with the ends removed of enamel. The third photo shows the completed board. With all connections made.

you will also notice that I have used thicker wire with the green insulation. These are the power connections.

Here is a description of the five green wires:

- 1st battery +ve to 2nd battery -ve
- 1st battery -ve to microcontroller GND and 7442 GND
- 2nd battery +ve to microcontroller VCC and 7442 VCC


Step 8: Circuit testing.

Once your circuit is built you will obviously want to test it.

Pressing either of the buttons will turn the screen on and the game will start to play. If you then press the down button, you player should move down. If you press the up button, your player should move up.

If you hit a wall the game should stop and present you with the level number that you made it to.

If you complete the game, then you should be presented with a smiley face.

Pressing either of the buttons on any end game screen should take you back to the start of the game.

If you dont press any buttons for approx 30 seconds, the game should go into standby mode and the screen will turn off.

* PLEASE NOTE * upon further testing, standby mode draws quite a bit of current and as such your batteries will die in a matter of days EVEN WHEN NOt BEING PLAYED. I highly recommend that you add an ON / OFF switch to your circuit to fix this problem.

Step 9: Cutting the thick cardboard to size.

Picture of Cutting the thick cardboard to size.
100_1304.JPG
Now as stated in the introduction, arts and crafts is certainly not one of my strong points. So this is where you guys can get creative! The main thing to have a look at in these next steps is the housing for the circuit board itself. All the extra decorations I will leave to you to let your imagination run wild!

1. First off you will need some thick corrugated cardboard - most packing / packaging boxes will use this type of cardboard. (see the first photo below for reference)

Cut out two squares with sides of 12cm each. (see second photo)





Step 10: Cut out a space for the circuit board.

Picture of Cut out a space for the circuit board.
100_1310.JPG
Place your completed circuit board on top of one of your cardboard squares. Line it up in the centre and cut around it with a scalpel or stanley knife. (see first photo)

Repeat this step for your second piece of cardboard.

one both of them are done, place one ontop of the other and tape together. (see second photo)

Step 11: Install the backing for the circuit board housing.

Picture of Install the backing for the circuit board housing.
100_1317.JPG
Now we don't want the circuit board to fall out, so cut yourself a 12cm square piece of thin cardboard and tape it to the rear of your circuit board housing.

Step 12: Install the circuit board and fill the gaps.

Picture of Install the circuit board and fill the gaps.
100_1314.JPG
100_1322.JPG
100_1327.JPG
Now with the back plate on, you can insert your circuit board into the housing.

You will notice that some components (namely the IC's and resistors) are seated lower than the other components. We need to fill in this space with some more thick cardboard to try and level everything out. (see the first photo)

This step just involves a little bit of manipulation in order to construct a piece that will fill the space.
(see the second photo for what my gap filler looks like)

Now basically everything is level with the top of the circuit board housing. (which means it will all be nice and flat when we place our decoration paper on top of it all.)

Once constructed, tape it all to hold it in place (see third photo)

The final step to this phase is to cut two pieces of thin cardboard to cover the batteries. Once cut - tape them in place (refer to the fourth photo)

Step 13: Start to make it look pretty...

Picture of Start to make it look pretty...
100_1330.JPG
100_1331.JPG
Now that the housing is complete you will want to make it look nice by adding decoration.

This is where you can start to get a little creative yourself (or rather - more creative than me...) All I did at this point was to use a whole heap of double sided tape and stick down some Christmas wrapping paper. (see the first photo for the double sided tape BEFORE the backing has been removed)

The second photo shows the completed package with the screen square cut out.

The third photo shows the rear of the card.

you may have noticed that there a re no holes for the push buttons - that's okay because you can still press them even with paper ontop - nifty huh?

Step 14: Stick down your button locators.

Picture of Stick down your button locators.
I cut two little stars from a Christmas card for my button locators.

I just stuck them down on top of where the two buttons are.

Step 15: Construct and attach the card flap.

Picture of Construct and attach the card flap.
100_1352.JPG
With the 'main' part of the card built, it is now time to construct the front cover card flap.

You will again need a 12cm square piece of thin cardboard.

Decorate it however you please (I used some more wrapping paper to decorate mine) The first photo shows the 12cm square piece of cardboard and also a 12cm square piece of Christmas wrapping paper.

Once you have it looking just as you want, use two lengths of sticky tape one on the outside of the card and one on the inside to hold the flap in place.

the second photo shows the completed flap in place.

Step 16: Final testing and thoughts...

Picture of Final testing and thoughts...
Just as with the previous test, if you press any of the two buttons, the game should turn on.

Pressing the up and down buttons should make you move up and down accordingly.

If you don't press any buttons for approximately 30 seconds, the game should go into standby mode.

Thoughts...

I really could have made this project better in a number of ways.

1. I should have included an ON / OFF switch. upon further testing, the standby mode actually draws quite a bit of current still and therefor the batteries will die in a couple of days even if you don't play it... So a power switch would fix this problem.

2. I need to work on my arts and crafts. Mine certainly could look a whole lot prettier!

3. Make the batteries more accessible for ease of replacement.

4. Maybe even replace the coin cell batteries with a mobile phone battery and include the charging circuitry so that the card could be recharged using USB?


Step 17: Description of how the circuit works.

I have made up a couple of pictures to help describe how this circuit actually works. Please note that the pictures below are of a single colour (RED) LED matrix whereas the Christmas card circuit actually uses a bi-colour (RED/GREEN) display.


The 8x8 LED matrix display's are (believe it or not) connected in a matrix. This means that you don't just have 2 connections for each led (of which there are 64 LED's) instead, the LED's are connected in such a way that we can light up every LED in the matrix and to do this, we only require 16 connections (rather than 128 doing it individually)

You will notice the image on the left has 64 LED's connected in an 8x8 LED matrix. There are 8 Columns where the cathodes are all connected together and also 8 Rows where the anodes are all connected together. The image on the right will be used to demonstrate how we get the matrix to do what we want.
(REFER TO PHOTO 1)


Let's start out nice and simple. What if we wanted to turn on just the top right LED. Well. we would need to ground the right most cathode and then connect the top Anode to our power supply (+5v) through a resistor, just like this next picture:
(REFER TO PHOTO 2)

You may also have guessed that if we connect +5v to the top row of anodes then EVERY anode up the top will have +5v connected to it. The reason that only the top right LED turns on is because we have only connected ground to the right most column of cathodes. We need the combination of +5v AND ground in order to complete the circuit to turn on whatever LED or LED's that we want.


What about if we wanted to turn on an entire Column of LED's? We'll you would connect your matrix as follows:
(REFER TO PHOTO 3)


Or perhaps you want to turn on an entire row?
(REFER TO PHOTO 4)


I will be using this next circuit to explain things a little further.
(REFER TO PHOTO 5)


To help us with scanning the display, we use a 7442 1 of 10 decoder.
(REFER TO PHOTO 6)


The 7442  is a 16 pin chip, of course it has a +5v connection and ground in order to power it up. It also has four inputs namely A, B, C and D. lastly, it has 10 outputs - 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. It is quite a simple chip to work with. The outputs will vary depending on what combination of 1's and 0's are on the inputs. All outputs of this chip will be a logic high EXCEPT for one. That one will depend on the input. Here is a chart showing you what the output will be for all combinations of inputs
(REFER TO PHOTO 7)

having a look at the 7442 output, we can make any one of the outputs low (or pretty much connect it to ground) by giving a certain combination on the input. If we wanted output 0 to be low then we would input 0000 OR if we wanted output 6 to be low then we would input 0110 etc...

We only require 8 (of the 10) outputs from this chip therefor we use these 8 combinations on the input:

000
001
010
011
100
101
110
111

This means that we don't need to use the fourth input line (D) so that is why I have connected it straight to ground and only the first three inputs (A, B and C) are connected to the microcontroller so we can control them. So this means that we will have any one of these eight combinations on the inputs:

0000
0001
0010
0011
0100
0101
0110
0111

So hopefully you can see that by using this chip, we can 'Activate' one column of Cathodes at a time by connecting one column at a time to ground (logic 0) and to do this it only required 3 I/O lines from the microcontroller - whereas without the 7442, we would have required 8 I/O lines and we only have seven to spare (because PORTB is used for the anodes and PORTA pin 5 cannot be an output)


So now we are working towards drawing a picture on the screen. Here is what we want to draw:
(REFER TO PHOTO 8)

Now you may very well be asking "That's a pretty picture, BUT how do we draw a picture with all of those LED's lit up at once if we can only 'activate' one column at a time?"

We'll I am glad that you asked that question! there is a little bit of a trick to it.

What you see on the 8x8 matrix is a face. BUT not all columns are on at the same time - infact only one column is drawn at any one time but we 'scan' through the columns so fast, that to the human eye it just looks like one steady image.


If we were to slow down how fast we scan through the display, you would see something like the next photo.
(REFER TO PHOTO 9)

You will notice that we activate a column, then place eight bits of data on the data bus and it displays that data on just that one column. Then we move to the next column in line and then place a different eight bits of data on the data bus for that column. We keep doing this until we get to the end. That is one complete frame.

If we were to do this alot faster then our brains would perceive this as one steady image. Similar to how your TV or computer monitor works.

I hope this discription helps!
 


 




1-40 of 56Next »
Will this decoder work?
http://electrontubestore.com/index.php?main_page=product_info&cPath=68_72_107_51&products_id=146
bradsprojects (author)  knexpert17002 years ago
Yes that one will be fine :)
belsey3 years ago
I've been wanting to try my hand at electronics. This instructable is so well explained and illustrated, and looks fairly simple and inexpensive, plus I love making cards, so I thought this would be a good place to start... However I'm already stumped at step two. The direction to "simply open the hex file in your programming software and burn it to the microcontroller" makes me draw a blank. What is programming software? How can it be burned to a microcontroller? What would be helpful would be a link to different programming software sites (maybe 2 links, one for PCs and one for Macs) so novices like me can go to download programming software, and learn the really basic basics.
Redsic belsey2 years ago
Do a quick google PIC programming

You will find guides like
http://www.mstracey.btinternet.co.uk/pictutorial/picmain.htm

You will find the manufacturers website, where you can download the software
http://www.microchip.com/

And you will find
Compeitor compilers like http://pp06.sourceforge.net/
I am sorry your question was asked a year ago, and nobody responded, INST seems to have a sleeping community.
belsey Redsic2 years ago
Thank you!
READ ME!!! >:-O
Hi, I wanna know if this is the right micro controller: (just in case)
http://www.mcustore.com/gbp/section30/117-pic16f648a-18-pin-microcontroller.html
bradsprojects (author)  knexpert17002 years ago
Yep, that's the one : )
Zakkron3 years ago
Hi, I really don't know anything about microcontrollers. Does it matter if you have a
PIC16F648A-I/P, PIC16F648A-I/SO, or PIC16F648A-I/SS?
bradsprojects (author)  Zakkron3 years ago
Hi, these different part numbers are all the same chip, however just built into a different package. The one I used is the I/P which is the ones with the legs that go through the board and get soldered onto the other side. The other two are smaller surface mount chips which have legs that don't go through the board but are soldered on the same side as the chip.
hey i also have another question is there a way you can send me a preburned micro controller. i know how these work but i dont have the peice that will allow me to connect to my computer and burnit on to the controller.I will pay with my paypal/creditcard if needed. Cheers (im from america lol )
hey i was wondering how deep you cut these and also how do you know when you make these cuts well enough
bradsprojects (author)  vincentstockdale3 years ago
You just need to cut them so that the copper is removed, leaving just a channel of pcb.

To make sure, you can cut them with a stanley knife and then use a flat blade screwdriver (a small one) to make the channel a bit wider.
Oh wow!!! Incredible! I'll never be able to make this but oh well- I may try sometime :D
Oh and btw your accent is awesome ^-^
PJPEEJ4 years ago
and how do you solder so well?
PJPEEJ4 years ago
Hi thanks for the ible. I plan on making this, but i am a noob at soldering, but i do have some experience with electronics. I was wondering, where can i get the programming software for the hex file? I already downloaded it to see if i had it already but i dont. Also, I have a mac.

Thanks
andy707074 years ago
This looks like a good project, but instead of using stripboard, I would like to make a PCB. Could you check my PCB design to make sure the pins are all connected correctly? Please note some of the resistors are simply wire links (R12-16). I am also having a lot of trouble programming the pic, I have the correct pic chip, but my pic programmer doesn't seem to like the hex file your provided. Would it be possible to send me a per-programmed pic (I can pay for the cost of the pic, the shipping, and your time), or I could send you my pic to program if it would be cheaper/easier.
LED Game.bmp
bradsprojects (author)  andy707074 years ago
Hi,

have you got your pic in the circuit when you try and program it? What programmer are you using?

Also, why are you not using resistors with your LED's? If you don't use resistors, the internal resistance of the chips will need to drop the rest of the voltage (which increases the chips power consumption) which will most probably burn it out pretty quickly.

As for the PCB design, it looks very different from the schematic. Did you get the schematic from here:

http://www.instructables.com/files/orig/F9A/MK4K/G3KY0ONB/F9AMK4KG3KY0ONB.png
I haven't made the circuit yet as I want to develop a PCB for it. My programmer doesn't like the hex file you provided, and it would be a lot easier for me if I could pay you could send me a pre-programmed pic. I did use your schematic as reference, but I had to put the LED display together myself from various datasheets as the pins on your schematic aren't labeled. Also, I do have 150 ohm resistors on pins 24, 21, 18, 15, 1, 4, 7, 10, and 11, but I am not sure whether they are in the right place or not, I was hoping you would check this for me.
Sorry, I didn't realize how small that image was. Here is is in a higher resolution.
led game.jpg
mr.noris4 years ago
were can i buy these supplys
bradsprojects (author)  mr.noris4 years ago
You can get basically all of these components from any decent electronics store. I mainly buy my components online through ebay. If you buy in bulk, you can get some fantastic bargains!
Makeman4 years ago
in the 5 picture where did the other 1 (150) ohm resistor and 2 (10k) resistor go
bradsprojects (author)  Makeman4 years ago
The circuit you see here is just to show you the basic theory behind drawing a graphic on an LED matrix. The other 150 ohm resistor is used to display 'Santa' on the screen. The two 10k resistors are for the two push buttons. For more info on how the push buttons and 10k resistors work (and why we need the resistors) you can check out tutorial 4 on my electronics website.

www.bradsprojects.com then click on pic tutorials and then click on tutorial 4
Makeman4 years ago
I noticed that you added a small connector piece. is that required.Whats it for
bradsprojects (author)  Makeman4 years ago
That connector is where the pickit programmer plugs into in order to upload the code to the microcontroller. Some people have different programmers where you plug the microcontroller into the programmer to upload the code, before soldering it into the board.
pedronanez5 years ago
 how do you download the archive into the microcontroler ,but w
how do you connect it
bradsprojects (author)  pedronanez5 years ago
I have included 5 little pads on the circuit board so that you can connect the pickit2 programmer to it. then you just click 'program in the pickit2 software and it's done = )
a video wold be nice,cool project!
I will have a video uploaded today = )
cool :-)
 Zaphod's just this guy, you know?
There appears to be many kinds of 16f648a PICs, Do I want the 18 pin PIC16F648A-I/P or the 18 pin PIC16F648A-I/SO?
Thanks.
bradsprojects (author)  circuitbreaker5 years ago
Just get the I/P

They are all the same chip, just different packaging (through hole DIP / Surface mount etc...)
Thanks!
andy707075 years ago
That hex file dosent seem to work with my programmer. It says it needs to be INH8XM format. It displays everything right except the last collumn of characters is replaced by random (non-hex) ones suggesting there is a problem with the file, and it shows up fine in notepad. So how can I convert it to INH8XM format or could you send me another version that is in that format? Thanks!
nolte9195 years ago
This is a really great Instructable.  Is there a reason you're reluctant to release the source code?  That would make it tons easier to adapt it to many different microcontrollers and alternative hardware.  It seems a shame to make such an awesome and detailed Instructable and leave out the source code.  If it's too much trouble to convert it to another microcontroller then let that be our problem.  We're not asking for a conversion, we're only asking for the original code.  It certainly wouldn't take anything away from your excellent Instructable and would, in my opinion, make it even better because we could more easily adapt it to our projects.

Would you mind posting the source code?

Please?!?!
bradsprojects (author)  nolte9195 years ago
Hi, sorry for the late reply.

This game is actually just a copy of the great race (a game I came up with a few years ago)

you can check out all the details of that including source code on my electronics site:

www.bradsprojects.com/index.php
Hey thanks!!  I can't believe you wrote it in assembly.  You're a mad man.  Great website too.

And by the way, responding to a comment in less than 72 hours is a pretty friggin' prompt response in my opinion.  Thanks again.

Oh, and might I suggest putting a link to your website in the body of the Instructable.  Maybe say something like "you can find this game and others like it at www.bradsprojects.com/index.php
brunoip5 years ago
you should use the last green line too ...
andy707075 years ago
This looks like a really good project, I just went out and bought all the components except the PIC and the 7442, and I couldnt find one, so would this one be ok? http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=5190221 and if not, could you suggest an alternative or a link to somewhere I can buy one (preferably in the UK) Thanks!
1-40 of 56Next »