Sunteți pe pagina 1din 32

Sample Unit – Technology Mandatory

Sample for implementation from 2019

Technology context Project

Digital Technologies Monitor Your Home and Garden (Part A)

Overview

Students develop knowledge and skills in the use of a general-purpose programming language to design, produce and evaluate a monitoring
and alert system using a microcontroller. They document their skill development tasks in a design and production folio.
Students are provided with opportunities to develop algorithms and implement them in a general-purpose programming language. Students will
program a microcontroller, connect sensors and output devices and have the opportunity to build a case for the system.
Students with disability may require adjustments to safely engage in practical tasks.
The glossary in the Technology Mandatory Years 7–8 Syllabus has definitions for terms used in the Digital Technologies context.

Length of unit Assessment opportunity Evidence of learning

10 Weeks (25 hours) Functioning moisture sensor Throughout the unit of work the content marked with an * indicate
opportunities for assessment of, for or as learning.

Outcomes

A student:
TE4-1DP designs, communicates and evaluates innovative ideas and creative solutions to authentic problems or opportunities
TE4-2DP plans and manages the production of designed solutions
TE4-4DP designs algorithms for digital solutions and implements them in a general-purpose programming language

1
TE4-7DI explains how data is represented in digital systems and transmitted in networks
TE4-10TS explains how people in technology related professions contribute to society now and into the future

Related Life Skills outcomes

TELS-1DP, TELS-2DP, TELS-3DP, TELS-5DP, TELS-8DI, TELS-11TS

Teacher background information

A microcontroller is a small, simple computer. It includes a processor (CPU), memory, and input/output pins on a single integrated circuit board.
Some microcontrollers also include integrated inputs (sensors) and output components (actuators) such as buttons, temperature sensors, LEDs
and buzzers. Microcontrollers are used in systems or products that require automatic control. An example would be the buttons that control a lift
in a multi-story building. An inexpensive and widely used microcontroller is the Arduino Uno. A microcontroller recently developed for
educational purposes is the BBC Micro:bit it has a number of integrated input and output components built onto it.

Thanks to microcontrollers, we all have the power to cheaply create a monitoring and response system to suit our needs. Using specifically
written instructions that program the microcontroller called code, we can tell the microcontroller what it needs to do when it senses data from its
environment.

2
Content Suggested teaching, learning and assessment Resources

Identifying and defining Design Project


Students: Design, produce and evaluate a microcontroller system to that monitors  Arduino microcontroller
 define and decompose growing conditions of plants, informing you when action is required to overview
real-world problems, taking help them grow. For example, a soil moisture testing system that informs
into account functional you when you need to water your plants as the soil is too dry. Using the  Arduino Uno
requirements and a range collected data, students include a threshold value within their code to https://store.arduino.cc/usa/ar
of constraints, eg decide when a plant needs to be watered, for example: duino-uno-rev3
economic, environmental, - IF sensor value < threshold THEN display ‘Please water’
social, technical and - IF sensor value < threshold THEN turn on red LED.  Micro:bit
usability (ACTDIP027) ) http://microbit.org/
Students will apply their knowledge of microcontroller hardware using
inputs and outputs, with skills in coding/programming to develop a system
that addresses identified need. The collection of data to help inform
decision making throughout the unit will be necessary.
 Digital agriculture: what’s all
This unit is modelled on a system that monitors growing conditions for the fuss about?
plants, specifically soil moisture levels. It can be expanded to monitor a https://blog.csiro.au/digital-
range of other conditions including: agriculture-whats-all-the-fuss-
▪ humidity about/
▪ pH
▪ temperature.  Micro:bit Burglar Alarm
https://make.techwillsaveus.c
Teachers may look at alternate examples of monitoring systems in the om/bbc-
home for this unit such as: microbit/activities/combination
▪ tracking activity of a pet -lock
▪ alerting when the bins are full and need emptying
▪ reporting the temperature in a home
▪ creating a safe box that requires a pin code to safely access it.

3
Content Suggested teaching, learning and assessment Resources

Presentation and class discussion of the design project


▪ Read over the design project with the class.
▪ Students highlight or underline key words to include in their ongoing
glossary* for the unit. Explain or discuss some key words, including:
− coding
− data
− hardware
− inputs/sensors
− microcontroller
− outputs/actuators
− system.
▪ Introduce (or review) the design process.
▪ As a class discuss the requirements and limitations of the project.

Identifying and defining Research of an existing monitoring system


Students: In pairs/teams students select one of the following monitoring systems to
 evaluate how existing research.
information systems meet Evaluate the system to assess how it meets needs, is innovative, and  NRMA fire blanket
needs, are innovative, and take account of future risks and sustainability. https://fireblanket.nrma.com.a
take account of future risks u/
and sustainability Monitoring Systems
(ACTDEK029, ▪ disaster detection system, eg NRMA fire blanket  Precision agriculture: IoT in
ACTDIP031) ▪ smart farming, eg Vodafone precision agriculture the field
 evaluate the suitability of ▪ fish tank https://www.vodafone.com.au
hardware with particular ▪ health monitoring. /red-wire/iot-agriculture
performance
characteristics against the Teacher background information
needs of different users, Students may conduct research in an open-ended or guided way, for
for example: (ACTDIK023) example a web quest. In a web quest students are provided with a series

4
Content Suggested teaching, learning and assessment Resources

of websites they must visit to collect particular information.


− high-powered systems
for gaming and Student Presentation*
computation Students present an outline and evaluation of the system to the class
− energy-efficient including:
systems for travel and ▪ the need/problem the system was addressing
productivity ▪ what the system aims to achieve
− small and light systems ▪ how the system works to achieve its purpose
for health monitoring ▪ features of the hardware used that allowed it to achieve its purpose
eg size, processing power, energy requirements, durability.

Identifying and defining Input, Process, Output


Students: Teacher background information
 define and decompose An input, process and output (IPO) model is often used in the first stage
real-world problems, taking of a system’s development to map out the basic relationships in a
into account functional system. As students develop a microcontroller system, they need to
requirements and a range break the functioning parts down into the input data and hardware, the
of constraints, eg logic processes that transform/compute the input(s) into output(s) and
economic, environmental, the output information and hardware.
social, technical and
usability (ACTDIP027) ) Class presentation/explanation of the IPO model
Introduce students to the concept of input, process, output (IPO) using
everyday examples. Provide two of the three IPO parts and students
suggest the third. For example: ‘If the input is flour, eggs and milk and
the output is pancakes, what is the process?’ Use a Kahoot or cloze
activity to help familiarise and develop knowledge of IPO charts and
concepts.

5
Content Suggested teaching, learning and assessment Resources

Explain the general features of a microcontroller system mapped to the


IPO Model:
▪ Input: Sensors that take in data from the environment, for example:
- temperature
- pH.
▪ Process: Instructions written in code that make decisions based on
the input.
▪ Output: Actuators that display information on screen or perform a
function (such as a light turning on) based on the decisions made in
the code/computer program.

Display pictures of simple microcontroller systems and students complete


IPO tables to summarise how they think the system works.

IPO Example: Automatic light

Input (sensor) Process Output (Actuator)

Ambient light Read current light level Turn on/off light

IPO Example: Automatic Sliding Door

Input (sensor) Process Output (Actuator)

Person Motion detection Door opens


approaching
door

6
Content Suggested teaching, learning and assessment Resources

Researching and planning Data representation – digital


Students: Teacher background information
 investigate how digital Computers use binary to represent and communicate data. A simple
systems represent text, example is what we see on the screen in a word processor is represented  Explanation of binary:
image and audio with by binary in the computer. The computer converts binary to characters https://www.youtube.com/wat
whole numbers, for we understand on the screen. Each time a key is pressed on the ch?v=ku4KOFQ-bB4
example: (ACTDIK024) keyboard the computer converts this to binary in the background before
− representing letters, displaying the letter on the screen.
digits, symbols and
emojis in Unicode Explanation of analog versus digital data discussion/classwork
− representing colours  How binary is used to make
Teacher discusses:
and pixels as amounts the internet work:
▪ analog as continuous values and digital as discrete values.
of red, green, blue and http://education.abc.net.au/ho
▪ computers as made up of switches (on and off) – binary.
alpha me#!/media/2198569/how-
▪ need to convert from analog to digital for processing and storage.
− representing audio binary-information-is-
signals using sampling communicated-via-the-
Role play – counting in binary
and quantisation internet
▪ Select six students to act as six binary digits. Students line up in
 explain how and why
chairs at the front of the class all starting in a sitting (‘off’) position.
whole numbers are
Option: students hold A4 signs showing their base 2 place value, eg
represented in binary in
20 = 1, 21 = 2, 2 2 = 4, etc.
digital systems
▪ The student in the furthest right position (20) stands up to represent
(ACTDIK024) ST
1.
▪ Students stand and sit down to represent counting from 1 to 31.

Individual challenge*  Cisco binary game:


Students play the Cisco binary game online. http://games.penjee.com/bina
ry-numbers-game/

7
Content Suggested teaching, learning and assessment Resources

Identifying and defining Class brainstorm then think/pair/share for home monitoring ideas  How a fax machine works
Students: ▪ Students brainstorm situations in their home that would benefit from http://webs.mn.catholic.edu.a
 define and decompose monitoring and record them in a mind map. u/science/wilko/IS94/notes/no
real-world problems, taking ▪ Individually, students extend their mind map, identifying what data 5.htm
into account functional needs to be captured for each situation and how this can be
requirements and a range captured (sensors).  Reading sensors with an
of constraints, eg ▪ Students share and discuss their ideas with a partner. Arduino
economic, environmental, ▪ One student from each pair presents to the class. https://www.allaboutcircuits.c
social, technical and ▪ Repeat or combine with the above for the output(s). om/projects/reading-sensors-
usability (ACTDIP027) ) with-an-arduino/
Class presentation/explanation of sensors  Arduino sensors
Teacher explains in fundamental terms how some key sensors work, https://core-
including the conversion of energy into an electrical signal, which is then electronics.com.au/arduino/se
digitised for the computer to process. nsors.html
 Arduino sensors
https://www.littlebirdelectronic
s.com.au/sensors/

Identifying and defining Criteria for success


Students: Class brainstorm
 develop criteria to evaluate Revisit the design project. Students develop criteria for success for their
design ideas, processes project that includes at least the following:
and solutions, the ▪ addresses a need for monitoring in the home
functionality, aesthetics ▪ uses a microcontroller connected to at least one sensor (input) and
and a range of constraints, one actuator (output)
eg accessibility, cultural, ▪ makes a decision based on the input captured by the sensor, for
economic, resources, example: different coloured LED’s light up, an LCD screen displays a
safety, social, message.
sustainability, technical

8
Content Suggested teaching, learning and assessment Resources

(ACTDEP038,
ACTDIP027, ACTDIP031)
DT ST

Researching and planning Coding fundamentals


Students: Teacher background information
 design algorithms that use All students need to learn the basic fundamentals of coding in order to
a range of data types, develop algorithms to solve problems. These are:
branching and iteration ▪ variables – storage of data
and represent them ▪ data types – what type of data is represented by the 0s and 1s, eg
diagrammatically and in integer (whole number), float (decimal number), string (text),
English (ACTDIP029) CT Boolean (true or false)
DT ▪ process – an instruction that accesses or manipulates data (as in the
IPO model)
▪ operators – symbols used in calculations and conditions, eg +,-,*, /,
>, <, ==, !=
▪ sequence – the order in which processes occur (there are links with
mathematics with this content)
▪ decision – a process may or may not occur, depending on whether a
condition is met
▪ repetition – a process may be repeated 0 or many times depending
on a condition.  Khan academy:
https://www.khanacademy.or
There are many online training environments that teach these g/computing/hour-of-
fundamentals of coding through a particular coding language: code/hour-of-drawing-code/
▪ Khan Academy
▪ Codecademy  Grok learning:
https://groklearning.com/hoc/
Hour of code is a world-wide initiative that aims to encourage everyone to

9
Content Suggested teaching, learning and assessment Resources

try coding. There are many hour of code resources available online which
provide a quick taste and brief introduction to coding for anyone without
 Hour of code:
coding experience. Some example hour of code activities are listed in the
https://hourofcode.com/au
resources column.

Algorithms are planned using pseudocode an English-like language


and/or a graphical, symbol-based method called algorithm flowcharts.
These plans are then used to implement the algorithms in code using a
programming language.

Demonstration of ‘coding’ a real-world activity – Programming a


robot to make pancakes
▪ Design project: You have been given a humanoid robot equipped
with an electric pan attached to its left arm and interchangeable
 Coffee making robot
cooking tools (eg blender, spoon, spatula) on its right hand. You
https://www.sbs.com.au/news
would like to program your robot to make pancakes for you every
/japanese-cafe-unveils-
morning.
coffee-making-robot
▪ Students write down the steps they follow to make pancakes (or
have students bring in a recipe).
▪ Students label or highlight the inputs, processes and outputs.  Robot barista
▪ Students identify where a decision will need to be made by the robot https://www.broadsheet.com.
and what condition(s) determines the action/result. au/melbourne/food-and-
▪ Students identify where repetition is occurring and what condition drink/robot-barista-just-made-
determines the end of the repetition. my-coffee
▪ Write the pseudocode (or flowchart) for the problem on the board for
students to review and ask questions:

10
Content Suggested teaching, learning and assessment Resources

BEGIN
Heat pan
Combine all ingredients in a bowl to make batter
WHILE batter remaining
Add butter to pan
Spoon batter into pan
REPEAT
Cook batter
UNTIL Bubbles burst on surface
Flip Pancake
REPEAT
Cook pancake
UNTIL Pancake turns golden brown
Place pancake on plate
ENDWHILE
Serve pancakes with berries and syrup
END

▪ Students add the terms ‘sequence’, ‘decision’ and ‘repetition’ to their


glossary.
▪ In pairs students discuss how this algorithm could be improved to be
more precise using quantitative data, eg the amounts of data values
(WHILE batter volume > 0, UNTIL bubbles on surface > 20)

A taste of coding
▪ Students complete an online hour of code activity.
▪ Following the activity, go through the key points students should take
away from the activity, including variables, data types, process and
sequence and link back to the design project.
▪ Students write a reflection on what they learnt during the hour of
code, including any difficulties faced.

11
Content Suggested teaching, learning and assessment Resources

Producing and Coding skills for the microcontroller


implementing Teacher background information
 Equipment guide
Students: Students work through tutorials to develop coding skills for the selected
 implement and modify microcontroller and microcontroller programming language. Select a
programs involving sequence of tutorials that best suits the resources and abilities of the
branching, iteration and class. It is recommended every student has their own microcontroller to
functions in a general- work with so they are participating actively in all of the practical activities.
purpose programming
Suggested microcontrollers/electronic shields for microcontrollers
language, for example:
▪ Arduino Uno: A widely used microcontroller ($7–$15 for generic  Arduino microcontroller
(ACTDIP030) CT
brand, $45 for genuine) that can be programmed using a coding https://www.arduino.cc/
− microcontroller
language similar to C.
▪ Raspberry Pi: similar to Arduino in specification and price. The key  Raspberry Pi microcontroller
Identifying and defining
difference is this microcontroller requires an operating system https://www.raspberrypi.org/
Students:
 evaluate the suitability of installed on it to work, the Arduino has it preinstalled.
▪ The MAAS ThinkerShield is a printed circuit board that fits neatly on
hardware with particular  MAAS ThinkerShield
performance top of the Uno. It includes a number of sensors and actuators
https://maas.museum/learn/th
characteristics against the including a potentiometer, a button, a light sensor, six LEDs and a
inkershield/
needs of different users, buzzer. It also allows for the connection of other sensors or actuators
for example: (ACTDIK023) using wires with crocodile clips.
▪ BBC Micro:bit: This is an all-in-one microcontroller recently  Micro:bit
− high-powered systems developed for educational purposes in the UK and available for http://microbit.org/
for gaming and ~$25. It includes a number of integrated input and output
computation components including two buttons, light and temperature sensors,
− energy-efficient motion sensors, 25 LEDs, and radio and Bluetooth communication.
systems for travel and Similar to the MAAS ThinkerShield, it also allows for the connection
productivity of other sensors or actuators using wires with crocodile clips. The
small and light systems for board can be coded using a variety of text or visual-based
health monitoring languages, generally using web-based coding interfaces. Due to the

12
Content Suggested teaching, learning and assessment Resources

widespread use across the UK there is a wide array of resources


available online.

Example tutorials for Arduino Uno with MAAS ThinkerShield.  MAAS Get On With It
https://maas.museum/app/upl
Example tutorials for Arduino oads/2016/10/GetOnWithIt-
v1-2-ONLINE.pdf
Example tutorials for BBC Micro:bit.
 Arduino examples
Tutorials should cover: https://www.arduino.cc/en/Tut
▪ creating and saving new files orial/BuiltInExamples
▪ compiling files and uploading them to the microcontroller
▪ inputs from a few built in sensors  Micro:bit resources
▪ output for a few built in actuators http://microbit.org/en/2017-
▪ setting up variables and assigning them values 03-07-javascript-block-
▪ simple operation on variables resources/
▪ decisions based on a condition (or conditions)
▪ repetition based on a condition (or conditions)
▪ storing data
▪ connecting and writing code for additional sensors and/or actuators.

Activities: independent or pair work through assigned tutorials


▪ Introduce tutorial, including requirements and learning goals.
▪ Demonstrate key features of the tutorial (as required), referring back
to key terms and concepts and pointing out important steps and
areas of potential difficulty.
▪ Students complete the tutorial with assistance from the teacher as
required.
▪ Students record their progress after each activity, reflect on what

13
Content Suggested teaching, learning and assessment Resources

they have learnt and how this could be applied to their project. This
is added to their design and production folio.

Researching and planning Planning our plant monitoring system


Students: Teacher background information
 design algorithms that use Students may work individually or in pairs when developing their system.
a range of data types, It is recommended students develop their own version of the system, but
branching and iteration are able to collaborate on the hardware and software design if required.
and represent them
diagrammatically and in Planning documentation
English (ACTDIP029) CT ▪ Students complete an IPO table for their plant monitoring system. A
DT template may be provided.*
▪ Students identify what sensors they need and how they plan to store
Testing and evaluating and/or display the collected data and results.
Students: ▪ Students draw a schematic/sketch/plan of their intended plant
 trace algorithms to predict monitoring system, labelling the key features (sensors and
output for a given input actuators/display) and how they will function.*
and to identify errors ▪ Review the basics of the electronic configurations for a three-pin
(ACTDIP029) sensor (voltage/power, signal and ground) to help students show this
on their diagram.
▪ Students draw an algorithm flow chart and/or pseudocode to plan the
code for their plant monitoring system. Students could reference the
pseudocode keywords and flowchart symbols, and/or examples of
algorithms represented using these methods.*
▪ For each of the above activities, the teacher checks the accuracy of
the planning documentation before the student can progress to the
next activity.

14
Content Suggested teaching, learning and assessment Resources

Prototype and initial testing


Producing and Teacher background information
implementing
Using the resource guide provided under resources, students prototype
Students:  Refer to equipment guide
and develop their plant monitoring system.
 plan and manage projects used earlier.
individually and
Depending on how much theoretical background provided for the
collaboratively  Using a soil moisture sensor:
electronics in this unit, providing visual guides to help students connect
(ACTDEP039) https://www.youtube.com/wat
their sensors to the microcontroller may be necessary.
 implement and modify ch?v=1h6D_pkeoks
programs involving
In the prototype form, the sensor should be temporarily connected to the
branching, iteration and
microcontroller either through breadboards, crocodile clips or jumper
functions in a general-
wires. Connecting more securely by soldering once significant testing has
purpose programming
occurred may be desirable.
language, for example:
(ACTDIP030) CT
When testing microcontroller systems if the output is not what was
− microcontroller
expected, there may be a number of bugs (problems) with the hardware
and/or software (code/program) that may be causing a problem. Below is
Testing and evaluating
brief description of some debugging/troubleshooting that could be
Students:
attempted.
 evaluate how student
▪ Checking that the hardware (parts and components) are physically
solutions address defined
and electrically connected is a recommended first step. Something
functional requirements
as small as a disconnected wire to a sensor may give unexpected
and constraints
values or outputs from a system.
(ACTDIP031)
▪ A useful way to debug code is to print out strings or variable contents
 trace algorithms to predict
on screen. This can be done by connecting the microcontroller to a
output for a given input
computer using a USB port. Encourage students to add ‘debugging
and to identify errors
output statements’ at points in their code where they think something
(ACTDIP029)
is going wrong. This can be the most frustrating and time-consuming
part of the system development.

15
Content Suggested teaching, learning and assessment Resources

▪ It is recommended the teacher has a working version of the  Flowchart sample code/sketch
hardware and/or software to compare students’ work if a solution to  Sample code/sketch for a
a problem is not readily found. moisture sensor
Prototype
▪ Using their sketches as a guide, students set up the microcontroller
hardware by connecting the required sensor.
▪ Using the flow chart/pseudocode as a guide, students code the plant
monitoring system algorithm in the appropriate general purpose
programming language.
▪ Students write code/sketch for their chosen monitoring system. This
can be an modification of code or sketch provided by the teacher or
sourced by the student.*
▪ Students upload the code to the microcontroller. The functionality of
the code can be tested using soil samples with known moisture
content (see next section).

Researching and planning Initial testing and prototype modification*


Students: ▪ Students set up two cups containing the same amount of soil, and
 collect and access data add 20 ml of water into one of the cups. Students predict what they
from a range of sources, will observe when the sensor is tested in each cup. Students test the
for example: (ACTDIP025) prototype and compare what they observed to what they
predicted/expected.
− using sensors to collect ▪ Students repeat the process for a series of cups (~six) of increasing
temperature data known volumes of water (eg no water, 5ml, 10ml, 20ml, 50ml,
− downloading public 100ml). If the observed output is different to the expected output,
datasets from the students use debugging techniques (eg debugging output
internet statements) to try to find the location and source of the bug.
▪ Students fix the code and/or the hardware and retest until the
observed output is the same as the expected output for the full range

16
Content Suggested teaching, learning and assessment Resources

of inputs.
▪ Testing is recorded in the students’ design and production folio using
a table with headings. Each table should record the software version
(or test date), expected output, observed output and solution.
▪ Using the collected data, students include cut off values within their
code to decide when a plant needs to be watered. Students research
different plant and soil types, experimenting to determine cut off
values for moisture levels.*

Testing and evaluating Final implementation, testing and improving*


Students: ▪ Students set up their plant monitoring system in a real setting and
 evaluate how student observe its functionality, making adjustments as errors or
solutions address defined inefficiencies with the design are identified.
functional requirements
and constraints
(ACTDIP031)

17
Extension Activities

 Write a piece of additional code to add a piezo alarm to the project at the top end of the dry measurement so that an audible alarm is also
heard.

 Code the piezo alarm to play different tones to indicate soil moisture levels e.g. high tone for dry and low tone for moist.
 Adapt the moisture sensor to gather data on food, for example: moisture levels in scones and muffins.
 Draw a pseudocode flowchart to represent the Arduino code for the soil moisture sensor.
 Modify the code to use a 2 line LCD display giving further information about the soil conditions and how to manage them.
 Build a housing to enclose it all safely and neatly.

18
Evidence of learning
Throughout the unit the content marked with an * indicates opportunities for informal assessment:

 Student developed glossary


 Monitoring system research presentation
 Binary game results
 IPO examples
 Flowcharts / pseudocode samples
 Students draw a schematic/sketch/plan of their intended plant monitoring system
 Final code/program for the monitoring solution
 Prototype function
 Data collection and comparison
 Final function and housing of the moisture monitoring system.

19
Arduino Microcontroller Overview
The Arduino project started in 2003 as a program for students at the Interaction Design Institute in
Ivrea, Italy to provide a low-cost and easy way for novices and professionals to create devices
that interact with their environment using sensors and actuators.

Arduino consists of both a physical programmable circuit board (a microcontroller) and open-
source software that runs on your computer that is used to write and upload computer code to the
physical board. Information about Arduino can be found at
https://www.arduino.cc/en/Main/Software where Arduino open-source software can be
downloaded free.

Input/Output Pins Description: English:


Arduino Uno
Date: 14 April 2014,
13:49
Source: ARDU-UNO-
03-Front
Author: oomlout
USB Socket
LED

Integrated Circuit

Power Jack

A detailed description of the components on an Arduino microcontroller can be found at


https://learn.sparkfun.com/tutorials/what-is-an-arduino

Inputs
A range of sensors (inputs) can be connected to an Arduino including light and moisture sensors.

Outputs
Actuators (output devices) can be connected to the microcontroller. They can include outputs
such as powering an LED or a buzzer.

1
Programming Microcontrollers
In the sample program/sketch below the Arduino is programmed to make an LED turn on and off
once per second. By changing the values (variables) in the program, both the duration of the
‘blink on’ and the duration between ‘blink off’ can be changed. The variables can also be adjusted
to ‘blink’ in different patterns, for example: sending messages in Morse code.

2
Equipment Guide – Monitor Your Home and Garden

Equipment Guide
Step by step process to build an Arduino controlled soil moisture
sensor

Parts list

Approximate
Part Quantity Option(s)* Cost
(2018)

Jaycar XC4410 without usb


$29.95
cable

Little Bird Electronics


Arduino board 1 $7.50
KnockOffDuino

Freetronics Eleven includes


$29.00
micro usb cable

USB connector 1 Jaycar WC7912 $14.95

Jaycar PB8817 $4.95


Mini breadboard 1
Little Bird Electronics LB-
$3.95
LR0245A-Y

Soil moisture 1 Tronixlabs SEN0114 $7.95

1
Equipment Guide – Monitor Your Home and Garden

Approximate
Part Quantity Option(s)* Cost
(2018)
sensor
Little Bird Electronics DF-
$7.02
SEN0114

Core electronics SEN0114 $7.50

Little Bird Electronics AF67 $5.78

LEDsales
$2.20
9V_BATT_HOLDER
9V battery box /
1
snap
Ebay $1.50

Little Bird Electronics TB-


$0.40
PH9230

Jaycar RP7510 $2.50


Potentiometer (pot) 1
Little Bird Electronics AF-562 $1.39

Jaycar RR2830 $0.48/pk2


220 ohm resistor 3
Little Bird Electronics TB-
$0.48/pk2
RR2558

Jaycar ZD0150 $0.30


Red LED 1
Little Bird Electronics SF-
$4.32/pk12
COM-12903

Green LED 1 Jaycar ZD0170 $0.30

Yellow LED 1 Jaycar ZD0160 $0.30

Jaycar WC6024 $5.95/pk40


Plug to plug jumper
4
leads Little Bird Electronics TB-
$6.42/pk40
WC6024

Jaycar WC6028 $5.95/pk40


Plug to socket
3
jumper leads Little Bird Electronics TB-
$6.42/pk40
WC6028

Container
1 Woolworths Systema 380ml $4.25
(housing)

9 volt battery 1

* sample suppliers only, alternate suppliers may be better suited to your school context.

2
Equipment Guide – Monitor Your Home and Garden

Component assembly
1. Trim the legs of the three resistors using
side cutters. Bend the legs 900 and place in
position on the breadboard.
Note: Holes in the breadboard are
connected in rows of five (running vertically
in the diagram shown).Resistors are non-
polarised so orientation on the breadboard
is not critical.
2. Place 3 x LED’s in position on the
breadboard taking note of the orientation as
they are polarised and only go one way.
Note: There are three ways to determine
polarity. The long leg on the LED is
positive, the flat edge on the LED is on the
negative side, the cathode(cup) in the LED
is larger than the anode and is negative.

3. Connect 4 x plug to plug jumper leads from


the breadboard to the Arduino.
Note: the resistors are placed on the
positive leg of the LEDs to reduce the
voltage input to an acceptable level. The
three leads to the LEDs are placed on pins
8, 9 & 10 which are outputs on the Arduino
board; the lead from the common negative
leg of the LEDs connects back to ground
on the Arduino board.

3
Equipment Guide – Monitor Your Home and Garden

4. The project is designed to use a soil


moisture sensor as the input source,
however at this stage you can connect a
10k potentiometer (pot) in its place to be
able to check if the project works
appropriately. Using plug to socket leads,
connect the two outside pins on the pot to
5v and ground, and the middle pin on the
pot to the Analogue In pin, A0.
Note: The pot can be connected directly to
the Arduino board but conventional practice
is to make all connections through the
breadboard. With the pot in place you will
be able to vary the output reading and
consequently the illumination of the LEDs
when you upload the soil moisture sensor
code in step 9.
5. Use the usb lead to connect the Arduino
board to the computer.
Note: This supplies power to the Arduino as
well as enabling you to upload the code
from the computer to the Arduino.

Note:
Schools may use jumper wires instead of the breadboard for connections.
Schools may choose to solder the connections in lieu of the breadboard.

4
Equipment Guide – Monitor Your Home and Garden

Loading sample code into Arduino


1. Open the Arduino
app/program on the computer

2. Go to file – new (top left


screen)

3. Delete all the preloaded text


from the Arduino app to have
a blank sketch box.

5
Equipment Guide – Monitor Your Home and Garden

4. Copy and paste the sample


code/sketch provided in the
teaching program into the
blank Arduino app.
Note: The commands and
specialist terms should
automatically change colour
once pasted into the Arduino
application.

5. Upload the moisture sensor


file to the Arduino (top left
screen)

Note: The input reading


should be able to be adjusted
by rotating the pot.

6. You can now experiment with some variations. For example, you could set a range of
values to measure water requirements for cacti which would be different to the settings
you might use for swamp hibiscus.
Note: After any changes are made you will need to upload them again to the Arduino.

6
Equipment Guide – Monitor Your Home and Garden

Sample code variables

The numbers in the orange boxes above can be changed to suit different electrical
connections as well as different soil moisture levels for different soils/plants. This can be a
research task for students to determine the variable for each plant and/or soil.

7
Equipment Guide – Monitor Your Home and Garden

Electronic component setup


If it all works as expected, remove the pot and put the soil moisture sensor in its place. When
you remove the usb computer cable, you will need another power source. Use the 9v battery
box provided.

ground

+5volts

sensor output

8
Equipment Guide – Monitor Your Home and Garden

Flowchart/pseudocode sample code/sketch

Start

Read soil moisture


value

Is value yes LED Dry on


between 0
and 400

no

Is value
yes LED Ok on
between 401
and 625

no

Is value yes
between 626 LED Wet on
and 1023

Delay 5 seconds

1
Equipment Guide – Monitor Your Home and Garden

Sample code/sketch for a moisture sensor


Following is a sample sketch that should work with the three LEDs moisture sensor. Copy
and paste the code into Arduino and it should work as is, provided the electronic
components are connected correctly. Deleting all the text in the Arduino IDE before pasting
in the sample code/sketch below is recommended as the sample text should have all
necessary commands included. It will work with the MAAS Thinkershield but the
moistureSensor number will need to be changed to match the potentiometer (if you want to
use that for calibration/testing).

Sample code/sketch
/*

* Soil Moisture Sensor Simple Version

* The moisture thresholds are estimates, students will need to research and adjust these
variables to suit their plants.

*/

//Arduino pins

int moistureSensor = A0;

int ledDry = 8;

int ledOk = 9;

int ledWet = 10;

//moisture upper thresholds

int soilDry = 400;

int soilOk = 625;

int soilWet = 1023;

int moistureLevel;

void setup() {

pinMode(ledDry, OUTPUT);

pinMode(ledOk, OUTPUT);

pinMode(ledWet, OUTPUT);

pinMode(moistureSensor, INPUT);

2
Equipment Guide – Monitor Your Home and Garden

Serial.begin (9600);

void loop() {

moistureLevel = analogRead(moistureSensor);

if (moistureLevel<=soilDry){

digitalWrite (ledDry,1);

digitalWrite (ledOk,0);

digitalWrite (ledWet,0);

Serial.print("Soil is dry ");

if ((moistureLevel>soilDry)&&(moistureLevel<=soilOk)){

digitalWrite (ledDry,0);

digitalWrite (ledOk,1);

digitalWrite (ledWet,0);

Serial.print("Soil is OK ");

if (moistureLevel > soilOk){

digitalWrite (ledDry,0);

digitalWrite (ledOk,0);

digitalWrite (ledWet,1);

Serial.print("Soil is wet ");

Serial.print("The moisture level of the soil is ");

Serial.println(moistureLevel);

delay(5000); // waits this long in milliseconds before taking the next reading

S-ar putea să vă placă și