You are on page 1of 9

Home Sign Up!

Browse Community Submit


All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech

Low speed AVR oscilloscope V2.00 (Is updated on 19 Mar 2011)


by serasidis on December 15, 2007

Table of Contents

Low speed AVR oscilloscope V2.00 (Is updated on 19 Mar 2011) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Low speed AVR oscilloscope V2.00 (Is updated on 19 Mar 2011) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Selecting the components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 2: Designing the schematic diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3: Making the prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 4: Putting the components in order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 5: Soldering, calibrations and usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 6: Oscilloscope demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

http://www.instructables.com/id/Low-speed-AVR-oscilloscope/
Intro: Low speed AVR oscilloscope V2.00 (Is updated on 19 Mar 2011)
>> The firmware was updated on 19 Mar 2011 <<

A few months ago a friend of mine -car mechanical at profession- told me that he had problem with some car sensors. He couldn't check, with a simple multimeter, if a
sensor was working properly. I advised him to buy a LCD oscilloscope instead of a normal oscilloscope, because of its small size. The use of an oscilloscope is very
helpful because you can see the waveform that is produced by a "healthy" in-circuit-sensor* and you can compare it with the waveform of a "suspect" in-circuit-sensor.
After that, he told me that this oscilloscope costs a "fortune" for him as he has a small car service shop. I offered to help him by designing and constructing a small,
cheap and workable LCD oscilloscope for him.

*in-circuit-sensor is the sensor which is connected on a board (PCB) or it's connected somewhere in the car. It's not a disconnected sensor.

You can download the source code, hex, schematic diagram,PCB and picture of the circuit .

Image Notes
1. Probe connector
2. 12V DC power supply
3. DEM128064A 128x64 pixels graphical LCD
4. ATmega32 microcontroller
5. 1:2 voltage divisor switch.
Image Notes 6. AC or DC selector switch
1. The maximum voltage of he waveform. It shows also the voltage of a DC signal. 7. Beam up/down calibration.
2. It shows the Volts peak-to-peak of the measured waveform. 8. Power ON/OFF switch
3. The frequency of the measured waveform.
4. The waveform's displaying area.
5. Moves UP the waveform.
6. Moves DOWN the waveform.
7. Shrinks the low frequency waveforms to fit on LCD.
8. Restore the shrunk waveforms.
9. Calibrates Up or Down the horizontal beam on LCD.
10. Input probe.
11. Power socket (12 V DC).
12. On-Off switch.

http://www.instructables.com/id/Low-speed-AVR-oscilloscope/
Step 1: Selecting the components
As the circuit has to be constituted by a few and cheap components, I chose the DEM128064A graphical LCD based on KS0108 controller chip to display the measured
signals. The ATmega32 microcontroller is chosen because it has a lot of IN/OUT pins and a 2kB RAM size. 1kB is needed from gLCD and some bytes of the rest 1kB
are used in C source code as registers. Because my oscilloscope has to read both AC and DC currents and at the same time it should have a High input resistance, I
chose to use an LM358 which is a dual operational amplifier. The rest components like LM7805 , capacitors and resistors are very common and I won't refer to them.

Image Notes
1. ATmega32 microcontroller
2. LM358 operational amplifier
3. DEM128064A 128x64 pixels graphical LCD

Step 2: Designing the schematic diagram


After I had chosen the components, I had to draw the schematic diagram of this circuit. For this purpose I used the Splan 5 that is not freeware but it is a very cheap
schematic diagram software.

http://www.instructables.com/id/Low-speed-AVR-oscilloscope/
Step 3: Making the prototype
The prototype was made on a dual breadboard and the microcontroller was placed on an STK500 development board (see photo). I haven't taken any photos from the
prototype board. So, I can show you only the boards without the components I used on them.

Image Notes
1. Breadboard
2. STK500 development board

Step 4: Putting the components in order


The breadboard circuit was temporary. It was the time to make the PCB for my AVR oscilloscope. The software that I used to draw the PCB is the Sprint layout 4 . It is a
really easy-to-use, cheap and efficient software to make your own PCBs.
I made my PCBs by myself by using toxic chemicals. That's why I don't describe the procedure. It's very dangerous. I suggest you to give the transparency that you will
print to a professional to make the PCB for you.

Image Notes
1. PCB 101x160mm size
2. Component placement on PCB

http://www.instructables.com/id/Low-speed-AVR-oscilloscope/
Step 5: Soldering, calibrations and usage.
Soldering
Solder all components on PCB, starting from the smallest and go on to the biggest component. Check the PCB from soldering side for shortcuts that could have been
made during the component soldering. Remember to put IC3 on a base, so the removal for future reprogramming can be done very easily.

Calibrations
If everything is ok, supply the circuit with 12V Dc. On the screen you will see the oscilloscope's raster with a horizontal line on it. Adjust P1 (LCD contrast) with a small
screw driver up to the point you will see clearly the content of the screen. If you adjust the P2 you will see that the horizontal line (beam) will be moved up or down
depending on the adjustment of P2. Adjust the P2 to set the beam at the center of the screen.

Usage
Connect a 1:10 probe at BNC connector (K1) of oscilloscope. Now you are ready to make your own signal measurements. Take care not to exceed the maximum input
voltage which can be up to 24V Ac or 30V Dc on 1:10 selection prob. At 1:1 the maximum input voltage can be up to 2.5V Ac or 5V Dc. S1 gives an extra input voltage
division by 2. With S2 you can select between AC or DC input signals.

Step 6: Oscilloscope demonstration


See AVR oscilloscope v2.00 in action!

See more of my projects at http://www.serasidis.gr

Thank you for reading


Vassilis Serasidis

Related Instructables

Debugging AVR
code in Linux
with simavr by
Easy Atmel
AVR acoustic Help: An Faraday For hardwarehank
spectrum Absolute Fun: An Xmega Sine
Beginner's Electronic .... by vithrar Wave /
analyzer by Waveform
manekinen Guide to 8-Bit Batteryless Dice
AVR by Gadre Generator by
Programming- wandererwolf
AVR Dragon by
PopSci

http://www.instructables.com/id/Low-speed-AVR-oscilloscope/
Comments
47 comments Add Comment

serasidis says: Mar 21, 2011. 8:53 AM REPLY


The firmware has been updated to version 2.00

- Now, indications such as voltage and frequency are displayed on LCD.


- A small increment of sampling rate has been made too.

rolocz says: Nov 23, 2010. 2:58 PM REPLY


Hello, nice project. Some time ago I (re) built and XY oscilloscope that uses external ADCs. That makes it a lot faster and a lot of nice curves can be
displayed. Not as well finished or as useful as yours, but still fun to build and try. If you please you can check it in my website:
http://eercz.com/en/avr_xy_oscilloscope_nokia_lcd

Regards

qz9090 says: Jul 14, 2010. 7:03 PM REPLY


Would you recommend a inexpensive 1:10 probe that I can used with this scope? Maybe a supplier and part number? Thanks.

com4both says: May 1, 2010. 6:56 AM REPLY


very good project..i have seen pc based oscilloscope...
but this one is very good.....

where can i get the lcd....its not available here at my place...


i can make online shopping..
can anybody who made this project, send me few links for online shopping

what will be the cost of the LCD?

what is ks0108...do i need to buy this controller or simply lcd?

make my doubt clear....

dan_dan says: Sep 23, 2009. 8:11 AM REPLY


how much did the lcd display cost, nice design tho.

matchett808 says: Feb 27, 2009. 1:27 PM REPLY


hey....what was your total cost? Very nice job though...am needing a oscilloscope so wondering if this is the cheapest way to skin this particular cat.lol

geeklord says: Aug 28, 2009. 10:41 PM REPLY


The Pololu AVR programmer has a built in SLO-scope that I really like. It only works from 0-5v, and only on windows, however. But its only $20(USD), so
its great for simple low voltage applications.

serasidis says: Feb 28, 2009. 2:04 AM REPLY


The all project (including the probe) cost me about 70 euro.

mog123 says: May 11, 2009. 1:20 PM REPLY


I did the whole project in ~20-30 euro (<100 PLN)

matchett808 says: Feb 28, 2009. 12:05 PM REPLY


nice one....good build and quite cheep.....compared to the commercial ones i have sourced.

jamilm9 says: Jun 14, 2009. 6:53 AM REPLY


if you don't want to make this get this $50 prebuilt o-scope.
http://www.seeedstudio.com/depot/digital-storage-oscilloscope-with-panels-p-167.html
there is also a kit but it needs smd soldering.

senfield says: May 21, 2009. 7:48 PM REPLY


hello serasidis, we can use the mega32l instead mega32, the code is the same? , about the xtal, change the frequency or something? (cause the max clock
of the mega32 (16mhz) , i have a mega32l-8pi (8mhz) max, thanks

http://www.instructables.com/id/Low-speed-AVR-oscilloscope/
withume says: May 14, 2009. 8:29 PM REPLY
hlp, me to display the voltage,and frequency in the display........what changes hv 2 be done with this.

pkumarhu says: May 13, 2009. 11:15 PM REPLY


hi my name is pramod i hve done tis project it is very nice but i like to do some modifications i like to display the voltage and frequency on the lcd screen so
pls help me in changing the code

adie_hendri says: May 11, 2009. 5:57 AM REPLY


hi to ALL heloo Mr serasidis mr serasidis giveme advise u havent my question

mog123 says: May 6, 2009. 6:59 AM REPLY


Hey, I finished my oscilloscope!

http://i39.tinypic.com/30vk45l.jpg

It turns out i didn't need to use an inverter, your screen is the same as mine!
Although I have a problem: I'm using software 1.01 and I can't use the time/div buttons (left and right). Do you know a solution?

withume says: May 3, 2009. 1:52 AM REPLY


can this project be done using atmega32L, instead of 32 since atmega32 is not available for us.........pls reply me as soon as possible

serasidis says: May 3, 2009. 9:59 AM REPLY


Yes, you can use ATmega32L instead of ATmega32.

mog123 says: Apr 8, 2009. 2:22 PM REPLY


Hey, I found an LCD that input matches yours (and its a KS108). But 3 bits are negated (CS1 CS2 RST). Could you look in the datasheet if it will work like
yours or will I have to change something in the sourcecode?
Heres the datasheet
http://www.artronic.pl/o_produkcie.php?id=612

serasidis says: Apr 9, 2009. 1:03 AM REPLY


I think the LCD you mentioned needs inverted CS1, CS2 and RST signals. You have 2 choices: either you edit the lcd.c file correcting the commands for
these pins or you put 3 NOT gates between lcd pins and AVR pins. Depend on you what you will do. I would suggest you to find a pin-compatible LCD to
build this project.

mog123 says: Apr 9, 2009. 1:41 PM REPLY


so will this code be ok? I can't seem to find a screen with a compatible pinout ;/

http://mog123123.googlepages.com/glcd2.c

Besides I see that the "signal wire" of the probe connector (K1) is soldered to both ground(0V) and Capacitor (C2) why is that?

mog123 says: Apr 14, 2009. 5:35 AM REPLY


OK I'm gonna use a 74hct04 with the screen I showed you to invert CS1 CS2 and RSTB. I have one question though: Can I use an ATMEGA16
instead of 32? The hex file is only 10kB so it should fit or am I missing something important? Please reply.

adie_hendri says: Mar 15, 2009. 8:14 AM REPLY


hello im ADIE im so excited, so proud this great why in serasidis web , i can't join in forum . server not fungtion i will build up avr oscilosope u can help, an
give me advise?? oh yeah why this project is the limit 5khz, can you explain?? thanks best regars

thatonekid says: Feb 26, 2009. 4:56 AM REPLY


please post the schematic as a file so that it can be downloaded. thank you

serasidis says: Feb 26, 2009. 5:18 AM REPLY


You can download all you need from my web site:
http://www.serasidis.gr/circuits/AVR_oscilloscope/avr_oscilloscope.htm

DELETED_toolazy2p says: Dec 28, 2007. 11:53 PM


(removed by author or community request)

http://www.instructables.com/id/Low-speed-AVR-oscilloscope/
serasidis says: Dec 29, 2007. 5:53 AM REPLY
The main problem (up to now) is that the microcontroller spends a lot of time to draw the graphical LCD. When I improve this part of the code, the
oscilloscope will measure up to 7.5kHz that is the half of 15kSPS (kilo Samples Per Second). 15kSPS is the maximum hardware limit that the ATmega32
ADC (Analog to Digital Converter) can measure.

biojae says: May 6, 2008. 8:07 PM REPLY


So if i used a 1.2 ghz adc i could get that much more precission?

serasidis says: May 7, 2008. 5:46 AM REPLY


Actually, ATmega32 cannot process continuous data in higher speed than the frequency of this microcontroller works. Don't forget that AVR has
to draw the gLCD too.

ebidk says: Feb 11, 2009. 6:12 PM REPLY


Assuming it would be computationally cheaper one solution would be to add another cheap(smaller?) MCU to handle the display and have
the two communicate the data over I2C or SPI.

serasidis says: Feb 11, 2009. 11:40 PM REPLY


That would be a good idea but instead of using a second AVR I could use an Analog to Digital Converter chip (ADC) that could measure
more than 15k samples per second. The duty of AVR could be to read the values from the ADC IC and draw the gLCD. All of these could
be a good solutions but there are not as simple as the version I did. You could say that they are completely different circuits.

Narbotic says: Apr 13, 2008. 6:35 PM REPLY


On your site you mention that after burning the hex file, one should - "select external crystal at the fuses section.
After that, you Must disable the JTAG interface from your ATmega32 microController"
I'm attempting to calculate the fuse programming using this calculator , but I'm seeing a lot of other options for the external crystal - and only "enabled" or
unprogrammed options for JTAG.

Perhaps these variables make more sense in the software you're using?

I am quite new to AVR development, any help is greatly appreciated!

serasidis says: Apr 14, 2008. 6:12 AM REPLY


Go to fuse calculator page.
You should tick only these options:
- SPIEN
- BOOTSZ1
- BOOTSZ0

All the other options should be not ticked.


Press "Apply fuse bits" to see on your left the fuses.

Narbotic says: Apr 23, 2008. 7:28 PM REPLY


Many thanks! That info did the trick - and I learned a good deal in the process. great work, keep it going!

lordofthedonuts says: Jan 5, 2008. 1:59 AM REPLY


Very nice!

I want to build one but I can't find the DEM128064A graphical LCD, I've searched on many place i go to buy my electronics parts the only place I found LCDs
was at DigiKey and they only sell Optrex LCDs, looking from the specs you put in your Instructable the closer I came to, is this one :

http://www.optrex.com/products/partdetail.asp?PartNumber=F-51852GNFQJ-LG-ACN

I don't think this is it, yours don't have any backlights.

could you, please, send me all the Technical Specifications of the DEM128064A or an equivalent of it?

Thanks and have a good year!

PS. excuse my English, it is not my native language.

serasidis says: Jan 7, 2008. 5:21 AM REPLY


Happy new year!

Every 128x64 pixel graphical LCD which is based on KS0108 controller is ok.
Try to make a search on google for LCDs that are based on KS0108 controller.
This is one site KS108 LCDs KS108 LCDs

DEM128064A has back light but I have reduced the light through a resistor because of high power consumption.

http://www.instructables.com/id/Low-speed-AVR-oscilloscope/
lordofthedonuts says: Jan 19, 2008. 12:32 PM REPLY
Thank you very much! As soon as I get the cash I'll make one.

Myself says: Jan 5, 2008. 10:37 AM REPLY


I'd love to see more detail in how you arrived at the design. How did you choose the op-amp, how does the AC/DC switch work, what steps did you take in
designing the program that runs inside the AVR?

serasidis says: Dec 24, 2007. 2:36 PM REPLY


Thanks all of you for your good words. Zak, I 'll keep in mind your suggestions. They are very helpful. Istarian, do you mean an LCD 1x16 or 1x20
characters?

technodude92 says: Dec 24, 2007. 2:25 PM REPLY


wow 0.0 (jaw on floor)

Zak says: Dec 24, 2007. 12:44 PM REPLY


Would it be an idea to change the input stage a bit? I would suggest a non-inverting input. Seen from the input side, in series: a resistor (overvoltage
protction) connected to the positive input of the op-amp. Diodes from the positive input to the pisitive supply and negative supply, to take any current
resulting from over-voltage. If AC input is required, put the capacitor in series with the actual input and add a resistor to ground, then the protective resistor
and the rest. This allows connecting the input in AC mode to a 200 volt line and seeing some noise there.

GorillazMiko says: Dec 24, 2007. 11:51 AM REPLY


Awesome! Looks complicated.

shortbus says: Dec 24, 2007. 8:58 AM REPLY


Awesome!

Istarian says: Dec 24, 2007. 8:42 AM REPLY


It would be interesting if you could make another one with a single line lcd as well as the graphical one( to show frequency, voltage, etc, could make it scroll
too). ~Istarian

gmoon says: Dec 24, 2007. 7:09 AM REPLY


I wish you would put the scope frequency in the ible--5 kHz is pretty darn slow. Still, for a single AVR running both the display and the ADC, that's pretty cool.
Anyway, I'm familiar with your other builds, so you get a (+) for this, and all the other sweet projects!

mrbob1000 says: Dec 24, 2007. 5:35 AM REPLY


i would love to build one of those and put it in a cool enclosure. i think i might just have to make one of these.

thadrien says: Dec 24, 2007. 3:22 AM REPLY


Great project ! The small size is the best quality of the system ! Not many scopes have this quality, probably more useful than 2 GHz velocity . And, merry
christmas !

http://www.instructables.com/id/Low-speed-AVR-oscilloscope/

You might also like