Table of Contents

read analog sensor () at ()

Description

The block returns the analog reading of the sensor connected to the specified analog pin of the Quarky. The value varies between 0 to 4095.

Example

Discover the fascinating LDR (Light Dependent Resistor), an analog-type sensor that alters its resistance with varying light intensity
Introduction

LDR, also known as a Light Dependent Resistor, is an analog-type sensor renowned for its ability to modify its resistance based on the intensity of incident light. As the surrounding light changes, the resistance of the LDR fluctuates, making it an essential component in various light-sensing applications. While generally designed as a two-pin sensor, it is also available in a three-pin module, providing enhanced features and flexibility.

circuit

How To Use An LDR Sensor With Arduino Tutorial 1

in this example, we will interface our sensor module with Arduino and we’ll be reading the change in it’s resistance upon the change of light.

Code

  1. Add a “when flag clicked” event from the events palette.
  2. Place a “forever” block from the controls palette after the event block.
  3. Within the “forever” block, add a “say()” block from the looks palette.
  4. From the Arduino sensor palette, drag the “read analog sensor () at ()” block and insert it in place of “hello” in the “say()” block.

Output

Read More
Learn how to interface an MQ sensor with Arduino to detect multiple gases like CO2, LPG, and more.
introduction

The MQ series of sensors offers a diverse range of gas detectors used for detecting multiple gases like CO2, LPG, and more. These sensors have numerous applications, from detecting smoke caused by fires in buildings to identifying gas leaks and natural gases in mining operations.

Buy MQ-137 NH3 Gas Sensor Module Online in India | Robocraze

In this example, we will interface an MQ sensor with Arduino to detect gas levels above a certain threshold. When the gas levels surpass the set limit, Arduino will trigger a buzzer alarm. Let’s delve into the exciting world of gas detection using Arduino!

Circuit

connection

Sensor                                Arduino

VCC                                        5V

GND                                      GND

A0                                           A0

buzzer+                                   D13

Buzzer-                                    GND

Code

  1. From the event palette, add the “when flag clicked” block into the scripting area.
  2. Add the “forever” block from the controls palette.
  3. Inside the “forever” block, add the “if-else” block from the control palette.
  4. From the operator palette, add the “greater than” operator into the “if” conditional part.
  5. In the first space of the “greater than” operator, use the “read analog sensor () at ()” block from the Arduino sensor palette and insert the MQ sensor value from A0.
  6. In the second space of the “greater than” operator, set a specific value as the threshold for gas detection.

Script.

Output

Read More
Explore the functionality of a raindrop sensor, an analog-type sensor that detects changes in resistance upon contact with water.
introduction

The raindrop sensor is an analog-type sensor that effectively measures changes in resistance when it encounters water. This property makes it an ideal choice for detecting rain and water presence in various applications. While typically designed with two pins, there are also versions available with a controller module, effectively converting it into a three-pin sensor for enhanced functionality.

rain drop sensor

Circuit

To set up the raindrop sensor circuit, make the following connections:

  • Sensor:
    • VCC: Connect to the 5V power supply
    • GND: Connect to ground (GND)
    • A0: Connect to analog input pin A0
  • Buzzer:
    • Buzzer+: Connect to digital pin D13
    • Buzzer-: Connect to ground (GND)

Code

  1. Add an “if-else” block from the controls palette.
  2. Insert a comparison operator into the “if” block from the operators palette
  3. Check whether the value of the raindrop sensor is below a certain threshold, let’s say 800. From the Arduino sensor palette, add “read analog sensor () at pin ()” and place it in the blank space of the operator. Choose “raindrop sensor” from the drop-down menu.
  4. If the value is below the set limit, activate the buzzer (alarm) connected to pin 13. Add set digital pin () output as () from Arduino palette within the “if” block. In the “else” part, ensure the alarm remains off when the raindrop sensor value is above the set limit.
  5. Add the above set of code inside a “forever” block to continuously monitor the sensor’s readings.
  6. Finally, add a “when flag clicked” block at the start of the code to initiate the raindrop sensor monitoring.

Script

Output

 

Read More
Learn about soil moisture sensors and how they work to measure the moisture level in the soil.
introduction

A soil moisture sensor is a valuable tool used to determine the moisture content in the soil, crucial for efficient gardening, farming, and agricultural practices. This analog sensor generates varying output values depending on the moisture level present in the soil. Typically, it operates as a two-pin circuit, with these pins responsible for powering up the sensor module. To obtain soil moisture readings, a voltage divider circuit is employed on the negative pin of the sensor, resulting in a signal pin that provides the moisture level data. Alternatively, some sensor modules come with a controller circuit that automatically converts the 2-pin connection into a 3-pin output, simplifying the process of accessing moisture values.

Below is a simple circuit diagram and code to get you started with monitoring soil moisture using an Arduino board. By following these steps, you can create your own moisture monitoring system with ease. Let’s begin!

 

Soil Moisture Sensor Hookup Guide - SparkFun LearnAuslese™ Detection Module Soil Moisture Sensor (Pack of 1Pcs) : Amazon.in: Industrial & Scientific

circuit diagram

Code

  1. Go to my variables and create a variable and name it “moisture level.” Set its initial value to 0.
  2. Add a “forever” loop from the control palette.
  3. Inside the forever loop, add a “set () to ()” block using the “my variable” category. Set the variable “moisture level” to the output value of the next block.
  4. From the Quarky palette, add the “map () from ()-() to ()-()” block. Replace the placeholder “0” with the map block.
  5. From the Sensors palette of Quarky, insert the “read analog sensor () at ()” block in place of “50”, and change the data range from 0-4095 to 0-100, as shown below. 0 stands for 100 percent moisture and 100 means completely dry
  6. Add an “if-else” block from the controls palette. Use it to check whether the value of the sensor is greater than 50% or not.
  7. If the value is greater than 50%, activate the buzzer connected to pin D2 otherwise the buzzer must remain off.
  8. Finally, add the “when flag clicked” block at the start of the script to initiate the monitoring process.

Script

 

With these steps, your script is complete, and you can now monitor the soil moisture effectively using the soil moisture sensor and Arduino board. Happy gardening and farming!

Output

 

 

 

Read More
Learn how to interface a flex sensor with Quarky, the versatile microcontroller, to detect bending or flexing.
INTRODUCTION

The flex sensor is an ingenious device employing carbon on a plastic strip to serve as a variable resistor. As the sensor bends in one direction, its resistance varies accordingly. The more it bends, the higher the resistance becomes. This unique property makes it an ideal choice for applications where detecting bending or flexing is necessary.

In this example, we will be interfacing a flex sensor with Quarky and based on the change in its resistance we’ll be controlling the movement of our servomotor.

Circuit Diagram

 

Code

  1. Open Pictoblox and create a new file.
  2. Select Quarky from the board menu
  3. Create a variable called “sensor value” and set it to 0
  4. Add a “forever” block from the control palette.
  5. Inside the “forever” block, set “sensor value” to read analog sensor at A1.
  6. To convert this range to 0-180 for controlling the servo motor, use the “map” block from the Quarky palette and insert the sensor value in place of 50.
  7. Create another variable as “Servo angle”, Set the mapped value as the value of our new variable.
  8. connect servo at port servo 1 and fed variable servo angle as for the servo motor.
  9. Finally, add a “when flag clicked” event to complete the script and initiate the servo control with the flex sensor.

Script

OUTPUT

 

Output GIFs are need to be updated

 

 

Read More
Learn how to interface a joystick with Quarky, the versatile microcontroller, to control the movement of Quarky Robot in different directions.
Introduction

A joystick is an input device used to control the movement or actions of a computer, video game console, or other electronic device. In gaming, joysticks are often used to control the movement of characters or vehicles in a virtual environment. They provide analog input, meaning the degree of movement can vary based on how far the handle is pushed in a particular direction. In aviation and flight simulation, joysticks are commonly used to simulate the control of aircraft, providing pitch, roll, and yaw inputs. Some advanced joysticks also come with additional features such as throttle controls, programmable buttons, and force feedback to enhance the gaming or simulation experience. below is a simple animation of a joystick.

 

 

In this example, we’ll be interfacing a joystick with Quarky and try to find different directions for our robot by moving the joystick along the x and y axis let’s begin!!

Circuit Diagram

 

 

connection

JoyStick       Quarky

GND                          GND

5V                                  V

VarX                             A1

VarY                              A2

this is logic we will be using

Code

Remember that whenever we are moving the joystick in any direction, the value of both X and Y axis changes simultaneously, so we will be defining a range for both the X-axis and Y-axis so that when their values lie under this range our system must be able to decide the direction as forward,backward, left or right. based on the ranges and logic.

  1. Connect JoyStick as per the above connections.
  2. Open pictoblx and create a new file.
  3. Select Quarky from the board menu.
  4. Go to my blocks and create a new block as “forward”
  5. From controls palette, add if-than block with under forward block.
  6. From operators palette insert AND operator in if block.
  7. Again from operator palette, add grater then operator and first space of the AND block.
  8.  From Sensor palette of Quarky, choose the block “read analog sensor () at pin()” select joystick X from the dropdown and A1 from the dropdowns. change the value from 50 to 4000
  9. Again from the operator palette drag less then operator and insert in second space if the AND operator.
  10. From sensor palette of Quarky, insert read analog sensor () at pin (). in first space of the less than operator and change the value from 50 to 4100.
  11. Copy this if block and paste it inside the existing if block.
  12. this time change joystick X to joystick Y and pin from A1 to A2, as shown below.
  13. this time change the range for y from 1800  to 900 in first and second  space of grater than and less than operator respectively.
  14. From looks palette add say block in if block and inside the say block add join block from operators.
  15. replace apple with “forward >> ” and in place of banana add another join block.
  16.  This time in place of apple type “x = ” and again add join operator from operators palette in place of banana.
  17. In place of apple add “read analog sensor () at pin () ” from sensor palette. choose joystick X and A1 from dropdowns, Add another join block in place of banana.
  18.  this time in replace appl with “ y = ” and banana with “read analog  sensor () at () ”  block and choose joystick Y and A2 from the dropdowns.
  19. Now from display palette of Quarky,  drag “display matrix as ()” .
  20. Click on drop down and create a forward arrow on display.
  21. from Controls palette and wait for 0.25 seconds.
  22. create 3 more blocks for backwards, left and right prospectively. for backward.
  23.  Left
  24. Right
  25. Now let’s start writing the main script. from events palette add when flag clicked.
  26. From control palette add a forever block.
  27. finally, add all the blocks that you have created inside the forever block.

By following all the above steps, you will be able to control the robotic car in any direction you want.

Output

 

Read More
Learn about A force sensor, also known as a load cell or force transducer, is a device designed to measure the force or load applied to it.

Introduction

A force sensor, also known as a load cell or force transducer, is a device designed to measure the force or load applied to it. It’s used in various applications to quantify the magnitude of forces in different directions. Force sensors are utilized in fields such as engineering, manufacturing, robotics, healthcare, and more.

 

Circuit Diagram

 

Code

  1. Select “when flag clicked” from the event palette.
  2. Use the “forever” block from the control palette.
  3. Add the “if – else” block from the control palette.
  4. Read the analog sensor at A0 to obtain pressure readings.
  5. If the value of the analog sensor at A0 is greater than 200, set the output pin 13 to High.
  6. if the value of the analog sensor at A0 is less than 200, set the output pin 13 to Low.
  7. Now the script has been completed.

OUTPUT

 

Read More
Joystick Is Basically Input Device That Will Be Used TO Control The Robotics And It Has Been Also Used In Gaming.  The Joystick Are Different Types And Uses In Different Purposes.
Introduction

Joystick Is Basically Input Device That Will Be Used TO Control The Robotics And It Has Been Also Used In Gaming.  The Joystick Are Different Types And Uses In Different Purposes. The Above Images Shows The Pins That Will Be Used For Interfacing With Hardware. We Know About The First Two Pin That Is Basic Pins Which Is Used In Every Hardware. That Is +5V And Another Is Ground. Another Three Pins Are Input And Output Pins. The VRx And VRy Are The Input Pin And SW Is The Output Pines Will Briefly Understand About The Interfacing Joystick With Arduino.

 

Circuit Diagram

 

Code

  1. Open PictoBlox and create a new file.
  2. Change the scripting mode from “stage” mode to “upload” mode.
  3. Click on the extension button and add the communication extension.
  4. From the Arduino palette, drag the “when Arduino starts up” block into the scripting area.
  5. click on communication extensions and drag  “set serial () baud rate to () ”  into the scripting area.
  6. Set the baud rate to 9600.
  7. From the controls palette, add the “forever” block.
  8. add all the blocks that you have created inside the forever block
  9. From controls palette, define forward block.

  • from the control pallet select AND  block
  • Again from the operator palette drag less then operator and insert in second space if the AND operator.
  • From sensor palette of Quarky, insert read analog sensor () at pin (). in first space of the less than operator and change the value from 0 to 100.

  • his time change joystick X to joystick Y and pin from A1 to A2, as shown below.
  • Add all these blocks
  • for backward
  • for right

  • for left

Output

Read More
Understand how the piezoelectric effect generates electric charge in response to mechanical stress, making these sensors useful for pressure, acceleration, vibration, sound detection, and more
Introduction

A piezoelectric sensor is a type of sensor that uses the piezoelectric effect to measure changes in pressure, acceleration, force, temperature, and other physical quantities. The piezoelectric effect is a phenomenon in which certain materials generate an electric charge in response to mechanical stress or deformation. This property makes piezoelectric sensors useful for a wide range of applications where accurate measurements of mechanical changes are required. Here’s how piezoelectric sensors work:

  1. Piezoelectric Material: Piezoelectric sensors are constructed using materials that exhibit the piezoelectric effect, such as quartz, certain ceramics, and some polymers. These materials have a crystalline structure that allows them to generate an electric charge when subjected to mechanical pressure or deformation
  2. Applications: Piezoelectric sensors find applications in various fields:
    • Pressure Sensing: Measuring changes in pressure in industrial, medical, and automotive applications.
    • Acceleration and Vibration Monitoring: Detecting vibrations and accelerations in devices, structures, and machinery.
    • Acoustic and Sound Detection: Capturing sound waves for microphones and other acoustic applications.
    • Force Measurement: Measuring forces in materials testing, robotics, and biomechanics.
    • Temperature Compensation: Piezoelectric materials can be used for temperature compensation in electronic components.

Circuit diagram

Code

  1. Open pictoblox and create a new file.
  2. Goto boards and select Arduino Uno.
  3. Add ” When Flag Clicked” when from the event palette into the scripting area.
  4.  Add Forever ” block from controls palette.
  5. From looks palette drag “say() ” block into the scripting area and place it inside the forever block.
  6. From Sensor palette of Arduino, Drag ‘Read analog sensor () at ()”  and place it inside the say block. Choose generic from the drop-down.
  7.  Your final script will look like this.

Output

OUTPUT Gifs will be updated soon.

Read More
Learn about the working principle of piezoelectric sensors, their applications, and how to interface them with Quarky using Pictoblox.
Introduction
Introduction

A piezoelectric sensor is a type of sensor that uses the piezoelectric effect to measure changes in pressure, acceleration, force, temperature, and other physical quantities. The piezoelectric effect is a phenomenon in which certain materials generate an electric charge in response to mechanical stress or deformation. This property makes piezoelectric sensors useful for a wide range of applications where accurate measurements of mechanical changes are required. Here’s how piezoelectric sensors work:

  1. Piezoelectric Material: Piezoelectric sensors are constructed using materials that exhibit the piezoelectric effect, such as quartz, certain ceramics, and some polymers. These materials have a crystalline structure that allows them to generate an electric charge when subjected to mechanical pressure or deformation
  2. Applications: Piezoelectric sensors find applications in various fields:
    • Pressure Sensing: Measuring changes in pressure in industrial, medical, and automotive applications.
    • Acceleration and Vibration Monitoring: Detecting vibrations and accelerations in devices, structures, and machinery.
    • Acoustic and Sound Detection: Capturing sound waves for microphones and other acoustic applications.
    • Force Measurement: Measuring forces in materials testing, robotics, and biomechanics.
    • Temperature Compensation: Piezoelectric materials can be used for temperature compensation in electronic components.

Piezoelectric Sensor Pinout, Working & Datasheet

Circuit Diagram

 

Code

  1. Open Pictoblox and create a new file.
  2. Goto boards and select Quarky.
  3. Add ” When Flag Clicked” from the event palette into the scripting area.
  4.  Add Forever ” block from the controls palette.
  5. From looks palette drag “say() ” block into the scripting area and place it inside the forever block.
  6. From Sensor palette of Quarky, Drag ‘Read analog sensor () at ()”  and place it inside the say block. Choose generic from the drop-down.
  7.  Your final script will look like this.

Output

Now to read the different changes from the sensor, hit the sensor with your punch and you will see the change in sensor value shown by your sprite.

OUTPUT Gifs will be updated soon.

 

Read More
Learn about the significance of force sensors and their applications. Discover how to interface a force sensor with Quarky using Pictoblox.

Introduction

A force sensor, also known as a load cell or force transducer, is a device designed to measure the force or load applied to it. It’s used in various applications to quantify the magnitude of forces in different directions. Force sensors are utilized in fields such as engineering, manufacturing, robotics, healthcare, and more.

 

Circuit Diagram

 

Setting up the stage

  1. Go to Sprite button and add bell as a ew sprite.
  2. change the backdrop to  “Sky blue 2”.
  3. Now you have two sprites on the stage “Tobi ” and “Bell”.  change 
  4.  Select “Bell” and set its x value to 0 and y to 150. and size to 50% at the bottom of the stage.
  5. Change the size of Tobi to 80%
  6. Now the final thing adding the sound effect. go to sound block, search for bell, and add ‘Doorbll”.

Code

  1. Open Pictoblox and create a new file.
  2. Go to the board menu and select Quarky.
  3. Now after setting up the stage, select Tobi and start writing the below code for Tobi.
  4. From event palette,  drag ” when flag clicked” block into th scripting area.
  5.  Let’s set the initial location for Tobi in the stage as x=0, y=0. Goto Motion palette and add “goto x() y()” block, feed the value for x and y.
  6. Create a variable as “Initial value ” to store the initial (or normal) value of the sensor.
  7. From Variable palette, drag “Set () to ()” and add after the goto block. select “initial value from the drop-down button.
  8. From Sensor palette of Quarky. place ” read analog sensor () at ()” block in place of 0. and choose generic from the list.
  9. Now add a forever block in the script and put “if-then-else” block inside the forever block.
  10. From operator palette, add grater then operator in the conditional part and compare the current value of the sensor with initial value, as shown below.
  11.  Inside the if section of the block, we have to map the sensor value in such a way that whatever the value sensor is generating, it must get converted from 0-150, so that our Tobi can jump to ring the bell. For this, we are going to use  “change y by ()” block from motion palette and “map () from () ~() to () ~()” block from quarky palette.
  12. place the sensor value in place of 50 and set the required range. as shown below.
  13. With this our Tobi can jump account to the data fetched from the sensor. Since we are trying to ring the bell, so we have to set the condition for this. add a if block after “change y by () block”.
  14.  Here we have to check if the Tobi touches the Bell or not. for this, Goto sensing palette and add “touching ()?” block in the second if block and select bell from the dropdown. as shown below.
  15. If the tobi touches the Bell, we have to play the doorbell sound that we have added during the stage settings. Go to sound palette add block “play () until done” and select doorbell from the list.
  16. In the else part, tobi must glide to its initial location that x=0 y=0, from Motion palette, add “glide for () secs to x() y()” block. 

with this, your script is complete now.

 

Output

Output Gif will be updated soon.

 

Read More
Learn about soil moisture sensors and how they work to measure the moisture level in the soil.
introduction

The soil moisture sensor is a valuable tool used to determine the moisture content in the soil, crucial for efficient gardening, farming, and agricultural practices. This analog sensor generates varying output values depending on the moisture level present in the soil. Typically, it operates as a two-pin circuit, with these pins responsible for powering up the sensor module. To obtain soil moisture readings, a voltage divider circuit is employed on the negative pin of the sensor, resulting in a signal pin that provides the moisture level data. Alternatively, some sensor modules come with a controller circuit that automatically converts the 2-pin connection into a 3-pin output, simplifying the process of accessing moisture values.

Below is a simple circuit diagram and code to get you started with monitoring soil moisture using an Arduino board. By following these steps, you can create your own moisture monitoring system with ease. Let’s begin!

 

Soil Moisture Sensor Hookup Guide - SparkFun LearnAuslese™ Detection Module Soil Moisture Sensor (Pack of 1Pcs) : Amazon.in: Industrial & Scientific

circuit diagram

Code

  1. Goto my variables and create a variable and name it “moisture level.” Set its initial value to 0.
  2. Add a “forever” loop from the control palette..
  3. Inside the forever loop, add a “set () to ()” block using the “my variable” category. Set the variable “moisture level” to the output value of the next block.
  4. From the Arduino palette, add the “map () from ()-() to ()-()” block. Replace the placeholder “0” with the map block.
  5. From the sensor palette, insert the “read analog sensor () at ()” block in place of “50”, and change the data range from 0-1023 to 0-100, also add “when flag clicked” at the start of the script, from event palette. As shown below.
  6. Add an “if-else” block from the controls palette. Use it to check whether the value of the sensor greater than 50% or not.
  7. If the value is greater than 50%, activate the buzzer connected to pin 13.
  8. And if the value if less then 50% then the buzzer must remain OFF.

Script

With these steps, your script is complete, and you can now monitor the soil moisture effectively using the soil moisture sensor and Arduino board. Happy gardening and farming!

Output

 

 

 

Read More
Learn about LDR (Light Dependent Resistor) sensor and its analog properties while creating a fun activity using Quarky.
Introduction

The LDR (Light Dependent Resistor) sensor is a renowned analog-type sensor that adapts its resistance according to surrounding light intensity. With its ability to fluctuate resistance based on light changes, the LDR plays a vital role in various light-sensing applications. Though typically designed as a two-pin sensor, it is also available as a three-pin module, offering enhanced features and versatility.

In this example, we embark on a fun activity using the LDR sensor and Quarky. Through this engaging experience, you will grasp essential concepts like analog and PWM signals, creating an exciting learning journey. So, let’s dive in and explore the wonders of LDR and Quarky together!

Circuit Diagram:

Code:

Follow these steps to implement the code using Pictoblox for Quarky and explore the behavior of the LDR sensor:

  1. Open Pictoblox and create a new file.
  2. From the board menu, select Quarky and connect it to Pictoblox.
  3. Add the “when flag clicked” event block into the scripting area.
  4. Create two variables named “brightness” and “LDR value” from the “my variables” category and set them both to 0.
  5. Add a forever loop to ensure continuous execution of the code.
  6. From the sensor palette of Quarky, drag the block read analog sensor () at pin () and the LDR value equal to the value of this block as shown below.
  7. Map this value to change the range from 0-4095 to 0-255 (0V-5V) and store the result in the “brightness” variable.
  8. Go to the Quarky palette and drag the “set PWM pin() output as()” block. Select D1 from the drop-down menu.
  9. Set the PWM value as the “brightness” variable.

 

With these steps, your script is complete, and Quarky is ready to interact with the LDR sensor.

Output:

Through this exciting project, you have learned about the LDR sensor, its analog characteristics, and how Quarky can control an LED based on the light intensity sensed by the LDR. Delve deeper into the concepts of analog and PWM signals, making your robotics journey even more captivating with Quarky! Stay curious and keep exploring the endless possibilities!

Read More
Learn how to interface an MQ sensor with Quarky to detect the presence of gases like alcohol.

Introduction

The MQ series of sensors comprises a range of gas detectors used to detect multiple gases like CO2, LPG, CO, and more. These sensors find applications in various scenarios, from detecting fire-induced smoke in buildings to detecting gas leaks, making them crucial for mining and other industries.

Buy MQ-137 NH3 Gas Sensor Module Online in India | Robocraze

In this example, we will interface an MQ sensor with Quarky to specifically detect the presence of alcohol. Our objective is to detect alcohol levels and trigger an alarm if they exceed a certain limit. Let’s embark on this exciting journey of gas detection with Quarky!

Circuit Diagram:

Code:

  1. Create the circuit as per the provided circuit diagram.
  2. Open Pictoblox and create a new file.
  3. Select Quarky from the Board menu.
  4. Drag the “if-then-else” block from the controls palette into the scripting area.
  5. From the operator palette, add the “greater than” operator into the “if” conditional part.
  6. Insert the “read analog sensor () at pin()” block from sensor palette Quarky into the space provided in the “greater than” operator block.
  7. As the sensor is connected to A1, set the condition to check if the value generated by the sensor is greater than 50. If it is, it indicates that the gas (alcohol) is above the desired level, and Quarky should trigger the LED connected to pin D1. Otherwise, the LED should remain off.
  8. Drag the “forever” block from the controls palette into the scripting area and place the above code block inside the “forever” block.
  9. Now your script is complete. Add an event to start the script by dragging the “when flag clicked” block from the events palette to the beginning of the script.

 

Script

 

Output

With this exciting project, you have learned how to interface an MQ sensor with Quarky to detect alcohol gas levels. Explore the diverse applications of MQ sensors, from detecting smoke in buildings to monitoring gas leaks in industrial settings. Create your own gas detection system with Quarky, and unleash the potential of gas sensing technology! Keep experimenting, and the world of robotics and AI will become your playground!

 

Output gifs are need to be updated.

 

 

Read More
Explore the functionality of a raindrop sensor, an analog-type sensor that detects changes in resistance upon contact with water.
introduction

The raindrop sensor is an analog-type sensor that effectively measures changes in resistance when it encounters water. This property makes it an ideal choice for detecting rain and water presence in various applications. While typically designed with two pins, there are also versions available with a controller module, effectively converting it into a three-pin sensor for enhanced functionality.

rain drop sensor

Circuit

 

To set up the raindrop sensor circuit, make the following connections:

  • Sensor:
    • VCC: Connect to the 5V power supply
    • GND: Connect to ground (GND)
    • A0: Connect to analog input pin A2
  • Buzzer:
    • Buzzer+: Connect to digital pin D2
    • Buzzer-: Connect to ground (GND)

Code

  1. Add an “if-else” block from the controls palette.
  2. Insert a comparison operator into the “if” block from the operator palette
  3. Check whether the value of the raindrop sensor is below a certain threshold, let’s say 800. From the sensor palette of Quarky, add “read analog sensor () at pin () ” and place it in the blank space of the operator.
  4. If the value is below the set limit, activate the buzzer (alarm) connected to pin D2. Add set digital pin () output as () from the Quarky palette within the “if” block. In the “else” part, ensure the alarm remains off when the raindrop sensor value is above the set limit.
  5. Add the above set of code inside a “forever” block to continuously monitor the sensor’s readings.
  6. Finally, add a “when flag clicked” block at the start of the code to initiate the raindrop sensor monitoring.

Script

Output

 

 

Read More
Learn how to interface a joystick with Quarky, the versatile microcontroller, to control the movement of Quarky Robot.
Introduction

A joystick is an input device used to control the movement or actions of a computer, video game console, or other electronic device. In gaming, joysticks are often used to control the movement of characters or vehicles in a virtual environment. They provide analog input, meaning the degree of movement can vary based on how far the handle is pushed in a particular direction. In aviation and flight simulation, joysticks are commonly used to simulate the control of aircraft, providing pitch, roll, and yaw inputs. Some advanced joysticks also come with additional features such as throttle controls, programmable buttons, and force feedback to enhance the gaming or simulation experience. below is a simple animation of a joystick.

 

 

In this example, we’ll be interfacing a joystick with Quarky and try to read the values of the joystick along the x and y axis let’s begin!!

Circuit Diagram

 

 

connection

JoyStick       Quarky

GND                          GND

5V                                  V

VarX                             A1

VarY                              A2

 

Code

  1. Connect JoyStick as per the above connections.
  2. Open pictoblx and create a new file.
  3. Select Quarky from the board menu.
  4. From events palette drag when the” flag clicked “block into the scripting area.
  5. Now add a “forever ” loop from controls palette
  6. A say() block from the looks palette
  7. from the sensor palette of Quarky add “read analog sensor () at pin()”  in place of hello. and select “joystick X” at pin A1 from the dropdown. 

Now run the code, with this simple script, you will be able to read the value of the joystick along for X-axis in forward, backward, left, and right. with these values you will be able to set the logic on different values for fixing the direction as forward, backward, etc. do same for finding values for Y-axis.

Task for you.

Try to print the value of both the axis together

Output

Read More
All articles loaded
No more articles to load