Environmental Monitoring with Arduino and Compatibles +
Takeaway Points Never more than three takeaway points! Environmental monitoring is important. Arduino is cheap and easy. Small computers are fun.
Why? Why environmental monitoring? Repeatability (trends) Water is shiny and deep Why Arduino? Small computers One-chip micros (vs four-chip 4004)
The Arduino aka ATMega 168 An IDE written in JAVA plus gcc A board exposing the ATMega168 pins
Integrated Dev Environment IDE in Java Edit Compile Download Run
Water Temperature Thermistor changes resistance with temperature Voltage divider turns resistance into voltage Arduino measures voltage in middle
Stuff in the Water Stuff in the water is turbidity. Not necessarily pollution – think tea with milk Amount of light blocked is proportional to turbidity
Salinity (and other ions) Electricity flows through ionized water Metals carry electrons; ions have to move Salt ionizes; but so do other things Conductivity is inverse of salinity
Measuring Conductivity Generate AC by flipping bits int conduct(int high, int low) { int otherbit; DDRB = high | low; // Generate AC on pins high and low PORTB = low; delay(5); // wait 5 milliseconds for the analog-to-digital // converter to settle after the last reading: PORTB = high; return analogRead(0); }
int conduct(int high, int low) { int otherbit; DDRB = high | low; // Generate AC on pins 0 and 1 PORTB = low; delay(5); // wait 5 milliseconds for the analog-to-digital converter // to settle after the last reading: PORTB = high; return analogRead(0); }
Takeaway Points Never more than three takeaway points! Environmental monitoring is important. Arduino is cheap and easy. Small computers are fun.
No way have I said everything Ask questions! Ask more questions! 1/3rd of this talk is your questions! Yer lettin' me off lightly if you don't ask questions!