Hello readers, I hope you all are doing great. In our previous tutorials on raspberry pi Pico, we discussed the basic features, architecture, download and installation of development environments for raspberry Pi Pico programming. In this tutorial, we will learn how to access and control Raspberry Pi Pico and its GPIO pins to implement LED blinking using MicroPython.
Raspberry Pi development boards are quite popular and frequently used among students and hobbyists. But the drawback of Raspberry Pi is their cost i.e., around $35-$45. So when cost of the development board is of prime importance the users prefer to use ESP8266, ESP32, Arduino, PIC etc. over Raspberry Pi. To overcome this drawback, Raspberry Pi foundations designed a new board i.e., Raspberry Pi Pico which is a cost effective solution for costlier Raspberry Pi boards.
Raspberry Pi Pico is a cost-effective development platform designed by Raspberry Pi which has enough processing power to handle complex task. It is a low cost and yet powerful microcontroller board with RP2040 silicon chip.
We have already published tutorials on how to download and install the above mentioned software components.
Follow the given link for detailed study of Raspberry Pi Pico: https://www.theengineeringprojects.com/2022/04/getting-started-with-raspberry-pi-pico.html
We have already published a tutorial on installing Thonny IDE for Raspberry Pi Pico Programming. Follow the given link to install the IDE: https://www.theengineeringprojects.com/2022/04/installing-thonny-ide-for-raspberry-pi-pico-programming.html
The Raspberry Pi Pico board comes with an onboard LED which is internally connected with GPIO 25. So first we will discuss how to access the on board LED and then will interface an external one.
Fig.
Steps included in programming the Raspberry Pi Pico to make the onboard LED to blink are:
“from machine import Pin, Timer”
“led = Pin(25, Pin.OUT)”
“ led.toggle()”
Fig. Save the program
Fig. Run the code
Note: If you are already running a program on Raspberry Pi Pico board then press ‘Stop’ before running a new program.
from machine import Pin, Timer
led = Pin(25, Pin.OUT)
timer = Timer()
def blink(timer):
led.toggle()
timer.init(freq=2.5, mode=Timer.PERIODIC, callback=blink)
Fig. Blinking On-board LED
Table 1
Fig. Iterfacing LED with Raspberry Pi Pico
Steps included in programming the Raspberry Pi Pico to make the peripheral LED to blink are:
“from machine import Pin”
“import time”
Create an object ‘led’ from pin14 and set GPIO pin14 to output.
“led=Pin(14,Pin.OUT)”
“while True:"
“led.value(1)”
“time.sleep(1)”
“led.value(0)”
Fig. Interfacing and Blinking LED with raspberry Pi Pico
from machine import Pin, time
led=Pin(14,Pin.OUT) #Creating LED object from pin14 and Set Pin 14 to output
while True:
led.value(1) #Set led turn ON
time.sleep(1)
led.value(0) #Set led turn OFF
time.sleep(1)
This concludes the tutorial, we hope you find this of some help and also hope to see you soon with a new tutorial on Raspberry Pi Pico programming.
Running a business is not an easy job. It requires a lot of deliberate effort and careful attention to run business processes successfully. Some tasks involved are repetitive and time-consuming, making it difficult for you to do them manually. This is where workflow automation comes in handy that doesn’t require human intervention and can be used to effectively manage and execute business processes.
Curious to know about Top 10 workflow automation software?
Scroll on.
Workflow is a process that requires a lot of steps to be completed in a sequential manner. The process goes from start to finish and normally involves people or systems.
Workflow automation software is a tool used by most businesses to automate repetitive and time-consuming tasks. This tool is usually employed to improve employees’ efficiency, reduce errors and increase revenue. From lead management, sales, and marketing, to finance and accounting, this tool is used to automate manual processes. Some software come with flexible customization options, allowing you to develop and modify workflows as per the business needs.
Mainly two types of software are used: no-code tools and low-code tools.
No-code tools come in simple drag-and-drop and flow chart settings that you can use with no coding skills or technical expertise while low-code tools, on the other hand, require a little bit of technical knowledge to get a hands-on experience of them. But don’t worry, you don’t require a software degree to use them, if you pay careful attention, you can learn them yourself on the go.
Listed below are the top 10 workflow automation software used by organizations.
Zapier is a user-friendly automation tool that helps you automate business processes. It comes with thousands of pre-crafted templates that you can customize based on your business needs. Building a zap is just one click away. Plus, you can add tailor-made workflow logic and multiple steps to automate tasks that would otherwise be completed manually.
Nintex is an intelligent no-code workflow automation tool that helps you easily optimize and manage processes. Trusted by more than 10,000 organizations, Nintex allows you to create result-driven workflows with a workflow cloud which means your data is managed and stored over the internet. Setting you free from creating and managing in-house data centers. Automate the manual, repetitive, and time-consuming tasks with just a few clicks.
Kissflow is a market leader in workflow automation that allows users to develop workflows with the visual builder. Integrated with a sleek interface and drag-and-drop settings, Kissflow helps companies to speed up the workflow processes from all-in-one workflow automation software. Moreover, the notification alert option gives you a deep insight into the performance of complex workflow automation processes.
Integrify is a user-friendly workflow automation software that facilitates in building file approval workflow and custom documents. Plus, it incorporates a visual drag-and-drop builder that lets you visualize the workflows as you develop them. Its form builder allows you to monitor workflow automation, giving you an insight into inefficiencies so you can find areas for improvement.
Flokzu is a workflow automation software that allows you to develop visual workflow models with a visual builder. It is a cloud-based process management tool that features a real-time reporting dashboard allowing you to get a hold of each stage your process is in, so you can make educated decisions for your future outcome. Gives you notification of each pending task, and as the pending task is completed, it automatically assigns a new task to the user.
Trusted by over 30,000 organizations from small enterprises to Fortune 500, automate.io is a process management automation software designed for industries where you can create simple workflows or sync data between two different apps. You can sequentially automate tasks in different business processes including lead management, sales outreach, content marketing, social media marketing, and more.
Processmaker is a low-code automation tool used to create approval-based workflows with ease. A notification alert system allows you to get real-time reporting about the tasks to be created so you know exactly what’s happening inside each process. Industries that can benefit from this tool include healthcare, insurance, banking, higher education, manufacturing, and telecom.
IFTTT stands for If This, Then That. It’s a powerful tool that works on conditional statements (called Applets) and executes processes when these conditions are met. It is mainly used to connect apps and allow services and devices to work together. Most popular applets are used in building a smart home environment. For instance, turning on the device with your voice, powering the security system upon leaving your home, and determining the temperature using the weather.
Trusted by over 152,000 customers worldwide, Monday is an open-source automation tool to streamline your everyday tasks. Build and customize workflows to improve the collaboration and productivity of your team. Stay connected with real-time notifications, so you know the performance of each task completed.
Asana is a project management software designed to remotely manage teams and assign tasks with one integrated platform. You can collaborate and build strategic project plans from anywhere. The notification alert feature gives you an insight into when the task is completed and what’s new on the table. Allows you to automate routine work so you can pay attention to what matters and adds value to your team.
Workflow automation is critical for business growth. When repetitive and manual tasks are automated, you can improve the productivity of your team by paying attention to the actual business objectives. Using technology to your advantage is the best way to excel and grow in this digital transformation stage and leave a footprint in the competitive market.
That’s all for today. Hope you’ve enjoyed reading this article. If you have any questions, you can ask me in the section below. I’ll help you according to the best of my knowledge. Share your experience if you have used any workflow automation software before. Thank you for reading this post.
Keywords
ESP32, IoT, Temperature sensor, Humidity sensor, Pressure sensor, Altitude sensor, Arduino IDE, ThingSpeak.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | ESP32 | Amazon | Buy Now |
The evolving generation of wireless technology has made human life a lot easier. Where everything is online and automatic we can easily monitor multiple things virtually from anywhere in the world. The WSN (wireless sensor networks) and Internet of things or IoT play an important role in implementing and accessing these wireless technologies. Smart homes, smart cities and smart weather monitoring systems are examples of such technologies where things are quite simpler or easier.
In this web-server based weather monitoring system, the weather data (from the surrounding environment or of a particular location) like temperature, humidity, pressure etc. is measured with the help of some sensors and then the collected data will be stored on a server after being processed by a microcontroller. Our daily activities are inseparable from weather conditions and various environmental factors. The real-time data collected can be used in research and analysis and the results can be helpful in human life and for improving environmental conditions as well.
The Internet of Things is a system made up of multiple inter-related computing devices. The main factor ‘things’ in IoT is designated to a component that is capable of communicating data over a network (IoT), the thing could be animals, a digital machine, a sensor, a human being etc. Each component of the Internet of Things network is given an individual or a distinct identity and the ability to communicate data or information over a wireless network that is too without the intervention of a human or a computer [8].
An interface medium capable of collecting, controlling, and communicating data among transmitter and recipient electronic equipment or servers is required to build the IoT network[9].
The ESP32 microcontroller series was developed by Espressif Systems. This module (the ESP32) includes a 2.4GHz Wi-Fi chip, memory, a 32-bit Tensilica microcontroller, an antenna, peripheral interfacing abilities, power management modules, and more. This ESP32 module is excellent for the Internet of things because of all of its technological and infrastructural aspects [10].
DHT11 and BMP280 sensors are used to collect the data from their surrounding environment and then communicate the data to the ESP32 module over a particular protocol [11].
The application of this weather monitoring system can also play an important role in the field of agriculture[12 ] to increase productivity, research application, and reducing manpower (by reducing the need to manually monitor the field status). Sometimes in a particular agricultural zone that is hazardous for a human beings, it is quite difficult to manually (offline) monitor the environment or weather conditions. In such cases, this web server based or online weather monitoring system can be of great importance.
Fig. 1
The list and quantity of the components required to implement the web server based weather monitoring system are shown in Table1.
Table: 1
Fig. 2 DHT11 sensor
DHT11 sensor (or temperature and humidity sensor) is a sensor module used to measure humidity and temperature from its surrounding. This sensor module is responsible for monitoring the ambient temperature and humidity of a given area. An NTC (negative temperature co-efficient) temperature sensor and a resistive type humidity sensor make up the sensor. An 8-bit microcontroller is also included. The microcontroller performs ADC (analogue to digital conversion) and outputs a digital signal via the single wire protocol [13].
Some of the technical specifications of the DHT11 sensor are:
Table:2 DHT11 technical specifications
DHT11 sensors can also be used to create a wired sensor system with up to 20 meters of cable.
To measure temperature and humidity, two DHT modules (DHT11 and DHT22) are available on the market. Both modules serve the same purpose, but they have different specifications. The DHT22 sensor, for example, has a wider range of temperature and humidity sensitivity. However, DHT22 is more expensive than DHT11. As a result, you can choose to use any of the modules as per your needs.
Table.3 Interfacing DHT11 with ESP32
Another sensor we are using is the BMP280. The BMP280, also known as the barometric pressure sensor, is a temperature, pressure, and altitude sensor. This sensor's small size and low power consumption make it suitable for mobile applications, GPS modules, and battery-powered devices, among other things[15].
The Bosch BMP280 is based on Bosch's validated ‘Piezo-resistive pressure sensor technology’, which features high accuracy, long-term stability, linearity, and EMC robustness.
The barometric pressure sensor (280) is the successor to the BMP180 sensor, and it is mostly preferred in all areas where precise temperature and pressure measurements are required.
Fig.3 BMP280 Sensor
Fitness, indoor navigation, and GPS refinement are all new technologies which require relative accuracy, and the BMP280 is ideal for them. This module is preferred over the other available modules for temperature records or measurement because of its low TCO (Temperature coefficient of Offset).
The temperature measured with the BMP280 sensor is more accurate than the DHT11 sensor. BMP80 provides a 0.01°C accuracy rate.
Some technical specifications of the BMP280 sensor are:
Table:4 BMP280 Technical specifications
A web server is a place where one can store data online and can access that data at any time and from anywhere in the world [16]. A real-time data is created with the help of a web-server. There are various web services available to store real-time data for research and analysis like AWS (Amazon Web Service), Azure, Firebase etc.
We are using the ThinSpeak web service provided by MathWorks which allows us to send sensor readings/data to the cloud. The ThingSpeak is an open source data platform for the Internet of Things (IoT) applications. We can also visualize and act on or access the data (calculate the data) sent to the ThingSpeak server from ESP32. Two different types of channels are available to store data on the ThingSpeak server namely ‘Public Channel’ and ‘Private Channel’ and one can use either of the available channels to store and display data [17].
ThingSpeak is frequently used for IoT prototyping and proof-of-concept systems that require analytics[18].
We need to give instructions to our ESP32 module so that it can interface, read data from DHT11 and BMP280 sensors and then finally publish the collected data to the ThingSpeak server. Arduino IDE is an integrated development environment used to write, compile and debug the program for the ESP32 module[19].
Fig. Arduino IDE
The process flow of our weather monitoring system is shown below in Chart 1. The process starts with the initialization of ESP32 module which is acting as an interface medium between the sensor modules and the web-server. The ESP32 wi-fi module is continuously searching for the network credentials as per the instruction provided. After connecting to the internet the sensor modules will be initialized and the real-time data [22] collected from the surrounding environment will be pushed to the ThingSpeak web server[23].
Flow Chart: 1
The results observed from the implemented weather monitoring system are shown below. We observed four different environmental conditions which include temperature, humidity, pressure and altitude. The sensor data collected by ESP32 from DHT11 and BMP280 sensors is published to the ThingSpeak web server. On ThingSpeak we have created a channel that contains four fields to store four different environmental factors temperature, humidity, pressure and altitude.
Fig. Hardware
In fig. 4 we can see the ‘Field 1’ which is containing the temperature readings published or communicated from the ESP32 module and saved on the ThingSpeak server.
Similarly, fields 2, 3, and 4 are displaying the humidity, pressure and altitude respectively.
Fig. 4 Temperature (°C)
Fig. 5 Humidity
Fig. 6 Pressure (hPa)
Fig. 7 Altitude
Each factor is monitored at different intervals of time to observe the variations in various environmental factors. From table 5 we can see the various environmental factors and their values at different time intervals for the approximate duration of 24hrs.
Table 5 Variations in weather conditions
We observed the weather conditions (that includes temperature, humidity, pressure and altitude) with our “Web-server based weather monitoring system using ESP32”. The observed real time data is stored on the ThingSpeak server which can be accessed globally. The different values of each (mentioned earlier) environmental factor at different intervals in time are also observed (given in table 5) and the observed result clearly shows the changes in the weather conditions for a full day cycle. Hence, we have successfully implemented and tested the web server based weather monitoring system with ESP32 and ThingSpeak web server.
Storing and analyzing big data is essential for process audits. For example, a company’s ongoing shipping audits explained several issues, including patterns of overcharges and delayed deliveries. A customer experience audit can yield similar findings by noting bottlenecks in the customer journey. All of these processes require the input of large sets of readable data.
Businesses need a data normalization process to store and filter raw data into useful information that can inform these valuable processes.
Data normalization is an automated process that organizes information into a database or table. As a result of normalization, data is searchable and verifiable. Normalized data is also easier to scan for errors, such as missing data or redundancies.
Most data normalization tables categorize data by recognizable fields. For example, a table of customer information would most likely contain their names, contact information, and job titles. Company data may contain labels such as product SKUs or employee identification numbers.
Data normalization tables prevent a phenomenon known as inconsistent dependency. This occurs when unrelated data items are entered in the same table. Data input should be logical so that anyone searching for a piece of information knows exactly where to find it.
Many software-as-a-service platforms, such as invoicing or customer management solutions, automatically normalize data. To reduce errors in automated normalization, companies must set a standard format for inputting data. Some commonly used conventions are abbreviations for addresses and job titles, or no hyphens or spaces in telephone numbers. Once data is normalized, it is easier to carry out important data analysis processes, including cleaning and interpretation.
Normalization tables come in several normal forms, known as NFs. Each NF has its own rules for organizing and displaying data. For example, a 1NF table restricts any cell from containing more than one piece of data. Additionally, no entry can be duplicated.
For example, if a data table contains a product that comes in several sizes, each size will be listed as a separate row rather than a distinct column. In a 2NF table, the searcher can pull up a separate table to view all of the color options for a particular product.
As normal forms advance, they build off one another. A 2NF pulls data from 1NF tables, a 3NF from a 2NF table and so on. While there are many normal forms to choose from, most databases only need up to 3NF to process and store data.
Choosing the correct normal form and preparing the data can be time-consuming. As a result, more developers opt to outsource this process to automated software.
As data collection has become ubiquitous, data normalization has become indispensable. Firstly, normalization corrals data into one depository. This reduces storage space by eliminating duplicate information. Browsing through normalized data also saves time as databases contain search functions that quickly identify the needed information.
Normalized data also lends itself well to segmentation. During segmentation, the analyst will filter the data through parameters, such as location, gender, or average purchase value.
Segmentation allows marketers to target specific demographics with tailored messaging. This process can also benefit internal business processes. For example, human resource departments may search for employees demonstrating signs of burnout, such as higher than normal call-outs, and connect them to resources.
Data normalization is also essential for monitoring metrics and performance. Normalization makes it possible to create visual dashboards to measure common indicators such as sales targets, vendor costs, and revenue.
Data normalization is an essential step in any business’s data strategy. As a developer, you can make you and your client’s jobs much easier by considering normalization as you create your projects and database structures.
Most developers follow the decades old principles created by relational database pioneer Edgar Codd. Codd’s 12 rules, since expanded to more than 300, outline the existential criteria for relational database management systems. While no system follows every rule, they are a foundational step for approaching normalization projects.
Hi Guys! Hope you’re well today. I welcome you on board. In this post, I’ll walk you through Introduction to Workflow Automation.
Workflow automation is a critical part to run a successful business. It is used to improve the efficiency and productivity of the business to provide a better user experience, reduce errors and increase revenue. Workflow automation is the process of automating a set of repeatable tasks to achieve a certain goal within the software or app you use.
Confused?
Don’t be.
We’ll touch on this further in the article.
Curious to know more about workflow automation, its benefits, how to choose workflow automation software, and how it can help your business?
Keep reading.
Before we get into the nitty-gritty of workflow automation we must know what workflow is.
Every business is based on a predefined process. It’s the set of activities including manual tasks like creating reports, data transfer, collaborating within the company and more… all these tasks are performed to fulfill the business needs. Workflow guarantees all these processes are planned and executed in a sequential manner by the people or systems to achieve a certain goal.
Know that a workflow image can be a simple flowchart diagram representing a set of activities to reach the desired goal.
And automation is the process that repeats itself without human intervention. It works on WHEN and THEN rules. For instance, when the temperature falls below 30 C, then turn on the AC.
Simply put, workflow automation is automating the workflow – it involves incorporating the automated software system within the company to monitor and control business processes. The software is used to perform a repeated set of steps consecutively to do a certain task. In this process the work goes from start to finish without human involvement, eliminating the manual steps and ensuring the error-free work on time.
The workflow automation you can implement in the business processes includes sales and marketing, human resource, lead management, and more. This way businessmen can pay careful attention to the more important tasks rather than worrying about properly executing the workflow within the software.
The key benefits of workflow automation include:
Choosing the right workflow automation software is a bit tricky. It depends on the workflow processes you want to manage within a business.
There are two types of software used in workflow automation: no-code tool and low-code tool.
The no-code tool works better for the beginner with no technical expertise. Some of these tools come with a drag and drop feature, allowing you to easily customize the workflow for your business process at hand. The low-code tool, on the other hand, requires coding skills to put into practice. Low-code tool doesn’t mean you have to be a tech-geek to get a hold of it. And you don’t require any software degree either, you can learn it easily if you put a deliberate effort and attention.
Other things you must consider while choosing the right tool include:
The tool comes with easy to handle user interface UI which means you can learn it yourself, if it requires technical support at every step, you better skip it.
The tool must be economical and scalable so you can modify it as per the business processes.
The tool must be compatible with your apps. What may fit for other businesses might not work for your business. If everyone is buying it doesn’t mean you also have to buy it. Keep your business processes in mind before choosing the right tool.
Workflow automation sets you free from doing manual repetitive tasks and automates your business processes to improve efficiency and productivity.
Following are the key areas of your business you can automate with workflow automation:
Invoice generation is a crucial task to create a document to bill your clients. When done manually, mistakes are obvious. But with workflow automation, you can automate the invoice generation process to bypass the multiple manual processes. You can use workflow automation software to create the invoice to bill the client month after month for a definite amount. Plus, you can keep a record of the invoices you create for a particular client.
Onboarding new candidates is overwhelming at times. It requires a lot of brainstorming, resources, workforce, and time. However, with workflow automation, this process can be straightforward without the involvement of repeated manual processes. Workflow automation software allows the new candidates to list their information and submit it directly to the HR department. It removes the need for manual tests and check-ups to reach the hiring manager, effortlessly bridging the gap between the company and new candidates.
Quality leads form the basis of any business growth. Manual lead management requires a lot of data filtering and manual follow-ups that slow down the process of reaching potential clients.
Workflow automation allows the companies to discard the low-quality leads, and automate the process to turn the visitors into customers. Moreover, it allows the sales team to streamline the sales funnel process, stuff CRM with the required information, direct new leads to the sales manager, and effectively deliver the products to the customers.
Manual handling of staff expenses is a tedious job. But workflow automation is here to rescue you. At times you spend money on the behest of the company. If you want to have approved those expenses from the company, first you need to write the email to the manager who will approve it and then send it to the accounting department. Everything will be documented in a report before the accounts department refund the money to the employees. However, workflow automation software can simplify this and other manual processes including creating reports, managing travel tickets, approving leave and vacation requests and producing purchase orders, and more.
A workflow automation software is an important tool for your business growth.
Using this tool, redundant tasks are eliminated and repetitive and manual tasks are put on auto-pilot.
Whether or not should you pick the automated workflow software for your business is a tricky question and unfortunately, there is no simple formula to figure this out. However, the business processes that can use automation to drive value include time-bound activities, manual repetitive tasks, lead management, customer support and data entry jobs, and more.
Keep two things in mind while picking the right tool: it meets your business's core objectives and it should be economical.
That’s all about the Introduction to Workflow Automation. If you have any questions in mind, you may ask me in the comment section below. I’ll help you to resolve your query. Keep sharing your feedback and suggestions to help us improve the quality of our content. Thank you for reading this article.
Hello friends, I hope you all are having fun. Today, we are going to share the 7th tutorial of Section-III in our Raspberry Pi Programming Course. In the last tutorial, we interfaced a DHT11 sensor with Raspberry Pi 4. Today, we are going to interface another temperature sensor i.e. DS18B20 with Raspberry Pi 4.
DS18B20 is a popular temperature sensor especially in severe/critical environments i.e. chemical plants, mines, industrial sites etc. because of its 1-wire operational technique and accurate readings up to 4 decimal digits.
Today, we will interface a DS18B20 temperature sensor with Raspberry Pi 4 and will display the values on a 16x2 LCD.
Let's have a look at the components required for this project:
Here's the list of components:
A waterproof variant of this sensor is also available, which encloses the sensor within a cylindrical metal tube. The sensor depicted in the above image will be used in today's project. The sensor's specifications are shown below.
A wide variety of temperature sensors are available. The following are the two most common kinds of temperature sensors:
Contact sensor: Some thermometers use direct contact with an object, referred to as "contact type temperature sensors," to measure the degree of warmth or cold.
Non-Contact sensor: This type of thermometer does not touch the object it is measuring; instead, it measures the temperature based on the radiation emitted from that object. DS18B20 is a non-contact temperature sensor.
Here's the circuit diagram of the DS18B20 temperature sensor and a 16x2 LCD display, connected with Raspberry Pi 4:
Now, let's design this circuit on a breadboard with the help of Jumper wires. When everything is connected, my hardware will look like this.
We have designed our circuit, so it's finally time to write the Python code for DS18B20 with Raspberry Pi 4:
Before start working on our code, we need to first install the LCD Python library and enable the 1-wire protocol in RPi board.
We need to install Raspberry Pi's Adafruit LCD library to display the temperature on the LCD screen. Using Adafruit's library, we can easily operate the LCD in 4-bit mode. So, follow the below instructions to install Adafruit Python Library:
Any project on GitHub can be cloned using Git. Since the library is hosted on Github, we'll need to set up a Git before installing this library.
That's all there is; the library should now be operational. In the same way, let's install the 1-wire library for DS18B20 sensor.
If we want to connect with the DS18B20 sensor via a One-Wire approach, we must have to enable the One-Wire Protocol in Raspberry Pi first. So, follow the below instructions:
This is what you can expect to see in your terminal windows:
You can see the sensor's readings on the terminal as a result of these commands. The image below shows a red arrow pointing to the temperature. The current temperature in my home is 37 degrees Celsius.
Here's the complete Python Code to display the temperature from DS18B20 on an LCD display with Raspberry Pi 4:
So, let's understand this Pi code for LCD display and One-Wire communication. I've broken down the code into smaller, more digestible chunks below to make it easier to understand.
DS18B20 Python Code Explanation
Importing the necessary header files is always the first step in a new program. Time and the LCD header are imported here to use the LCD with Pi.
It is important to mention the Display pins linked to the Raspberry GPIO. Consult the diagram above if you're unsure of the pin numbers for specific GPIO pins. Once the pins on the PI to which the LCD is connected have been declared, use these lines of code to initialize the LCD display.
Once the LCD has been initialized, we show a sample text message. To indicate a new line, the character 'n' is used. There is a delay of two seconds before users can begin reading the intro message.
Make sure you remember what you did in step 4 in order to enable the one-wire interface on your Pi. For this reason, we are using the os.system function to repeat the code. Afterwards, a file path is supplied where the temperature value will be read from. We can't open the folder since we don't know its exact name. The device folder variable connects to the '28-' folder using the * symbol. The temperature value is stored in a file with the name device file, which is also in that folder.
Then we create a get temp method, which specifies how to read the temperature from the file we previously linked. There will be a file containing the temperature data; however, the format will be as follows:
We only need the temperature value, which is 37000, from this. A reading of 37.00°C can be seen in this instance. After trimming all the unnecessary information from this type of text, we must next divide 37000 by 1000.
Using the lines variable, the file's lines can be parsed. A search for "t=" is done in these lines, and in the variable temp string, the value that comes after that letter is recorded. Finally, we perform division on the string value with 1000 in the variable temp c to obtain the temperature value. Finally, the code should output the temp c variable.
To display the current temperature on the LCD panel, we merely need to invoke the previously described function inside the infinite while loop. Every second, we refresh the LCD display to show the current value.
Use the code provided at the end of this page to compile it on your Raspberry Pi and see what happens. Before running the application, Install the display libraries and enable a one-wire connection on the Pi. You can now run the application and see if everything went well; if so, the intro text should be visible. Adjust the contrast potentiometer, if necessary. What you'll see when it's all done is shown in the below images:
Temperature sensors can be used in a variety of ways, so here are some examples.
In this lesson, we have studied how to use Raspberry Pi's GPIO pins to connect DS18B20. In addition, we looked into the sensor's fundamental principles and current-day usefulness. We also designed a circuit that we later programmed to collect temperature readings using the temperature sensor and perform a little calculation and display it on the LCD screen in degrees Celsius. In the next tutorial, we will interface the BMP180 Air Pressure sensor with Raspberry Pi 4. So, stay tuned. Have a blessed day.
Hello friends, I hope you all are doing great. Today, I am going to share the 6th tutorial of Section-III in the Raspberry Pi Programming Course. In our previous tutorial, we have seen how to interface an Ultrasonic Sensor with Raspberry Pi 4 and used Python to perform its calculations. In today's tutorial, we'll discuss how to interface a DHT11 temperature and humidity sensor to a Raspberry Pi.
So, let's get started:
Here's the list of components, we are going to use in today's circuit:
DHT11 is a low-cost digital sensor, used to measure temperature and humidity in the surroundings. DHT sensor has three main components i.e.
Now, let's have a look at the Pinout of DHT11 sensor:
DHT11 has 4 pins in total, which are:
The DHT11 timing diagram is shown in the below figure:
This device uses a thermistor to monitor temperature and a capacitive humidity sensor to measure relative humidity. A humidity-detecting capacitor's electrodes are separated by a dielectric substrate that retains moisture. When the humidity level fluctuates, the capacitance value changes as well. Analog resistance values are measured, processed, and stored by the IC, which then translates them into digital values.
The resistance value of this sensor is monitored, as it warms up using a negative temperature coefficient thermometer(NTC). This sensor is commonly made of semiconductor ceramics in order to achieve a higher resistance value even at the smallest temperature change.
With a 2°C precision, the DHT11's temperature range is 0 to 50 degrees Fahrenheit. This sensor can accurately monitor humidity levels from 20% to 80% with a 5% degree of precision. One reading per second, or 1Hz, is the sampling rate of this sensor. The microcontroller DHT11 has a power consumption of 3 to 5 volts. The maximum amount of current that can be drawn during a measurement is 2.5 mA.
The sensor and the microcontroller are connected via a 5K to 10K ohm pull-up resistor.
There are many types of temperature sensors available. Factors involved in selecting a correct sensor are: what we're measuring, how precise we need it to be, and where we're taking the readings. The Negative Temperature Coefficient (NTC) thermistor, thermocouple, semiconductor sensors, and Resistance Temperature Detector(RTD) are the most commonly used temperature sensors.
With its dual-row flat, no-lead SMD design, Grove's new AHT20 temperature and humidity sensor is ideal for use in reflow soldering applications. In addition to the standard temperature sensor, the AHT20 has a capacitive humidity sensor made by MEMS semiconductors that is more accurate than the standard sensors.
Digital sensors can monitor temperature as well as relative humidity. Two measurements are converted into a digital signal via an analog-to-digital converter chip. Temperature sensors with long-term stability and great performance are among the most popular.
Both temperature and humidity are monitored by the DHT22, quite similar to DHT11. The DHT22 costs a little more because it has a wider temperature and humidity range than DHT11, making it more precise. In terms of how it's handled and coded, the DHT22 is identical to DHT11. A temperature sensor that performs better and is more accurate should definitely be considered.
When compared to the DHT series, the BMP280 has the capability to measure both temperature and barometric pressure. You can use this in both SPI and I2C modes, making it an upgrade from the BMP180. Because the air pressure changes with elevation, it can estimate a location's altitude as well.
While the BMP280 only monitors temperature and air pressure, the BME280 has a humidity measurement in addition.
DS18B20 is a one-wire temperature sensor and gives accurate values up to 4 decimal digits.
AF5485 is a small and light-weight sensor but it has an impressively complex internal system that allows it to provide the best accuracy. Building automation, weather stations, and temperature monitoring are just a few possible applications.
Compact and lightweight, the AM2311A is an auto-calibration module that consumes minimal power. Furthermore, it is capable of transmitting data at distances greater than 20 meters. It goes without saying that this sensor is extremely dependable and stable over the long run. As a result, it can be employed in a variety of settings.
As you can see in the above figure, the circuit diagram is quite straightforward. To avoid noise in the DHT11 output, a 5K pull-up resistor is connected to the Data Pin. The temperature and humidity readings are transmitted as serial data through this pin.
We have also placed an LCD 16x2 to display the values. We have already discussed LCD Interfacing with RPi4, but in that tutorial, we used data pins to write on the LCD, but today, we will use an I2C LCD and send the data via I2C pins.
To connect the DHT11 sensor to the Raspberry Pi, the following steps must be followed.
Now, Raspberry Pi 4 has to be connected to the 16x2 LCD screen:
All our modules are powered up, so everything's correct. Now it's time to write the Python Code for getting DHT11 values and displaying them on the LCD screen:
We need to install the DHT11 Adafruit library to read the sensor values from Raspberry Pi 4.
Now let's design our Python code:
Here's the complete Python Code to read the data from the DHT11 sensor using Raspberry Pi 4:
Let's understand the code line by line:
Monitoring or controlling environmental quality is the main goal of environmental monitoring. The DHT11 humidity and temperature sensors are widely used in such systems.
Since this temperature sensor is inexpensive, it can be used in low-cost but effective weather stations that show the temperature and humidity of the surrounding environment.
Climate control is a method of managing the temperature. So, the DHT11 temperature and humidity sensors may be useful in ensuring that the environmental readings are accurate. Temperature and humidity sensors are sent to the microcontroller, and the system will respond if the temperature exceeds a predetermined upper or lower limit.
In this tutorial, we have studied how to connect a DHT11 sensor for humidity and temperature readings with Raspberry Pi 4. The sensor's principles and applicability in the current world were also studied. In the next tutorial, we'll learn how to interface DS18B20 with Raspberry Pi 4. So, stay tuned. Have a good day.
Hello friends, I hope you all are doing well. Today, I am going to share the 5th tutorial of Section-III in our Raspberry Pi Programming Course. In our previous tutorial, we have seen the interfacing of a PIR Sensor with Raspberry Pi 4. In today's tutorial, we will interface an Ultrasonic sensor with Raspberry Pi and will use Python to perform its calculations. So, let's get started:
Here's the list of components, we are going to use in today's project:
An Ultrasonic Sensor consists of a transmitter and a receiver, the transmitter emits the ultrasonic wave, which after hitting some object bounces back and receives by the ultrasonic receiver. If the Ultrasonic sensor is operated at 5V, it normally measures a distance of up to 450 centimeters.
With an ultrasonic sensor, you can measure the distance between your body and a target item, by sending and receiving ultrasonic sound waves. Unlike audible sounds, ultrasonic waves move faster. To create ultrasonic sound waves, the transmitter uses piezoelectric crystals. The sound then travels to and from the target. When it returns, the receiver gets the sound.
Mostly, ultrasonic sensors can detect objects as close as a few centimeters and as far as about five meters. Measurements of approximately 20 meters can be achieved with specially designed units.
An established technology, ultrasonic sensors have a wide range of uses, from industrial to consumer. Many new devices requiring presence detection or distance measuring can benefit from their simplicity, low cost, and durable construction. Because the hardware and software settings can be changed, they can be used in a wide range of situations.
The Ultrasonic Sensor has four connections:
An ultrasonic sensor is made up of two parts: a transmitter and a receiver, arranged side by side as close as possible. Smaller measurement errors are achieved when the receiver is near the emitter, as the path of sound from the source to the destination is straight-lined. In addition, the transmitter and reception functionalities of some ultrasonic transceivers are combined into a single device, decreasing inaccuracy to the greatest extent possible while simultaneously reducing the PCB footprint of the device.
Moving further away from the transmitter causes sound waves to broaden and the detection area increases. Ultrasonic sensors, instead of specifying a fixed detecting region, provide coverage specifications in the form of beam width or beam angle to account for this shifting terrain. For comparison, either the full beam angle or the difference from a transducer's straight line, is being used.
The beam angle has a secondary effect on the device's range. As shown in the above figure, in the case of a narrow beam, the energy of an ultrasonic pulse can travel farther, before it dissipates to unusable levels. Wide beams are better for broad detection and covering large regions, while narrow beams are better for preventing false positives, since they limit the detection region.
When looking for individual parts, transmitters and receivers for ultrasonic sensors can be found separately, or as part of a single device called an ultrasonic transceiver. In most analog ultrasonic sensor alternatives, a trigger signal is sent by the transmitter, and the receiver gets the signal as soon as the echo is recognized. In order to meet specific requirements, the designer can alter the pulse length and any encoding. The microcontroller is ultimately responsible for decoding and calculating the time between the trigger and the echo.
Ultrasonic sensors typically emit a chirp of ultrasonic radiation, that is much higher in frequency than the range of human hearing. This chirp is used to calculate the duration taken for sound to reflect from an item. This method is based on the principles of echolocation, which are used by bats to detect their prey. With this in mind, it is easy to convert the time of the ultrasonic chip to distance because the sound travels at 343 m/s in the air at ambient temperature. So, in order to calculate the distance covered, we will use the following formula:
We have divided it by 2 because the waves will cover the distance twice, one while going toward the object and the second while coming back from the object.
For example, an ultrasonic sensor emits an ultrasonic wave pointed toward a box. The waves take 0.025 seconds to bounce back. Now, in order to calculate the distance between the sensor and the box, we need to use the above formula and it gives us 4.2875 meters, as shown in the below figure:
As we discussed in the Pinout section, Ultrasonic Sensor has 4 pins in total.
If you set Vcc to 5 volts, the Echo pin will also output 5 volts. Raspberry Pi GPIO pins are prone to voltages above 3.3V, so it is imperative to avoid them. Two alternatives exist at this point:
Now let's design it with real hardware:
Double-time distance measurements are calculated with the following Python program:
For ten seconds, the trigger is engaged and the sensor uses this signal to produce sound pulses. The start time is decided as soon as the echo signal rises to a high level. Once the echo signal's negative edge is identified, the stop time is calculated. To calculate how long it will take for a sound wave to travel between two points, subtract the starting time from the final time. The speed of sound in the air is 343 m/s, so multiple this time is multiplied by the speed of sound. You must multiply the values by 100 in order to display them in cm. A speed of 34,300 cm/s is obtained. Finally, to acquire a single distance, divide everything by 2. Now let's implement this pseudocode in Python script:
When using the GPIO SetMode, the numbering scheme used to work on Raspberry Pi's GPIO can be defined in two ways: GPIO.board and GPIO.BCM, respectively.
If you want to learn more about GPIO.Board and BCM, I'd like you to check out the following picture.
It is important to take into account the limits of ultrasonic sensors before making a final decision on which sensor to use.
In this tutorial, we learned how to connect ultrasonic sensors to Raspberry Pi 4. In addition, we studied the sensor's fundamentals and the distance calculation etc. Next, we'll learn how to interface a DHT11 sensor with Raspberry Pi 4 board. Till then, take care. Have fun!!!
Almost all designers agree that Adobe Illustrator is the best tool for creating vector graphics. You can use the software to create artwork, logos, infographics, artwork, icons, and pretty much anything else you like. Adobe Illustrator uses mathematical formulas to scale images as opposed to pixels, which means resizing might strain your computer, but you get seamless and infinite resizing.
Adobe Illustrator is not free. You get a free seven-day trial and then have to pay $20.99 per month after that.
Affinity Designer is regarded by many as the best Adobe Illustrator alternative. It is great for beginners and experienced designers alike, offering an intuitive interface and user-friendly features. You can also use it for almost all design work, and its two notable features are its 8,000X history steps and 1,000,000% zoom. Both of these features make it perfect for working with clients who want even the smallest details to be perfect.
In the past few years, stickers have grown exponentially in popularity, and it is almost impossible to go a day without seeing at least one sticker in real life or on social media. They are great promotional tools because they can be added to books, flasks, guitars, laptops, social media, and so many other places. With stickers being such useful marketing tools, designers need a way to create them easily.
Picsart Sticker maker makes it easy to make your own stickers, you only have to upload your photo and work on it using the tool. The platform also makes it easier to share all your stickers online or print physical copies for distribution.
Canva is an all-around online design tool that you can use to design almost anything. It uses a drag-and-drop interface that is familiar to many people, and that makes it easy even for beginners to whip up some quick and professional-looking designs.
The tool also comes with lots of backgrounds, templates, fonts, and images to get you started. Do note that you need to pay to get access to some of the assets on the platform.
Canva also stands out due to its social media integration; you can post designs directly from Canva to your accounts.
Pixlr is an image editing tool that is a little different; it does not come with all the tools other apps do. It provides all the basic and essential tools you need without requiring you to learn how to use new tools or integrate them into your workflow. Because of this, Pixlr is perfect if you are looking for a tool to help you complete quick edits.
Pixlr is part of an ecosystem of complementary design tools and supports many of the popular design file formats. It also uses a drag-and-drop interface which makes things a lot easier, even for beginners. As with Canva, it also comes with numerous design tools and templates to get you started quickly.
There are different graphic design tools, apps, and platforms available depending on what you are looking for. For beginners, there are online apps with simple features that get simple products done, while for professionals there is software that makes it easier to handle and complete massive and complex design projects.
Hello friends, I hope you all are doing well. Welcome to the 11th tutorial of our Raspberry Pi programming course. In the previous chapter, we have seen how to regulate the speed of a Stepper motor with Raspberry Pi 4. Today, we'll work on the servo motor and will control it with RPi4. So, let's get started:
We will need the following components to control Servo Motor with Raspberry Pi 4:
The Tower Pro SG90 Servo Motor has 3 wires in total, which are:
Vcc and GND pins of the servo motor should be connected to the
power supply. The Servo Motor's Signal Wire should be connected to the Controller's GPIO Pin.
There are three wires in a standard servo motor: one for power control, one for ground, and one for neutral. Their intended purpose determines the size and shape of these motors.
There are unlimited possibilities in Robotics where we can use Raspberry Pi to control servo motors.
DC servo motors usually have separate DC sources for the stator and armature windings. The armature current and the field current can be controlled to get the desired result.
An AC servo motor, which incorporates an encoder, is employed for closed-loop control systems. This motor may be precisely positioned and regulated to meet the application's needs. Better bearings and higher tolerances are common in these motors, and higher voltages are sometimes used in simple designs to boost torque. When it comes to robotics, CNC machines, and other automated systems, servo motors are preferred because of their accuracy and precision.
It is the most commonly used servo motor and has a rotation of approximately 180 degrees. To keep the rotation sensor safe, it has physical brakes built into the gear mechanism. Many of these popular servos are used in radio-controlled water, radio-controlled automobiles, airplanes, robotics, toys, and many more applications.
Additional gears transform the servo motor output from circular motion to back-and-forth motion.
A servo mechanism consists of three main components i.e.
The servo motor uses a permanent magnet DC motor with an inbuilt tachometer to calculate the output voltage. The electronics drive provides motors with electrical power in response to tachometer feedback voltages. After setting a commanded speed using a closed velocity loop, the driver's circuitry compares the tachometer feedback voltage to the goal speed. The velocity loop monitors the tachometer feedback and the commanded velocity while the driver modulates the power in the motor.
A sophisticated servo motor system has multiple integrated loops configured to optimal performance for the most precise motion control. For current, velocity, and location, the system uses feedback loops with high precision. To adjust parameters in real-time, each loop notifies the next and checks the feedback elements.
The current loop, also known as the torque loop, is the foundation for all other loops. An electric motor's acceleration or thrust is determined by the relationship between current and torque (or force, in the case of a linear motor). A current sensor is a device that measures the amount of current flowing through the motor and communicates this information to the user. Control electronics frequently receive proportional signals via analog or digital techniques. Ordered signals are subtracted from this signal. The servo motor needs to run at the specified current for an extended period to keep the loop intact. It will then update at sub-second intervals until it reaches the desired current.
Similarly, the velocity loop works with a voltage proportional to velocity in the same method. At low velocities, the current loop receives a command from the velocity loop to increase voltage.
The velocity loop is fed a velocity command from a PLC or motion controller that supplies the required current for acceleration and deceleration of the motor. The servo mechanism is controlled precisely and smoothly by the three loops working together in perfect harmony.
It doesn't matter if it's brushed or brushless, rotatory, or linear. The servo system receives feedback from various sensors, i.e. potentiometers, encoders, linear transducers etc. This system's capabilities are rounded out by an electronic control system that verifies feedback data and command references to make sure the servo motor is performing as instructed. Multi-axis milling centers use brushless motors and motion control systems more complex than those used in recreational applications.
Pulse Width Modulation is required to operate a servo motor. The pulse's width or length controls the servo motor's shaft position when using the PWM approach.
There is a defined frequency for the PWM signal, determined by the type of Servo Motor being used. The PWM Frequency of our SG90 and MG90S Servo Motors is 50Hz.
A pulse width signal of one millisecond (one-thousandth of a second) sets the servo's position to the LEFT. This post has a duty cycle of 0.5 percent.
As with pulse widths of 1.5 and 2 microseconds, the servo is set to MIDDLE (7.5% duty cycle) and FAR RIGHT with a duty cycle of 10%.
Now let's design the Python code for Servo Motor Control using Raspberry Pi. We'll be using our favorite code editor, Thonny, so get it up and running on your Raspberry Pi:
Variable duties are defined and assigned random values, such as 2. When counting our intervals, it serves as the starting point.
After that, we'll run a for loop to find all the duty values between 2 and 17. Given the range of 2 to 17 as an interval, The motor will move the shaft if duty is increased by one every time the shaft moves. After every one-second interval, the shaft rotates 12 degrees to the right until it reaches 180 degrees.
You can experiment with multiple motors to see how much fun this can be. This project's complete source code can be seen below:
When it comes time to put the concept into action, we'll take advantage of Raspberry Pi's PWM functionality. If you've been following along, you know that the Servo Motor position changes depending on the PWM signal from the Raspberry Pi.
To achieve a sweeping effect from the Servo Motor, we need to alter the PWM signal's Duty Cycle between 5% and 10%, corresponding to the extreme left and right positions.
If you look at the code, you'll see that the duty cycle steadily increases from 5% to 10%, with a 0.5 percent increase at each stage. The reversal will commence as soon as it hits 10%.
Many applications can benefit from regulating the angle of rotation of the Servo Motor via the Raspberry Pi, such as:
It is impossible to find a radio signal, take pictures of a galaxy billions of light-years away, or photograph a live subject without using a servo motor.
It's all about safety while designing and implementing transportation networks for buildings. Servo motors are extensively used in elevators in some of the world's highest buildings to carry passengers safely and smoothly.
Robotics is a hot topic, and their practical applications are growing at an ever-increasing rate. Servo motors, which are compact, powerful, and precise due to their changing size and force density, are the most widely utilized in robotics. Using robots to control the detonation of bombs, autonomous firefighter trucks, or even the joints in robot arms is all possible.
To eliminate the risk of human error and speed up production, manufacturers are creating robotic alternatives. Another robot example is the pick and place robot, which can move items from one side of an industrial building to the other. Servo motors are commonly utilized when mobility or rotations could be hazardous.
Precision and power are critical features of servo motors, which are used in bending and cutting metal sheets and high-speed milling machines. Servo motors are commonly employed in the spinning sections of conveyor systems in various industries, such as the food and beverage industry.
Congratulations! You have made it to the end of this tutorial. We have seen how PWM is used to control a servo motor. A variety of servo motor designs and real-world applications have also been demonstrated and their application in real life. In the next tutorial, we will learn how to interface an LDR Sensor with Raspberry Pi 4. Thanks for reading. Have a good day.