A bench oscilloscope is one of the most invaluable tools in the hardware hacker’s arsenal, but even the slimmest digital models are a bit large to be part of your everyday electronic carry. Sure you could throw one of those cheap pocket scopes in your bag, but what if there was an even easier way to take a peek at a few signals while you’re on the go?
For those who roam, the Arduino-web-oscilloscope project created by [David Buezas] is worth a close look. Using the Web Serial API built into recent versions of Google’s Chrome browser, this project allows you to pop open a software oscilloscope without installing anything locally. Whether it’s a public computer or that cheap Chromebook you keep around for emergencies, a valuable tool is just a few clicks away.
Of course, there has to be some hardware involved. Despite what you might think given the name of the project, the code currently only supports the Logic Green LGT8F328P microcontroller. This cheap ATmega328P clone not only runs at 32 Mhz but according to [David], many operations can be done in fewer clock cycles than on the original 328P. In short it’s fast, and fast is good if you want more samples.
One of the best parts about this project is that a function to flash the firmware to the LGT8F328P is built right in the web interface. With the oscilloscope running in the browser, you just need to plug in a blank board, click the button to flash it, and start taking measurements. You could outfit a whole classroom or hackerspace with basic oscilloscopes in minutes, with a per-seat cost of just a few bucks.
Now as you might expect, there are some pretty hard limits on what you can realistically measure with this setup. For one thing, the board can’t handle anything higher than 5 volts. Even the cheapest oscilloscope kit is still going to be an upgrade, but the fact you can spin this up almost anywhere for the cost of a cheap MCU board makes it hard to complain about the results.
[Thanks to Bill for the tip.]
I am so happy that web serial exists! And this is really a wonderful project.
Given that the use case is so small, I think iWeb serial is an unwarranted expansion of the attack surface.
I think that allowing humans to use computers is an unwarranted expansion of the attack surface. Just imagine how much secure they would be if we did not allow human access.
Seriously what is your concern? What can be attacked? Who even has serial ports any more? If they do, it’s for a particular application.
The more browser APIs exist the more people will be able to combine them in weird ways to make exploits work, or just do fingerprinting. High-accuracy timing, which presumably someone wanted for some reason, allowed side-channel attacks to happen in-browser to some extent. The battery API is unavailable in some browsers because of, presumably, fingerprinting. Also, the more APIs exist the less time can be spent ensuring implementations are secure and the higher the barrier to entry for browser development is.
Wow it’s an advertisement for Rust! Thanks again for showing us that the use of C++ is costing us all billions In bad security issues.
Yes no APIs available is by far the best option. Let the computer be a black box with no outputs or inputs, that’ll show those pesky hacker types.
While I think Rust is a good idea, it does not magically fix side-channel attacks, non-memory vulnerabilities, or fingerprinting…
Maybe we should also remove the code for assisting disabled people as its use case is also small.
Usability enhancements is not a small use case and it is the moral and ethical thing to do. Providing a web serial interface is not comparable. There are many alternatives to accessing a serial device on a computer–exposing that capability in a web browser is not necessary. Don’t forget serial devices include USB.
And I’m happy it isn’t actually made with Flash, like the article title sounded like :)
What’s the max sample rate?
use the source, Luke
https://github.com/dbuezas/arduino-web-oscilloscope/blob/master/arduino/src/adc.h
Did you consider that the source code can be incomprehensible to a person who doesn’t know the implementation? I see a bunch of esoteric gibberish that I barely recognize, and nothing that directly answers the question.
So the comments that show the sample rates in plain english at the top of the file wasn’t a clue?
Or is english the “esoteric gibberish” you’re referring to? Your comment history does seem to show you have limited comprehension.
It doesn’t answer the question. ARE those the max sample rates, or just something that was used? In what situations are these sample rates available? What’s the limitations? There is some text saying “adc can’t read over 2.5v here”, what does that mean?
The reason why the question was asked is because I already looked at the source code and decided it was too much trouble to decipher it when other people probably already know the answer!
There is no need to attack someone personally like this.
The reason why the question was asked is because I already looked at the source code and decided it was too much trouble to decipher it when other people probably already know the answer!
727.28 kSamples/s // adc can’t read over 2.5v here
363.64 kSamples // up to Vin – a diode (4.5v more or less)
the author has extensive info about the LGT8F328P boards in a separate github repo:
https://github.com/dbuezas/lgt8fx
Allthough i definitely am going to build one, it won’t replace my DSO188 ultra-small scope for on the go
A quick scan of the project looks pretty light on the electronics side of things, but I might have missed something?
They have another repo with more work on the electronics side: https://github.com/dbuezas/lgt8fx
Thanks but I meant where you hook up the inputs, I looked through that but didn’t spot anything.
I suppose it assumes some knowledge of the arduino boards, as I’ve not really played with one much, it’s not obvious.
Having looked at the board I guess you just hook it up to A0.
A wireless battery-powered version of this would be interesting, as you could just hook it up to the DUT and leave it floating, so no worries about earthing and blowing up your PC, plus also you could use a phone for the screen.
The channels in the web interface are labeled the same as the pins on the LGT8F328P, you just need to connect whatever you want to measure. There’s no other components required, once the board is flashed it’s ready to use.
According to the second repo, the Software Serial on the LGT8fx runs @ 32Mhz
I am truly astonished by the level of expertise portrayed by the author! Exceptional work, will use this right away!
The lpc4370 with a sample rate of 80Msps would be good to interface to the app.