Make your own DIY oscilloscope for £4 - Raspberry Pi PICO Project

Поделиться
HTML-код
  • Опубликовано: 22 июн 2022
  • Make your own DIY oscilloscope for £4
    Amazon sell full kits if you are starting from nil:
    UK: amzn.to/3OxvpHn
    USA: amzn.to/39Nvc3u
    Admittedly that might cost you more than the $5 that route, but you will have a nice little setup for experiments!
    Python Source Code is included here, but for performance, switch to the Arduino stack:
    from machine import Pin, I2C, PWM
    from ssd1306 import SSD1306_I2C
    import utime
    #lets go!
    button = Pin(10, Pin.IN, Pin.PULL_DOWN)
    pwm = PWM(Pin(12))
    pwm.freq(100) #1k
    pwm.duty_u16(32767)
    adc_read = machine.ADC(26) #A read takes 2us therefore 500ks/s!
    i2c = I2C(0,sda=Pin(0),scl=Pin(1),freq=40000)
    oled = SSD1306_I2C(128,32,i2c)
    oled.fill(0)
    oled.text("Ready!",0,0)
    oled.show() #update the screen!
    coefficient = 3.35 / 32767
    while True:
    reading = adc_read.read_u16()
    calcvoltage = reading * coefficient
    print("V", calcvoltage)
    if button.value():
    screenstuff = str(calcvoltage)
    oled.fill(0)
    oled.text(screenstuff,0,0)
    oled.show() #update the screen!
    utime.sleep(0.01)
    Come chat with me on discord / discord
    See my recommendations on Amazon: www.amazon.co.uk/shop/backoff...
    If you would like to buy me a coffee or support the channel you can do so via Patreon at / backofficeshow
    I do have some bits and pieces on my web store at backofficeshow.com
    Please note: As an Amazon Associate I earn from qualifying purchases. As such links to Amazon products within this video may fall under this. Thanks to all of you who use these links and help support the channel - you are fantastic!
    Thanks you lovely people, and keep on tinkering!
    RUclips Chapters
    0:00 Introduction
  • НаукаНаука

Комментарии • 79

  • @backofficeshow
    @backofficeshow  2 года назад +4

    Please note that there is the microPython source code in the description if you want to have a closer look!

    • @dooogides9176
      @dooogides9176 2 года назад

      I have problem
      I have Casio boss Sf-m10 while clean it inside I just make contact between cable screen and board lose!
      So can u help me tell how to fix it?

    • @ARJUNDASED
      @ARJUNDASED Год назад

      Could this be used alongside with Grafana or some sort of dashboard for added vizualizations ?

  • @CuriousCyclist
    @CuriousCyclist Год назад +1

    Just discovered your channel. It appeared on my feed and I'm glad it did. I love learning.

  • @Dygear
    @Dygear 7 месяцев назад

    This was excellent. Great video well done!

  • @zxrenew5642
    @zxrenew5642 Год назад +1

    Excellent stuff Andrew.

    • @backofficeshow
      @backofficeshow  Год назад +1

      Sorry only just saw this, cheers dude 👍

  • @mhavock
    @mhavock 2 года назад +7

    I think it was fairly accurate. For example if you look a the samples at when its suppose to be at 0, they are averaging around 0.03 volts. By compensating (subtract that from measurement of the charger you tested = 1.52-0.03 =1.49 volts.

    • @backofficeshow
      @backofficeshow  Год назад +6

      Sorry I just saw this, I really need to revisit this subject, I would quite like to sit down a look at calibrating this properly, using *shudder* maths. It would be interesting to see if it scales linearly

    • @Bobo-ox7fj
      @Bobo-ox7fj Год назад +4

      Or a quick-and-dirty "CALIBRATE" button that takes the average of the next few reads and uses it as an offset :P

    • @thomasperri3294
      @thomasperri3294 Год назад +1

      ​@@Bobo-ox7fj for most use cases this approach is by far the best.

  • @degstenk
    @degstenk Год назад

    Everything worked! thx!

  • @ColdHawk
    @ColdHawk Год назад +1

    Thank you!

  • @samhorowitz7593
    @samhorowitz7593 Месяц назад +1

    Great video! It would be super neat if you could get the serial plotter to display on the OLED!

  • @ooloncolluphid9975
    @ooloncolluphid9975 2 года назад +3

    neat project! didn't know about the Better Serial Plotter software, looks dope. also I'd wager one could optimize the sampling rate further by fiddling with adc settings or directly writing to registers or tweaking micropython internals

    • @backofficeshow
      @backofficeshow  2 года назад +1

      I think there is diminishing returns on the micro python route vs shifting over to Arduino. I found I was hitting the walls pretty quickly and wishing it was C or Lua 😂

  • @minniedobinda429
    @minniedobinda429 Год назад +2

    this tutorial is one of the BEST one's ive ever watched, you described how and also why - which is rare! i might be using this in my senior design project as a stretch goal for our analog/digital hybrid monophonic synthesizer, would you mind if I credited your help on our final paper?

  • @Smaxx
    @Smaxx 2 года назад +3

    Nice, that was kind of entertaining, even though I more or less saw what I expected. Only bit I was missing was a short explanation on the voltage divider, ignoring it's just 1:1 here, which is also the reason for the 32767 magic value after all (half of unsigned 16 bit integer maximum). People might want to read some bigger (reasonable) values without frying their Pi, like let's say some 9V battery block.
    P.S.: The chapters dropped out of the video description.

    • @backofficeshow
      @backofficeshow  2 года назад

      Unfortunately the original audio of the recording died and I had to recreate it. It was around half of the duration of the computer side so a lot of explanation got lost 😒

    • @Smaxx
      @Smaxx 2 года назад +1

      ​@@backofficeshow Aw, too bad. But still way better than scrapping the whole effort.👍

    • @backofficeshow
      @backofficeshow  2 года назад +1

      @@Smaxx Yeah it happens. I think it would be nice to next 3d print a case for this, after giving it is own bigger screen to show the traces

  • @shreyasmurali2836
    @shreyasmurali2836 Год назад +1

    Noticed a missing zero in the SCK frequency (i2c initialization). You probably want 400khz and not 40khz which makes the communication 10 times slower

  • @mr.q7597
    @mr.q7597 Год назад +1

    Hi, could Scoppy detect negative signals?

  • @peddersoldchap
    @peddersoldchap 2 месяца назад

    Hi. What is the maximum frequency of a signal that this scope can detect?
    Can it be used to repair old computers like the ZX spectrum and the C64?

  • @arnolduk123
    @arnolduk123 8 месяцев назад

    I think someone looking to create an oscilloscope would surely know how a breadboard operates at 5:36 Still a great video tutorial!

  • @illuzati
    @illuzati Год назад +1

    Can a raspberry pi 4 be used instead of the pico?

  • @singaporeseaslugs1393
    @singaporeseaslugs1393 2 года назад +3

    Hey mate, are you able to explain logic gates, and how to control inputs? From my understanding are that chips have various gates, and or nand nor xor xnor, but how are they applied, i'm aware of the boolean algebra, but not clue how they are applied in real life usage. How do these logic gates also aid in input to output? And their use in circuit boards.
    Help my brain is fried thinking about plcs

    • @backofficeshow
      @backofficeshow  Год назад +2

      How do, I could probably have a go, but I would suggest looking at some browser based circuit simulators. You could have a fiddle and see which support logic. This is the first Lindsay l list I found: www.electronics-lab.com/top-ten-online-circuit-simulators/

  • @LiamTietjens
    @LiamTietjens Год назад +1

    Use multi threading the rp2040 has 2 cores

  • @jorgeferreira6727
    @jorgeferreira6727 Месяц назад

    Why didn't you reheat the first pin you soldered (pin1 - GP0)?
    It was clearly out of alignement due to beeing soldered on the bench.

  • @Silentsobs
    @Silentsobs Год назад +1

    How much freq it can measure ??

  • @andrewsawesome
    @andrewsawesome 2 года назад +1

    Would this be better, worse, or the same as one of those $50 pocket oscilloscopes? Also, would I be able to do the same thing using a Raspberry Pi 3B?

    • @backofficeshow
      @backofficeshow  2 года назад +2

      This would be much worse, I did a video or two on some excellent pocket scopes.
      I don't recall if the pi has an ADC channel but there definitely exists hats to do the same

  • @jamie7823
    @jamie7823 8 месяцев назад

    Can someone add a link to the USB-C to mini USB adapter that would work with the pico so I could purchase it?

  • @stupossibleify
    @stupossibleify Год назад +1

    Why don't you need to specify the I2C address anymore? Does it autoscan as part of the library?

    • @backofficeshow
      @backofficeshow  Год назад +1

      Generally you do, but some devices only come with limited it even only one address, so they incorporate that into the driver as a default

  • @kilinw
    @kilinw 2 года назад +1

    Hello. I wonder what's the reason why the coefficient is 3.35/32767 rather than 3.3/65535?

    • @bencoskater
      @bencoskater Год назад

      I think it's because of positive and negative values. In programming, you have Unsigned and signed int, short, long.
      Unsigned starts from 0 whereas signed starts at -xxxx. In this case, the resolution is 16bit (short, ushort) 0 to 65535 values in Unsigned and -32768 to 32767 in signed.

  • @magnuskristoffersson5863
    @magnuskristoffersson5863 Год назад

    What will the range for voltage measurment be? Is it possible to measure 9V? Thanks for a great video!

    • @backofficeshow
      @backofficeshow  Год назад

      With the correct potential divider you can measure anything 👍

  • @technicaltaurus1
    @technicaltaurus1 Год назад +1

    You should go the extra step and make the display show the actual waveform...

  • @mertsage6281
    @mertsage6281 Год назад +2

    I keep getting this error
    Traceback (most recent call last):
    File "", line 1, in
    File "/lib/machine/__init__.py", line 1, in
    File "/lib/machine/timer.py", line 7, in
    File "/lib/signal.py", line 13, in
    AttributeError: 'NoneType' object has no attribute 'func'
    what am i doing wrong?

    • @backofficeshow
      @backofficeshow  Год назад +1

      Hi, sorry only just seeing this, did you resolve it?

    • @mertsage6281
      @mertsage6281 Год назад

      @@backofficeshow no I haven't. Would be awesome if you could help..

    • @backofficeshow
      @backofficeshow  Год назад

      I'm no expert in python, but I think that means you are referencing a library that is not installed. Is there a way in your environment to select the raspberry pi Pico. Look for a board selection menu in the software

  • @Derlaft
    @Derlaft Год назад +3

    A bit underwhelming. Was really expecting the use of PIO, otherwise the readable freq is way too low.

  • @ClacKeyTech
    @ClacKeyTech 5 месяцев назад

    the ssd1306 library doesnt work

  • @garygranato9164
    @garygranato9164 Год назад +1

    great project , can it be made to display x,y mode ??

    • @backofficeshow
      @backofficeshow  Год назад

      Sorry just saw this, I don't see why not. We might need a different plotting software, but hardware wise it should not be a problem. Coding bare bones or in C would likely yield a nice speed boost. Makes me wonder if you could render a vector display!

    • @garygranato9164
      @garygranato9164 Год назад +1

      @@backofficeshow unfortunately i dont have a clue about coding, but if you can make it display in x,y mode then you can make a huntron track/curve tracer, and the best thing is most people probably already have most of the parts laying around the house. it would make a brilliant easy to do project.

  • @larryplatzek9017
    @larryplatzek9017 Год назад

    how about a link to the solderless breadboard you are showing or at least the name?

    • @backofficeshow
      @backofficeshow  Год назад

      It's just generic breadboard, the kind you randomly find in the box with cheap electronic kits

    • @larryplatzek9017
      @larryplatzek9017 Год назад

      @@backofficeshow It would have been except for the Raspberry pin numbers, which is why asking about it.

    • @backofficeshow
      @backofficeshow  Год назад

      www.google.com/search?q=raspberry+pi+breadboard

  • @mohammedredaziar4615
    @mohammedredaziar4615 Год назад +1

    why you used 1k resistor and 100k resistors ,why not other value like 120k ...

    • @ozzieenkees
      @ozzieenkees Год назад

      My question too. Now you have an input impedance of 2k, which is really low and probably influences your measurements when probing in circuit signals.

    • @godarklight
      @godarklight Год назад

      I know this is an old comment, but you'd probably assume you're out by a multiplier, so multiply your reading by 1.48/1.52.
      It might also be worth adding a tiny bit of averaging because of the jitter (this would reduce sample rate however..), and increasing the input resistor divider a little for 12V circuits.

  • @johnjcb4690
    @johnjcb4690 Год назад

    Im sure arduino nano does the samr

  • @johndomville5751
    @johndomville5751 Год назад

    The discord link is no longer valid…….do you have a more current one?

    • @backofficeshow
      @backofficeshow  Год назад

      discord.gg/ZsvS7C3 I will update it, thanks for the heads up!

  • @devilvortex1
    @devilvortex1 10 месяцев назад +1

    search for rasberry scoppy

  • @555circuitslab5
    @555circuitslab5 Год назад

    Don't solder the pins of the Pico on the breadboard. Never!
    The heat can melt the plastic of the breadboard.

    • @backofficeshow
      @backofficeshow  Год назад

      Let people use their stuff how they want, if they are quick it won't cause a problem 😂

    • @555circuitslab5
      @555circuitslab5 Год назад +1

      @@backofficeshow Sure, you can use your stuff how you want.
      But it is still is a bad example when you solder on the breadboard

    • @Bobo-ox7fj
      @Bobo-ox7fj Год назад

      I'm sure a flathead screwdriver would sort that out right quick :)

  • @vlogulsibian
    @vlogulsibian Месяц назад

    😂😂😂 better this way. take a moto and a mirror and a laser pointer. tge laser will be stationary and will hit the mirror. a motor will make the mirror to move up and down . so the mirror move will have the shape o signal. the driver will take the input and the murror will bounce the laser into mirror who will reflect it to a wall. niw yiu will need just a camera of a phone and a soft who can mive the image to the left . on the phone screen will be laser at all the points in time

  • @MichaelKingsfordGray
    @MichaelKingsfordGray Год назад

    Good intro, sir.
    Question: Why do you use so much totally unnecessary white-space in your code?
    Does the Python editor force this practice?

    • @backofficeshow
      @backofficeshow  Год назад

      Why do you think it is unnecessary?

    • @MichaelKingsfordGray
      @MichaelKingsfordGray Год назад

      @@backofficeshow I have been a professional coder since 1969.
      Any white-space that is syntactically unrequired is mere decoration, NOT code, nor comment, and utterly superfluous.
      It makes code harder to read, especially when inconsistently applied.
      `In my 53 years of programming, I have noticed a solid correlation between use of unnecessary white-space, and other very poor coding practices.

    • @Bobo-ox7fj
      @Bobo-ox7fj Год назад +1

      @@MichaelKingsfordGray Would you prefer all the extraneous whitespace was commented out? :P
      This sort of video is made for brainlets with little experience in electronics or programming, and everything needs to be easily understood by them

    • @MichaelKingsfordGray
      @MichaelKingsfordGray Год назад

      @@Bobo-ox7fj Then redact the whitespace!
      If your code needs whitespace, then you are a very poor programmer.

    • @backofficeshow
      @backofficeshow  Год назад

      A good programmer is any who manages to make a living or even better, a living with and for their team. Get over yourself and leave folk alone to code how they seem fit. I'm not sure if you have used a modern IDE in the last several decades but you can automatically reformat the code to however you want at the click of a button. Even adding all the pedantic rules you like. Or play with chatGPT and see how utterly pointless it is to discuss programming semantics at this level, literally it does not matter anymore.