Go Down

Topic: Oscilloscope... (Read 934 times) previous topic - next topic

0212995500229

Hello,
I would like to ask if anyone has seen any oscilloscope project with arduino that would connect to android device via usb (android device because of portability) and would allow measurements up to 40v.

I would need that kind device for measuring clipping on car amplifiers.

Thank you very much for help.

MrMark

There are Android apps that implement an oscilloscope using the devices audio input.  For 40V one would need external attenuation and some form of overvoltage protection, but that would be the case with an Arduino project anyway.  Such apps are limited in their general applicability because the device's analog input is typically DC blocked and only does audio frequencies, but should suit your application.

0212995500229

There are Android apps that implement an oscilloscope using the devices audio input.  For 40V one would need external attenuation and some form of overvoltage protection, but that would be the case with an Arduino project anyway.  Such apps are limited in their general applicability because the device's analog input is typically DC blocked and only does audio frequencies, but should suit your application.
I had looked at this way. But phones input won't work with frequencies lower than 150hz and I need to measure at 50hz. I would also like to use it to measure DC (for automotive).

Thank you for your help.

0212995500229

#3
Feb 03, 2018, 10:14 pm Last Edit: Feb 03, 2018, 10:48 pm by 0212995500229
If I understand correctly if I would go and create my own arduino code and android app I would just need arduino to send voltage readings to android device via usb as fast as it can (serial command)?
And than I would need to make app for android that would take these readings and draw a curve out of them?

As for voltage dividing and overvoltage protection I would first use two resistors for voltage dividing by ten (so 50v would become 5v) and after voltage divider I would use two diodes (one from gnd to A0 and one from A0 to +5V pin, to clamp voltage to max 5v).

I would drove a schematic to make it clear, but I don't have access to computer at a moment.




Is my approach correct?


EDIT: I have found this code. It works with pc:

define ANALOG_IN 0


void setup() {

  Serial.begin(9600);

  //Serial.begin(115200);

}


void loop() {

  int val = analogRead(ANALOG_IN);

  Serial.write( 0xff );

  Serial.write( (val >> 8) & 0xff );

  Serial.write( val & 0xff );

}


DVDdoug

#4
Feb 03, 2018, 11:03 pm Last Edit: Feb 03, 2018, 11:04 pm by DVDdoug
Are you planning on using test-tones or regular music?

Test tones are "easier" (music looks like garbage on a 'scope") but I hope you will use a dummy load because you can burn-up speakers with continuous high-power test-tones.

This could "work" but the Arduno's ADC can only sample (accurately) up to 15kHz.   And in case you're not familiar with the Nyquist theory, you need to sample at least twice per cycle (once for the top-half and once for the bottom-half) so that means you can only digitize audio up to 7.5kHz.

Also, to prevent aliasing (false frequencies) you have to filter the audio (to remove frequencies above the Nyquist limit) with an analog filter before sampling.

The thing you have going for you is that audio clipping is usually driven by the bass (low frequencies) so you might still see the clipping with normal music (or lower frequency test tones).

You also won't be able to transmit the data to your phone continuously in real-time and the Arduino doesn't have a whole lot of memory, so you'll have to sample a fraction of a second at a time and then pause to transmit it.  (So, you're going to skip-over lots of audio.) 


DrAzzy

The Arduino's ADC is not nearly fast enough to make anything better than a piss-poor 'scope. It is really not fit for purpose. I think the phone's audio input would probably suck a lot less.

But you can also buy - for not *that* much - a cheap smartphone size/shaped 'scope....
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

ard_newbie


An example sketch to send data to your phone :

http://arduino-er.blogspot.fr/2013/03/test-code-for-adk-on-arduino-due.html

Note that a DUE can sample an analog input at up to 1 Msps.



0212995500229

I wasn`t aware of all the limitations of Arduino, it that case I will rather buy cheap oscilloscope.
Thank you for your help!

Go Up