Code Monkey home page Code Monkey logo

pillscope's Introduction

pillScope

Oscilloscope based around the STM32F103 Blue Pill and an OLED screen
Take a look at pillScope Plus, with a better screen and more sample memory

Features

-3.3V to 3.3V input range (can be increased if using attenuator probes)
Approximatively 1MOhm input impedance
Timebase goes down to 20uS/div
On screen measurements: min/max voltage, peak-to-peak voltage, frequency
Captured waveforms can be sent over USB or UART in TekScope-compatible CSV format.

Required parts

Base parts:

STM32F103C8 Blue Pill development board
128x64 SSD1306-based OLED display
4 pushbuttons

Analog frontend:

LM358 dual op-amp (rail-to-rail opamps should work better in this context, but this is what I had on hand)
2x 68kOhm resistors (to create a 1.65V offset voltage)
2x 500kOhm resistors (to create the input attenuator)\

2x probes:

just a 1MOhm resistor, in series with the input

Schematics

The OLED display is connected to I2C1 (PB7-SDA and PB6-SCL). The buttons are connected as follows:
PB12: Menu
PB13: Select
PB8: Down
PB9: Up

PA9 is the UART TX, PA10 is RX

The output of the analog frontend is connected to ADC1_IN0, which corresponds to PA0.

The analog frontend consists of:
a 1.65V voltage reference, which serves as a virtual ground point for the input,
a 2x voltage divider at the input,
an LM358 dual op-amp, which buffers the reference voltage and the output of the input attenuator

The schematic of the analog frontend can be found in the frontend.pdf file.

Using the oscilloscope

The UI

The menu buton cycles between menus on the right side of the screen, while the select button changes the current selection in the menu.

Measuring things

The frontend makes use of a virtual ground point which is 1.65V above the real ground. Because of this, the oscilloscope and the device under test must not be sharing the same ground reference. If you need to send data to the computer while measuring a device which shares ground with the scope, you should connect the computer via the UART port, with an opto-isolated adapter, while powering the oscilloscope from an external source.

Saving wavevorms

The captured waveforms can be sent to a computer over USB or UART. Sending s or S to either port will tell the scope to output the captured waveform in CSV format. This data can then be imported into the Tektronix TekScope app for further analysis. Waveform in TekScope Waveform on pillScope

Code

The code can be compiled with make. Be sure to recursively clone this repository, as the display driver is included as a submodule. The actual oscilloscope code of this project is located in Core\Src, the scope.c, ui.c, wave.c files. Feel free to take a look, as they're commented for ease of understanding.

Pictures

20220619_165356 20220619_165433

pillscope's People

Contributors

tvlad1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.