$13 Scope And Logic Analyzer Hits 18 Msps

We aren’t sure what’s coolest about [Richard Testardi’s] Flea-Scope. It costs about $13 plus the cost of making the PCB. It operates at 18 million samples per second. It also doesn’t need any software — you connect to it with your browser! It works as an oscilloscope, a logic analyzer, and a waveform generator. Not bad. The board is basically a little life support around a PIC32MK and the software required to run it.

Of course, for $13, you need to temper your expectations. One analog input reads from -6 to 6V (hint: use a 10X probe). The goal was for the instrument to be accurate within 2%.  There are also nine digital inputs sampled simultaneously with the analog sampling. The signal generator portion can output a 4 MHz square wave or a 40 kHz arbitrary waveform.

If you need more channels, the board can cooperate with other boards, which is interesting — who doesn’t want a scope you can add a new channel to for $13 each? The little board also has a Basic programming system built-in that includes an editor, compiler, debugger, and file system so that you can script the entire thing that way.

Honestly, we aren’t sure using this as a scope appeals to us as much as using it as a building block for other things. The fact that you can chain them and it has its own web interface means you could probably build some interesting things with it. [Richard] notes that he has one controlling his reflow toaster oven, for example.

You can find similar offerings commercially that have better specifications but, naturally, they don’t cost under $20. Creating a simple logic analyzer is fairly easy with today’s high-performance CPUs, but there are still a few details to consider regarding stability and triggering.

30 thoughts on “$13 Scope And Logic Analyzer Hits 18 Msps

  1. 18MSPS means theoretically 8MHz of analog bandwidth. That’s good enough for most people. It beats all those chinese almost-DSOs in old MP4 player cases. One might consider improving on the analog front-end, either by using some decent op-amps with selectable or programmable gain, or by designing BJT version.

    1. I reviewed a “DSO 138” from Amazon about 5 years ago. It advertised a 200KHz bandwidth, but at 3db down, the actual bandwidth was about 40KHz. Square waves started looking off at around 10KHz. Not too impressive, but not totally unuseable for audio work.

      1. But that’s the problem with all those cheap ones: they lie in specs and unless you know it, those scopes are useless. Let’s say someone wants to test their 1-Wire protocol implementation and wants to check the integrity of the signal at 125kHz. They connect one of those chinese poop-scopes and there is utter garbage. So they waste hours troubleshooting a perfectly good design instead of getting a better tool. It would be better for those manufacturers of electronic manure, if they told the truth upfront – people would still buy them for (for example) audio work.

    2. Indeed, When a front end with selectable attenuation / amplification is added, this can be a quite nice gadget. The DSO-Shell may be a nice example to add a frontend, that one uses a few opamps and 74hc4051 / 74c4053 for the range switching.

      Also, the schematic and PCB seem to be designed in some not very well known program. If there is interest, I can spend some time to port the design to KiCad.

      1. It seems to be done in DipTrace.

        +1 to Kicad conversion and what ever options can be added.

        I’d also prefer Sigrok interface instead of some web usb interface, although that is a separate issue.

      2. The schematic is poorly drawn, and there is no real front-end. The design could be easily and cheaply improved.

        One might consider using cheaper MCU with external ADC. With simple external trigger circuitry it could be turned into cheap, yet functional DSO.

    1. I was reading the datasheet for the chip used and scratching my head, until I read the flea-scope.pdf file
      “Flea-Scope uses a huge amount of automated hardware in the PIC32 MK-GPK microcontroller (MCU) to achieve its end result. The individual Analog-to-Digital converters (ADCs) in the MCU only run up to 3.75 million samples-per-second (Msps), so Flea-Scope uses 5 of them interleaved together to measure the input signal in a time-synchronized fashion, thereby achieving 18 Msps.”

      So from a SDR point of view you could have a 5 antenna array with each individually sampling at 3.75 Msps REAL (1.875 Msps I+Q) but then you would need to add 5 RF tuners like the R860 (previously known as R820T2) or else one antenna with 18 MSPS READ (9 Msps I+Q) or 9MHz of spectrum with a 12-bit dynamic range.

      1. Actually I’m wrong reading page 385 of the PIC32MKXXMCXX datasheet (table 25-1) it supports 15 Msps using 5 ADCchannels (out of 7) at 12-bit, but …


        10-bit using ADV 5 channels 20 Msps

        12-bit using ADV 6 channels 20 Msps

        The problem is that the price point for the NXP LPC4370 (used in the Airspy R2) is close enough to the Microchip PIC32MKxxxxMCF and it can sample 12-bits at 80Msps, but due to USB 2.0 High Speed the maximum continuous stream of data off chip to a host computer is limited to about 40MB/sec (even with bit packing and allowing for over heads, this would be a maximum sample rate of about 24 Msps)

        LPC4370 – SRAM: 282 kB ; CPU’s: ARM Cortex M4+2xM0 ; Maximum clock frequency: 204 MHz; on chip program storage: 0 MB
        PIC32MKxxxxMCF – SRAM: 256 kB ; CPU: MIPS32 microAptiv ; Maximum clock frequency: 80 MHz; on chip program storage: 1 MB

        I have to admit that both are very interesting chips and either could be at the heart of a SDR (software Defined Radio).

        1. It is a real shame that the CH569 does not include an ADC, but it does support Gigabit and USB 3.0, so maybe swallowing the cost of adding an ADC chip might be interesting. In fact I wonder could you use the LPC4370 as the 12-bit 80 Msps ADC (find a cheaper 12-bit 80 Msps ADC) and transfer the samples to a CH569 using the GPIO pins.

          1. The CH569(120 MHz max clock frequency) and LPC4370FET100 (204 MHz max clock frequency) both have 49 GPIO pins, so in theory at least 48 pins could transfer 4 12-bit samples in parallel.

          1. Oh I see see what you mean out of stock until November, none at lcsc, none at mouser, none at digikey. And farnell have the LPC4370FET100E listed as “No Longer Manufactured”.

  2. The hardware has 18Msps @ 10-Bit resolution. As far as I can tell, the Chip should be able to do the same speed at 12-Bit resolution, but maybe the software is not fast enough to keep up and transfer the data.

    Also: “StickOS® BASIC — an entirely MCU-resident patented interactive programming environment, used by Flea-Scope™”. So most of the code is all rights reserved. Although most of the Fleascope specific code seems to be public domain…

  3. The lack of proper frontend has always been a major issue of these “cheap” scopes… Personally as a portable “cheap” option, I’ve chosed to shell out a bit more money to get one of these miniware DS213… these might be quite more expensive, they are still cheap and provide proper front end and more perofmances, with a proper shell and eversthing..

    but getting such design out is definitely a great achievement!

  4. Hopefully not a duplicate comment… The last one just evaporated…

    Hi Al,

    Thank you so much for this article — I somehow missed it when it came out!

    You hit the nail on the head with summarizing my intentions with Flea-Scope — from the low cost to the lack of software install, to even ganging up multiple scopes channel-by channel! And of course, the icing on the cake being the BASIC interpreter inside that you can use to take control of the pins and reprogram the board to do anything else you want, still with nothing but a web browser!

    If you would like I have some slightly older boards here (just old silkscreens, mostly, and some using alternate MCUs or QFP instead of QFN, as production of my first choice MCU ramps up) and I’d be happy to send you a couple to play with — just give me an address and I will mail them! My e-mail is rtestardi at live.com.

    And I totally agree with some of the comments above about the lack of selectable analog input attenuation/amplification — if this takes off, that will be my first enhancement to “v2”! I actually had this is some earlier boards, but using the MCU itself to activate circuitry (instead of an analog switch), and the stray pin capacitance was too high. But I think I could add this with an analog switch outside the MCU for just a few more dollars (and a bunch of testing, as we try and push down from 15 mV resolution to hopefully sub-millivolt).

    PS And someone above was right — at 20 Msps, I ran out of DMA in the MCU (we also use DMA for concurrent waveform generation thru the D/A converter, as well as for capture of the logic analyzer inputs), which is why I had to limit us to 18.18 Msps. And I actually did look into the NXP LPC4370, but could not get them — pity — in the end, I decided it was better to be at the start-of-life of a new MCU than the end-of-life of an old one.

    — Rich

  5. PS I also added this to license.txt, for anyone concerned (all the scope code and general-purpose code is completely open source — the functionality of StickOS is not used by the Flea-Scope when operating as an oscilloscope — only when used in “deep dive” mode, and below should cover that):

    “pic32.X.27.production.hex” and the instance of StickOS contained therein is released under a free, irrevocable, perpetual license to U.S. Patent 8,117,587 for personal, educational, or non-commercial purposes. This instance of StickOS is released “as-is” with no warranty of merchantability and no warranty of fitness for any purpose. This license shall not be implied to cover any future releases of StickOS which are not expressly released under such a license.

  6. One cautionary note: remember that the Flea-Scope USB ground, meaning your Laptop sheath and frame, are connected electrically to the barrel of the USB coaxial BNC (? J9 in the schematic). Give that careful forethought when using your probe return clip. When Rich is ready on Tindie or other method with fully assembled board, I will try it in the field task. Recall that when you fly to work by Airline, overhead Laptop in backpack space is at a premium and *this is small*. I have a differential-probe kit (not as compact, really ||expensive|| , but fully isolated) and a short BNC-BNC adapter.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.