Chapter 4. It Began with a Dripping Faucet

Similar documents
If you have been there, You know about the ʺmagic momentsʺ That only a few will ever discover!

AI-1616L-LPE. Features. High-precision Analog input board (Low Profile size) for PCI Express AI-1616L-LPE 1. Ver.1.02 Ver.1.01

DAC Express Release 3.4 (VT9801B)

Digital 1 Final Project Sequential Digital System - Slot Machine

AD16-64(LPCI)LA. Non-isolated high precision analog input board for Low Profile PCI AD16-64(LPCI)LA 1. Ver.1.01

E X P E R I M E N T 1

MULTISIM DEMO 9.5: 60 HZ ACTIVE NOTCH FILTER

LabView Exercises: Part II

SPACESCAN SERIES SS 02

AD16-16U(PCI)EV. Features. High-Speed & Resolution Analog Input Board for PCI AD16-16U(PCI)EV 1. Ver.1.02

ex 800 Series ematrix System

Re: ENSC 370 Project Physiological Signal Data Logger Functional Specifications

Measure the value of water flow using water flow sensor and DC water pump 12 V interfacing with Arduino uno

W0EB/W2CTX DSP Audio Filter Operating Manual V1.12

AD12-16U(PCI)EV. Features. High-Speed Analog Input Board for PCI AD12-16U(PCI)EV 1. Ver.1.01

The Micropython Microcontroller

UNIT V 8051 Microcontroller based Systems Design

Lesson Sequence: S4A (Scratch for Arduino)

TV Character Generator

0.56" 4 Digital Blue LED Panel Meter (rescalable) User s Guide

Log-detector. Sweeper setup using oscilloscope as XY display

AP-40. AP-40 Series Features Industry s smallest-sensor head Ultra lightweight High-speed response Two-color LED digital pressure display

Silver Mountain Targets V2 Software Reference Guide. July 22, 2015

Video VBOX Waterproof

AI-1664LAX-USB. Features. 100KSPS 16-bit Analog Input Unit for USB AI-1664LAX-USB 1. Ver.1.01

Informatics Enlightened Station 2 Park distance control system

Data Acquisition Using LabVIEW

The measurements are stored in non-volatile memory, which retains data even when the power down.

Event recording (or logging) with a Fluke 287/289 Digital Multimeter

DICKSON ES120/ES120A DICKSON. Electronic Signal Data Logger. Specifications. Applications, Features, & Getting Started. Instructions / Operating

EDL8 Race Dash Manual Engine Management Systems

Kicker SUM8 OEM integration solution

Introduction. The Clock Hardware. A Unique LED Clock Article by Craig A. Lindley

OptoFidelity Video Multimeter User Manual Version 2017Q1.0

Application Note AN-708 Vibration Measurements with the Vibration Synchronization Module

Instructions and answers for teachers

Choosing an Oscilloscope

ECE 402L APPLICATIONS OF ANALOG INTEGRATED CIRCUITS SPRING No labs meet this week. Course introduction & lab safety

Lab experience 1: Introduction to LabView

Training Note TR-06RD. Schedules. Schedule types

The Measurement Tools and What They Do

The Syscal family of resistivity meters. Designed for the surveys you do.

INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR NPTEL ONLINE CERTIFICATION COURSE. On Industrial Automation and Control

Edge Connector Light Level Detector

PHY221 Lab 1 Discovering Motion: Introduction to Logger Pro and the Motion Detector; Motion with Constant Velocity

ME EN 363 ELEMENTARY INSTRUMENTATION Lab: Basic Lab Instruments and Data Acquisition

Physics Lab 2 RLC Circuit Oscilloscope & Function Generator

EEM Digital Systems II

VOB - data over Video Overlay Box

Troubleshooting. 1. Symptom: Status indicator (Red LED) on SSR is constant on. 2. Symptom: Output indicator (Yellow LED) on SSR is flashing.

ECE 4220 Real Time Embedded Systems Final Project Spectrum Analyzer

VBOX3i Dual Antenna. Measures Slip and Pitch/Roll (RLVB3iSL) Features

SingMai Electronics SM06. Advanced Composite Video Interface: HD-SDI to acvi converter module. User Manual. Revision 0.

DESIGN AND DEVELOPMENT OF A MICROCONTROLLER BASED PORTABLE ECG MONITOR

Introduction: Overview. EECE 2510 Circuits and Signals: Biomedical Applications. ECG Circuit 2 Analog Filtering and A/D Conversion

TASKI Service Tool Edition: V5.10/2014

PESIT Bangalore South Campus

Getting Started with the LabVIEW Sound and Vibration Toolkit

MTL Software. Overview

The BAT WAVE ANALYZER project

SingMai Electronics SM06. Advanced Composite Video Interface: DVI/HD-SDI to acvi converter module. User Manual. Revision th December 2016

We had to design a Led circuit that would contain multiple Leds, activate them by address, then holds the flashing addressed Led in memory and

Chapter 1. Introduction to Digital Signal Processing

Video VBOX Lite RLVBVD10LT2. Powerful VBOX data logging and video technology in a user-friendly, affordable product. What can Video VBOX Lite do?

ZN-PD. Smallest Air Particle Sensor in the Industry for In-line Measurement. Air Particle Sensor. Features

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

127566, Россия, Москва, Алтуфьевское шоссе, дом 48, корпус 1 Телефон: +7 (499) (800) (бесплатно на территории России)

Chapter 5 Flip-Flops and Related Devices

Video VBOX Pro RLVD10P2P/RLVD10P2PV/RLVD10P4PV/RLVD20P2PV/RLVD20P4PV. Features

INPUT OUTPUT GAIN DELAY. Hue Candela Strobe Controller. Hue Candela s STROBE CONTROLLER. Front Panel Actual Size 7 ¼ By 4 ¾ POWER. msec SEC 10 1.

Music-Visualization and Motion-Controlled LED Cube

COMP sequential logic 1 Jan. 25, 2016

USER MANUAL FOR THE ANALOGIC GAUGE FIRMWARE VERSION 1.1

FIR Center Report. Development of Feedback Control Scheme for the Stabilization of Gyrotron Output Power

NanoGiant Oscilloscope/Function-Generator Program. Getting Started

Working with CSWin32 Software

Preventing Fieldbus Physical Layer Problems

Arduino LED Matrix Control. Controlling lots of LEDs

C200H-AD002/DA002 Analog I/O Units Operation Guide

PIECEWISE PRODUCTION MACHINES

Part 2 -- A digital thermometer or talk I2C to your atmel microcontroller

The word digital implies information in computers is represented by variables that take a limited number of discrete values.

Oscilloscopes for field applications

Introduction To LabVIEW and the DSP Board

Hardware Design I Chap. 5 Memory elements

OPTIMUM Power Technology: Low Cost Combustion Analysis for University Engine Design Programs Using ICEview and NI Compact DAQ Chassis

Digital Systems Principles and Applications. Chapter 1 Objectives

iworx Sample Lab Experiment HM-3: The Electrogastrogram (EGG) and the Growling Stomach

Lesson 4 RGB LED. Overview. Component Required:

USER MANUAL FOR THE ANALOGIC GAUGE FIRMWARE VERSION 1.0

Introduction Display...1 Mounting...1 Firmware Version...2. ADL Operation... 3

Hardware Guide BrightSign, LLC Version:.1 Los Gatos, CA, USA. MODELS: XD Product Line

Dac3 White Paper. These Dac3 goals where to be achieved through the application and use of optimum solutions for:

A 400MHz Direct Digital Synthesizer with the AD9912

Troubleshooting and Analyzing Digital Video Signals with CaptureVu

There are many ham radio related activities

Yosemite in HO FROM HALFDOME TO CAMP CURRY

Module 4: Traffic Signal Design Lesson 1: Traffic Signal (Arduino) Control System Laboratory Exercise Grade 6-8

Laboratory 9 Digital Circuits: Flip Flops, One-Shot, Shift Register, Ripple Counter

TEST-3 (DIGITAL ELECTRONICS)-(EECTRONIC)

Transcription:

Chapter 4. It Began with a Dripping Faucet 4.1 Childhood Memories When I was a kid we didnʹt have a lot of money. We werenʹt really poor, but we couldnʹt afford to hire things done for us. My dad was very versatile and was able to fix almost anything. The exception? Pluming. In those days when you wanted to stop the faucet from dripping you just squeezed the handle tighter. When you do that you eventually reach a point where the washer is flattened and more squeezing doesnʹt help that much. So, Iʹve heard my share of dripping faucets. Maybe you havenʹt thought much about dripping faucets, but itʹs a pretty complex affair. Water tends to build up on the faucet lip and eventually a drop falls off. But there is more to it than that. With new water coming in the drop tends to oscillate up and down until there is enough weight to break the cohesive forces and surface tension of the drop, and it lets go (usually at the bottom of an oscillation). Who would have thought that all that stuff is going on for each drop! This phenomenon is so complex, could it exhibit any coherent pattern at all? Well, a dripping faucet seems to operate in three different modes:

Mode 1: At a very slow rate the drops are pretty steady. Mode 2: A little faster and they seem to become random, and then Mode 3: At a high flow rate it turns into a steady stream. The situation we are interested in is Mode 2. I call it the ʺin betweenʺ mode. Hereʹs where the drops seem to be random. Are they really? How could such a complex event as this contain any patterns or attractors at all? Well, this is our first experiment. Visit my website at rickmckeon.com/mcu.html for some interesting videos on this topic. 4.2 Capturing and Displaying Data The first thing we need to do is design an experiment to capture information from the system and put it in a form that is useful for analysis. For any system, that means capturing the event (sound, light, pressure, movement, etc.) and converting it into numbers. Then we need to present those numbers in a way that might reveal any hidden patterns. Figure 4.1 shows the overall plan, and Figure 4.2 shows the setup for capture. You may want to simplify this process a little bit (maybe eliminate the audio recorder and capture directly with the Arduino) but this is the procedure I followed: 1. Capture the sound of the dripping faucet as an mp3 file using an audio recorder. 2. Transfer the audio file to the computer so that you can play it back through the computer speakers with volume control. 3. Sample the audio file with a microphone shield on the Arduino, and log those numbers to a text file called ʺdatalog.txtʺ on the SD card. 4. Remove the SD card from the Arduino SD shield and transfer the datalog.txt to the computer. 2

5. Write a BASIC program in QB64 that will read the numbers from datafile.txt and convert them to a three-column comma separated variable (csv) file. 6. Import these files to a to your favorite display software. I used Graphing Calculator 3D to do the visualization. This software is completely GUI based with no coding required, so it is intuitive and easy to use. Of course you can use any graphing program you are familiar with. I have used GNU Octave to produce the same plots, but in my opinion, this program is quicker and easier. There is a free demo version available, but to do anything useful you need to purchase at least the Standard version. 7. Then the real fun begins! Look for patterns in the graphical displays and see if you can understand where these patterns came from. Figure 4.1 Capturing the Dripping Faucet 3

Figure 4.2 Recording the Dripping Faucet We could capture the dripping faucet in other ways, like having the drops interrupt an LED/Photo diode pair or fall on a pressure sensor, but for this project I chose to record the sound of the drops. 4.2.1 Arduino as Data Logger We are going to use the Arduino UNO to log the captured data. It has some on-board storage, but we will use an SD card ʺshieldʺ to increase its storage capacity. For each of these projects we will be capturing 10,000 samples. 4

The beauty of the Arduino is that it can be used at home or in the field to capture and store information because it: 1. Stores the program in non-volatile memory. 2. Starts running the program upon power up, and 3. Can be powered via the USB connector or from a single 9V battery. Figure 4.3 shows the simple arrangement used to capture data with the Arduino. I recorded the sound of the dripping faucet with a Zoom H2 recorder and transferred it to my computer as an mp3 audio file. Then I played the audio file through the computerʹs speakers. Playing the audio file back via the computer speakers allows us to adjust the volume to put it in a good range for the Arduino to capture. We are using a microphone sensor on the breadboard that feeds the signal to A0 on the Arduino. The microphone I used is the Adafruit Electret Microphone Amplifier MAX9814. 5

Figure 4.3 Equipment Setup Figure 4.4 shows the schematic diagram for this experiment. 6

4.2.2 Importing the Data File Figure 4.4 Microphone Schematic Now that we have sampled the recording of the dripping faucet and created a list of numbers (one dimensional array) on the SD card we need to import it into the PC and display it in a way that might reveal any hidden patterns. Importing the data set is as simple as removing the SD card from the Arduino shield and sticking it in your PC. If your machine doesnʹt have an SD card slot, you can use an SD card reader with USB connector as shown in Figure 4.5 below. 7

Figure 4.5 SD Card Reader Then itʹs just a matter of setting up a folder on your computer to hold the data file. Make sure you know where it is, because you will need to specify the path when you run the BASIC routine. I do all of my file management with Windows File Explorer. That approach helps me to know exactly where everything is. Now weʹre ready to read the data file with our BASIC routine and paint the screen with a bunch of dots! 4.2.3 Displaying Our Captured Data The Arduino sketch for capturing data from analog port A0 is shown in Appendix A. The BASIC routine for file conversion of our captured data from a one-column text file to a three-column csv file is discussed in Appendix D. Figures 4.6-4.8 are three different views of our data set derived by sampling the dripping faucet at regular intervals. 8

Figure 4.6 Dripping Faucet Captured at Regular Intervals Figure 4.7 Dripping Faucet Captured at Regular Intervals 9

Figure 4.8 Dripping Faucet Captured at Regular Intervals Looking at Figures 4.6-4.8 you can see that this complex event that seemed pretty random when just listening to it actually has a form. How can we interpret this plot? Keep in mind that these numbers represent a sampling of voltages at regular intervals on the A0 analog port. Those voltages are recorded as numbers from 0 to 1023 by the Arduino A/D converter, and then we present them as a 3-D plot. If there are patterns we are bound to see them! You may see things that I donʹt, but here are a few of my initial observations: 1. There is a central clustering of points around coordinates (250,250,250). 10

2. There is a central ʺshaftʺ that extends from (250,250,0) to (250,250,500) with a cluster at each end. 3. There is a ʺcloudʺ of points surrounding the central plot. 4.3 A Different Approach: Timing Individual Events Now, hereʹs a different approach to understanding the same captured event. In this case we clean up the signal so we can isolate the time individuals between drops, and then we plot those intervals in 3-D. This may seem like a subtitle difference, but it is a major shift in perspective! After all, when listening to a dripping faucet for patterns what are you listening for? Your brain automatically filters out all the noise and concentrates on the drops themselves. Wow! How amazing! If you really want to look for ʺattractorsʺ You need to capture time intervals. If a natural process consists of a series of events (no matter how much noise there is in the signal) we can find a way to isolate those events and determine the time intervals between them. Then we can create a plot based on those intervals. How amazing is that! Even as I write about it, it seems pretty complicated, but itʹs really not. 4.3.1 Capturing Time Intervals Figure 4.9 shows the captured audio recording. It is pretty noisy, but you can see where the individual drops occur. We need to clean this signal up so we can trigger interrupts based in the individual drops. These interrupts 11

will determine how much time has passed since the last interrupt (drop) occurred and write that number (in milliseconds) to the SD card. How can we extract the actual drops from all this noise? Enter the Schmitt Trigger! Figure 4.9 Raw Signal 12

4.3.2 The Schmitt Trigger The Schmitt Trigger is a simple but amazing circuit. It has hysteresis. Youʹre probably wondering, ʺWhat the heck is hysteresis?ʺ OK, let me give you an example. We use hysteresis all the time and donʹt even think about it. Letʹs say during the winter you set your heater thermostat to 68 0 F (my apologies to the rest of the world. We use Fahrenheit over here in the U.S.). So when does the heater actually kick on or turn off? If it is below 68 degrees we want the heater to come on. Once it gets above 68 degrees we want it to shut off. But, what if the temperature is exactly 68 degrees? Should it kick on or turn off? I think you can see the dilemma. It canʹt just sit there and chatter. Without getting into bimetallic strips, mercury switches, and all that stuff, just know that we have to get a little bit above the target temperature for the heater to shut off, and a little bit below the target temperature for it to turn on again. Thatʹs called hysteresis! In the same way, we can clean up a messy signal with a comparator that has some hysteresis built in. If the signal is noisy, but does have some peaks every now and then, weʹll use a comparator that will turn on above a certain point, but wonʹt turn off until it reaches a point well below the place where it turned on. 13

These values are called ʺtrip points.ʺ We are using a 5V power supply and the trip points are about one third and two thirds of the supply, so we have trip points of: 1. Upper trip point = 3.3V 2. Lower trip point = 1.6V The 555 is wired as an inverting Schmitt trigger, so this means that when the input signal gets above 3.3V the output will go low. Then the input can vary all over the place, but the output wonʹt go high again until the input goes below 1.6V. At that point the reverse is true. The output wonʹt go low again until the input goes above 3.3V. Figure 4.10 shows a 555 op amp wired as a Schmitt Trigger, and Figure 4.11 shows graphically how it works. Figure 4.10 The 555 Op Amp Schmitt Trigger 14

Figure 4.11 Inverting Schmitt Trigger Trip Points Figure 4.12 shows how we convert a noisy analog signal to a clean digital signal with nice clean rising and falling edges that can be used to trigger interrupts. 15

Figure 4.12 Schmitt Trigger Cleans Up Noisy Signal 4.3.3 Interrupts When you donʹt want to be constantly checking an input to see if it has changed and you donʹt know when a change might occur, interrupts are a great tool. Itʹs like when you are expecting an important phone call. You donʹt know exactly when the call will come in, but you donʹt want to just sit by the phone waiting. So you go about your other tasks. You might be busy vacuuming the carpet when the phone rings. What do you do? You stop 16

vacuuming and go answer the phone. When the call is over you can go back to vacuuming. 4.3.4 Displaying Our Captured Data in 3-D Figures 4.13-17 show five different views of the time intervals between drops. In the first plot the dots look fairly random, but when viewed from various angles a distinct structure is revealed. Figure 4.13 Dripping Faucet Time Intervals (View 1) 17

Figure 4.14 Dripping Faucet Time intervals (View 2) Figure 4.15 Dripping Faucet Time Intervals (View 3) 18

Figure 4.16 Dripping Faucet Time Intervals (X/Z Plane) Figure 4.17 Dripping Faucet Time Intervals (Y/Z Plane) 19

4.3.5 Displaying Our Captured Data in 2-D You would think that a two dimensional plot would contain less information, but displaying the same data set in two dimensions can actually help us understand the 3-D plot. In Figure 4.18 the structure becomes very apparent. Figure 4.18 Dripping Faucet Time Intervals (2-D Plot) 20