Lilypad Personalised Alert Buzzer
About this lesson
The lesson can be extended to include LED’s that light up or flash according to the note played to enable the buzzer to be used for the hearing impaired. This lesson idea was created by Toni Falusi.
Year band: 7-8
Curriculum Links AssessmentCurriculum Links
Links with Digital Technologies Curriculum Area
Band | Content Description |
---|---|
7-8 |
Define and decompose real-world problems with design criteria and by creating user stories (AC9TDI8P04). Design the user experience of a digital system (AC9TDI8P07). Evaluate existing and student solutions against the design criteria, user stories and possible future impact (AC9TDI8P10). |
Assessment
Formative Assessment
- Observation of students creating circuit including Buzzer and Button
- Review diagram sketch with students prior to connecting the components with conductive thread
- Successful upload & execution of alert buzzer basic program
- Documentation of evidence of iteration of project, particularly changes made between the initial diagram sketch and the final product and the consideration of the needs of the client.
- Completed product with personalised alert tone and a user friendly design that meets all requirements of the task.
Quantity of knowledge | Quality of understanding | ||||
---|---|---|---|---|---|
Criteria | Pre-structural | Uni-structural | Multi-structural | Relational | Extended abstract |
Algorithms Programming |
Some attempt to copy the provided code into the program has been made. | Provided code has been copied into the program successfully . Limited customisation is evident. Eg. additional tones |
Algorithm has been altered to include a personalised tone containing min 3 notes Some instructions have been commented out in the program. |
Program has been extended to include 4-6 notes to create an interesting melody Algorithm has instructions commented out through the program. |
Algorithm brings in prior learning and/or independent learning beyond the task and possibly includes branching, variables and loops. Eg: complex melody Full use of Programming interface is evident |
Diagram | Diagram contains all components of the project. Some evidence of labels. |
Complete diagram includes labels using correct vocabulary. Eg input/output, Button, Buzzer Some notation of of changes included. |
Diagram is complete, clearly labeled includes symbols and is easy to follow. Changes or iterations evident. | Specific vocabulary is used throughout the diagram. Proper symbols and explanation key is included. Iterations made during the project are documented. |
Correctly labelled diagram complete and presented to an excellent standard. Complete detail of all connections and hardware including description of components included. Iteration and changes documented, including a final reflection. |
Vocabulary | No specific / technical terms used. | The terms program or code may be used as a general description. | The terms program or code are used as a general description. The terms analogue and digital are known and used correctly. |
Specific terms such as program, loop, debug are used confidently with specific reference to learner’s work. Code is commented in specific places. | Understanding of specific terms such as constant, function and variable. Understanding of terms in the code such as digitalWrite. Code is well commented throughout. |
Overview
Description
In this lesson students will create a personalised musical buzzer by programming the LilyPad Arduino to play a sound using the Main board, Buzzer and Button, coding the note frequency in Arduino IDE. The lesson can be extended to include LED’s that light up or flash according to the note played to enable the buzzer to be used for the hearing impaired.
During the testing phase, the LilyPad components will be connected using alligator clips before progressing to hand stitching them together using conductive thread for a final product that can be held in a person's hand or attached to their clothing.
The buzzer is to be personalised with a tune or tone of the student's choosing and will be used as an alert system for a person who is incapacitated.
Resources
- Lilypad ProtoSnap kit with rechargeable battery
- LilyPad LED’s
- Conductive thread
- Alligator clips
- Arduino IDE installed onto computers
- Mini USB cable
- Chalk or pen for marking fabric
- Felt/Material
- Scissors
- Paper
- Needle
- Pencils for design sketches
- Embroidery hoop (suggested)
- Mac or PC with latest Arduino IDE installed:
For Windows
For Mac
Prior Student Learning
An understanding of basic circuitry is essential for this activity as it is important that the threads do not cross over or touch as you may short circuit the board.
Simple hand stitching skills would be beneficial but not essential as the components can be connected with alligator clips.
Learning hook
- Discussion prompts:
- What would the advantages be of a wearable personal buzzer?
- Why would it be useful for a personalised alert tone’? (Carers would know who was in need of attention quickly)
- How could the buzzer be adapted for use in a noisy environment? (Include LEDs)
- What other applications would a personalise buzzer be useful for? (eg. Quiz game buzzer)
- Pose a scenario to the students that they have been approached by a Retirement Village to produce personalised buzzers for a range of clients who have varying needs. These include but are not limited to the elderly who are hearing impaired, visually impaired,have mobility issues and/or vocal impairment.
- These clients require a means of getting the attention of their carers when they are in areas of the Retirement village other than their room. These devices must be wearable or able to attach to them in some way and be aesthetically pleasing.
- Introduce the concept of how these devices are programmable and thus code can be written to achieve the planned outcomes. Introduce the concept of functions and discuss how arduino has predefined functions for all the LilyPad components. Some of these functions include:
- loop - for repetition
- delay - delays action
- pinMode - for configuring the specified pin to behave either as an input or an output
- digitalWrite - for writing a low or high value to a pin
Learning map and outcomes
- Identify LilyPad main board, Buzzer and Button
- Review basic electronics & circuitry.
- Explore Arduino IDE software that has been installed onto computers & configure port plus select LilyPad in Board Manager
- Connect LilyPad components together using alligator clips for testing
- Type Alert Buzzer Basics program into Arduino IDE & upload to LilyPad
- Establish the needs of the client who the personalised buzzer will be designed for & research the constraints that will limit the design.
- Discuss possible designs and present to peers for feedback
- Create diagram flow chart to show connections needed for LilyPad components and the chosen design of the Alert Buzzer
- Create algorithm to create personalised musical sequence which includes more than three notes.
- Students identify the ways in which the program can be decomposed into functions
- Students identify the key arduino functions and learn how to change parameters and use these these functions to achieve planned outcomes
- OPTIONAL - include visual component using LED’s and alter algorithm in Arduino IDE. Include changes to the diagram chart to indicated additional changes.
- Hand stitch LilyPad components onto fabric following the flow chart
- Present final project to the class.
Learning input
The teacher should have an understanding o
- circuitry,
- basic hand sewing techniques
- the elements of C language used in the Arduino IDE
- see Sew Electronics tutorial for basic code elements
- Get started with Lily Pad (Arduino) Programming with this document by Andrew Bulleen.
This activity can be completed in small groups or individually depending on the experience of the students with the technology & Arduino IDE
Learning construction
- Students review knowledge of basic electronics and the issue of short circuits.
- Introduce conductive thread discussing issues with insulation & resistance. The kit contains 2 ply thread that will compromise the brightness of the LED if sewn over a long distance. (This should not be a problem with this task)
- Open Arduino IDE and connect board to computer using mini USB cable
- Select the board type and port - Tools_Board Manager_ LilyPad Arduino. Then Tools_port (select the serial port that is corresponds to the USB port eg:COM3
- Set up LilyPad - Using alligator clips, connect the positive (+) on the Buzzer to Port 5 on the Main Board. Attach the negative (-) on the Buzzer to the negative port on the Main Board. Attach the (+) on the Button to Port A3 on the main board and (-) on the Button to (-) on the Main Board to complete the circuit.
- Type the following code into the Arduino IDE and save as Alert Buzzer Basic
// Pin the buzzer is attached to
int buzzerPin = 5;
// Pin the button is attached to
int buttonPin = A3;
// Variable to store the button's state
int buttonState = 0;
// Set a time in milliseconds for all delays
int delayTime = 100;
// Notes
const int C = 1046;
const int D = 1175;
const int E = 1319;
const int F = 1397;
const int G = 1568;
const int A = 1760;
const int B = 1976;
const int C1 = 2093;
const int D1 = 2349;
void setup()
{
// Set the buzzer pin as an OUTPUT
pinMode(buzzerPin, OUTPUT);
//Set the button as INPUT
pinMode(buttonPin, INPUT_PULLUP);
}
void loop()
{
buttonState = digitalRead(buttonPin);
if (buttonState == LOW)
{
// Call a function named playSong()
playSong();
} else
{
noTone(buzzerPin);
}
delay(delayTime);
}
void playSong()
{
tone(buzzerPin, C);
delay(delayTime);
// Use noTone() to shut off the buzzer and delay to create a 'rest'
noTone(buzzerPin);
delay(delayTime);
} - Upload Sketch to LilyPad and test by pressing the Button. There should be a single pulse tone played when the button is pressed.
- Once the test program is successful, students move on to designing the user interface for the Alert Buzzer based on the needs of their client.
- Identify the key blocks of the code, in particular the setup() and loop() functions, and discuss their purpose. What about the delay() function? What other functions of interest can students find?
- Share designs with class members for feedback and make any changes are required.
- Create a labelled diagram flow chart to show connections needed for LilyPad components and the chosen design of the Alert Buzzer
- Currently the Alert Buzzer only plays a single tone using the frequency of C=1046. Make alterations to the program to incorporate a minimum of three varying tones.
- Students decompose this problem into key elements:
- setting the first tone - using the tone function
- delay - using the delay function
- setting the second tone using the tone function
- delay - using the delay function
- This can be done by adding additional lines of code under the new function called void playSong ()
Eg:
tone(buzzerPin, D);
delay(delayTime);
tone(buzzerPin, A);
delay(delayTime); - Students can explore the varying tones of each note added. The program will play sequentially through each command repeatedly when the button is pressed. Remind the students to upload the sketch each time they make a change.
- For a more advanced activity, LED’s can be incorporated into the design at this stage but is not an essential component for this task.
- Hand stitch all components to fabric following the diagram flow chart.
- Present final product to class and evaluate designs based on the original design brief.
Learning demo
- Students present their final product to the class, together with their diagram flow chart and evaluate the Alert Buzzer against the original design brief.
Learning reflection
- How has the final product met the requirements of the Retirement Village brief?
- How user friendly is the design for the client? Can it be attached or worn with ease whilst still being accessible for the patient to push the Button?
- Is the alert tone personalised?
- How could they market this device? Could it be reproduced easily?
- What is the role of technology in this task? Could the Alert buzzer be produced without it?
- What are the advantages/disadvantages of using functions in code? Did they discover an interesting/useful function they want to share?
Resources
- Download entire lesson plan: PDF version.
- Download entire lesson plan: Microsoft Word version.
- Instructables: Let's Make with Lilypad - Website with additional ideas and instructions.
- Instructables: Wearable Electronics Class - Free online course teaching techniques to build wearable elecontronics and program interactions using Ardunio software. There are variances in the Lilypad kit supplied by CSER and those referred to in the lessons.