Fork me on GitHub

Project Notes

#700 Laser Harp Kit

Build and test an 8051-based laser harp kit.


Here’s a quick demo..



There’s a common C51-based “laser harp” kit that is available in various packagings from sellers on aliexpress, icstation and other market-places.

I picked up one of the kits from an aliexpress seller to check it out. There are various build and demo videos out there, for example:



The kit comes with all the parts needed to build the harp, including USB power cable and speaker. Note: in the final build, I replaced the speaker with a piezo buzzer - the sound quality is not much different!

Item Qty Ref
1kΩ 11 R1-7, R16-19
10kΩ 8 R8-15
30pF 2 C3-4
10µF 2 C5-6
12MHz crystal 1 Y1
3mm blue LED 10 D1-10
STC89C52 1 U1
50 pin DIP socket 1 U1
wire 2 U1
40mm copper pillar 2 U1
speaker 1 SPK
5V laser 7 JG1-7
power jack 1 DC002
USB power cable 1  
8550 PNP 1 Q1
5516 LDR 7 GM1-7
pushbutton 2 K1-2
small copper pillar 4  
DPDT switch 1 KG
screw 4  

Circuit Design

The circuit is quite straight-forward:

  • 7 lasers are pointed at 7 LDRs monitored by 7 GPIO ports
  • 2 switches are wired to GPIO ports
  • the microcontroller polls/reads the LDR inputs and switches
  • the microcontroller generates the appropriate sound output (square wave)

Here is a transcription of the circuit in Fritzing:



Testing the Behaviour

The two buttons control the mode of the harp:

  • K1: play a tune. Rotates between “Happy Birthday” and a Chinese nursery rhyme “世上只有妈妈好” (Mother is the Best)
  • K2: selects between 3 note ranges octaves (low, medium, high)

The output frequencies:

Note Octave 1 Octave 2 Octave 2
1 141 281 561
2 153 317 627
3 178 355 705
4 187 375 740
5 211 421 837
6 237 473 937
7 266 530 1047

Here are some sample scope traces of the lowest and highest notes in the first octave:




After playing around for a few minutes, a couple of limitation are quite apparent:

  • why 7 notes?? There are plenty of spare GPIO pins, so why not 8 for a full octave?
  • tuning: I don’t think the note frequencies match standard tuning
  • button responsiveness: the code doesn’t handle concurrently pressing the range button and playing a note, making it very hard to play a tune across multiple octaves
  • “string” sensitivity: it does not appear very responsive to making/breaking contact with a laser

Next Steps?

I haven’t found the 8051 source code or tried to download it fro the chip. Hoever given the problems with the laser harp - most of which can be solved in code - I don’t think that’s a big loss.

The obvious next step is to redo this project but with:

  • 8 lasers/notes
  • new code that is more responsive and handles concurrent button presses while playing a note. Maybe attempt this with 8051, or switch to an AVR/Arduino.

Credits and References

Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.