Flowchart Terminal, input/output, Process, Flow lines and decision and examples

Flowchart

Flow chart:

Flowchart is a pictorial representation of the algorithm that uses different types of boxes each box in the flow chart denotes a specific instruction of the algorithm. actual instruction of the algorithm is written in its box. each instruction in the box must be clear but short. These boxes of the flow chart are connected with each other with solid lines. These lines have arrow marks at one end which shows the directional flow of the operation. Operation wrote in the flow chart written in such a sequence in which it will execute.

Basically an algorithm first represented in the flow chart from then this flow chart is expressed in any programming language to prepare a computer program. The algorithm expressed in the flow chart format is basically the directional representation of the logic. it is not concerned with the detail of the logic but simply shows the main theme of the algorithm. It is very easy for any programmer to code the algorithm while taking logic from the flow chart.

A flow chart is a picture of the logic of the program. It is a simple method to assist the program in a layout in a visual. the flowchart provides a complete road map to programmers of the algorithm to follow steps expressed in the flow chart and generate an errorless program.



Advantages of flowchart:

  • a flowchart is very simple to express the logic of the algorithm.
  • Provide flow of operation is very simple manner.
  • Provide a complete layout of the algorithm to the program.
  • Each box contains clear information on the logic to be executed at each step.
  • Easy to find the start and endpoint of the algorithm.
  • The result of the algorithm can be generated with a dry run using a flow chart.
  • The error can be reduced while drawing a flowchart.
  • Provide flexibility for modification in the algorithm to add or remove any function.

Disadvantages of flowchart:

  • Difficult to understand each symbol process.
  • Instruction is written in the symbol some time very difficult to understand due to its conciseness.
  • Error at any step may result in wrong direction of the flow.
  • A wrong entry in any symbol results in wrong logic representation of the algorithm.


Flow chart symbols:

As discussed that flow chart Is basically the combination of the different symbols and each symbol in the flow chart has its own functionality. these symbols are given as under:

Terminal:

Flowchart

As its name shows that it is used to represent the beginning (START), Pause(HALT)and ending(STOP) function in the program logic flow. When we start flowchart it is the first symbol which we enter into our flow chart if program use calls for a pause where pause statement calls normally in a program in some sort of the error condition then for that logic terminal also uses in addition terminal use to end any flowchart logic, in other words, we can say that terminal is the end to end flow chart logic with error conditions.



input/output:

the input/output symbol is used to denote any function of an input/output device in the program logic. If the program contains any function which is used to take data as input from an input device then input/output symbol used to represent the function. Data taken by the input/output symbol will provide in the program for further execution.

Data can be input from the terminal disk magnetic tap card reader or any input device that steps will be indicated in the input/output symbol in the flowchart. In addition, this symbol also uses to represent the output instructions of the algorithm in the flow chart. The output of the program may be taken from the execution process step or printer terminal screen or any other output device.

Flowchart

Process:

This symbol contains all the arithmetic and data movement instructions in the flowchart. All arithmetic functions addition subtraction multiplication division etc. while in case of data movement logical processing symbols denote logical data movement from one main memory location to another location. in a special case when we have more than one arithmetic instruction or data moving instruction which has to be performed more than once and continuously then these instructions placed in the same process symbol box and they are assumed to be executed in the order of their experience.

Flowchart

Flow lines:

Flow line are with arrowhead and are used to indicate the direction of the operation were direction of the operation means it shows the exact sequence in which the instruction will execute. The normal flow of the flowchart is from top to bottom and left to right. Arrowhead are required only when the normal top to bottom flow not to be followed. But good drawing practices tell that fin a flow line will be with arrowheads.

The main advantage of using arrowheads is that it avoids the ambiguity from the program . another point of the good drawing practice is that flow lines do not cross each other and such kind of intersection must be avoided.

Flowchart


Decision:

A decision symbol is used in a flow chart to show a point where a decision has to be taken and as a result of the decision a branch to one or more than one alternative point is possible. In a decision path, all the possible exit paths must be defined clearly. Some of the decision symbols are given as under:

Two-way branch flowchart

Flowchart

There are two possible exit path of the decision if decision instruction condition results in true which means that A>B then flow will follow in downward direction if given condition result false then data flow will follow path right to the decision symbol .flow line at the top of the decision symbol indicates that data enters in the decision symbol from that this path.

Three-way branch flowchart:

Flowchart

Multiple-way branch flowchart:

Flowchart

Examples of Flowchart:

A few examples of the flow chart are given as users to learn how data flows from one direction to others during a process. In the flowchart example, we will able to learn the direction of data in two or more options. flowchart contains more than one path for a single data to either take one path or another path this decision of data flow remains active data will follow path specified for that condition. this process of data flow from continues from start to end. Some of the flow charts are given as under:


I myself, whenever I think of a new project, I usually sit and think for an hour or two and start asking myself some questions.

Why am I making this project?

Which hardware components I will need?

How all the components will be connected?

How I will read sensors and make certain decisions “Programming”?

Let me explain this with the help of an example. Let’s say I want to work on a soil moisture monitoring system, which can automatically turn ON and turn OFF the Water Pump.

The first question, Why am I making this project?

I want to make an automatic plants watering system. Whenever the soil gets dry the controller turns on the water pump automatically, and whenever the soil has the enough moisture/water the water pump is turned OFF automatically.

The 2nd question, which hardware components I will need?

For this project, I will need a controller board Arduino Uno, or Arduino Nano, or Arduino Mega, or any other controller board. But I will go for the Arduino Uno. I will also need a soil moisture sensor, A relay Module, 12v DC water Pump, 12v Adaptor, and some connection wires.

The third question is, how all the components will be connected?

This usually consists of a circuit diagram. Which you have to make. Let’s say the circuit diagram is also ready, you are satisfied with all the connections.


Soil Moisture monitoring system flowchar:

Final step is programming. But before the programming Flowcharts are developed. Right now I have things going on in my mind about the program/algorithm. Like

  • First I will initialize pins for the soil Moisture sensor and relay module to control the water pump.
  • I will declare some variables for storing the soil moisture value.
  • I will go through basic setup, in which I will tell the controller which pins are the input and which pins are the output. What is the baud rate etc.
  • Some conditions to check the soil moisture, if the soil moisture is greater then turn OFF the motor and if the soil moisture is less then turn ON the motor, otherwise do nothing and keep reading the soil moisture.

So this is basically the logic development. Now if I write the above things in the pictorial/boxes form this will become the flowchart.

Flowchart

This is really a good programming practice to first develop the flow charts and then start working on the programming. This way you won’t forget anything. Above is the flowchart of the soil moisture monitoring system. We will explain everything in detail.


Arduino based Soil Moisture monitoring system flowchart detail:

This is the same flowchart which is given above. This time I am going explain this. When the program starts, first of all, the variables are initialized, which can be the Arduino Uno Pins, or any other Controller board pins. This step also consists of the data variables. Next, step is the setup function which reminds the programmer to tell the controller about the pins, which pins are the input and which pins are the output, set the baud rate and other basics things. Then the infinite loop which is the void loop() function in the Arduino Programming.

There are two conditions which are used to compare the two variables M and P. M is the variable which stores the value coming from the Soil Moisture Sensor and P is the variable which stores the pre-defined value. The two variables are compared if M < P then turn ON the motor else the control transfers to the next condition. If M > P then turn OFF the motor else the control is transferred to the beginning and again starts comparing the variables. This process continues forever and stops only if the program is stopped I.e. when the Arduino Uno board is turned OFF.

Flowchart of over Voltage system using  Scada for Plc and Arduino:

Flowchart

The boxes from start to the infinite loop are exactly the same as explained earlier. Let’s discuss the two conditions. The first condition checks if there is a High signal from the Overvoltage circuit then give a signal to the PLC input and the plc then sends data to the SCADA application. If there is no signal from the Overvoltage circuit then the control transfers to the second condition where the Arduino checks if there is any signal from the SCADA application, if there is a signal/command from the SCADA application then the Arduino sends a command to the SCADA application to turn on the specified load and if no signal/command then the control is transferred again to the beginning.

So from this flow chart, we can clearly see, that the purpose of this program is to monitor the Overvoltage and control the electrical loads using the computer SCADA application.



Arduino based Solar Tracker Flow chart :

Flowchart

The direction of rotation of the DC motor is controlled using the two LDR’s. Depending on the High and Low signals from the two LDR’s the H-bridge is controlled accordingly. For more information, you can read my article on the Arduino based Solar tracker.



How to make Arduino led blink flowchart

flowchart

 

Recommended For You

Fawad

About the Author: Fawad

My name is Shahzada Fawad and I am a Programmer. Currently, I am running my own YouTube channel "Expertstech", and managing this Website. My Hobbies are * Watching Movies * Music * Photography * Travelling * gaming and so on...

Leave a Reply

%d bloggers like this: