Saturday, April 9, 2016

Kevin Week 12 Blog





Blog Week 12 Requirement:

Explain your setup.

    My Circuit consists of two main parts separated by a control relay.

     The First half of circuit provides voltage to the relay's coil, consists of: 
     4 solar panels, 
     1 Op-Amp IC chip
     2 Resistors (68 and 350 Ohms)
     1 Toggle Switch
     A 12 Volt Power Supply   
     
     The 4 Solar panels are connected in series and provide an input voltage to the Op-Amp.  The Op-Amp is setup in non-inverting  configuration and connected to a 12 VDC power supply through a simple on/off toggle switch along with two resistors.  This configuration provides an approximate voltage 6x the input from the solar panels to the coil of the relay.

    When the Relay is actuated it provides voltage from a second separate 12 VDC power supply to a single pole double throw switch.  This switch has one input and two outputs, with the input being spring loaded to it's "normally closed" contact when no pressure is applied.
    The switch's normally closed contact is connected to a 12VDC pump which is capable of circulating 200 Liters of water per hour.  While the "Normally Open" contacts ar connected to a 12VDC 35W Halogen Flood Light.
     
    The switch itself rests between two spring loaded plates, when enough pressure is applied to the upper plate to overcome the spring's tension the switch actuates and breaks the "normally closed" contact while simultaneously connecting the input to the "normally open" contact.

    The Circuit is actuated by providing light to the solar panels which send a 1.5-2 VDC to the Op-Amp.  It the the toggle switch in in the ON position the Op_amp then actuates the control relay sending power to our pressure switch.  That power then activates the water pump pumping water from a reservoir into a container resting on top of the pressure plate.  As the container fills the increased weight on the pressure plate overcomes the plates' spring tension and compresses the pressure switch into the normally opened position.  This cuts off the voltage the pump, stopping the flow of water, and redirects it to the floodlight.  Light from the Floodlight is then used as a trigger for Chris's circuit (See Chris's Blog Entry for a full breakdown of his circuit.)  


Provide the computer drawing for your individual Rube Goldberg setup.

My Week 12 Circuit Schematic made at www.CircuitLab.com

     Provide photos of the circuit and setup.
 
Solar Panel / Op-Amp / Floodlight Setup

A Picture of my Pressure Plate along with my water receptacle.


The Inner Workings of my Pressure Plate, The pliers provide spring tension which must be overcome by the water bottle, while the switch at the top controls both the pump and floodlight.
I made my Reservoir out of a cooler jug I had, the lid is ideal for routing the and minimizing the pressure it's weight applies to the pump's nozzle. 



I forgot to snap a picture of the pump before installing it so here is the stock image from Amazon where I ordered it from, along with a link to it's page.
4  
     Provide at least 2 videos of your setup in action, one being a failed attempt. 
     
 
A Demo of the Solar Panel/Op-Amp/Relay Setup

 
The workings of my Pressure Plate Explained

 
Dry Demo with a Different Pump
           
 
Complete Test Number 1.  AKA what happens if you forget to factor in gravity.

 
Complete Test Number Two.  Moving the Reservoir


 
Complete Test Number 3.  SUCCESS!!!!

    What failures did you have? How did you overcome them? 

    Initially I feared this project might have been a bit over ambitious when I submitted this week's pre-quiz the implementation actually went surprisingly smooth.  That being said I did encounter a few fairly significant hurdles.

    First was trying to figure out a way to move the water from the reservoir to the receptacle initially I planned a gravity feed using an electric motor to pull a stopper (See my initial Concept Drawing Below).  This proved to be overly complicated and potentially very messy.  My first thought was to find an electrically actuated valve but when I asked the technician if he had a suitable valve he didn't, but he did say he may have a pump.  I liked the pump idea so much I went home and ordered one off Amazon even before hearing back from the technician.  This turned out being a good thing because the pump the technician had proved to be far to require more amperage than our power supplies can provide.  The pump I did end up using was a 12 VDC aquarium/fountain pump.




Original Concept Art


    As I mentioned above I also ran into some limitations with the power supply in our labs.  Not only could the supply at my work station not run my first pump it also struggled to provide enough power simultaneously activate my relay and power the floodlight.  I overcame this by adapting a standard 12V 2A Power Supply, I had around from an old External Hard Drive.  By adding the stand alone power supply I not only solved the amperage issue, but also eliminated any issue me and Chris might have encountered sharing the power supply at our work station.

    The final major issue I encountered was water siphoning backwards from my receptacle back into my container into the reservoir.  This can be seen in my Complete Test 1 and 2 Videos above.  I initially thought I may need to install a check valve to prevent the backwards flow, but I was able to find a much simpler solution.  I adjusted the position of my receptacle on my pressure plate so that less water was required to overcome the spring.  I also moved the end of my hose to a higher position within the water bottle.  What this did was left a gap of air between the end of the hose and the water line when pressure switch actuates eliminating the siphoning effect.   As an additional bonus by moving the hose to the bottom of the bottle and restarting the pump for a few seconds the water can be made to siphon back into the reservoir making resetting the circuit much easier and less messy. 

    I am Looking forward to demonstrating the full circuit in class on Monday or Wednesday.  Enjoy the rest of your weekend and see you next week. 


Sunday, April 3, 2016

Lab Team 4 Week 11

Blog sheet Week 11: Strain Gauges
Part A: Strain Gauges:

Strain gauges are used to measure the strain or stress levels on the materials. Alternatively, pressure on the strain gauge causes a generated voltage and it can be used as an energy harvester. You will be given either the flapping or tapping type gauge. When you test the circle buzzer type gauge, you will lay it flat on the table and tap on it. If it is the long rectangle one, you will flap the piece to generate voltage.

    1. Connect the oscilloscope probes to the strain gauge. Record the peak voltage values (positive and negative) by flipping/tapping the gauge with low and high pressure. Make sure to set the oscilloscope horizontal and vertical scales appropriately so you can read the values. DO NOT USE the measure tool of the oscilloscope. Adjust your oscilloscope so you can read the values from the screen. Fill out Table 1 and provide photos of the oscilloscope.

    The table below shows the data we collected while testing our strain gauge. 



     2. Press the “Single” button below the Autoscale button on the oscilloscope. This mode will allow you to capture a single change at the output. Adjust your time and amplitude scales so you have the best resolution for your signal when you flip/tap your strain gauge. Provide a photo of the oscilloscope graph.


The above photo shows what our oscilloscope displayed when we did not have the "Single" mode on and we tapped our energy harvester.




Hard Tap
Light Tap

    The two photos above were taken with the oscilloscope in "Single Mode". The top photo shows the result of a hard tap, while the bottom photo was taken after a light tap.

Part B: Half-Wave Rectifiers 

     1. Construct the following half-wave rectifier. Measure the input and the output using the oscilloscope and provide a snapshot of the outputs.



This image shows our input and output as read by the oscilloscope in out half-wave rectifier circuit.

    2. Calculate the effective voltage of the input and output and compare the values with the measured ones by completing the following table.

    The table below shows the data we collected. 



    3. Construct the following circuit and record the output voltage using both DMM and the oscilloscope.




    The table below shows the data  the output voltage we recorded from the circuit above. 



    4. Replace the 1 µF capacitor with 100 µF and repeat the previous step. What has changed?
  
The table below shows the data  the output voltage we recorded from the circuit above. 





When the 1 µF capacitor was replaced with a 100 ÂµF capacitor the peak to peak voltage decreases significantly from 2.6 Volts to 0.16 Volts, while the Mean/RMS voltage increase slightly form 2.8 Volts to 3.3 Volts. 

Part C: Energy Harvesters

      1.   Construct the half-wave rectifier circuit without the resistor but with the 1 µF capacitor. Instead of the function generator, use the strain gauge. Discharge the capacitor every time you start a new measurement. Flip/tap your strain gauge and observe the output voltage. Fill out the table below:





    2. Briefly explain your results.

When tapping at a rate of 1 flip/second the voltage output increased steadily as the time tapping increased, however; when the tap rate was increased to 4 taps per second the value the increase was not as consistent we believe this is because of difficulty in keeping  our tap strength consistent at the increased rate. 

    3. If we do not use the diode in the circuit (i.e. using only strain gauge to charge the capacitor), what would you observe at the output? Why?

    When the diode is removed from the circuit the capacitor fails to accumulate a charge.  The reason for this is that the diode acts as a half-wave rectifier filtering out the negative portion of the sinusoidal voltage wave.  When the diode is removed both positive and negative voltage reach the capacitor with the net result being 0 Volts RMS applied.  

Tuesday, March 22, 2016

Lab Team 4 Week 10

Blog Sheet week 10

In this week’s lab, you will collect more data on low pass and high pass filters and “process” them using MATLAB.


PART A: MATLAB practice.

  1.  Open MATLAB. Open the editor and copy paste the following code. Name your code as FirstCode.m
clear all;
close all;
x = [1 2 3 4 5];
y = 2.^x;
plot(x, y, 'LineWidth', 6)
xlabel('Numbers', 'FontSize', 12)
ylabel('Results', 'FontSize', 12)

<Save the resulting plot as a JPEG image and put it here.>



(FirstCode.m code and output figure.)

  2.  What does clear all do?

Clear All clears all previously assigned variables/Scripts and functions.

  3.  What does close all do?

Close All clears all deletes all figures whose handles are not hidden.

  4.  In the command line, type x and press enter. This is a matrix. How many rows and columns are there in the matrix?

When “x” is input into the command window it returns a 10 column single row matrix as seen below:

>> x

x =

         0    0.0140    0.0279    0.0419    0.0559    0.0698    0.0838    0.0977    0.1117    0.1257



  5.  Why is there a semicolon at the end of the line of x and y?

The Semi colon at the end of x and y prevent those lines of text from being displayed in the command window.

  6.  Remove the dot on the y = 2.^x; line and execute the code again. What does the error message mean?

When the periods is removed  from line four the following error is returned

Error using  ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.

The reason we are getting this error is that we are trying to use an operator that only works with scalar values in a calculation involving matrices.

  7.  How does the LineWidth affect the plot? Explain.

As the Name implies the LineWidth value sets the width of the line connecting the points on your plot.  A low LineWidth value outputs a thin line while a higher value will  result in a thicker line.

  8.  Type help plot on the command line and study the options for plot command. Provide how you would change the line for plot command to obtain the following figure (Hint: Like ‘LineWidth’, there is another property called ‘MarkerSize’)


Below is a version of our original code, along with a screenshot of its output, that our group modified to mimic the figure above.

clear all;
close all;
x = [1; 2; 3; 4; 5];
y = x.^2;
plot(x, y, '-ro','LineWidth', 5, 'MarkerSize', 18, 'MarkerEdgeColor', 'r')
xlabel('Numbers', 'FontSize', 12)
ylabel('Results', 'FontSize', 12)




By adding the text ‘-ro’ (r for red and o for circle) sets the line color to red and adds circular markers at each specified point.  The size of the marker is determined by the “‘MarkerSize’, x,” script additionally the edge color of the marker be set using the “‘MarkerEdgeColor’, x,” although in this case it matches the line color.

  9.  What happens if you change the line for x to x = [1; 2; 3; 4; 5]; ? Explain.

The addition of the semi-colons between the values of x makes no visible change to the output of our script.  The reason for this is that the final semi-colon outside of our closing bracket suppresses the x values from being displayed in the command window.  If that final semicolon were removed the output of x would change from output 1 below to something closer to output 2 (please ignore any vertical alignment issues).

1.)   x = 
         Columns 1 through 5
                        1 2 3 4 5   

2.)  x = 
              1
              2
              3
              4
              5


  10.  Provide the code for the following figure. You need to figure out the function for y. Notice there are grids on the plot.



Below is the code and output we came up with to mimic the figure shown above.

clear all;
close all;
x = [1; 2; 3; 4; 5];
y = x.^2;
plot(x, y, ':sk','LineWidth', 6, 'MarkerSize', 19)
grid
xlabel('Numbers', 'FontSize', 12)
ylabel('Results', 'FontSize', 12)




To achieve the output above we changed the ‘-or’ script to ‘:sk’ (: for a dotted line, s for square markers and k for the color black).

  11.  Degree vs. Radian in MATLAB:
a.       Calculate sinus of 30 degrees using a calculator or internet.

sin(30°) equals 1/2 or 0.5 on my TI-Nspire Calculator
b.      Type sin(30) in the command line of the MATLAB. Why is this number different? (Hint: MATLAB treats angles as radians).

In MatLab sin(30) equals -0.9880.  This is because sin(x) function in MatLab looks at x as a radian value.
c.       How can you modify sin(30) so we get the correct number?

To find the value of sin(30 degrees) in MatLab use the sind(x) function.  When sind(30) is input into MatLab  you get the following result.

>> sind(30)

ans =

    0.5000

  12.  Plot y = 10 sin (100 t) using Matlab with two different resolutions on the same plot: 10 points per period and 1000 points per period. The plot needs to show only two periods. Commands you might need to use are linspace, plot, hold on, legend, xlabel, and ylabel. Provide your code and resulting figure. The output figure should look like the following:

Below is the code and output we came up with to mimic the figure shown above.

clear all;
close all;
t = linspace(0,pi/25,1000);
x = linspace(0,pi/25,10);
y = 10*sin(100.*t);
z = 10*sin(100.*x);
plot(t, y, '-k','LineWidth', 1)
hold on
plot(x, z, '-or','LineWidth', 1, 'MarkerSize', 5)
hold off
xlabel('Time', 'FontSize', 12)
ylabel('Line Function', 'FontSize', 12)




  13.  Explain what is changed in the following plot comparing to the previous one.

The change in this figure is that the maximum y value of the “Fine” plot has its maximum value capped at 5.

  14.  The command find was used to create this code. Study the use of find (help find) and try to replicate the plot above. Provide your code.

Below is the code and output we came up with to mimic the figure shown above, using the find command to cap the Fine plot’s y value at 5.

clear all;
close all;
t = linspace(0,pi/25,10);
y = 10*sin(100.*t);
plot(t, y, '-or','LineWidth', 1, 'MarkerSize', 10)
hold on
x = linspace(0,pi/25,1000);
y = 10.*sin(100.*x);
k = find(y>5);
y(k)= 5;
plot(x,y,'-k')
legend('Coarse','Fine',0);
xlabel('Time (s)', 'FontSize', 12)
ylabel('y function', 'FontSize', 12)




 15.  Create a code that would clip the negative part of the sinusoidal signal for the fine plot to -5.

Below is the Code, and output I wrote to clip the limit the minimum y value of the Fine plot to -5.

clear all;
close all;
t = linspace(0,pi/25,10);
y = 10*sin(100.*t);
plot(t, y, '-or','LineWidth', 1, 'MarkerSize', 10)
hold on
x = linspace(0,pi/25,1000);
y = 10.*sin(100.*x);
k = find(y>5);
j = find(y<-5);
y(k)= 5;
y(j)= -5;
plot(x,y,'-k')
legend('Coarse','Fine',0);
xlabel('Time (s)', 'FontSize', 12)

ylabel('y function', 'FontSize', 12)




PART B: Filters and MATLAB

1.  Build a low pass filter using a resistor and capacitor in which the cut off frequency is 1 kHz. Observe the output signal using the oscilloscope. Collect several data points particularly around the cut off frequency. Provide your data in a table.

Table B-1

2.       Plot your data using MATLAB. Make sure to use proper labels for the plot and make your plot line and fonts readable. Provide your code and the plot.

Below is the Code, and output we wrote Displaying the output of Table B-1.

clear all;
close all;
vin = [5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94];
vout = [5.89 4.39 2.88 2.03 1.57 1.28 1.07 .929 .813 .656 .267];
x = [30 200 400 600 800 1000 1200 1400 1600 2000 5000];
y = vout ./ vin;
plot(x, y, '-ro','LineWidth', 2, 'MarkerSize', 8, 'MarkerEdgeColor', 'k')
xlabel('Frequency', 'FontSize', 12)

ylabel('Vout / Vin RMS', 'FontSize', 12)


Low Pass Filter Output 

3.  Calculate the cut off frequency using MATLAB. find command will be used. Provide your code.

Below is the Code, and output we wrote to calculate our filter's cutoff value.

clear all;
close all;
vin = [5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94];
vout = [5.94 5.86 5.61 5.26 4.88 4.48 4.12 3.79 3.49 2.99 2.12 1.64];
x = [30 200 400 600 800 1000 1200 1400 1600 2000 3000 4000];
y = vout ./ vin;
plot(x, y, '-ro','LineWidth', 2, 'MarkerSize', 8, 'MarkerEdgeColor', 'k')
xlabel('Frequency', 'FontSize', 12)
ylabel('Vout / Vin RMS', 'FontSize', 12)
k = find (vout>5.94*.65, 1, 'last')
x(k)

Output

>> w10B1
k =  7
ans = 1200

>> 

We were not entirely surprised that the cutoff was around 1200 Hz as opposed to the expected 1.0 kHz.  The reason for this was although our capacitor was labelled as 22 nF our DMM showed it to actually be close to 18 NF and when calculated

1/(2*pi*7230 Ohms*18E-9 NF) =1222 Hz

 4.  Omitted, Not required for Team Blog

 5.  Repeat 1-3 by modifying the circuit to a high pass filter.

   We modified our circuit to construct a high pass filter similar to the one we worked with in week 9 by placing our capacitor in series between our Frequency Generator and Resistor.  

    1B.  Build a high pass filter using a resistor and capacitor in which the cut off frequency is 1 kHz. Observe the output signal using the oscilloscope. Collect several data points particularly around the cut off frequency. Provide your data in a table.

Table B-2 Below shows the data we collected as request in step 1B


Table B-2

    2B.  Plot your data using MATLAB. Make sure to use proper labels for the plot and make your plot line and fonts readable. Provide your code and the plot.


Below is the Code, and output we wrote to calculate our filter's cutoff value.

clear all;
close all;
vin = [5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94];
vout = [5.89 4.39 2.88 2.03 1.57 1.28 1.07 .929 .813 .656 .267];
x = [30 200 400 600 800 1000 1200 1400 1600 2000 5000];
y = vout ./ vin;
plot(x, y, '-ro','LineWidth', 2, 'MarkerSize', 8, 'MarkerEdgeColor', 'k')
xlabel('Frequency', 'FontSize', 12)
ylabel('Vout / Vin RMS', 'FontSize', 12)

High Pass Filter Output




3B.  Calculate the cut off frequency using MATLAB. find command will be used. Provide your code.

clear all;
close all;
vin = [5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94 5.94];
vout = [.261 1.02 1.95 2.78 3.41 3.91 4.29 4.59 4.82 5.14 5.53];
x = [30 200 400 600 800 1000 1200 1400 1600 2000 3000 4000];
y = vout ./ vin;
plot(x, y, '-ro','LineWidth', 2, 'MarkerSize', 8, 'MarkerEdgeColor', 'k')
xlabel('Frequency', 'FontSize', 12)
ylabel('Vout / Vin RMS', 'FontSize', 12)
k = find (vout>5.94*.7, 1, 'first')
x(k)

Output

>> w10B1
k =  7
ans = 1200

>> 

Once again MatLab calculated our cutoff frequency to 1200 Hz.  Again this is not surprising as the formula for calculating the cutoff frequency is the same in both High and Low Pass Capacitive Filter, so;  

1/(2*pi*7230 Ohms*18E-9 NF) 

still equals 1222 Hz in our High Pass setup.



Please feel free to comment below and we will be back again next week

Lab Team 4 Out