Some time ago I was working on an Arduino project and I needed to see if the output signal was into compliance with the specifics. Thus I spent some time on the internet looking for Arduino Oscilloscopes already implemented, but I did not like what I found. The projects that I found were mostly composed of a Graphical User Interface for the computer written in Processing and a very simple arduino sketch. The sketches were something like:
void setup() {This approach is not wrong and I do not want to insult anyone, but this is too slow for me. The serial port is slow and sending every result of an analogRead() through it is a bottleneck.
Serial.begin(9600);
}
void loop() {
int val = analogRead(ANALOG_IN);
Serial.println(val);
}
I have been studying Waveform Digitizers for some time and I know reasonably well how do they work, so I got inspiration from them. These were the starting points of the oscilloscope that I wanted to create:
- the incoming signal should be decoupled from the arduino to preserve it;
- with an offset of the signal it is possible to see negative signals;
- the data should be buffered;
- a hardware trigger is required to catch the signals;
- a circular buffer can give the signal shape prior to the trigger (more to follow on this point);
- using lower lever functions that the standard ones makes the program run faster.
The sketch for the Arduino is attached to this step, along with the schematic of the circuit that I made.
The name that I came up with, Girino, is a frivolous pun in Italian. Giro means rotation and adding the suffix -ino you get a small rotation, but Girino also means tadpole. This way I got a name and a mascot.
Girino.7z90 KB
Remove these ads by
Signing UpStep 1: Disclaimer
Electronics can be dangerous if you do not know what you are doing and the author cannot guarantee the validity of the information found here. This is not a professional advice and anything written in this instructable can be inaccurate, misleading, dangerous or wrong. Do not rely upon any information found here without independent verification.
It is up to you to verify any information and to double check that you are not exposing yourself, or anyone, to any harm or exposing anything to any damage; I take no responsibility. You have to follow by yourself the proper safety precautions, if you want to reproduce this project.
Use this guide at your own risk!































































Visit Our Store »
Go Pro Today »




I quickly skimmed HardwareSerial.h and saw no usage of said namespace. Maybe versioning issue?
This thread seems kinda dead, so I may be speaking to an empty room...
ADC:1 is Analog 0 on Arduino,
PWM:1 is Analog3
but where to go with AnalogComparator:1 and Threshold:1?
Thanks a lot
Dinoi
Given that the Arduino has only one ADC you must alternatively feed to the ADC your signals. This means that you have to use the multiplexer (see step 8). At each iteration you have to:
- Read Ch 1 with the ADC
- Switch to Ch 2
- Read Ch 2
- Switch back to Ch 1
Plus doubling the number of channels you halve the amount of available memory, because you have to store two numbers at each iteration.
ADMUX |= ( ADCPIN & 0x07 );
unfortunately I am unable to locate ADCPIN in the datasheet or any of the source files provided by the Arduino developers. I like your solution and would like to dig into it a little deeper. Could you please provide some additional detail regarding ADCPIN? What it refers to and so on...Thanks for what appears to be a lot of work documenting this instructable.
#define ADCPIN 0
It refers to the ADC pin number that I used for the data acquisition.
Any recent update to the schemes?
a.f
No, there have not been any updates so far. I was planning to work more on this project, but some work problem denied that and are still denying.
I am still considering the idea of putting this project somewhere like Sourceforge.
Can I use a LCD T6963c and use with girino? I have one and it run at 6 Mhz, and i want to make your project portable. Can you help me with the code for that? My ideia is to have 2 channel, but not every time.
Thank you
This scope is great, my question though isâ¦
This Oscilloscope is only able to read 0 -5v ? Is there anyway to Increase this ?
I know adding a resistor can make this go up to like 0-48+volts but reduces it's accuracy.
This beats the other Arduino scopes I tried hand's down.
I think this is the best DIY scope out there,
On IDE maybe you could steal the IDE from lxardoscope on Sourceforge.
I get what your saying on the power it can be powered from 12v, but you RECOMMEND 5 Volts as that's what the Ardino uses...
I really like this, not because it is a really great and simple scope with a really small footprint space wise...
but simply because of it's growth potential...
Just an Idea... for most people growing an Interest in the field.. space and initial hardware outlay cost's are an issue...
I was recently lucky enough to win a great old oscilloscope, function generator multimeter and regulated power supply for pretty cheap... second hand
and when I say cheap... I mean a few hundred pounds...
and they pretty much take up almost Half my workbench space wise.. even stacking the power supply and function generator on-top of the Oscilloscope.
This Scope is set to be the cheapest and smallest space wise...
You could combine more into this, with an Arduino mega maybe for more inputs you could build in a simple Function generator... a Multi-meter, and design to put in your own regulated power supply....
all with one credit card sized board, with a bread board and some components, you could make a PCB CNC design layout and sell them for great profit, and great value saving the average enthusiast beginner hundreds of pounds, and ton's of desk space, so they can take their projects from the garage workbench to the study desk...
then to add on a Raspberry PI 25£ credit card PC with a customized distribution with Arduino IDE etc. or a cheap 7â android capacitive touch pad with apps.
You now have an entire workbench with a design IDE, with all the tools capable of operating off a 12 volt battery... powered by wall/solar panels, and all fit in one little box smaller than your average Oscilloscope able to fit on any desk, small enough that the wife does not throw it out !
The applications could be endless...
But this project has a lot of room for Growth... and If you highlight it's growth potential... there will be a lot more interest... and a lot more people building these, and making cut's with components able to be sourced cheaply in many countries...
Man...
You will have a following and be set for life.
Schools/Universities will want this, what better way to learn than to build your own test equipmentâ¦
Not to mention cost savingâs, Saving each school from forking out thousands per each lab desk, to a mere hundred or so pounds, making education affordable !
but keep it open source please, and make the commission of donations and official branded boards, Which people will want to have...
anyway.
If your keen to go down that Path, I am keen to help.
From a Automation/Integration/Programmer/IT specialist dabbling in electronics
Grinoscope
Simple Logic Analyzer
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1223530321
Multimeter
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1266030815/7
Waveform Generator
http://www.instructables.com/id/Arduino-Waveform-Generator/
Voltage Regulator
http://www.arduino.cc/playground/Main/RegulatedPositiveVoltageBooster
All in the same box, with say a Raspberry PI, Touchscreen/LCD, and a Lead acid Battery, = Super low cost full lab in one little box, Ideal for starters and beginners.
The calculation
ADCCounter = ( ADCCounter + 1 ) % ADCBUFFERSIZE;
involves an integer division which tends to be time consuming (at least on a Microchip PIC - I do not know Atmel as well). Instead, try
if (++ADCCounter >= ADCBUFFERSIZE) ADCCounter = 0;
Second, you can completely avoid the time required to evaluate
if(wait)
and live without the wait variable if you simply set stopIndex to a value that the counter never reaches, as long as you aren't yet in the post-trigger phase. I.e. during initialization (when starting a new sweep) set
stopIndex = ADCBUFFERSIZE + 1;
and when the trigger event happens then just do as you did so far, but without the boolean wait variable:
ISR(ANALOG_COMP_vect)
{
// Disable Analog Comparator interrupt
cbi( ACSR,ACIE );
// Turn on errorPin
//digitalWrite( errorPin, HIGH );
sbi( PORTB, PORTB5 );
stopIndex = ( ADCCounter + waitDuration ) % ADCBUFFERSIZE;
}
and the ADC ISR routine becomes
ISR(ADC_vect)
{
if (++ADCCounter >= ADCBUFFERSIZE) ADCCounter = 0;
if ( stopIndex == ADCCounter )
{
cbi( ADCSRA, ADEN );
freeze = true;
}
}
This period is very though for me but I am planning to modify the project according to your suggestions.
Hoppy
Here is such a project that uses an AVR, ready to be copied:
http://www.myplace.nu/avr/minidds/index.htm
The third op-amp stage isn't really needed. Did you try to run without it? (make sure the unused op-amps inputs are tied to VCC and VSS, respectively, to avoid oscillations).
Second, to protect the input stage against overvoltage I'd add clamping diodes to VCC and VSS, respectively, right at the place where the 1 MOhm resistor is. Good, cheap, fast, low-capacitance diodes would be e.g. 1N914.
For a GUI you could use Qt which is free and coded in C++.
Check my instructables to get an overview of what Qt could do.
Good luck
I was actually thinking about using the Qt with Qwt.
Here some information about that :
http://www.instructables.com/id/Control-your-arduino-from-your-PC-with-the-Qt-Gui/
For Qwt, take a look at this :
http://www.instructables.com/id/Make-graphs-on-Qt-and-plot-your-arduino-measuremen/
As you are a physicist (like me) you could find Qwt very useful to develop your applications.
cheers
That said, you seem to be in the position of writing new code, so this probably wouldn't matter.
Oh, did I mention the learning curve? :)
BTW - Really nice project. Well done.
I would like to use the preprocessor more, it is intriguing :)