Это видео недоступно.
Сожалеем об этом.
Arduino mini-oscilloscope
HTML-код
- Опубликовано: 18 сен 2014
- Arduino sketch: www.iforce2d.ne...
PPM description: • CPPM and the FrSky D4R...
OLED screen: www.banggood.co...
Improved version of sketch (see reply to buncho888 in comments): www.iforce2d.ne...
Finally a maker that talks, explains and NO MUSIC!! Thanks
As was already stated the "waves" are the result of the power wiring in your house, either 50 or 60 Hz depending on where you live....you do not need to touch the input wire because it has a high input impedance and the signal is being "capacitively" coupled into it from your hands proximity to it and when you touch it your "clipping" the input because your exceeding 5 volts. This limited bandwidth oscilloscope is still useful for monitoring line power, checking sub audible frequencies used in CTSS radio signaling, and with a little modification a useful multi channel logic monitor...
Notwithstanding the excellent technical content of this site, the courtesy and generosity of the contributors has lifted my heart beyond imagining. From a UK novice still coming to terms with the ‘mains’ wiring Earth configuration changing from green to brown.
I just bought the parts from this project from eBay. Can't wait to make it!
Thanks for posting, I am gonna to use it as a starting point for a oscilloscope display built into a Eurorack module for an analog synth. You saved me a few hours of headache.
I want to do the same, did you manage to do it ?
I've made some modifications to the code to better show PWM signals. Would you mind if I created a video and re-posted the updated source code? I would cite you as the original writer.
+Kris Kasprzak sure, go for it :)
Science & engineering as it should be done! :D
@@ericmjl I TOTALLY AGREE WITH YOU ALL Science & engineering IDEAS SHOULD BE FREE AND AVAILABLE TO EVERYONE INCLUDING NASA AND GOVERNMENT PLANS AND FINDINGS
if god didnt exist, i would worship you. freaking fantastic project. saved me a lot of time
You, sir, are awesome!!! Your videos are always interesting and informative, and you have a really modest style of presentation, despite the fact that you could be quite big-headed about all your achievements. Total. Dude. Please keep up the good work!
I don't know how to express my gratitude to you for generating this video. Just what I needed... I'm new to the Arduino world and was looking for some simple tools. I have a Bluetooth module connect to a NANO that doesn't want to work for me and this is a great tool to look at key, tx, rx and power.
I had purchased an ssd1306 to play with. So I hooked to it to my UNO and this just works... worked on first try...no muss, no fuss, no headaches, no frustrations... :-)
Thank you, thank you thank you
Just wanted to thank you for the sketch: short, sweet, useful.
I rarely write RUclips comments
+Derek Hyams Thanks Derek!
@@iforce2d nice project but could you pls post a schematic part? i would be thanksful to see it
Great little project.... with some modifications and perhaps a better front end opamp it could have higher resolution at least to audio spectrum range...I Dont know if anyone mentioned it but the wave you are picking up is the 60 HZ room electric via RF....all modern (unless England) is 60 hz..50hz in England...
And yes it is all around you all the time because AC is being generated all the time in the electrical lines....its very small as far as current goes but in england its at 240 volts coming out of the wall... That is a large waveform....
"The Oscilloscope sampling thingy" :)
Cool little scope and it was useful.
Great channel man.
I built one of these back when you first posted it, mounted the deal in an Altoids case, used a pro mini so it would fit with a 9 volt battery running it all, put little clips on the end of the wire. I now have a couple kit built scopes that do a little better job but once in awhile when I just need a quick look at a signal, I grab the little tin box and hook her up.
nice project but could you pls post a schematic part? i would be thanksful to see it
the 20 millisecond pulse is due to powerline radiation. You can see it in normal oscilloscope also when you touch the probes with finger. :)
Just built this with a different make of OLED screen (which isn't supported by the Adafruit library). I converted your code to use a different graphics library: U8glib and it just works. This is so useful for Arduino projects and has to be the cheapest useful oscilloscope you could make!
Cool! What type of screen are you using? I ended up building a permanent version of this with a 320x240 color screen to use in future projects. I worked on the sketch a lot more after making this video, and I now have a more generic version where the width and height of the screen are #defines and I don't hardcode anything that expects the screen to be 64 pixels high. It uses double-buffering to store two sets of sample data - the old samples are used to write black pixels over the previous line pixels to clear them, before drawing the new line. This was necessary because the 320x240 screen was much too slow to do a full screen clear every time. I also tried using much faster sampling methods, and if you're only interested in a digital signal (as in the latter part of my video here), things can be done much much much faster :) I've added another link to the video description.
***** It has an SH1106 controller. Very similar otherwise with 128 x 64 resolution in monochrome cyan. I like the sound of that double-buffering, a faster screen refresh would definitely be useful. I've been planning on putting a lipo powered pro mini 3.3v with a 10DOF module (for the compass and altimeter) onto a small quadcopter or heli. Your quadcopter videos are a good inspiration. I like the idea of a really simple, cheap, fully autonomous drone.
buncho888
can you please share U8glib version, as I'm using SPI OLED SS1306..
Thank you (;
Raf C
Just change this line to suit your model of display:
// Set up the display
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE); // I2C / TWI
I recommend getting the u8glib examples to work with your screen first. For I2C wiring pin A4 is SDA, pin A5 is SCL.
buncho888
Hi, did managed to run it on Adafruit just added lines to drive my SPI screen.
Thanks!
Instead of modifying "sampleRate = ..." on top, I've connected a potentiometer between Vcc, Gnd, and A1. So I define "sampleRate" each time the main loop starts.
void loop() {
sampleRate = map(analogRead(1), 0, 1023, 1, 10);
....
This helps for visualisation of low frequency signals.
I still have to fix TRIGGER_ENABLE and SCREEN_UPDATE_ENABLE. Connecting pin 2 to Vcc just display a static curve, and pin 3 doesn't do anything.
The wave shown when nothing is connected is induced voltage from mains EM radiation (about 20 ms sine wave i.e. 1/20 ms = 50 Hz).
Yeah, that's what I started to realize after making the video :)
Cool project, clean wiring, well presented. Two thumbs up.
That is fast enough for what I need. Only need it for maybe up to 120Hz.
Fantastic video summary of an elegant solution, well explained and interesting. Thanks for sharing!
+danns87 thanks!
Nice work with homemade oscilloscope from Arduino.
The sign wave is likely caused from your body acting as an antenna for the mains frequency of your local power.
Thank you! I just want to analyse the waveform of some projects i have, and don't need a super accurate 1000$ oscilloscope and neither have the space for one. I will order parts right away!
simple useful,I changed a line like this --- display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Initialize with the I2C addr 0x3D (for the 128x64).
That is so cute, love it!
This is brilliant (elegant) solution.
Ultimately my goal is to integrate a MMA7455 (3-axis Accelerometer) to show (real) basic displacement along all three axis. I have the the MMAA7455 working nicely, as well as the OLED, but learning as I am going and your solution seems to be the closest I have seen.
I have implemented it using a sainsmart Nano, and for the most part it works perfectly except I get freezing of the OLED and previous reading. Left alone, it unfreezes by itself- any guidance would be much appreciated!
Looks like you could also make a digital Theremin. Just take the input as your hand comes closer and further from your green wire probe and output a sound frequency based on that.
Yes indeed... hmm... arrghh... I will not be able to stop thinking about that now :)
djmips It would be better to use a light-sensitive resistor across the ADC for a Theremin. Light offers certain advantages over inductance.
I worked for MONTHS on an inductive theremin, using a Nano. Ultimately threw the entire contraption at the wall in frustration because of uncontrollability. You might have better luck, but it was just too damn many variables, I did end up using a photo control later.
Very professional, I liked!
nice project. I was playing with the idea of using an arduino oscilloscope to visualize audio signals, but with a maximum frequency of 300 Hz, this seems impossible.
it's picking up 50hz from the house wiring
Nice project. I have one question concerning use of Analog pins 4 & 5 for the SDA and SCL lines. I assume they are set to behave as digital outputs but where in the code does is that specified? I even looked in the included library files. On other projects I've used digital pins 11, 12 & 13 for the SPI interface.
nice project but could you pls post a schematic part? i would be thanksful to see it
This is so awesome, thanks for sharing!
Just a thought, perhaps a pull-up resistor would quiet the screen when there is no input?
maybe the crystal on the 3.3v board is running slow, maybe the crystal is rated for 5v? something is definitely funny here. I have gotten many chinese arduino pro minis, and they all have different components on them, it's like they throw them together with whatever they can get. but for 2$ a piece, man.. its still awesome
Not sure what you are referring to there. The problem I was having with the CC3D board turned out to be my code was written for a 16MHz arduino, and the pro-mini runs at 8MHz. Values used for timers need to be halved for 8MHz to get the same real-world time.
thanks for the creative insight.
Hi wonder if anyone's come across this problem with this project the waves read on the oled as shown, yet can't adjust the wave amplitude (that is height) hold and select buttons won't work either have checked all the connections they are all exactly the same as this, maybe a problem with code? Thanks in advance for any positive suggestions if anyone has any?
50 Hz "humm" is 20msec.
+morpher44 This is correct. If you notice the sample points are really stretched out in the middle and the waveform is being clipped at the top and bottom.
Nikolas Britton display needs to use double-buffering.
Hi, I am using a display looking just similar BUT not exactly the same. Its top portion has a few lines of yellow pixels while the bottom part is all made of while pixel rows. There is a slight separation between the two areas.
Running this code will just result in only showing 3 out of 6 of those volt dots which appear on the left tension scale.
Basically the level "0 volt" line is not visible while the top of the waves appear only when their volts is above 3.
Can anybody explain that? Although I suspect the library might be the problem, the same library perfectly works on other sketches I have already run.
Thanks
A
the library is coded to 128x32. You need change Adafruit_SSD.....
Roberto S. Chiandotti @Roberto S. Chiandotti How do I go about doing what you're recommending here?
Hi!!! great work!! can you help me? im usin a DFRobot Beetle (Leonardo compatible) and the only thing i get its frozen pixels all around the screen...
good job! my testing shown finger touch image, and straights line of DC voltage, not show waves, what can be? thanks.
I would not expect waves just from touching it with your finger, at least if you are a normal human. I think it only happened for me by some rare coincidence.
@@iforce2d ha. I mean can it works as an Oscilloscope to show sine wave with a signal input?
where's the potentiometer to change the refresh rate?
What are those tables called, if it is a table. With all the squares? is
GREAT PROJECT
Any way to use this on my cars 12 v line? Would like to test my alternator's duty cycle difference from my PCM.
This would only handle up to 5V.
@@iforce2d rats. thanks for the info
The provided code does not display anything on my OLED screen. I am using a HiLetgo .96" OLED I2C IIC SPI Serial 128x64 OLED LCD, 4 pin display that is colored white. Could this issue be related to an updated version of the Adafruit libraries?
hmm... I don't know. It sounds like your gear is the same as mine. Usually libraries like this are written so as not to disturb existing code.
Im having a problem I don't know how to fix. I used the OLED on a past project and when I hooked it up for this one both projects are showing up on the screen.
+Jake Lampada Ram in the screen maybe? You gotta blank it to your background colour.
Would a pull-down resister help to smooth out the signal or would it put too much current into the arduino?
fezickthebig I don't think it would do anything to the signal except change the voltage of it. Capacitors would change the signal because they take time to charge/discharge, but unless I'm very much mistaken resistors arestill instantaneous :)
Could you put two or three screens side by side to make a longer scan buffer output?
better to just get a larger screen. After this I made a version for a 320x240 screen www.iforce2d.net/sketches/Scope_ILI9340.ino
is there a version for a 32 screen not a 64?
so if you say (7:00) it takes 10 lines of code, i can use another uC like ATmega8(-A)(arduino NG)?
Gabi Done It takes 10 lines of code to find the zero point for the trigger... not 10 lines of code for the whole thing. The source code is at the first link in the description.
Excelent!
very cool man
I cant load the website for the code. It just stops in the middle of loading. Then when i reload it goes back to the browser
You mean this link? Works fine for me....
www.iforce2d.net/arduinoOscilloscope.txt
This is very neat....:)
I have a problem with with my arduino uno (R3) , using same parts without shield , it's freezing my screen from time to time, getting some strange reads when is out, it's reading when i put it in 3.3 and 5 V it's reading correctly and triggers are not working, is my arduino "broken" or i'm doing something wrong ? I'm new to this so there are some things i don't understand.
Niga Vasile Best way to find out would be to try a different arduino or a different screen and see if it still happens. Perhaps you could start by trying to figure out what causes the freezes so you have a better situation than "from time to time"
+iforce2d Seems my arduino was broken is working fine now with a new one thanks for help and for code sharing. Have a nice day.
I made a 2 channel version that measures negative and high voltages: ruclips.net/video/JUA7Z36RbsI/видео.html
I can't seem to turn my LED screen on at all. Could I be incorrectly wiring the screen?
+TisanUminko well there are only four wires, it shouldn't take long to check :)
haha see thats what i thought
Vcc to +5
Gnd to Gnd
Scl to Analog 5
Sda to Analog 4
pls give me schematics
Very cool
For some reason your PM is not showing in my inbox. The wiring is very simple, I explained it all from about 1:00 onwards, there are only 5 wires so you should be able to pause the video in a couple of spots to see it all.
Thank you
i am realy interrested in your proyect. I tried opening the lin for the sketch but it would not work. Has sombody a solving?
My server is down at the moment, I'll let you know when it's back online.
@@iforce2d Thank you very much . i apprechiate the work you do for us a lot!
Site is up again now.
Would it be easy to display this graph in processing on a connected computer?
Wouter Van Goey Yes, but a little less than $20 dollar thing has to hook up to a thousand dollar thing. It is more cool if you can do everything on the cheap. I'm worried these little OLED displays are basically too slow for an oscilloscope. We would need a display that can do 500 FPS or greater to get into the realm of audio oscilloscope.
Yeah I feel you but everyone already has a pc, how many people have oled displays laying around? I get it, they're cheap, but the added functionality a pc would give negates that imho.
Wouter Van Goey Most PCs don't have any convenient way to measure analog voltage like the analog pins on the arduino can. You could connect the arduino to your computer and send the info to display on the screen of the PC, then you have to write more code for sending from the arduino side and to interpret the incoming data at the receiving end, and code to draw the graph. I hear processing makes that easy but I've never tried it. But in any case, you would not get better results because the speed of it depends on how fast the ADC in the arduino can convert the voltage samples it sees into digital values. The 'added functionality' of the PC would only be that the final display looks prettier, on a bigger screen.
morpher44 As far as I know digital oscilloscopes take a sample and then display the result, same as this one does. They don't refresh their screen anywhere near 500fps. The usefulness of the scope is not limited by the display refresh rate, but the speed of the ADC in the arduino, and the number of samples it can store for each pass. Although I guess, if the display rate goes below a few refreshes per second that would be kinda limiting :)
***** Right. With a low FPS, you will be "missing" much of the data. You will be only able to see every Nth frame. That might be ok for such a low-end, cheap, scope. Sample rates won't be able to go up very high too, though, because if there is an interrupt per sample, eventually you are over-saturated with interrupts. It would be better to have hardware assist here (DMA, FIFOs) for the sampling. Some sound chips like AC97, have fifos, DMA, etc.
for example, i want to include pulse sensor and produce real-time waveform to oled display. Which part of the code that I need to adjust? Can somebody helps me out?
I think you will need a better CPU and a better screen for a real-time display, eg: goo.gl/8w8CS0
okay great. but how about the code? and can you look at this example arduino-er.blogspot.my/2015/04/display-waveform-on-mini-oled-with.html
The code for a different CPU will be completely different. I don't think you could even use this code as a starting point, it's so different. I have no idea how to do it. What should I look at that code for? If you have a question about somebody else's code, ask the person who wrote it :)
okay then..thanks
Quick & dirty oscilloscope
Perfect for testing oxygen sensor in cars.
There a way to get the pinouts?
www.arduino.cc/en/Reference/Wire
or just watch this video at 1:08
Thank you, that worked.
I just made this , comes up as 14 ms and not the expected 36 , anyone know why ?
Are you using a 8MHz cpu or 16MHz?
Crystal says 16Mhz. I can get longer times by increasing the int sampleRate?
No, sorry it's been a long time since I made this, I thought it was using ticks to measure time.
iforce2d if i increase the intsample it does show a longer section which is better for lower frequencies although then the refresh is slow on the updating,anyways i understand if its been a long time,thanks for the sketch.
can you do a print to your computer of the osiliscope
Chommie Smith I don't really know what you mean, but I think the answer is no :)
I mean instead of using a screen can you print the volts and stuff to serial moniter or with prossessing thank you for repying me
+Chommie Smith yes, you can use the Serial connection to do that
+iforce2d can you please make a video of that please man you wil be doing me a favour
+Chommie Smith No... it's about the simplest thing you can possibly do with arduino :) Read around www.arduino.cc/en/Reference/Serial
Hello, thanks for all your projects and good luck for you.
I have one question about your mini oscilloscope. I made the similar
project of oscilloscope (I mean using the same OLED display).
But I use my own code, and here the part of it:
for (x = 10; x