While working with electronics one of the most important tools is the Oscilloscope and it one of the most costliest tools too.

So in this instructable I'm going to show you how to build an oscilloscope with the LinkIt One. While this is can not replace an actual oscilloscope, this is a great project to visualize any signal below 5V. The coolest part of this oscilloscope is it can work wireless too.

The output of the oscilloscope is displayed in a processing program and can be modified according to your preference. I would also show you how to generate a square wave of a selected frequency using an Arduino board and display the waveform on the oscilloscope.

So lets get started.....

Step 1: Tools and Components

All that you need for this instructable is -

  • LinkIt One Board
  • Arduino Uno
  • LDR
  • 10K resistor
  • Relay Board
  • Breadboard
  • Jumper wires

Most of the components above is optional, it depends on what you are using the oscilloscope for.

Step 2: Circuit

This circuit is to demonstrate the oscilloscope so I'm going to show you how to visualize the analogue signal from an LDR. The circuit can be found above and can be assembled on a breadboard. You may also require a light source like an LED to test this out. Also make sure you try out my previous instructables if you are here for the first time they serve as a basic tutorials.

Step 3: Code - LinkIt One

The code to be uploaded to the LinkIt One can be found below. To upload the code you require the Arduino IDE with the LinkIt One plugin, you can find instructions on how to install that in my previous tutorials. Make sure you select the right port while uploading the code. By default the code is set to read values from analogue pin 0 but you may change it by editing the first line of the code to match which pin you used for the circuit.

const int sensorPin = A0; // pin that the sensor is attached to

// variables: int sensorValue = 0; // the sensor value

void setup() { Serial.begin(9600); }

void loop() { // read the sensor: sensorValue = analogRead(sensorPin);

// in case the sensor value is outside the range seen during calibration sensorValue = constrain(sensorValue, 0, 255); Serial.write( 0xff ); Serial.write( (sensorValue >> 8) & 0xff ); Serial.write( sensorValue & 0xff ); }

Step 4: Code - Processing

For this step you need the processing IDE and you can download it form the official processing website. Make sure you download the right file depending on your OS. You can download the code below and open it using the processing app. Make sure you note the com port while uploading the code in the last step. You can also find it in "Control Panel" if you are using windows. Select the port number from the array of ports and edit the below line in the code to match your preference.

port = new Serial(this, Serial.list()[0], 9600);

Step 5: Testing

Once you have everything set up connect the LinkIt one to your PC and click the run button in the processing IDE and if everything went fine you should see a black background window open up and the analogue values are plotted on screen. Now you can bring the light source close to the LDR and you should see the graph shoot up.

If you are facing any difficulties, feel free to leave a comment below.

Step 6: Arduino

This step is optional and is really cool to try out, in this step I'm going to show you how to generate a square wave using an Arduino and plot the wave using the oscilloscope you just created.

First you need to upload the blink sketch which can be found in the Arduino IDE to the Arduino,

Next, you need to connect the Arduino digital pin 13 to LinkIt One analog pin 0,

Then you need to connect the GND pin of both the boards together

And that's it, now you can run the processing sketch and you should see a square wave like the one in the picture.

About This Instructable




More by LightBug:Getting started with IoT using the Particle Core Fish Food Feeder Using the Linkit One Controlling High voltage devices with LinkIt One 
Add instructable to: