Close
0%
0%

ATtiny85 Mini PCB Violin

A tiny violin for playing tiny tunes ♪

Similar projects worth following

Designing and building this tiny violin was a fun way to experiment with building my own microcontroller development board from scratch, as I've been meaning to do for a while. So I'll be documenting the whole process here, from PCB design to programming the microcontroller.

schematic.png

Portable Network Graphics (PNG) - 72.81 kB - 10/18/2020 at 19:12

Preview

  • 1 × JLCPCB Customized PCB
  • 1 × ATtiny85 Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers
  • 1 × Piezoelectric Buzzer LPT9018BS-HL-03-4.0-12-R CRE-SOUND ELECTRONICS
  • 1 × Push Button B3U-3000PM
  • 2 × Side Mount LED LL-S110UYC-Y2-2B LUCKYLIGHT

View all 8 components

View project log

  • 1
    Circuit Schematic

    The first step was choosing the microcontroller I was going to use, based on the functionalities I wanted my violin to have. I needed at least one PWM pin for the piezoelectric buzzer and another two digital pins for the LEDs and for the push-button, so the ATtiny85 turned out to be the perfect fit.

    The circuit schematic is fairly simple. The ATtiny85 controls two LEDs and a piezoelectric buzzer, and I also added a push-button for switching between songs. The whole circuit is powered by a 3.7V LiPo battery.

    I wanted to make the PCB as small as I possible, in order to be able to use it as a badge, so I found the tiniest microcontroller package (MLF-20).

    As an extra feature, I also connected the strings of the violin to an analog input of the microcontroller, in order to actually be able to play the violin by touching the strings with a conductive material.

  • 2
    PCB Design

    I use Eagle CAD for designing my PCBs, and Gordon Williams' SVG to Eagle converter is always my go-to tool when I need custom PCB outlines. I traced the outline of a violin in Inkscape and then converted it to an Eagle script with this tool.

    In order to obtain the shine-through effect for the F-holes of the violin, I placed side-view LEDs on the back of the PCB and I used the Top and Restrict layers to remove copper and solder mask from that area.

    These are the PCBs I ordered from JLCPCB. The silkscreen is very detailed and I think the matte black solder mask suits the violins perfectly! I forgot to remove the order number this time, but JLCPCB has an option to do that when ordering PCBs.

    I've added the Gerber files and the Eagle CAD files to this Github repository if you want to order it as well.

  • 3
    Assembly

    The PCB is just a bit larger than the smallest LiPo battery I could find, so I can hide the battery on the back of the violin. I didn't use the classic LiPo JST connector because it was huge in contrast to the rest of the components, so I soldered 2mm pins instead.

    A great tip that I've seen others use to enhance the shine-through effect of the LEDs is covering them with black hot glue.




View all 5 instructions

Enjoy this project?

Share

Discussions

James Newton wrote 11/07/2020 at 19:36 point

Just an idea: Instead of continuous traces, provide a line of vias with bare copper around each on the front of the PCB. On the back, connect the vias via SMT resistors. One end of each "string" goes to Vcc, the other to an analog pin. Then play by touching a grounded wire to the front and read the resulting voltage via A2D. 

  Are you sure? yes | no

Alexandra Covor wrote 11/07/2020 at 20:50 point

Thank you for the advice, James! I'll keep that in mind and will try it next time.

  Are you sure? yes | no

Alexandra Covor wrote 10/29/2020 at 07:16 point

@Tim Thanks for the tip, I'll look into it! 

  Are you sure? yes | no

Ken Yap wrote 10/29/2020 at 06:34 point

Great idea! I should make some to hand out to listeners of my tiny sob stories. 🐱

  Are you sure? yes | no

Alexandra Covor wrote 10/29/2020 at 07:15 point

Haha, you should! xD

  Are you sure? yes | no

Alexandra Covor wrote 10/28/2020 at 21:27 point

@Mike Szczys 

I'll post a log here if I'll manage to add some real strings to it, it's a great idea!

Haha, nope, you're definitelly not ovethinking it, you're actually right! I did this mainly for fun, just to experiment with programming an ATtiny, as I've never done that before, so I made it as simple as possible.

Thank you again, it's really encouraging! ^^

  Are you sure? yes | no

Mike Szczys wrote 10/28/2020 at 01:08 point

The wires as strings on this are brilliant! I was hoping you would mention this in more detail. Was hit hard to get the tension right? What are you using for the bridge?

Awesome job, these looks spectacular!

  Are you sure? yes | no

Alexandra Covor wrote 10/28/2020 at 21:00 point

Thank you so much, Mike! :) The strings are just PCB traces, not actual wires (although that would be so much cooler, I might try that!). Two of them are connected to GND, and the other two are connected to an analog pin. They work like these PCB switches: https://i.stack.imgur.com/L2AQJ.jpg, when they're touched with something conductive, the circuit is closed. I connected the strings to an analog pin, hoping I could map the values to frequencies, but I think a more interesting approach would be to play random tones at each touch of strings. I should add a demo video for that as well in the future!

  Are you sure? yes | no

Mike Szczys wrote 10/28/2020 at 21:14 point

Ah, that makes sense... but yes I'd love to see how a test of wires as strings would look. I think you'd have problem with them getting loose over time but you never know until you try and it would be such a cool look. You might be able to take strands out of stranded wire so that they're thin enough.

I think the idea of using the ADC to read analog values from them is really interesting. But not sure how that would work electrically... I would think you'd need some capacitance reading to get different behavior when touching a different part of the sting. Maybe I'm overthinking it.

Anyway, they came out great!

  Are you sure? yes | no

Tim wrote 10/29/2020 at 04:48 point

This may help to read the strings:

https://github.com/cpldcpu/TinyTouchLib

In principle you could also get an analog reading using the same method which would allow detecting how close a finger would be to the strings.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates