Second prototype

A project log for Lightsaber prop with sound effects

An Arduino-based lightsaber with sound effects and an accelerometer

matthias-nigmannMatthias Nigmann 05/25/2024 at 03:240 Comments

Today I received the PCBs I ordered and the parts for the second prototype of the lightsaber. Assembling the PCB was very straightforward and worked with almost no issues. The sound is much louder and clearer and the reliability of the circuit has greatly improved.

The only issue I have with the second prototype is that the accelerometer is backwards. As it is now, the board would not fit inside the 1.25 inch PVC pipe we were planning to use as a handle. However, this is not an issue, as the headers on the accelerometer were accidentally installed upside down. We will just have to make sure that the kids solder the headers to the right side of the board.

I also had some difficulty uploading the audio data to the flash chip. Initially, I used this programmer, which consists of a sketch uploaded to an Arduino Mega and a Python program for communicating with it. However, this programmer was having some issues, probably because the chip I ordered for the second prototype was subtly different from the the chip I used for the first prototype. Eventually, I gave up on this method, and wrote my own crude programmer, which worked perfectly and was also much faster.

One of the key requirements for this project was that the Arduino Nano could be programmed (at least partially) using standard Arduino functions and libraries. To this end, I started writing an Arduino library that encapsulates all of the functionality necessary for interacting with the ATtiny and with the accelerometer.

I have updated the Github repository with the Arduino files, the Arduino library, the schematic, and the PCB files for this project. The schematic is also shown here.