Thứ Ba, 11 tháng 12, 2018

DIY Plant Monitoring System

Introduction

Monitoring plant health is very important for their fast growth. In this busy world, people usually forget to water their plants which leads to bad growth and health of their plants. For ensuring complete development of plants it is necessary to develop proper surrounding conditions in which plants grow. We are now going to make a small DIY Plant Monitoring system whose data will be displayed on the evive screen. The evive screen will display the following data:
  • Moisture sensor will sense the amount of moisture present in the soil.
  • Humidity of the surrounding is sensed by Humidity sensor DHT11 sensor.
  • Temperature of the surroundings is sensed by the Humidity sensor DHT11.
  • Amount of sunlight is sensed by the LDR sensor.
Video Player
00:00
00:44

Components Required

Building Guide

Step 1: LDR sensor

LDR  (wikipedia)  are light sensitive devices most often used to indicate the presence or absence of light or to measure the light intensity. An LDR can be applied in light-sensitive detector circuits and light-activated and dark-activated switching circuits.
How does LDR sensor work?
The resistance of a photoresistor decreases with increasing incident light intensity. In other words, it exhibits photoconductivity. A photoresistor is made of a high resistance semiconductor. In the dark, a photoresistor can have a resistance as high as several megohms (MΩ), while in the light, a photoresistor can have a resistance as low as a few hundred ohms.

Step 2: Setting up the circuit for LDR sensor

The circuit of LDR sensor is explained below
  • One end of LDR is connected through jumper wire(red wire ) to the 5V power supply in the evive board.
  • Another end of LDR is soldered with 10K resistor. Through the common junction of LDR and 10K resistor, a jumper wire is taken and hooked into the analog input(here we have used A1 pin number in the evive board) of the evive board.
  • The free end of the resistor is grounded with the help jumper wire(to make it more attractive the circuit can be placed inside the straw).
      

Step 3: Soil Moisture sensor

Soil moisture sensors (Wikipedia) measure the volumetric water content in the soil. The two probes of moisture sensor are connected to LM293 comparator. This sensor uses the two probes to pass current through the soil, and then it reads that resistance to get the moisture level.
How does soil moisture sensor work?
The Soil Moisture Sensor uses capacitance to measure the water content of soil (by measuring the dielectric permittivity of the soil, which is a function of the water content).M393 IC do the voltage comparing here, a reference voltage (UR) is set by the adjustable potentiometer, when the analog output value over this value, the LM393 comparator  will output a digital value to indicate this sensor is triggered by reaching this setup threshold.For more visit soil-moisture-sensor-interfacing-evive

Step 4: Setting up the circuit for soil moisture sensor

The circuit of soil moisture sensor is explained below:
  • + pin of the comparator is connected to the 5V pin of the evive board.
  • – pin of the comparator is connected to GND pin of the evive board.
  • Out of AO(Analog output) and DO(digital output) AO pin is connected to the analog pin(here in our code we have used A0 pin) of the evive board.

Step 5: Humidity and temperature sensor

DHT11 is a temperature and humidity sensor which uses a capacitive humidity sensor and a thermistor to measure the surrounding air and spits out a digital signal on the data pin (no analog input pins needed).

How does Humidity and temperature sensor work?
The DHT11 Humidity and Temperature Sensor consists of 3 main components. A resistive type humidity sensor, an NTC (negative temperature coefficient) thermistor (to measure the temperature) and an 8-bit microcontroller, which converts the analog signals from both the sensors and send out single digital signal.
 

Step 6: Setting up the circuit for humidity and temperature sensor

The connections between humidity and temperature  sensor are explained below
  • + Pin is connected with the female jumper wire and the male end to the 5V power supply on evive board. 
  • – Pin is connected with the female jumper wire and the male end to the ground on evive board.
  • OUT Pin is connected with the female jumper wire and the male end to the digital pin.

Step 7: Upload the code

After the circuit has been set up upload the Arduino code. The data will be displayed on your evive screen.

Step 8: Output

The values of the soil moisture sensor, plant temperature and humidity and energy state is displayed on the evive screen.
Video Player
00:00
00:44

Circuit Diagram

DESCRIPTIONCIRCUIT DIAGRAM
The sensors are connected as shown in the circuit diagram. Moisture sensor and LDR sensor are connected to analog pin A0 and A1 respectively whereas Humidity Temperature sensor is connected to digital pin 2.

Code

DESCRIPTIONDOWNLOAD CODE
Arduino Code for Plant Monitoring System and required LibrariesDownload
evive LibraryDownload

The Breakdance Showdown - Game cuộc tranh chấp

Introduction

The greatest Breakdance showdown is back in town, and the best breakdancer the town has ever seen, i.e. your best friend, is all set to break the floor! However, like any other showdown, there are rules:
  • As long as you don’t play the drums, the dancer cannot dance.
  • The dancer should finish his moves during the time the drums are played; as soon as they stop, her should stop as well.
Let’s make the game and watch the dancer steal the show! 

Building Guide

Step 1: A quick recap of Scratch

Scratch is a visual programming language that helps kids and budding programmers, to learn how to code, i.e. how to write a program in a fun, educational, and easy way using pieces known as blocks. This makes learning coding nothing but a jigsaw game that helps develop problem-solving and decomposition skills.
We will be using mBlock, a software based on Scratch for making our game. If you don’t have mBlock installed in your laptop/PC, visit here for detailed instructions on how to install it.
There are four basic elements for programming in mBlock:
  1. Stage
  2. Sprites
  3. Script
  4. Blocks
There are two modes in Scratch using which you can work:
  1. Scratch Mode
  2. Arduino Mode

Scratch Mode

In Scratch mode, which is the default mode in mBlock, you can run the script and control evive as long as it is connected to your laptop/PC; the moment you remove the USB you cannot use the script to work with evive anymore.

Arduino Mode

In Arduino mode, the blocks are transferred to Arduino C++ in Arduino IDE, and then you can modify the code in Arduino IDE. Another important aspect of Arduino mode is that you can upload the code to evive using this mode only.
To know more, please visit here.
We are going to make this game in Scratch Mode.

Step 2: Setting up the Stage

Before beginning with anything else in the game, it would be best to change the boring white backdrop to some quirky and lively. Follow the steps below to change the backdrop:
  1. Open mBlock; if already open and working on a project, save that project. Then, click on New.
  2. Go to the Stage palette and right click on the image icon; the Backdrop Library will open.
  3. From the library select the spotlight-stage backdrop and click on OK.
The stage is all set for the showdown to begin!
To know more about Stages, please visit here.

Step 3: Bringing in the Dancer

Now that the stage is ready, it’s time to bring in the Dancer sprite. Follow the steps below to import the Dancer sprite:

  1. Go to the Sprite palette and right-click on the Panda sprite. select delete from the drop-down menu.
  2. Now, click on the cartoon-like character icon; it is in the top-right corner of the Sprite palette. On doing so, the Sprite Library will open.
  3. Select the Breakdancer1 sprite from the library and click on OK.

Step 4: Script for the Dancer

Now that the dancer is on the stage, it’s time to write his Scratch Script. Follow the steps below to write the script:
If you’re working with evive in Scratch mode for the first time, or have uploaded the Arduino firmware previously, first upload the Scratch fimware; you can find the procedure to do the same here.
  1. Go to the Events palette and drag and drop the when I receive () block in the Scripting Area. Select new message… from its drop-down menu and write drum in the dialogue box that appears; click on OK.
  2. Go to the Looks palette and drag and drop the switch costume to () block below the when I receive () block. Select breakdancer1-a from the drop-down menu.
  3. Go to the Control palette and drag and drop the wait for () secs block below the switch costume to () block and write 0.2in the space.
  4. Repeat step 2; this time select breakdancer1-b.
  5. Repeat step 3.
  6. Repeat step 2; this time select breakdancer1-c.
  7. Repeat step 3; this time write 0.1 instead of 0.2.
  8. Go to the Looks palette and drag and drop the say () for () secs block below the third wait for () secs block. Write ‘And that’s how you breakdance!’  in the space next to the word say, and 1 in the second space.
Below is the complete script:

Step 5: Assembling the Drum

The procedure for placing the drum on the stage is the same as bringing in the dancer. After importing the Drum1 sprite from the Sprite Library, drag and drop the drums in the bottom-right corner of the stage.
You must have noticed that the drums are a bit big for the stage! In the Block palette there is a block inside the Looks palette that can help us reduce the size of the drums to suit stage. Follow the steps below for reducing the size of the drums:

  1. Go to the Looks palette and drag and drop the set size to () % block in the Scripting Area.
  2. Write 55 in the space in the set size to () % block.
  3. Double click on the block; as soon as you do so, the drum will become almost half its original size.

Step 6: Script for the Drum

Now it’s time to write his Scratch Script. Follow the steps below to write the script:
Before you begin writing the script, make sure that the drum sprite is selected. When you do so, you’ll notice that the Scripting Area becomes empty.
 
  1. Go to the Events palette and drag and drop the when this sprite clicked block in the Scripting Area. This block ensures that script for the drum sprite will run whenever you click on it in the stage.
  2. Drag and drop another when this sprite clicked block in the Scripting Area; or you can simply copy the first block by right-clicking on it and then selecting duplicate from the drop down menu.
  3. From the Events palette drag and drop the broadcast () block below one of the when this sprite clicked block and select ‘drum‘ from the drop-down menu.
  4. Go to the Looks palette and drag and drop the switch costume to () block below the second when this sprite clickedblock; select drum2 from the drop-down menu.
  5. Now, go to the Sound palette and drag and drop the play drum () for () beats block below the switch costume to () block; select 1 from the drop-down menu and let the number of beats be 2.5.
  6. Repeat step 5; this time select 2 from the drop-down menu.
  7. Repeat step 5; this time select 3from the drop-down menu.
  8. Repeat step 5; this time select from the drop-down menu.
  9. Repeat step 5; this time select from the drop-down menu.
  10. Repeat step 5; this time select from the drop-down menu.
  11. Go to the Looks palette and drag and drop the switch costume to () block below the second when this sprite clickedblock; select drum1 from the drop-down menu.
Below are the 2 scripts for the drum:
Script 1
Script 2


Go to the stage and click on the drum-1 sprite; when you do so, the dancer will perform his moves. As soon as the drum stops playing the dancer will stop.

Code

DESCRIPTIONDOWNLOAD CODE
Scratch Script: The Break-dance ShowdownDownload

Bài đăng mới nhất

ALEPH-M CLASS A ANFİ DEVRESİ N KANAL MOSFET

Aleph-M çıkış gücü yaplaşık olarak 35w Class A sınıfı anfi için oldukca iyi bir değer çıkış modfetleri n kanal 2 adet irfp240 kullanılmış be...

Bài đăng phổ biến