{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true)\n", "\n", "\"Open" ] }, { "cell_type": "markdown", "metadata": { "hide_input": true }, "source": [ "\n", "\n", "# Electrical Conductivity\n", "\n", "Based on LibreTexts library experiment titled \"[Electical Conductivity of Aqueous Solutions](https://chem.libretexts.org/Bookshelves/Ancillary_Materials/Laboratory_Experiments/Wet_Lab_Experiments/General_Chemistry_Labs/Online_Chemistry_Lab_Manual/Chem_9_Experiments/07%3A_Electrical_Conductivity_of_Aqueous_Solutions_(Experiment))\" published under a [Creative Commons Attribution-NonCommercial-ShareAlike license](https://creativecommons.org/licenses/by-nc-sa/3.0/us/)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Background \n", "\n", "Electrical conductivity is based on the flow of electrons. Metals are good conductors of electricity because they allow electrons to flow through the entire piece of material. In comparison, distilled water is a very poor conductor of electricity since very little electricity flows through it. Dissolving ions in water changes this and allows electrons to travel through the solution. If the solution is able to conduct electricity, the current can be measured with a conductivity meter." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The Question \n", "How does the conductivity of different solutions compare?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The Hypothesis" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Enter your hypothesis by double clicking this text." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Materials & Equipment\n", "\n", "* conductivity meter\n", "* wash bottle with distilled water\n", "* large beaker for rinsing/waste\n", "* sodium chloride\n", "* sugar\n", "* tissues \n", "\n", "Solutions: \n", "* acetic acid (vinegar) \n", "* tap water \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Procedure\n", "1. Use a wash bottle with distilled water and a large beaker labeled “waste” to rinse the electrodes. Dry using a tissue. When switched on, the meter should report 0 (or very close to it).\n", "2. Put 50 mL of distilled water into a beaker. \n", "3. Place the metal tips of your conductivity tester in the solution.\n", "4. Record the conductivity reading of the distilled water in the table below. \n", "5. Repeat steps 1-4 with samples of the other solutions. For example, take a spoonful of salt and dissolve it in water. After each conductivity measurement, empty the beaker and rinse it with distilled water. \n", "6. Clean up when done.\n", "\n", "Select the following code cell, then click the `▶Run` button to display a data table for recording your observations. If you get an error, then remove the `#` from the first line of code and run it again. Double-click on the `nan` values to put in your own observations." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "hide_input": true, "scrolled": false }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "d947bcc6cd6043f69ec09a79653cc23d", "version_major": 2, "version_minor": 0 }, "text/plain": [ "QgridWidget(grid_options={'fullWidthRows': True, 'syncColumnCellResize': True, 'forceFitColumns': True, 'defau…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#!pip install qgrid --user --upgrade\n", "import pandas as pd\n", "import numpy as np\n", "import qgrid\n", "rows = ['Distilled Water', 'Tap Water', 'Salt Water', 'Vinegar']\n", "columns = ['Reading 1', 'Reading 2', 'Notes']\n", "df = pd.DataFrame(index=rows, columns=columns)\n", "data_entry_table = qgrid.QgridWidget(df=df, show_toolbar=True)\n", "data_entry_table" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "After you have recorded your observations in the table above, `▶Run` the next cell to save and display your data." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Reading 1Reading 2NotesAverage
Distilled Water12NaN2.0
Tap Water34NaN6.0
Salt Water56NaN10.0
Vinegar7NaNNaN14.0
\n", "
" ], "text/plain": [ " Reading 1 Reading 2 Notes Average\n", "Distilled Water 1 2 NaN 2.0\n", "Tap Water 3 4 NaN 6.0\n", "Salt Water 5 6 NaN 10.0\n", "Vinegar 7 NaN NaN 14.0" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = data_entry_table.get_changed_df()\n", "data['Average'] = (data['Reading 1'].astype(int)+data['Reading 1'].astype(int))/1\n", "data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Questions\n", "\n", "1. Why must the conductivity electrodes and all the beakers be rinsed with distilled water after each conductivity test?\n", "2. Which solution conducted electricity the best? How can you tell? \n", "3. Why do you think different solutions conduct electricity differently?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Answers\n", "\n", "*Double-click this cell to edit it and add your answers.*\n", "\n", "1. \n", "2. \n", "3. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Comparing to Water Treatment Plants\n", "\n", "`▶Run` the next cell to download data from two water treatment plants, Rossdale and E.L. Smith, for the last week and graph the water conductivity as it compares to your data." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "linkText": "Export to plot.ly", "plotlyServerURL": "https://plot.ly", "showLink": true }, "data": [ { "line": { "color": "rgba(255, 153, 51, 1.0)", "dash": "solid", "shape": "linear", "width": 1.3 }, "mode": "lines", "name": "Rossdale", "text": "", "type": "scatter", "x": [ "SEP-14", "SEP-15", "SEP-16", "SEP-17", "SEP-18", "SEP-19", "SEP-20" ], "y": [ 369, 371, 372, 367, 365, 367, 369 ] }, { "line": { "color": "rgba(55, 128, 191, 1.0)", "dash": "solid", "shape": "linear", "width": 1.3 }, "mode": "lines", "name": "ELS", "text": "", "type": "scatter", "x": [ "SEP-14", "SEP-15", "SEP-16", "SEP-17", "SEP-18", "SEP-19", "SEP-20" ], "y": [ "382", "382", "378", "374", "376", "376", "373" ] }, { "line": { "color": "rgba(50, 171, 96, 1.0)", "dash": "solid", "shape": "linear", "width": 1.3 }, "mode": "lines", "name": "Distilled Water", "text": "", "type": "scatter", "x": [ "SEP-14", "SEP-15", "SEP-16", "SEP-17", "SEP-18", "SEP-19", "SEP-20" ], "y": [ 2, 2, 2, 2, 2, 2, 2 ] }, { "line": { "color": "rgba(128, 0, 128, 1.0)", "dash": "solid", "shape": "linear", "width": 1.3 }, "mode": "lines", "name": "Tap Water", "text": "", "type": "scatter", "x": [ "SEP-14", "SEP-15", "SEP-16", "SEP-17", "SEP-18", "SEP-19", "SEP-20" ], "y": [ 6, 6, 6, 6, 6, 6, 6 ] }, { "line": { "color": "rgba(219, 64, 82, 1.0)", "dash": "solid", "shape": "linear", "width": 1.3 }, "mode": "lines", "name": "Salt Water", "text": "", "type": "scatter", "x": [ "SEP-14", "SEP-15", "SEP-16", "SEP-17", "SEP-18", "SEP-19", "SEP-20" ], "y": [ 10, 10, 10, 10, 10, 10, 10 ] }, { "line": { "color": "rgba(0, 128, 128, 1.0)", "dash": "solid", "shape": "linear", "width": 1.3 }, "mode": "lines", "name": "Vinegar", "text": "", "type": "scatter", "x": [ "SEP-14", "SEP-15", "SEP-16", "SEP-17", "SEP-18", "SEP-19", "SEP-20" ], "y": [ 14, 14, 14, 14, 14, 14, 14 ] } ], "layout": { "legend": { "bgcolor": "#1A1A1C", "font": { "color": "#D9D9D9" } }, "paper_bgcolor": "#1A1A1C", "plot_bgcolor": "#1A1A1C", "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "font": { "color": "#D9D9D9" }, "text": "Conductivity of Solutions Compared to Water Treatment Plant Data" }, "xaxis": { "gridcolor": "#434343", "showgrid": true, "tickfont": { "color": "#C2C2C2" }, "title": { "font": { "color": "#D9D9D9" }, "text": "" }, "zerolinecolor": "#666570" }, "yaxis": { "gridcolor": "#434343", "showgrid": true, "tickfont": { "color": "#C2C2C2" }, "title": { "font": { "color": "#D9D9D9" }, "text": "Conductivity (yS/cm)" }, "zerolinecolor": "#666570" } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "rossdale = pd.read_html('http://apps.epcor.ca/DailyWaterQuality/Default.aspx?zone=Rossdale', header=0)[0]\n", "els = pd.read_html('http://apps.epcor.ca/DailyWaterQuality/Default.aspx?zone=ELS', header=0)[0]\n", "import cufflinks as cf\n", "cf.go_offline()\n", "combined_data = pd.DataFrame()\n", "combined_data['Rossdale'] = rossdale.iloc[6][1:]\n", "combined_data['ELS'] = els.iloc[6][1:]\n", "for i, row in data.iterrows():\n", " combined_data[row.name] = row['Average']\n", "combined_data.iplot(yTitle='Conductivity (yS/cm)', title='Conductivity of Solutions Compared to Water Treatment Plant Data')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Questions\n", "\n", "4. How do your observations compare to the water treatment plant values?\n", "5. What does this say about the water leaving the these water treatment plants?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Answers\n", "\n", "4. \n", "5. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[![Callysto.ca License](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-bottom.jpg?raw=true)](https://github.com/callysto/curriculum-notebooks/blob/master/LICENSE.md)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }