Peak detector

Hello everybody!

I am new on this forum and just joined it. I am also using audrino for the first time and running few examples. I have to detect the peaks of an analog signal (only positive peaks) and the duration of one peak is 10 microsecond which i want to detect and to display the peak value. The thing which I want to know is that whether this is possible to do with audrino by using its analog pins and then to program it accordingly.

Thanks everyone in advance for the support.

Have a nice day

If the peak only lasts 10uS there is not enough time to make sure you always get it. You need a peak detector on the front end of the A/D.

Thank you so much for the reply but actually thats what my task is, I need to make a peak detector in a software form so that the hardware portion from the board can be skipped, as previously the project was done by using a hardware peak detector and then the peaks are send to the arduino for counting, but now I have to do it by programming the arduino so what do you think?

Can I use some kind of counter?

Thanks again

but now I have to do it by programming the arduino so what do you think?

I think that this is perhaps a school project being set by someone who doesn't know what he is doing.

so you mean that it is not possible to do in any way?

Well it takes the internal A/D converter 260uS to do a conversion, and you want to detect a pulse that is only 10uS wide. Do you think it is possible in any way?

:frowning: :frowning: well thats what my supervisor had told me to do so and I have already taken this project :frowning: he also thought that whether its possible or not and then he said that you could do it.

If I can use some some other hardware other than peak detector to do something with the signal or?? is there any other way? I am not really seeing something now :frowning:

he also thought that whether its possible or not and then he said that you could do it.

Well he didn't think correctly about it. On the other hand he could have said the pulse was 10 milliseconds and not microseconds.

If I can use some some other hardware other than peak detector to do something with the signal

Sure you use a fast A/D or a fast D/A & comparator to get the signal in at the speed you want. Then it is not a peak detector but it is more hardware than a peak detector.

Any way it's your project and unfortunately for you your supervisor.

hmmm.....so I guess that I have to talk with my supervisor again I just want to ask one last thing that comes in my mind that since the internal A/D is not compatible in this case but is there any other board or controller for which it becomes possible as I assume the A/D for arduino is quite slow and may be some other has a fast response or what do you say?

Thank you so much for your continuous feedback

The arduino's in not very slow, there are lots of slower ones.

There are many other boards with faster A/D converters but if you are having such a struggle with the arduino then these are perhaps out of your league.

Will make easy work of what you want but it is not a beginners system, although it is much cheaper than an Arduino.

Perhaps this will be a better bet although I am not sure about the exact spec.
www.adafruit.com/datasheets/PIC32-PINGUINO.pdf

Thanks once again just a little confusion when you said that work would become easy is it for STM32F4DISCOVERY or the other one? I could not really see its A/D speed do you know how much it that as you know I need to read the peak whose duration is only 10 micro seconds.

I said the discovery board would easily do it. That is the speed of the inbuilt A/D is way faster than you need. I also said it was out of your league in terms of complexity.

I said I thought the Pingunio would as well but YOU would have to check the exact spec. Who's project is it anyway, I already have my degree, so it is expected you do a little work for your qualification.

It is my project of one of the course in sensors, I wanted to do something related to Arduino to learn it thats why I talked with the professor and he gave me that I also think that discovery would be little difficult for me but I would have a look on Pingunio again, but I have not much time as the arduino is something new for me so I really want to get started on things soon so that I would be able to do things and at the moment I am just stuck in finding the answer of question that whether I am going in right direction or not with board selection.

scorp84:
I am just stuck in finding the answer of question that whether I am going in right direction or not with board selection.

I'd say that board selection is an important first step.

Has your supervisor told you to use Arduino, or was that your idea? It doesn't look to me like Arduino is a good choice.

Hi,
probably a simple peak detector input stage, as shown in figure, could work. When a pulse signal with amplitude Vin is injected,
the capacitor connected to analog pin 0 maintains a voltage (Vin-0.7) Volt until it is discharged. This is done through the resistor connected
to digital pin 8. The sequence to be programmed on arduino should be:

  1. set pinMode(D8, INPUT), this sets high impedence input avoiding capacitor discharge;
  2. measure the pulse peak by calling analogRead(A0) at a low rate
  3. when done discharge the capacitor by setting pinMode(D8, OUTPUT); digitalWrite(D8, LOW).

@ ea123

Thank you so much for a very good answer and I would definitely try it, just want to know that how much you are certain that this method would work? The peak duration as I told you is 10 microsecond and the amplitude is also not much around 1 V and also I want to ask that what do you think if your proposed method does not work then can I use some kind of external high speed counter for counting the peaks and then sending the signal to the controller, what do you think about that?

Thanks once again

@ PeterH

actually I wanted to do some thing on arduino and my supervisor did not have any project at that time so he just think about that and gave me this as a project

scorp84:
I wanted to do some thing on arduino and my supervisor did not have any project at that time so he just think about that and gave me this as a project

This is going to be hard to do with an Arduino. If the project is negotiable, I suggest you enquire about changing to a different project that doesn't involve capturing microsecond pulses.

How accurate your peak detector has to be?
There is a way to do it with arduino if you change ADC settings via direct control register manipulation, it works as fast as 6 microsecond. The same time measurements little bit less accurate and source of the signal should have low output impedance.
Check out this project to get the idea:

@ ea123

Thank you so much for a very good answer and I would definitely try it, just want to know that how much you are certain that this method would work? The peak duration as I told you is 10 microsecond and the amplitude is also not much around 1 V and also I want to ask that what do you think if your proposed method does not work then can I use some kind of external high speed counter for counting the peaks and then sending the signal to the controller, what do you think about that?

Look at the simulation in attachment done with pspice. The analog input is simulated by the op amplifier, while the discharge pin by the switch activated at 50 usec. The peak voltage is latched by the capacitor until the discharge. But what is your intention, to measure the pulse height or to count the number of pulses?

@ ea123

Thanks once again with your continuous feedback, well if I can measure the pulse height as well that would be better but even just the number of counts would be enough in my case, that is when a positive peak comes the arduino must be able to count 1 and then for the next positive peak it should count 2 and so on, so thats what I am required to do here, so what do you say then?

Thanks once again