DSO with the help of Raspberry Pico
A Digital Spectral Oscilloscope, or DSO is an electronic device that helps us understand electronic signals. It captures the signal and display us how it changes over time. This can help us troubleshoot problems or understand how a device is behaving towards it intended output.
Some of the uses are:-
Waveform Capture: DSO captures waveform of electronic signals and displays them on the screen. This helps in analyzing the signal’s characteristics such as amplitude, frequency, and duration.
Signal Analysis: DSOs can analyses signals in both the time and frequency domains, making it easier to identify problems such as distortion, noise, or glitches in the signal.
Storage and Recall: DSOs can store waveform and settings for later recall, enabling users to compare different signals or analyses the same signal at different times.
Setup
You can find the original GitHub profile for the project “Scoppy” created by fhdm-dev at the following URL: https://github.com/fhdm-dev/scoppy. In case you encounter any inconsistencies or need further information, I recommend referring to that GitHub repository directly.
I took Raspberry Pico (micro controller board released by Raspberry Pi Foundation) and connected it with my mobile phone via OTG cable.
Next, I downloaded Scoppy app to my mobile phone for display of output waveforms[https://play.google.com/store/apps/details?id=xyz.fhdm.scoppy&hl=en_IN&gl=US&pli=1]
For Pico board, download the BOOTSEL file from the link : https://github.com/fhdm-dev/scpdl1/raw/master/a/v15/scoppy-pico-v15.uf2
For Pico W board, download the BOOTSEL file from the link :https://github.com/fhdm-dev/scpdl1/raw/master/a/v15/scoppy-picow-v15.uf2
To initiate the process, press and hold the BOOTSEL button located on the Pico board.
After that, connect the Pico to your computer using a regular USB cable (Type-A male to Micro-USB male).
Your computer should detect the Pico as a USB Mass Storage device.
Once you see the “RPI-RP2” drive appear on your computer, release the BOOTSEL button.
Next, copy the uf2 file to your Pico.
When the file transfer is complete, you should observe the onboard LED on the Pico start blinking.
Then I set up the Pin 31 (GPIO 26) of the Pico to the Arduino Uno I/O pin Pin 9 and the ground of the Pico to the ground of the Arduino.
I have used Arduino for generation of signal of my choice.However, if you want, you can test the Pico setup by connecting it with Pin 29(GPIO 22) for generation of 1 KHz square wave.
After completing the above circuit setup, open the Scoppy App on your mobile phone.
Click on ‘Change Connection Type ’ on the Scoppy App.
To familarise yourself with the UI/UX of the app, Demo option can be chosen. A Sine Wave will be the output waveform.
In case of Pico board, choose the USB option.
In case of Pico W board, choose the WiFi option.
Allow the Scoppy to access Pico.
Voila! Your setup is ready !
Digital Wave
Connect the Pin 31 (GPIO 26) of the Pico to the Arduino Uno I/O pin Pin 9 and the ground of the Pico to the ground of the Arduino.
The ground connection helps maintain signal integrity by providing a return path for the digital signals. When a digital signal transitions from high to low or vice versa, the current needs a path to flow. The ground connection provides this path and ensures proper signal propagation. In this case , signal will flow from 0V to 3.3 V .
const int outputPin = 9;
const int desiredFrequency = 1000;
const unsigned long halfPeriodDuration = 500000 / desiredFrequency;
void setup() {
pinMode(outputPin, OUTPUT);
}
void loop() {
digitalWrite(outputPin, HIGH);
delayMicroseconds(halfPeriodDuration);
digitalWrite(outputPin, LOW);
delayMicroseconds(halfPeriodDuration);
}
Scopy Output for Square Wave
Analog Wave
For Analog signal (Sinusoidal Wave), unlike digital wave ,ground connection is not necessary.
The Pin 31 (GPIO 26) of the Pico to the Arduino Uno I/O pin (Pin 9) is connected serially, makeing the output of the Arduino to be the input waveform of the Raspberry Pico.
In simpler analog wave configurations, where all components share a common power supply and ground connection, there may not be a need for an explicit mention or separate ground connection. The ground reference is implicitly assumed and shared among the components.
int OUTPUTPIN= 9;
int frequency = 2;
int samplingFrequency = 500;
int numberOfSamples = 500;
float time;
int interval;
byte sampleData[500];
void setup() {
pinMode(OUTPUTPIN, OUTPUT);
for (int i = 0; i < numberOfSamples; i++) {
time = (float)i / samplingFrequency;
sampleData[i] = (byte)(127.0 * sin(2 * PI * frequency * time) + 127.0);
}
interval = 1000000 / (frequency * numberOfSamples);
}
void loop() {
for (int j = 0; j < numberOfSamples; j++) {
analogWrite(OUTPUTPIN, sampleData[j]);
delayMicroseconds(interval);
}
}
The output waveform can be seen as the given figure
The noise encounter can be removed by use of a low pass filter(LPF) connected serially from the Arduino to Pico.
Compared to conventional oscilloscopes, the setup using Raspberry Pico as an oscilloscope offers several advantages. One significant advantage is its affordability. The required components are minimal, with Raspberry Pico being the main component, while the rest of the necessary equipment is commonly found in our daily lives. This setup is particularly advantageous for students as it is budget-friendly and can be utilized for projects with limited resources.
Disclaimer: Non-Profit Project Sharing
The purpose of this disclaimer is to inform readers that the project shared on this blog is not intended for personal profit but rather as a means of sharing my own experiences and knowledge. Please carefully read and understand the following information before engaging with the project.
1. Personal Experience: The project described in this blog is based on my personal experiences and knowledge. It is important to note that I am not a professional in this field, and the information provided should be considered as educational rather than professional advice.
2. Non-Commercial Intent: The project shared on this blog is not intended for commercial purposes. It is solely meant to serve as a platform for sharing knowledge, ideas, and experiences related to the subject matter.
3. No Warranty or Guarantee: While I have made reasonable efforts to ensure the accuracy and reliability of the information provided in the project, I cannot guarantee its completeness, reliability, or suitability for any specific purpose. The project is presented “as is,” without any warranties or guarantees of any kind.
4. Assumption of Risk: By engaging with the project, you acknowledge and agree that any actions taken based on the information provided are at your own risk. I shall not be held responsible for any damages, losses, or injuries that may arise from the use or implementation of the project.
5. Consultation and Professional Advice: If you require professional advice or assistance, it is recommended to consult with appropriate experts or seek professional guidance before undertaking any project or using any information provided in this blog.
6. Third-Party Content and Links: This blog may contain references, links, or content provided by third parties. I do not endorse or assume any responsibility for the accuracy, legality, or appropriateness of such content. Accessing or utilizing any third-party content or links is done at your own discretion and risk.
By engaging with the project shared on this blog, you agree to release me from any liability, claims, or damages arising from your use or reliance upon the information provided. It is your responsibility to assess the suitability of the project for your own purposes and exercise caution when implementing any techniques or methods discussed.
Remember, the primary goal of this blog is to share experiences, promote learning, and foster a sense of community.