This project shows how to create an MB Electronics Simon game clone using an 8-pin PIC12F683 microcontroller. The game includes a full emulation of the original Simon 'game 1' and the ability to select from 4 skill levels which control the number of colours you must repeat in a sequence in order to win the game.

The project was created for Sparkfun's microcontroller competition 2011 and aims to demonstrate an number of useful design techniques which can be used when working with low-pin count microcontrollers. The code is written entirely in C and fits neatly into the 2K of available program flash on the chip. The PCB is only 1.5 inches square and uses both SMD and through-hole components, however it is perfectly possible to recreate the project using larger components on a breadboard or a small piece of strip-board.

The game is powered by a standard CR2032 3V lithium cell which is mounted on the underside of the game. The design uses the ultra low power standby feature of the microcontroller meaning that no power switch is required. Overall power consumption is kept to a minimum by using the internal oscillator of the PIC running at 4Mhz.

You can see a video of it in action over on youtube
 
Remove these adsRemove these ads by Signing Up

Step 1: Parts List


The MicroSimon hardware consists of the following parts:

* 1 x PIC12F683 SOIC 8-pin microcontroller
* 5 x 10K resistors (1206 SMD)
* 1 x BC817 NPN Transistor
* 1 x 100nF capacitor (0805 SMD)
* 4 x 3mm LEDs
* 1 x CR2032 battery holder
* 5 x Tactile push-button switches
* 1 x QMX-05 speaker
* 1 x 6 pin 2.54" right angled header
gothen12345 says: Mar 13, 2013. 11:38 AM
Simon, I need desperate help with a similar project using a 16F84. Unfortunately my programming skills are absolutely awful. I have the 4 inputs on PORTA and the 4 LEDs on PORTB but I can't for the life of me figure out how to program SIMON into the chip. I know the commands but figuring it out is intensely frustrating.
deattila says: Jan 26, 2013. 10:20 AM
hello i have made your project but the programming is a little
problem, cause i use winpic wat for code do i need to use for
that program, i dont program for a long time so i hope you can help my

simoninns (author) says: Jan 26, 2013. 1:08 PM
You need to use MPLAB from Microchip to do the programming. You can download it (and the compiler) free from their website.
nodoubtman says: May 30, 2012. 1:31 PM
Here's the version of Colin Mitchell i have realised : http://www.youtube.com/watch?v=IzJERfsaF6E
nodoubtman says: May 16, 2012. 11:41 AM
I have used Colin Mitchel one's with a pic16f84A : http://www.talkingelectronics.com/te_interactive_index.html

it is great! :)
congradulation Colin!
Keep the good work!
marC:)
nodoubtman says: Apr 26, 2012. 8:52 AM
2n3904 is okay?
simoninns (author) says: Apr 26, 2012. 9:27 AM
It should be fine. I've never used one myself, so I can't be 100%. The application is a very basic one though, so pretty much any NPN would probably do the trick.
nodoubtman says: Apr 25, 2012. 6:00 AM
any other substitute for bc817?

thank you!
marC:)
simoninns (author) says: Apr 25, 2012. 7:45 AM
Any small signal NPN would do (like a BC337 for example).
nodoubtman says: Apr 25, 2012. 12:13 PM
2n3904 should work?

do you have a bigger schematic please? i don't see much on this one

thank you!
marC:)
simoninns (author) says: Apr 25, 2012. 8:06 PM
Follow the link in my profile to my website; there you will find better pictures of the project.
Stanh11 says: Jul 21, 2011. 11:57 AM
is there any other pic that i can use i cant find that pic where i live
simoninns (author) says: Jul 21, 2011. 12:44 PM
I would think that any similar PIC12F should do the trick. You will need to alter the fuse settings accordingly though.
Stanh11 says: Jul 21, 2011. 5:36 PM
what about the PIC12C508A the only difference i see is the memory this one is EEPROM and yours is flash
simoninns (author) says: Jul 21, 2011. 10:24 PM
I can't say I've played with that many types of PIC12F to really give you good advice (I usually work with 18Fs). Microchip have an on-line product selection tool which you may find useful:

http://www.microchip.com/productselector/MCUProductSelector.html
Stanh11 says: Aug 22, 2011. 4:37 PM
i have another question you have your own pic programmer or you using pickit?
because pickit is expensive and i would like to make my own programmer if i can
Stanh11 says: Aug 17, 2011. 8:50 AM
thank you this is my first project with a pic im kinda confused because i dont know much about pics but ill try to do this thanks for this tutorial
Tolaras says: Feb 21, 2011. 2:31 PM
Hello!

Really nice project! Congratulations!

I have one problem though. How can I assemble all these .c and .h files to an .asm file in order to load them to the PIC microcontroller? I tried microC for PIC and MPLab IDE but I couldn't managed it.

Thanks!
simoninns (author) says: Feb 23, 2011. 1:27 AM
The source code is for MPLAB with the HiTech PICC18 compiler which you can download for free from Hi-Tech's website. The code will not work with microC or microchip C18 compilers without alteration.

Hope this helps!
Tolaras says: Feb 23, 2011. 3:33 AM
I 'll try it later today..

Thanks!
Grazfather says: Feb 6, 2011. 10:50 AM
Nice. I like this a lot and I have a few 12f683's sitting around. Nice code, too.

One totally useless tip:

randomNumber++;
if (randomNumber == 5) randomNumber = 1;

could be

randomNumber &= 0b11;
randomNumber++;

to get rid of the branch, not that you have such a busy loop that you need to save instructions...
simoninns (author) says: Feb 8, 2011. 12:21 AM
@Grazfather - You could actually do it in one line using the mod operator, something like:

randomNumber = (randomNumber + 1) % 5;

But there is always the trade-off between code readability and memory efficient coding. I always go the 'readable' route unless I really need to save some bytes.
notsure says: Feb 6, 2011. 10:49 AM
Very well done!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!