Table of Contents

play tone of note () with duration ()

Description

The block plays the tone on the speaker for the specified note and duration.

Example

The example demonstrates using the Quarky touch display to make touch piano.

Script

 

Output

Touch-Numbers

Read More
This example shows you how to use the flame sensor to detect heat or flame nearby, and then how to create an alarm system that is triggered by the flame sensor.

This example demonstrates how to set up the flame sensor with Quarky to detect heat or flame nearby. Later, we create an alarm system triggered with the flame sensor.

Flame Sensor Connection to Quarky

Flame sensors have 4 pins: GND, VCC, DO, and AO. You have to connect the following 3 pins to the Quarky Expansion Board:

  1. GND to Ground Pin of Quarky Expansion Board
  2. VCC to 3.3V or VCC Pin of Quarky Expansion Board
  3. DO to the D3 (Digital Pin) of the Quarky Expansion Board

Calibrating Flame Sensor

The sensor also has 2 LEDs – Power and Detection. The desired calibration is achieved when the sensor is inactive when there is no heat or flame nearby and active when the flame is nearby. It is visible on the detection LED.

To calibrate the flame sensor:

  1. Turn the power on for the sensor.
  2. Place the sensor close to the heat or flame. You should see the detection LED turn on.
  3. If the LED is Off, adjust the potentiometer until the detection LED turns on.
  4. Move the sensor away from the heat or flame. The detection LED should turn off.
  5. If the detection LED does not turn off, continue to adjust the potentiometer until it does.

Project: Flame-based Alarm System

In the project, when heat or flame is detected, the alarm system starts with

  1. The fan turned ON.
  2. Quakry beeping with lights.
  3. The door is open for urgent evacuation.

The alarm system will be on until the flame sensor stops detecting the fire.

Circuit

Connect the following modules to the Quarky Expansion Board:

  1. Flame Sensor
    1. GND to Ground Pin of Quarky Expansion Board
    2. VCC to 3.3V or VCC Pin of Quarky Expansion Board
    3. DO to the D3 (Digital Pin) of the Quarky Expansion Board
  2. Motor Fan: Connect the motor to the Motor Port 1 of the Quarky Expansion Board.
  3. Door Servo Motor: Connect the servo motor to the servo port 5 of the Quarky Expansion Board.

Code

Adding IoT in Fire Alarm System

As an advanced system, we can also send the fire detection alert to the users using IFTTT. For that, we will use IFTTT webhooks.

The following IFTTT sequence is to be created:

You can learn in detail how to create an IFTTT applet here: https://ai.thestempedia.com/extension/ifttt-webhooks/

Code

You can download the code from here: Flame-Based Alarm System – Stage Mode

IoT-based Fire Alarm in Upload Mode

You can also make the automatic lighting work independently of PictoBlox using the Upload Mode. For that switch to upload mode and replace the when green flag clicked block with when Quarky starts up the block.

Note: Make sure you know how to work on Upload Mode with Quarky in IoT. Follow the example to learn more: https://ai.thestempedia.com/example/automatic-light-control-with-ldr-sensor/

You can download the code from here: Flame-Based Alarm System – Upload Mode

Read More
All articles loaded
No more articles to load