Author Topic: Analog signal 50Vpp into 3.3V MCU  (Read 1252 times)

0 Members and 1 Guest are viewing this topic.

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 564
  • Country: dk
Analog signal 50Vpp into 3.3V MCU
« on: May 29, 2021, 05:28:56 pm »
Hi  :)

Here is the situation: I am using a piezoelectric sensor which generates analog signals like these two attached (showing lowest and highest + imagine anything in between). Lowest is about 4Vpp and highest 50Vpp.

My board is running at +3.3V.

I do not care about the actual signal, I just want to send it to a MCU and digitalize it:
1 = there is a signal there (say above 4Vpp), 0 = there is not.
The MCU input can be an ADC or comparator input.

I am guessing the 50Vpp signal would actually damage the MCU, so the signal needs to be contained before being sent to the MCU.

How would you do that, without using a complex analog circuit (like a boost converter and an opamp)? I was thinking maybe adding some diodes to clip the signal?

Thank you!!  ;D
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 564
  • Country: dk
Re: Analog signal 50Vpp into 3.3V MCU
« Reply #1 on: May 29, 2021, 05:34:50 pm »
Actually thinking about it I do not now much about piezo sensors... I guess I should add a load to the sensor in any case?
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3113
  • Country: us
Re: Analog signal 50Vpp into 3.3V MCU
« Reply #2 on: May 29, 2021, 06:13:55 pm »
Have a look at this Sparkfun tutorial:

"Piezo Vibration Sensor Hookup Guide"
https://learn.sparkfun.com/tutorials/piezo-vibration-sensor-hookup-guide

Also, this page contains circuits which employ a piezo as a vibration or motion detector:

http://www.discovercircuits.com/S/s-vibration.htm
« Last Edit: May 29, 2021, 06:15:37 pm by ledtester »
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 564
  • Country: dk
Re: Analog signal 50Vpp into 3.3V MCU
« Reply #3 on: May 30, 2021, 08:51:00 am »
Thank you for the reply. I checked the sparkfun tutorial, but their piezo does not much low in voltage - mine is coming from a drum pad which is hit with a stick, probably why the spikes are a lot greated.

I try loading it with about 17k, then the spikes are about 14Vpp (-7V still sounds too violent for a MCU right?), problem is then the smaller hits are now only 2Vpp which might be harder to detect.

On the other side, I am thinking: these piezo sensors have a huge output impedance (mine should be around 40k I think), so with the output impedance and the diodes inside the MCU, would that not be enough to protect it?
« Last Edit: May 31, 2021, 08:38:17 am by simonlasnier »
 

Offline gcewing

  • Regular Contributor
  • *
  • Posts: 197
  • Country: nz
Re: Analog signal 50Vpp into 3.3V MCU
« Reply #4 on: May 30, 2021, 10:00:45 am »
You could use a resistor and zener diode to limit the input voltage.

I wouldn't like to rely on the MCU's protection diodes -- they're there to protect against damage, not to be used in normal operation. There's a chance that using them that way could cause glitches in the MCU.
 

Online nali

  • Frequent Contributor
  • **
  • Posts: 676
  • Country: gb
Re: Analog signal 50Vpp into 3.3V MCU
« Reply #5 on: May 30, 2021, 10:15:23 am »
Having done something like this before with analogue (a vandalism detector) I'd probably opt to rectify and measure the signal with ADC. Fine tuning the detection so ambient noise/vibration and accidental bumps don't cause false triggers can sometimes be a bit tricky, and it's easier to play about with in code.
 

Offline Alti

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: 00
Re: Analog signal 50Vpp into 3.3V MCU
« Reply #6 on: May 30, 2021, 11:21:46 am »
Use an opamp in differential arrangement and feed that to ADC.
This is like 6 resistors and raw opamp.
 

Offline e0ne199

  • Regular Contributor
  • *
  • Posts: 131
  • Country: id
Re: Analog signal 50Vpp into 3.3V MCU
« Reply #7 on: May 30, 2021, 12:54:26 pm »
try comparator
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 564
  • Country: dk
Re: Analog signal 50Vpp into 3.3V MCU
« Reply #8 on: May 31, 2021, 08:23:51 am »
Thank you all for the replies, I think I have what I need :)
 

Offline mrkev

  • Regular Contributor
  • *
  • Posts: 225
  • Country: cz
Re: Analog signal 50Vpp into 3.3V MCU
« Reply #9 on: May 31, 2021, 04:56:49 pm »
I wouldn't like to rely on the MCU's protection diodes -- they're there to protect against damage, not to be used in normal operation. There's a chance that using them that way could cause glitches in the MCU.
Actually, most MCU's have a limit current (usually something like 5mA, 20mA per port) which is specified in datasheet. This current should be absolutely fine (if the chip layouter didn't do something shady).
On the other hand, I fully agree that it's not a good practice. It's much better to use an extra shottky diode (with a smaller VF) between the pin and the VDD.
I think that the best solution would be a basic voltage follower with a resistor divider.
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 564
  • Country: dk
Re: Analog signal 50Vpp into 3.3V MCU
« Reply #10 on: May 31, 2021, 08:33:33 pm »
@mrkev: correct, my MCU says +/-5mA max per pin.
I am not sure what you mean with a voltage follower with a resistor divider? As I said I would rather not use an opamp unless really necessary :D

But actually I realized the output already had a TVS diode and a series resistor on, which does clip the signal.

Do you think that is ok to use the TVS diode for this (thinking now it will be used for "normal" operation and not only in case of ESD events)?

The circuit is basically:
Code: [Select]
sensor -> cable -> plug -> + -> 1.8k resistor -> MCU pin
                           + -> TVS -> GND
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf