Forum Rule: Always post complete source code & details to reproduce any issue!
Page 4 of 4 FirstFirst ... 2 3 4
Results 76 to 83 of 83

Thread: test code for piezo

  1. #76
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    1,584
    Quote Originally Posted by seayaker View Post
    I don't understand the connection to the 3v positive from board, all the examples I've seen are just analog inputs and gnd.
    If you're referring to Paul's circuit for the piezo, the diode to 3v3 is used "clamp" the voltage from the piezo to < 4 volts, preventing damage to the teensy analog port.

    the monitor output attachment in your post #75 is NOT from the sketch in post #23????? the sketch in post #23 prints two columns of numbers, DAC output and A0 input.

  2. #77
    I just ran it again freshly copied from #23 same result, 1 column printing rapidly 328 or so. I replaced the diodes and rebooted and now-
    Click image for larger version. 

Name:	nd1.PNG 
Views:	11 
Size:	29.9 KB 
ID:	12308
    Last edited by seayaker; 12-16-2017 at 06:44 PM.

  3. #78
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    1,584
    those numbers look promising, though in post #69 I indicated I was interested particularly in the high end numbers (4000 ... 4032). Is English not your first language?

    The sketch that was printing out 328 (presumably A0 values) is a mystery. That you couldn't get a fresh copy of sketch #23 to load and run is a mystery. That you had to reboot and replace diodes is a mystery. T3.6 damaged? poorly soldered?

    I fear I am out of ideas ... hopefully, others will have some fresh insights.

  4. #79
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,305
    I'm also running out of ideas here. The build in message #51 looks correct. The waveform in message #62 looks right, but at only 1/100th the correct amplitude. Wrong resistors are the main reason I can imagine it would be "working" but the signal far too low. But the resistors are measured as the right values, so I just can not know why it is not giving a strong enough signal.

    Maybe the piezo was damaged? Did you solder the wires on the piezo? They are very temperature sensitive. Maybe if it got too hot the material may have been damaged.

    If you buy another piezo, I highly recommend getting one which already has the wires connected.

  5. #80
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,875
    Quote Originally Posted by PaulStoffregen View Post
    I'm also running out of ideas here.
    Well, I found it very unusual to have a piezo connected 'directly' (i.e. without any impedance transformation (FET or transformer)) to an ADC. It may only work for very slow sampling rates.

    If you buy another piezo, I highly recommend getting one which already has the wires connected.
    Agree,
    any piezo where the soldering iron is on for more than 1 or two seconds, may not work properly. The polarisation within the piezo is destroyed by excessive heat and the piezo does nor work anymore properly.

  6. #81
    I have at least 30 extra piezos all with wires, first thing I checked. When I connect one to+A0 and gnd. using Manitou's sketch in#55 I get exactly those numbers, 900-1100 with a tap and then flat line at 0. I have yet to see 1 example of a piezo triggering a midi note with the T3.6. It's time to cut my losses and move on. I have tested every connection on the board tried 1/2 dozen sketches that work with Arduinos but not with T3.6 The buttons sketch still works so maybe I'll find a use for the board sometime. Thanks for trying.

  7. #82
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,879
    Quote Originally Posted by seayaker View Post
    I have at least 30 extra piezos all with wires, first thing I checked. When I connect one to+A0 and gnd. using Manitou's sketch in#55 I get exactly those numbers, 900-1100 with a tap and then flat line at 0. I have yet to see 1 example of a piezo triggering a midi note with the T3.6.
    If you already get that beautiful 900-1100 peak, you are only a few lines of code away from triggering midi notes. Why then being so desperate? You aren’t really expecting others to do your work and to write the code for you?

  8. #83
    Junior Member
    Join Date
    Oct 2018
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    The other resistor connects to GND, in parallel with one of the diodes. This 10K resistor gives the piezo a load to drive. The result is much lower noise at the analog pin. In this test I used 10K, but you can adjust this resistor for more or less sensitivity.
    I'm using the suggested protection setup on my piezo analog inputs in to a Teensy 3.6 as Paul describes in post #9 and it's working with the code. The downside is I need to get the sensitivity up quite substantially on my diy midi marimba. With that in mind is there an upper limit when swapping out the 10K resistor suggested? 27k is heading in the right direction but with only minor sensitivity increase. I would love some guidance before proceeding higher up the values please!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •