Simon Tweaking


Now that you've successfully made a Simon Board and thoroughly impressed all your friends at home, it's time to learn how to change your Simon Board into your own unique project!! That's right, your Simon board is capable of doing MUCH more than playing the Simon game. It can be re-programmed to do whatever you like. One creative lady at a past workshop planned to make a night-light that says "goodnight" with a unique sound and light sequence. Another person wants to use the Simon he built up to control the temperature of his custom made coffee maker. What will you do with yours? The sky is the limit!!

In this tutorial we will show you how to re-program your Simon Board. We will guide you through setting up the software and hardware. To do this, you will need a PC or Mac and these 3 pieces of hardware:

For the fourth part of the tutorial, we will show you how you can use your Simon board to detect light. This example will require a photocell, a 10K resistor and a soldering iron. However, you can still upload the example code and listen to disco mode (without soldering on the light sensor).

This tutorial is broken down into 4 parts:

  1. Setting up the free Arduino Software on your computer.
  2. Setting up your hardware.
  3. Getting some example code onto your Simon Board - Example Simon Code Download
  4. Adding a photocell and using Disco Mode!!


1.    Setting up the free Arduino Software on your computer.
 

  • First, you will need to go to the Arduino website.
  • Click on the “Download” tab on the menu at the top of the page.

  • Next, scroll down the page a bit, and click on the “Windows” or “Mac OS X” link. This should begin the download process.

 

  • You may get the following pop up message. If so, click “Save File” and “OK”.  Then choose somewhere you'd like to save it on your computer. Your desktop is fine.


 

  • The program should save to your computer as a zip file. It will be titled, “arduino-0021.zip” Right click on the zip file and select “Extract All...”. This will extract the software from the zip file and create a folder containing the software. If you are using Windows XP or later, the extraction wizard will start up and when it's done it will navigate you to the correct folder.
  • Your new folder should look like the following window. Double click on the Arduino Icon, and it should begin to run the software.

  • You may see the following warning pop up. Click “Run”.


 

  • You should see the following window pop up:

 

  • Congratulations! You have successfully setup the Arduino software on your computer! You are very close to tweaking your Simon!!

 


  

2. Setting up your hardware.

  • Note, If you bought a 40-pin strip of breakaway male headers from the website, you will have to break off a 6-pin section from the larger strip. You can cut these using some pliers, or snap them using your hands by bending the strip at the desired break-point.

 

  • These 3 items will be the link between your Simon Board and your computer. First, plug in the 6-pin male header into your FTDI basic board. Make sure to put the long end of the headers into the FTDI like so:

           
 

  • Next, plug in the USB cable into your computer. Then plug the other end into your FTDI basic board. You should notice that the RX and TX leds on the FTDI blink a few times. This indicates that your FTDI is communicating with your computer. *Note, at this step, you may need to install some FTDI Drivers. They should be included in the zip file that you downloaded from Arduino.cc. You can find them in this sub-folder of the zip file: "arduino-0021\arduino-0021\drivers\FTDI USB Drivers". If you are using Windows XP, an Installation Wizard should begin. You can click the "Install Automatically".  If you are having trouble with this, you can direct the installation wizard to the driver folder within the download.

           
 

  • Now you are ready to link your computer to your Simon Board. First you must find the programming port on your Simon Board. You will find it near one of the edges of the Simon Board. It looks like 6 holes with nothing soldered into them:


 

  • To reprogram your board, you are going to push the 6-pin header (that is already plugged into yout FTDI board) into this port. You will have to hold it at an angle to cause a temporary connection. You will also need to make sure you align it properly.  If you flip your Simon upside down, then you should see that the holes are labeled with some white ink. Look for the two pins labeled, “GRN” and “BLK”.  These indicate the proper alignment of your FTDI board.


 


3. Getting some example code onto your Simon Board.
 

  • Now that you've got your hardware setup, it's time to go back to the Arduino software and re-program your Simon Board. Before we can start re-programming there are just a couple settings we need to change in the software.
  • First, Click "Tools" from the menu at the top of the window. Then follow the options to select Board>LilyPad Arduino w/ ATMega328. This is so that the Arduino program knows that it's talking to a Simon Board. (the Simon and this LilyPad have the same chip).

  • Next, we need to tell Arduino which COM PORT we are going to use. (This is the communication channel that your FTDI breakout board is talking on). To do this, click Tools>Serial Port>COM4.  Note, you may have a different COM PORT option here. Do not select COM1 - your FTDI is not going to be on this COM PORT. Select the option directly below COM1.

  • We have written 4 example pieces of code that can be used on the Simon Board. You can download them here:

Example Simon Code Download

  • At this point, I would like to mention that any piece of code written in the Arduino Software (such as the examples in the download above), are more commonly referred to as a "Sketch".  Although it is essentially a text document, while you are writing and editing code within Arduino, it is saved as a ".pde" file and called a "Sketch".
  • On your Arduino window, click on File>open from the upper menu. Navigate to the folder titled, “SIMON_1_BLINK”. Now double click on the file titled, “SIMON_1_BLINK.pde” This file contains the Sketch (aka example code.)
  • You should see a new Arduino window pop up with the sketch inside the editor window.

  • Make sure your Simon board is on. While holding your FTDI in place, click on the “upload button”. It is the square button at the top of the window with an arrow to the right.

  • Give it a few seconds, and you should see an LED begin to blink on your Simon board. If so, congratulations!! You just successfully uploaded a new piece of code to your Simon Board!!
  • If you like, you can read the grey text at the top of the window. Any text that is gray is known as comments, and will help you understand the code. Comments are actually ignored by the Arduino program, and will not be programmed onto your Simon Board. The most important part of all this text is the code found at the bottom of the window.  This is the actual code that makes it onto your Simon.

  • Try opening up the other SIMON_EXPERIMENT examples 2 and 3. Upload them to your board and try hitting the buttons. Again, you can read the gray comments to get a better understanding of how the code works. If you'd like to get your Simon back to playing the original game, upload the sketch called, "Simon_Game_Code.pde". This is the same code that we pre-program the chips with before they are packaged up in the kit.

 


4. Adding a photocell and using Disco Mode!
 

  • This part of this tutorial requires a couple more pieces of hardware and a soldering iron. The two pieces of hardware are: (1) a Photocell and (2) a 10K resistor.  Using these (and a little bit of code) we can detect light. This will be useful in detecting whether the lights are on or off in a room. In the Disco Mode example code, we will have the Simon board only go into Disco Mode when the lights are off – when it's time to get your boogie on!
  • First off, let's take a look at the two components. Below, we have a picture of the photocell and the resistor. Do you recognize that resistor from building your Simon? It's the exact same component you soldered into place when you built up your kit!!

  • Next, let's take a look at the schematic for the light sensing circuit! Don't be scared – it's actually quite simple!

 

 

  • A schematic is a drawing that represents physical things. It shows us how we are going to connect the two components to the Simon Board. The green lines represent “nets” or connections. The other symbols represent actual things (like the photocell and resistor). The last three things in the schematic represent pin-outs on the Simon board. (GND, A0, and 5V).

 

  • First let's find these 3 holes on the Simon board. They are located on the bottom side underneath one of the batteries.

  

  • Next let's twist the Photocell and Resistor together in a way that will work with the schematic.  Notice in the Schematic how A0 is actually connected to both the photocell and the resistor. In order to solder this connection, it is helpful to twist one leg of the Photocell and one leg of the resistor together. See the two pictures below:

       

  • Now we have essentially 3 legs that will solder into 3 pinouts on the Simon. Before we begin to solder, please check out this picture below that shows how the legs should connect to the Simon.

  • Notice how 5V and A0 are going to have to overlap. Be sure to remove your batteries before you start soldering.
  • When you are finished soldering them into place, it should look something like this:

  • You can bend it around the edge so that the photocell is facing up and will do a better job of detecting the light. Like so:

  • You are almost ready to upload the Disco Mode Code!  First, put your batteries back in and turn your board ON. Then open up the Arduino Software and open SIMON_DISCO_MODE.pde
  • While holding your FTDI in place, click the upload button.
  • After the code is on there, try killing the lights and see if disco mode starts up!! If so, congratulations! You have just successfully completed your first embedded electronics project!
  • If you are interested to learn more about code, we recommend looking at some of the example sketches that come build in to the Arduino Software.  Click File>Examples>Basics.  All of the examples have good comments that will tell you a lot about how the code is working. But most importantly, we hope that you can start working on a project of your own. We find that most first time makers have more fun and are most motivated when they have a specific goal in mind. If you can think of a project that you would like to create  – whether it's a night light or sophisticated self-destructing robot – this will help you stay focused and you will be amazed how much you can learn along the way!! Happy Soldering!

Comments 9 comments

  • So, if we tweak the code, we lose the original game code including the easter egg, right? Does anybody have the game code with the easter egg included?

  • Hey Pete,

    This is awesome. I’m trying to get my 9 year old interested in programming this.

    Can you provide a simple example of generating a tone on the speaker?

  • I wrote some code to turn the simon says into a 4 hole ocarina: https://github.com/mrsoltys/Simon-Says/blob/master/Firmware/Ocarina/Ocarina.ino

    Note: the original code with the easter-eggs and everything can be found at: https://github.com/sparkfun/Simon-Says/tree/master/Firmware/Simon_Says

  • Now here is a tweak I wrote - Simon Says MAGIC! that adds a Magic Trick function to the kit. Enjoy!

  • Great tutorial, I used it to load the Magic trick onto my Simon Says. The initial instructions don’t specifically say to put the batteries in and turn it on in order to load the program onto the board. I had given up but then for some reason I kept reading on into the Disco Mode and, there it was, the golden information I was looking for!

  • Okay, just a little wondering here. I have all the stuff, and getting the hang of it, but I have one problem. I’m not sure what pin the speaker is on. Can someone who knows possibly provide assistance?