Question about taking a program from one Arduino board to another board.

I am currently in a microprocessors class and I would like some advice for my final project. I am looking at building a nerf gun target game for my final project (and my kids). But I am not sure if I am biting off more than I can chew.

Basically my idea there will be a vibration sensor in the middle of the target and when the sensor is triggered, a series of LEDs would be lit up. After 5 hits, the LEDs will flash in a random pattern and a motor will turn on and spin something.

I am currenty planning on having the LEDs in groups of four to the left side, right side, the top and bottom of the vibration sensor.

I've been playing around a bit with the LEDs and I've figured out how to program one array of LEDs and then daisy chain the other 3 rows of LEDs so that I am essentually controling all four sets of LEDs off of four pins.

But I would like to have more control over the individual LEDs the only problem I have is that the board that I was given for class only has 13 digital outputs. If I decide to control the LED's individually I am looking at using 17 outputs.

This is the board that I was given for my class:

If I were to buy another board that has more digital output, would I be able to program bits and pieces of the program on the board that I was given for my class and then transfer the program to the other board or would I need to do all of the programing on the larger board?

would I be able to program bits and pieces of the program on the board that I was given for my class and then transfer the program to the other board

Basically yes.
If you give all PIN numbers as variables, or in form of #define statements, then their is only one line to change for each PIN number if it needs to be changed from one board to the other.

I would have thought that your big problem is going to be the vibration sensor, these things are not that sensitive and you might have trouble detecting such a low mass impact.

The vibration sensor is another concern that I've had. I am not sure the impact from the nerf gun will trigger it. If I can't get the vibration sensor to work, my back up plan is to use reed switches.

Thanks for the help.

Not sure what a reed switch will do, have these things got magnets on them? Even so you will not get them to switch a reed. If they do have magnets on them then you could use a compass sensor called a magnetometer.

For the target I'm more thinking of a mechanical switch, e.g. a push button that is easy enough to press that the impact of a nerf dart can do this.
Or maybe a piezo impact sensor?
Vibration sensors don't sound too suitable, as they will vibrate from impact elsewhere on the board.
Or a light sensor, the moment the dart hits it the light is dimmed. A photodiode or phototransistor may work for this (LDRs not, too slow).

I have played with vibration sensors before (in the lightsaber prop/hobby scene).. before the majority moved to accelerometers or gyros.

They have different ones/versions for sensitivity... you'll have to heavily debounce them.

I guess it depends on the force/impact of the nerf bullet, to see if has enough force to trigger some vibration..

wvmarle:
For the target I'm more thinking of a mechanical switch, e.g. a push button that is easy enough to press that the impact of a nerf dart can do this.
Or maybe a piezo impact sensor?
Vibration sensors don't sound too suitable, as they will vibrate from impact elsewhere on the board.

wvmarle:
Forgive my ignorance, but I thought a piezo impact sensor was the same thing as a vibration sensor?.

Forgive my ignorance, but I thought a piezo impact sensor was the same thing as a vibration sensor?

While the basic components use the same physical effect they are not the same. An impact sensor is a pair of metal discs with the active element between them. Where as a vibration sensor is a plastic sheet in a small block. It waggles about and produces an AC signal but the sort of vibration it needs is like a washing machine on a spin cycle.

Vibration sensor
Impact sensor

An advantage of using a piezo is that you can get an analog output from it which varies with the force of the vibration, which allows you to set a threshold for the trigger force. You could probably achieve that to some extent with a vibration sensor since it will be bouncing on and off for longer with a stronger impact but it will not be such a fine grained output as the piezo in my experience.

You don't necessarily need a specialized piezo impact sensor. You can use one of the super cheap piezo disks usually used as buzzers. They come in a variety of diameters but I didn't find a very significant correlation between size and sensitivity in my crude tests. I found it worth buying the ones with the leads already soldered since I had trouble soldering to those things. There are a ton of tutorials for using them as a "Knock sensor" or "Knock lock" you can find online, including this one:

Here is a test I did with a vibration sensor quite a few years ago.
An offset weight was on a motor with the sensor attached like this:-

Then I changed the voltage going to the motor.

Attached is a small 3gp movie which shows when the motor is running there is no output until the motor reaches a specific speed when you can see the trace move. Ignore the gaps in the trace that is just the stroboscopic effect between the video and the oscilloscope trace.

I think this shows how useless a vibration sensor is for detecting an impact.

Vibration.3gp.zip (101 KB)

The lack of output in the beginning, is that caused by the diodes requiring a minimum voltage to even conduct? At the lower speeds there is a small but noticeable ripple in the signal.
I'm guessing here those four diodes are a bridge rectifier, and that cap to smooth the output.