{"id":154520,"date":"2024-12-20T19:17:19","date_gmt":"2024-12-20T13:47:19","guid":{"rendered":"https:\/\/www.electronicsforu.com\/?p=154520"},"modified":"2025-04-10T18:31:25","modified_gmt":"2025-04-10T13:01:25","slug":"indusscope-smallest-iot-oscilloscope","status":"publish","type":"post","link":"https:\/\/www.electronicsforu.com\/electronics-projects\/indusscope-smallest-iot-oscilloscope","title":{"rendered":"IndusScope &#8211; Portable Smallest IoT Oscilloscope"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"161\" height=\"147\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/Ashwini-EFY-Tested-2.webp\" alt=\"EFY Tested \" class=\"wp-image-154611\"\/><\/figure><\/div>\n\n\n<p><a href=\"https:\/\/www.electronicsforu.com\/technology-trends\/learn-electronics\/cro-cathode-ray-oscilloscope-working\">Oscilloscope<\/a> is an essential test and measurement device that enables us to analyze AC and DC signals, visualize waves, and determine frequency.<\/p>\n\n\n\n<p>However, most traditional oscilloscopes are bulky and large in size, which can be inconvenient when working with microelectronics, designing, and testing small components. <\/p>\n\n\n\n<p>Therefore, we have designed InduScope, a portable oscilloscope that offers IoT connectivity, allowing users to connect it to smart TVs, laptops, and phones. This enables real-time data visualization, display enlargement, and wireless control of the oscilloscope.<\/p>\n\n\n\n<p>In the design process, we utilized the <a href=\"https:\/\/indus.electronicsforu.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">IndusBoard Coin<\/a>, which incorporates both DAC and ADC functions, enabling us to read signals and use the board as an oscilloscope. Additionally, a circuit was integrated to extend the oscilloscope\u2019s range. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"578\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/osiliscope-1024x578.jpeg\" alt=\"IndusScope - Smallest IoT Oscilloscope\" class=\"wp-image-154521\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/osiliscope-1024x578.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/osiliscope-500x282.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/osiliscope-744x420.jpeg 744w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/osiliscope-696x393.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/osiliscope.jpeg 1368w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig. 1: IndusScope &#8211; Smallest IoT Oscilloscope<\/figcaption><\/figure>\n\n\n\n<p>Below You can see the demonstration video of IndusScope.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<span class=\"ENlfSBUv1jdymZYg59x\"><iframe loading=\"lazy\" title=\"IndusScope - Smallest Portable Oscilloscope with IoT Connectivity and Real-time Data Visualization\" width=\"696\" height=\"392\" src=\"https:\/\/www.youtube.com\/embed\/bH2wzNwzimc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/span>\n<\/div><\/figure>\n\n\n\n<p>The necessary components are listed below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Bill of Materials&nbsp;<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Components<\/strong><\/td><td><strong>Quantity&nbsp;<\/strong><\/td><\/tr><tr><td>IndusBoard Coin<\/td><td>1<\/td><\/tr><tr><td>BNC Connector&nbsp;<\/td><td>1<\/td><\/tr><tr><td>Slide switch&nbsp;<\/td><td>2<\/td><\/tr><tr><td>Resistors 10K, 100K<\/td><td>2<\/td><\/tr><tr><td>IN4148 Diode<\/td><td>2<\/td><\/tr><tr><td>Capacitor 1uF<\/td><td>1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>IndusScope Circuit&nbsp;<\/strong><\/h2>\n\n\n\n<p>Here, the InduBoard ADC pin is used when connecting many multichannel oscilloscopes. <\/p>\n\n\n\n<p>However, to keep the design simple and easy to manufacture, only one channel oscilloscope is made, and any pins can be used as an ADC. In this case, the four-pin is used as the first channel of the oscilloscope.<\/p>\n\n\n\n<p>After preparing the code, we can directly connect pin 4 to the probe to see the signal and use it as an oscilloscope. However, to switch between AC\/DC signals and extend the range from 0 to 33V DC and 220V AC, we need a special kind of circuit.<\/p>\n\n\n\n<p>Here is the design and circuit needed to achieve this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"766\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/smallest-ossiliscope-1024x766.jpeg\" alt=\"IndusScope Smallest IoT Oscilloscope circuit \n\" class=\"wp-image-154522\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/smallest-ossiliscope-1024x766.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/smallest-ossiliscope-500x374.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/smallest-ossiliscope-562x420.jpeg 562w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/smallest-ossiliscope-80x60.jpeg 80w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/smallest-ossiliscope-696x520.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/smallest-ossiliscope-265x198.jpeg 265w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/smallest-ossiliscope.jpeg 1142w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig. 2: IndusScope IoT Oscilloscope Circuit<\/figcaption><\/figure>\n\n\n\n<p>The voltage divider circuit consisting of&nbsp;<strong>R1 = 100k\u03a9<\/strong>&nbsp;and&nbsp;<strong>R2 = 10k\u03a9<\/strong>&nbsp;ensures safe input voltage levels for the ESP32-S2 ADC pin by scaling down the input signal. The output voltage is given by:<\/p>\n\n\n\n<p>Vout=Vin\u00d7(R2\/(R1+R2))<\/p>\n\n\n\n<p>=Vin\u00d7(10k\/(100k+10k))<\/p>\n\n\n\n<p>\u2248Vin\u00d70.091<\/p>\n\n\n\n<p>This means the input signal is reduced to about&nbsp;<strong>9.1%<\/strong>&nbsp;of its original amplitude, ensuring it remains within the safe voltage range of the ADC (0\u20133.3V).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Adding a Capacitor for AC Coupling<\/strong><\/h3>\n\n\n\n<p>To measure AC signals while blocking any DC component, a&nbsp;<strong>series capacitor<\/strong>&nbsp;is added. The capacitor should be placed between the BNC input signal line and the voltage divider (R1).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Steps to Add the Capacitor:<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Disconnect the connection between Pin 1 of&nbsp;<strong>BNC1<\/strong>&nbsp;and R1.<\/li>\n\n\n\n<li>Insert the capacitor in series between these points.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Capacitor Selection:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Low-frequency signals (50Hz\u20131kHz):<\/strong>&nbsp;Use a&nbsp;<strong>1\u00b5F to 10\u00b5F electrolytic capacitor<\/strong>.<\/li>\n\n\n\n<li><strong>High-frequency signals (10kHz+):<\/strong>&nbsp;Use a&nbsp;<strong>0.1\u00b5F to 1\u00b5F ceramic capacitor<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>If using an electrolytic capacitor, ensure proper polarity\u2014the positive leg connects to the input signal, and the negative leg connects to R1.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Adding Diodes for Overvoltage Protection<\/strong><\/h3>\n\n\n\n<p>To protect the ESP32 ADC pin from voltage spikes, two clamping diodes are added at the output of the voltage divider (R2).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Placement<\/strong>:<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Connect one diode between the ADC pin and 3.3V (anode to ADC pin, cathode to 3.3V).<\/li>\n\n\n\n<li>Connect the second diode between the ADC pin and GND (cathode to ADC pin, anode to GND).<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>How It Works:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Voltages &gt; 3.3V<\/strong>&nbsp;are redirected to 3.3V.<\/li>\n\n\n\n<li><strong>Voltages &lt; 0V<\/strong>&nbsp;are redirected to GND.<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Recommended Diodes:<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Schottky diodes (e.g., 1N5819)<\/strong>: Low forward voltage drop.<\/li>\n\n\n\n<li><strong>Standard diodes (e.g., 1N4148)<\/strong>: Alternative option.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Adding a Slide Switch for AC\/DC Mode Selection<\/strong><\/h3>\n\n\n\n<p>A&nbsp;<strong>slide switch (SW1)<\/strong>&nbsp;allows toggling between AC and DC coupling by bypassing the series capacitor.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>How to Connect the Switch:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Place the switch&nbsp;<strong>in parallel<\/strong>&nbsp;with the capacitor.<\/li>\n\n\n\n<li><strong>Switch closed:<\/strong>&nbsp;Capacitor is bypassed, enabling DC signal measurement.<\/li>\n\n\n\n<li><strong>Switch open:<\/strong>&nbsp;Capacitor blocks DC components, enabling AC signal measurement.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why Add These Components?<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Capacitor:<\/strong>&nbsp;Enables AC\/DC signal measurement flexibility.<\/li>\n\n\n\n<li><strong>Diodes:<\/strong>&nbsp;Protect the ESP32 ADC pin from voltage spikes.<\/li>\n\n\n\n<li><strong>Switch:<\/strong>&nbsp;Allows quick switching between AC and DC coupling modes.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>IndusScope Coding<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"824\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/image-1-1024x824.png\" alt=\"Code for IndusScope\" class=\"wp-image-154523\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/image-1-1024x824.png 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/image-1-500x402.png 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/image-1-522x420.png 522w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/image-1-696x560.png 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/image-1.png 1318w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig. 3: code snippet config. AP<\/figcaption><\/figure>\n\n\n\n<p>The IndusScope oscilloscope code is designed to sample input signals via the ADC, process the data, and display real-time waveforms on a web interface hosted by the ESP32-S2. <\/p>\n\n\n\n<p>It begins by including essential libraries like&nbsp;<strong>WiFi.h<\/strong>&nbsp;for WiFi functionality and&nbsp;<strong>ESPAsyncWebServer.h<\/strong>&nbsp;to set up an asynchronous web server. <\/p>\n\n\n\n<p>The ADC pin is defined as GPIO4, and the reference voltage for the ADC is set to 3.3V. The ESP32-S2 operates as an Access Point (AP) with the SSID&nbsp;<strong>Indus-Oscilloscope<\/strong>&nbsp;and password&nbsp;<strong>12345678<\/strong>, allowing devices to connect directly and access the interface via the IP address&nbsp;<code>http:\/\/192.168.4.1<\/code>.<\/p>\n\n\n\n<p>The web interface is created using HTML, CSS, and JavaScript. It features a canvas for real-time waveform display, sliders to adjust time and voltage scales, and a &#8220;Capture Waveform&#8221; button to save waveforms as images in a grid. <\/p>\n\n\n\n<p>The&nbsp;<strong>drawGrid<\/strong>&nbsp;function renders the oscilloscope grid lines, while the&nbsp;<strong>fetchData<\/strong>&nbsp;function periodically retrieves signal data from the ESP32 using an HTTP GET request to the&nbsp;<code>\/data<\/code>&nbsp;endpoint. <\/p>\n\n\n\n<p>The waveform is plotted on the canvas in real time by the&nbsp;<strong>updateGraph<\/strong>&nbsp;function.<\/p>\n\n\n\n<p>The signal data is processed in the&nbsp;<strong>handleDataRequest<\/strong>&nbsp;function. The ESP32 collects 100 ADC samples at 100\u00b5s intervals, and calculates the peak voltage (maximum amplitude), average voltage (mean value), and frequency (based on zero-crossings of the waveform).<\/p>\n\n\n\n<p>This data, along with the sampled waveform, is formatted into a JSON response and sent to the web interface. Users can adjust time and voltage divisions using the sliders, and captured waveforms are displayed in the capture grid for further analysis. <\/p>\n\n\n\n<p>This setup transforms the ESP32-S2 into a compact, versatile oscilloscope with a user-friendly web interface.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Testing IndusScope<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"527\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/indusScope-1024x527.jpeg\" alt=\"Smallest portable ossiliscope testing\" class=\"wp-image-154527\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/indusScope-1024x527.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/indusScope-500x257.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/indusScope-816x420.jpeg 816w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/indusScope-696x358.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/indusScope.jpeg 1340w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig. 4: Smallest portable oscilloscope testing<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"608\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/Indusscope-Ui-1024x608.jpeg\" alt=\"Webpage UI of IndusScope\" class=\"wp-image-154528\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/Indusscope-Ui-1024x608.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/Indusscope-Ui-500x297.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/Indusscope-Ui-707x420.jpeg 707w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/Indusscope-Ui-696x413.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/Indusscope-Ui.jpeg 1354w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig. 5: Webpage UI of IndusScope<\/figcaption><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Power the oscilloscope and connect it to&nbsp;the <strong>Indus-Oscilloscope<\/strong>&nbsp;using the given credentials.<\/li>\n\n\n\n<li>Open a browser and navigate to&nbsp;<strong>http:\/\/192.168.4.1<\/strong>.<\/li>\n\n\n\n<li>Observe the real-time waveform, adjust settings, and use the capture grid to save waveforms.<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-f0c2ed5d-3958-412c-91eb-0d62d3d364b6\" href=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/IndusScopeV4.zip\">IndusScope Code<\/a><a href=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2024\/12\/IndusScopeV4.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-f0c2ed5d-3958-412c-91eb-0d62d3d364b6\">Download<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Oscilloscope is an essential test and measurement device that enables us to analyze AC and DC signals, visualize waves, and determine frequency. However, most traditional oscilloscopes are bulky and large in size, which can be inconvenient when working with microelectronics, designing, and testing small components. Therefore, we have designed InduScope, a portable oscilloscope that offers [&hellip;]<\/p>\n","protected":false},"author":33369,"featured_media":154527,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,23,6070,6189,11851],"tags":[11666],"class_list":{"0":"post-154520","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-electronics-projects","8":"category-hardware-diy","9":"category-advanced-projects","10":"category-esp32-projects","11":"category-super-innovative-projects","12":"tag-indusboard"},"_links":{"self":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/154520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/users\/33369"}],"replies":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/comments?post=154520"}],"version-history":[{"count":1,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/154520\/revisions"}],"predecessor-version":[{"id":161014,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/154520\/revisions\/161014"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media\/154527"}],"wp:attachment":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media?parent=154520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/categories?post=154520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/tags?post=154520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}