Interfacing DHT11 with NodeMcu ESP8266 and using Ubidots Cloud

Nodemcu DHT11.jpg

Interfacing DHT11 with NodeMcu ESP8266 and using Ubidots Cloud In this tutorial, we discuss how to Interface DHT11 with NodeMcu ESP8266 and Sending its Data to Ubidots Cloud. Ubidots is an IoT(Internet of Things) data analytics and visualization company. We turn sensor data into information that matters for business-decisions, machine-to-machine interactions, educational research, and increase economization of global resources. Ubidots exists as an easy and affordable means to integrate the power of the IoT into your business or research. Ubidots technology and engineering stack were developed to deliver a secure, white-glove experience for our users. Device friendly APIs (accessed over HTTP/MQTT/TCP/UDP protocols) provides a simple and secure connection for sending and retrieving data to and from our cloud service in real-time. Ubidots’ time-series backend services are performance optimized for IoT data storage, computation, and retrieval. Our application enablement platform supports interactive, real-time data visualization (widgets), and an IoT App Builder that allows developers to extend the platform with their own HTML/JS code for private customization when desired. Ubidots exist to empower your data from the device to visualization. Because of different plans for different users’ high response rates, easy to use, fast services Ubidots are widely used by developers and industries. Features of Ubidots Reasonably priced Can send up to 20 -30 values per second  Can be used with any IoT tool like Raspberry Pi, NodeMcu etc. Works on rest api. Ubidots plans for users For students: – Ubidots provides free 5000 credits point and after consumption of 5000 credits you can purchase 1000 credits for 5$ for only one device. Fig1: Pricing for Students and Developers For developers:-  Ubidots provides a trial for 30 days and later on 20 USD per month with some advance features and up to 10 devices at a time. Plans for Developers For an IoT lab:- for IoT lab in colleges or training Ubidots charge  $99 USD per month and you can use up to 60 devices at a time. In industries:- Ubidots charge $499 USD per month and you can use up to 400 devices at a time. For large scale:- for a large scale usage  Ubidots charge $ 2499 USD per month and you can use up to 5000 devices at a time.  DHT11 Sensor The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It 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). It’s fairly simple to use but requires careful timing to grab data. The only real downside of this sensor is you can only get new data from it once every 2 seconds, so when using our library, sensor readings can be up to 2 seconds old. Pin Diagram DHT11 Components Required DHT 11  sensor module (costs around $3 USD) NodeMcu ESP8266 (costs around $6 USD) Jumper wires Software Required Arduino IDE Libraries Required DHT.H UbidotsMicroESP8266.h The procedure to downloading the libraries is given in coding section. Circuit Diagram If you are new to Node Mcu – Click Here Interfacing DHT11 with Nodemcu Now after making circuit it’s time to setup ubidots account. Creating ubidots account is very simple easy and just takes only few steps. Creating Ubidots Account Open browser and search  apps.ubidots.com  and go. When you open this link this type of page gets open. Error Page Now click on Advanced. After that click on Proceed to apps.ubidots.com (unsafe) in the tab. This type of tab opens in front of you. Click on SIGN UP option. Now SIGN UP. You can also sign up using your Twitter,  Github,  Google, or Facebook account. Fill all the details mentioned in the form and click on the signup. At username place any username for example – xyzio Please give your any mail id in email for example – xyz.gmail.com Now enter any password of your choice and signup. Now ,Ubidots setup is complete  let’s move on to the coding part all the left part for ubidots setup should be only done after successfully run of code. Coding Open Arduino IDE and go to file and new. Note:- please download the library only from here because it is updated according to this blog. Download the DHT library  Download the zip file from the given links and now add the library by the procedure given below. Now open arduino open sketch >include library>add .ZIP library And now open the path where the library is downloaded and click on open the file Now the library gets install in Arduino IDE automatically Now paste the below-given code in Arduino IDE. Change the token. get your token from going onto your Ubidots account. Click on your username first at the right upper corner. After clicking some option open there click on API Credentials . After clicking on API credentials copy your default token from there and replace the given token in code. Also change wifi name and password in code with your wifi name and password. Please write the wifi name and password in double cots. . Code #include “DHT.h”  #define DHTPIN D1 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); #include “UbidotsMicroESP8266.h” #define TOKEN  “A1E-kjeI6pKCeYOn6SFBDEBBiRezl68lxU”  // Put here your Ubidots TOKEN #define WIFISSID “Nokia 3.1” // Put here your wifi name here #define PASSWORD “”  // Put here your wifi password here my wifi is open put your  Ubidots client(TOKEN); unsigned long lastMillis = 0; void setup(){     Serial.begin(115200);     dht.begin();     delay(10);     client.wifiConnection(WIFISSID, PASSWORD); } void loop(){     if (millis() – lastMillis > 10000) {  ///every 10S       float MyHumidity = dht.readHumidity();       float MyTemperature = dht.readTemperature();             lastMillis = millis();             client.add(“MyHumidity”,MyHumidity );             client.add(“MyTemperature”,MyTemperature );             client.sendAll(true);             } } Code Explanation #include “DHT.h”  #define DHTPIN D1 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); These lines are used to call the library for DHT11 sensor and type of DHT sensor we are using and on which pin DHT is connecting to the NodeMcu. #include “UbidotsMicroESP8266.h” #define TOKEN  “A1E-kjeI6pKCeYOn6SFBDEBBiRezl68lxU”  // Put here your Ubidots TOKEN The lines are used to call ubidots library

How to use Arduino Analog Input – Theory and Practical

Arduino Interface LM35.jpg

How to use Arduino Analog Input In this tutorial, you will learn about How to use Arduino Analog Input along with the practice example. Analog input is to get data from analog sensors into our Arduino. Since most of the sensors are analog, it is quite important to get our basics clear. Let’s begin with theory: – First of all, we need to understand what an analog signal is. This is probably something which you might have studied in school. A digital signal is one which, at any point of time is either HIGH or LOW. An analog signal is one which varies continuously with time, as you can see in above picture. Now, let’s talk about analog sensors As you can see in the above infographic, a sensor (or technically, a transducer) is a device that converts any phenomenon (like temperature, light, moisture etc.) into electrical signals. In case of Arduino, this analog signal has to be fed through analog pins, into an ADC, to get the sensor values for processing. I will explain it in a moment. Arduino, as you already know is a microcontroller, but actually, Atmega328p, an IC is the brain of Arduino Uno. Atmega328p has a 10 bit ADC, which processes the analog signals. Let us try to understand ADC first. Analog to Digital converters, or commonly known as ADCs, are circuits, which convert analog signals to digital signals. Since ADCs are very broad topic, we will only see ADC of Arduino. Atmega328p has a 5v 10 bit ADC, which simply means that it generates a number between 0 – 1024 depending on input voltage 0-5 volts. The above infographic is quite self-explanatory. The ADC generates a value, based on the input signal that reflects the data from the sensor. One should note that the value from ADC is not the actual sensor value. To get the actual sensor value, one has to calibrate the sensor. Calibration of sensor is sensor specific, there is not general calibration, and is usually given by the manufacturer in the datasheet. Note that Arduino Uno has 6 analog pins, meaning you can use up to 6 sensors. That was all in theory, let us see how it works in practice. Time to get our hands dirty: – We will use LM35 temperature sensor by Texas Instruments, it is the most commonly used temperature sensor that measures temperature in the range   -55 C to 150 C. It is a three terminal device. You can easily find it in any electronics store and is usually included in most of the Arduino educational kits. Here’s how it looks- It is an analog sensor. It is a three-legged device, as one can see:- Vs, GND and Vout. Vs and GND pins are to power the circuit. You can connect to supply of up to 30 volts. Arduino has 5v pins to do this job. Vout is the output pin and has to be connected with A0 pin of Arduino (or any other analog pin). The signal generated by LM35 varies linearly with temperature. It is 10mV per degree rise/fall in temperature. Let’s see the circuit, it is a very simple one, connect the pins as described. Circuit Diagram Code float vout;  //temporary variable to hold sensor reading void setup() { pinMode(A0,INPUT); //A0 is pin number, INPUT is self-explanatory Serial.begin(9600); } void loop() { vout=analogRead(A0); //This function reads the value of ADC at pin A0.  vout=(vout*500)/1023; Serial.print(“Temperature =  “); Serial.print(vout); Serial.println(); delay(1000); //Getting temperature every second is a good idea! } You can copy paste the code in your Arduino IDE and upload the sketch. Code Explanation If you are more curious about the code (which you should be), I will explain the critical parts. pinMode(A0, INPUT) :- Defines that pin A0 is going to be used for input. vout=analogRead(A0) :- This function returns the value of ADC at pin A0. As discussed before, it returns a value between 0 and 1024 depending on temperature range of sensor (0C to 155C). vout = (vout*500)/1023 :- Don’t worry about this, here temperature is calculated out of ADC values based on calibration factor (10mV/C here). You can usually find this by a simple search. Once you have uploaded the sketch, therefore you can open serial monitor (ctrl+shft+M) to see the output. Conclusion Pro Tip: To verify if the sensor is working, blow on the sensor, you’ll observe the change in temperature. I hope that you are clear with the tutorial. If you have any queries, please feel free to ask in the comment section below.

Interfacing of HC-SR04 Ultrasonic Sensor with Arduino Uno

INTERFACING OF ARDUINO UNO WITH ULTRASONIC SENSOR  Complete arduino kit for beginners This tutorial is about the interfacing of the Arduino UNO board with HC-SR04 commonly known as ultrasonic sensor and code to run the sensor and obtain the output from the sensor accordingly. List of the components Arduino uno board HC-SR04 ultrasonic senso Bread board Jumper wires Working principle of the ultrasonic sensor  The working is very simple, the trigger pin of the HC-SR04 emits and transmits a high-frequency pulse. The HC-SR04 uses high frequency sound waves to find this distance, a kind of echolocation. If we need a machine to know about an obstacle in its path,we should  use an ultrasonic sensor. The HC-SR04 sensor echo pin senses the reflection.  Pins Of Ultrasonic Sensor HC-SR04 Ultrasonic sensor has four pins. Pin 1=Vcc=5v input  voltage to power the sensor.  Pin 2=trig pin=input pin for sending ultrasonic waves. Pin 3=echo pin=output pin. Pin 4=ground pin=it should be connected to the ground. Explanation The Arduino UNO has a micro-controller that reads data from various inputs and can compute it according to the programming code. Arduino Uno has 14 digital input & output pins and also 6 analog pins. The Arduino Uno power supply can be done with the help of a usb cable or an external power supply. The suggestion voltage range power is 9 to 12 volts. The circuit of the Arduino and distance sensor consists of  three parts. (i) Micro-controller (ii) Transmitter  (iii) Receiver Microcontroller It controls the timing and sending of pulses.  It receives the signal from the receiver as an interrupt, it also controls the frequency and speed of the sound wave generated and also record’s the time taken to receive the reflected wave. Transmitter The transmitter of the HC-SR04 emits high frequency sound waves. Receiver It receives the ultrasonic wave reflected by the object in front of the sensor  Pin Diagram Connect the VCC pin of the distance sensor(HC-SR04) with the 5V VCC output pin of the Arduino Uno board. Now, connect the trigger of HC-SR04 to digital pin 11 on Arduino board Then connect the echo pin of HC-SR04 to digital pin 12 on Arduino board. Finaly, Connect the ground pin of the ultrasonic sensor to Arduino’s ground pin. Code Result Upload the code to the Arduino UNO board and the distance of the object can be seen on the serial monitor screen. For any queries, the comment box is always open for you.

How to blink an led with Raspberry pi 3B+

How to blink an led with Raspberry pi 3B+ Introduction In this tutorial, you will learn how to connect the LED with the Raspberry pi, a microprocessor board commonly known as a single board computer and write the code to the board and control the accordingly. About Raspberry pi 3B+ Raspberry pi is an ARM architecture based single board computer having 1GB RAM with a faster 1.4GHZ  processor and it’s mainly used for IOT(internet of things). Components Required Raspberry pi 3B+ – Buy Now LED – Buy Now Resistor – 1kΩ – Buy Now Bread Board – Buy Now Jumper Wires – Buy Now Pinout of  Raspberry pi 3B+ : Circuit diagram First of all connect the positive pin of led to pin number 40(GPIO 21) and negative pin to pin number 39 (ground) of the Raspberry pi. Its not compulsion to add resistance as Raspberry pi only provide 15 amps to the led which is not dangerous at all but for safety please add a 1kΩ  resistance between pin number 40 and positive of led pin Working explanation of blinking LED with Raspberry Pi microprocessor: First of all setup the Raspberry pi  and click on the top left corner menu on the desktop and then go to programming and choose python                                                                                                                             After that click on new file in the file menu of python ide Next write the code given below in python idle. Now save the code as blink.py on desktop Go to run and run module  Now you see that led start blinking. CONCLUSION In this manner you can upload the code into the microprocessor board accordingly and can control the LED, depending on your requirement. You can also modify the code as for your convenience. This completes the tutorial and for any queries comment box is always open for you. AUTHOR CREDIT: Name: Harshith Jindal Profession: Electronics Student 

NodeMCU ESP8266 with AWS IoT Core using Arduino IDE & MQTT

NodeMCU ESP8266 with AWS IoT Core using Arduino IDE & MQTT In this tutorial, I will tell you How to connect NodeMCU ESP8266 with AWS IoT Core using Arduino IDE and MQTT Protocol. In this process, we will see how to create a thing in AWS IoT core, generating certificates and policy, How all AWS IoT core credentials are converted to .der format and directly downloaded into the NodeMCU ESP8266 SPIFFS file system. We will be developing a sketch that will marry ESP8266 and AWS IoT Core using MQTT Protocol. This sketch requires the certificate files to be uploaded to the device’s flash rather than storing them in line with the script. This allows the same script to be used by multiple devices, that each read the required files from their internal flash storage. Introduction to AWS IoT Core The Internet of Things (IoT) is being integrated with almost every device nowadays. There are a number of hardware and software IoT platforms available in the market for building IoT based applications. In my previous article, I have explained how to interface DHT22 with NodeMCU and post the Temperature and Humidity to the Thingspeak web server. Likewise, we can interface sensors to the hardware development kits like ESP32, ESP8266, Raspberry Pi, Particleboards( Aargon, Boron, Xenon) and post data to the clouds like Thingspeak, Ubidots, AWS IoT Core, Microsoft Azure. Amazon is not only in e-commerce but also focusing on IoT and providing cloud-based service named AWS IoT. Here, AWS IOT stands for Amazon Web Service Internet of Things. This service allows us to connect our devices to the internet for processing, operating and exchanging data securely. Along with AWS IoT, the Amazon Web Services also provides tons of other features like virtual machine deployment, web-hosting, etc. Steps involved in this tutorial Creating a Thing in the AWS, generating a certificate and attaching a policy to it. Converting AWS credential(Certificate, Private Key, Root CA) from .pem to .der format Installing ESP8266 sketch data upload tool in Arduino IDE Arduino sketch and modifications according to the thing. Uploading AWS certificates & code to the NodeMCU ESP8266 Testing/Subscription of things on Amazon Web Services(AWS). Results & Data Logging. 1. Creating a Thing in the AWS IoT Core, generating a certificate and attaching a policy to it Setting up the AWS environment for these devices is pretty simple. check the following:   login to the AWS Management Console & search for IoT core in the Amazon Services, Find services search bar will help you in this regard. After getting into the IoT Core section, tap on the tab called “Manage” from the AWS IoT menu which is on the left side, tap on the register thing button if you haven’t added any devices till now. If you have previously added things just tap on the button named “Create” which is on the top right corner beside the iot-notifications Icon. Setting up the AWS environment for these devices is pretty simple. check the following: Amazon AWS and login to the AWS Management Console & search for IoT core in the Amazon Services, Find services search bar will help you in this regard. After getting into the IoT Core section, tap on the tab called “Manage” from the AWS IoT menu which is on the left side, tap on the register thing button if you haven’t added any devices till now. If you have previously added things just tap on the button named “Create” which is on the top right corner beside the iot-notifications Icon. Use create a certificate. Next point is to create and attach a policy to the certificate, authorizing the authenticated device to perform IoT actions on IoT resources. for this tap on the “secure” tab from the AWS IoT menu which is on the left side, later go for the policies section. Now tap on the button named “Create” which is on the top right corner beside the iot-notifications Icon. give your policy name and fill the fields(Action, Resource ARN ) with a star “*” and check to Allow for Effect option then press the “create” button.  Now tap on the certificates section which is right above the policies section, You will see a certificate which you have created earlier, tap on the three dots and choose to attach the policy, a pop will come showing your existing policies, check on the recent policy that you have created and attach. That’s it you have successfully created a thing, generated a certificate and attached policy to it. You need to Download A certificate for a thing(option 1), private Key(option 3) and click on a root CA for AWS IOT Download and a page will be redirected and need to download RSA 2048 bit Key.(Save as a Link). Keep all the 3files a side in a proper file. 2. Converting AWS IoT Core credential(Certificate, Private Key, Root CA) from .pem to .der format There are two main methods for encoding certificate data. DER = Binary encoding for certificate data PEM = The base64 encoding of the DER-encoded certificate, with a header and footer lines added. DER DER: (Distinguished Encoding Rules) is a subset of BER encoding providing for exactly one way to encode an ASN.1 value. DER is intended for situations when a unique encoding is needed, such as in cryptography, and ensures that a data structure that needs to be digitally signed produces a unique serialized representation. PEM PEM: (Privacy-enhanced Electronic Mail) Simply a US-ASCII by base64 encoded DER certificate, certificate request, or PKCS#7, enclosed between typical PEM delimiters. ie “—–BEGIN CERTIFICATE—–” and “—–END CERTIFICATE—–“. PEM is an abbreviation for Privacy Enhanced Mail (RFC 1421 – RFC 1424), an early standard for securing electronic mail (IRTF, IETF). PEM never has been widely adopted as Internet Mail Standard but has become a staple standard in x509 pki (also called pkix) => Since our ESP8266 will not understand base64 encoding we will convert that certificate to Binary. OpenSSL on Windows If you’re using Windows, you can

Automatic Submersible Pump Starter

Automatic Submersible Pump Starter  We are going to make a very good project to save water and electricity. We turn on the submersible pump in our houses and our water tank starts filling up and sometimes we forget to turn off the motor so today we are going to make a project so that, when the water reaches the limit of overflow in our water tank, then our motor will automatically stop, so that our water will be saved from waste and electricity usage would also be reduced. COMPONENTS REQUIRED 12V relay ( Quantity -1) – Buy Now BC547 Transistor  ( Quantity -1) – Buy Now IN4007 Diode ( Quantity -1) – Buy Now 1k Resistor  ( Quantity -1) Buy Now 9V Battery  with battery Holder ( Quantity -1) – Buy Now Circuit Diagram  WORKING First of all in this circuit, we have used 100 Watt bulbs instead of the Submersible pump.  Similarly to that we give a 220 Volt to turn on a bulb in our house and connect a Switch in the middle of it and with that Switch we can turn that bulb off or on, just like that in this project I have used a relay instead of a switch to control that bulb. This relay will operate our motor. When we give power to that relay, it will turn off that motor. In this circuit BC547 transistors are used to amplify our current.  We the help of a 1k Resistor in it, a wire connected to this Resistor and connected to the relay will go into the tank where we have to set the limit of water overflow, and we must arrange those wires there again. Output We will start this circuit and as soon as we start, the bulb used in place of our motor will start and we will assume that our tank is full and then we will turn on the DC power given in our relay and those overflow of to wire someone . If you put them in a vessel filled with water, then those two wires will come in contact and power will start going in the relay and as soon as the power reaches our relay, our relay will be cut out and our bulb will be shut down, this means that our  The tank has reached the overflow limit and our water motor has shut down. CONCLUSION  Therefore this will benefit us a lot, earlier, after filling the tank, the water kept flowing for hours and wasting and we did not mind at all that we have to turn off our water motor, now this will not happen if we do this project  If we make it, then we will not have to worry about turning off our water motor and this will save a lot of electricity, the electricity bill which used to come in our houses was very high, now our electricity bill too.  APPLICATIONS This project submersible water pump is more useful for those places or for those industries or factories where there is no water shortage at all, we can put this project there as if our water gets in sufficient quantity then the motor will stop and like  If the water is less then the motor will start and fill the tank.

OBSTACLE AVOIDING ROBOT

OBSTACLE AVOIDING ROBOT What are we going to build? We will build a simple obstacle avoiding robot that will avoid obstacles which are in its path. There can be two possible robots that can be built:- 1. A simple robot with no rotation of the distance sensor. 2. A mediocre robot with the rotation of the distance sensor. Let’s gather the components needed:- 1. Arduino mega. (or any other Arduino i.e Arduino Nano or Arduino UNO). 2. L298N Dual H Bridge Stepper Motor Driver. 3. DC hobby BO motors.   4)HC-SR04 Ultrasonic Distance Measuring Sensor Module 5)9v battery 6)Robot chassis Obstacle avoiding robot Circuit Diagram. Connections of Ultrasonic sensor – 1.         VCC – VCC terminal of Arduino. 2.         GND – GND terminal of Arduino. 3.         Trigpin – digital pin 9 on Arduino. 4.         Echo pin – digital pin 10 on Arduino. Connections of L298N – 1.          +12V – Positive terminal of the battery. 2.         GND – a)GND of Arduino b)Negative terminal of the battery. 3.         Input terminal 1 – Pin 4 4.         Input terminal 2 – Pin 5 5.         Input terminal 3 – Pin 6 6.         Input terminal 4 – Pin 7 7.         The output terminal 1 – Positive of the first motor. 8.         The output terminal 2 – Negative of the first motor. 9.         The output terminal 3 – Positive of the second motor. 10.  The output terminal 4 – Negative of the second motor. Code Select the appropriate board in the Arduino ide Select the com port to which the Arduino board is plugged into and upload the code Obstacle avoiding Robot Explanation First, we will be finding the distance between the robot and its surroundings. For this, we have the ultrasonic sensor module which can measure distances from 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm. The ultrasonic sensor emits a high-frequency sound pulse and calculates the distance depending upon the time taken by the echo signal to travel back after reflecting from the desired target. The speed of sound is 341 meters per second in air, knowing this we get the duration of the pulse from the pulse function and we divide it by 2 since the duration output not only contains time taken for the pulse to hit the obstacle but also contains the time taken for the high-frequency pulse to return. This corresponds to about 29.412µs (microseconds) per centimeter. To measure the distance the sound has traveled we use the formula: Distance = (Time x SpeedOfSound) / 2.The better way to get the distance as centimetres is to use the formula: Centimetres= ((Microseconds / 2) / 29). After getting the distance we will use the distance to perform obstacle avoidance by sending commands from the microcontroller to the H-bridge motor driver. The robot will move forward only if the distance between the obstacle and robot is greater than 20 centimeters else it’s going to keep on turning left until the robot finds a path with no obstacles up to 20 centimeters of range. But why do we need a motor driver? Motor drivers act as an interface between the motors and the control circuits. The motor requires a high amount of current whereas the controller circuit works on low current signals. So the function of motor drivers is to take a low-current control signal and then turn it into a higher-current signal that can drive a motor.

Electronic Speed Controllers (ESC)

ELECTRONIC SPEED CONTROLLERS In this tutorial about electronic speed controllers (ESC) for drones is expalined. It is a hard-working, powerful component in the drone. It is an electronic circuit that controls and regulates the speed of a motor. It connects the flight controller and a brushless motor. As the brushless motor lacks the brush, they use a different way to turn direct current (DC)into alternating current (AC). This is performed by externally, through the use of an ESC. ESC FIRMWARE: Most of ESC’s runs on 3 major firmware – Blheli, SimonK, and KISS. SimonK is outdated firmware so that it is not used anymore. But some airplane ESC’s still use thisfirmware. KISS firmware is a closed source ESC which means that KISS firmware is only for KISS ESCs. whereas other firmware is open source. So the most popular choice nowadays is BLheli, as it is a user-friendly interface, oneshot125, and active braking. As the voltage rating increases the total power of a motor will increase and thus the drone will fly faster as compared to low voltage drone. COMPARISON BETWEEN BLheli_S  and BLheli_32 BLheli_S is the second generation of BLheli firmware developed for ESCs. they are 8bit processors. It has a small step resolution varying from between 512 to 2048 steps. The Signal response delay of BLhelli_S is 1-2ms.  BLheli_32 is the third generation of BLheli firmware. It is the latest firmware written for ESCs. they are 32bit MCU (microcontroller unit) and it is a closed source. These 32 bit MCU has more processing power compared to the 8-bit processor, so they can achieve faster input signals and lower latencies.  These ESC’s also include a current sensor where you can monitor your current consumption during flight. ESC’s are also capable of other features like controlling light-emitting diode (LED) and changing the direction of motor rotation.     FACTORS TO BE CONSIDERED WHILE CHOOSING ESPs: Individual or 4 in1 ESCs: As the name suggests there are typically two types of ESC’s individual and 4 in 1 ESCs. 4 in 1 ESC’s are a combination of 4 individual ESCs. these ESC’s are manufactured to reduce the complexity in wiring and to reduce the overall weight of the drone. The 4 in 1 ESC’s are low in cost compared to 4 individual ESC’s like the cost of a 4 in 1 ESC is about $50 and cost an individual ESC is $15. But replacing a 4 in 1 ESC is better than replacing a single individual ESC. If you are a beginner I recommend you use an individual ESC’s. As your drone might crash often. So you need to replace ESCs. since replacing a single ESC is more cost-effective than replacing 4 in 1 ESC. Voltage and Current Rating: The size of a motor decides the current rating of ESCs. So if 2207 sized motor draws a 40A current at full throttle at the ground condition. The current draw is approximately 20 – 25% lower in air. i.e. if current draw at ground condition is 40A then in the air it draws 32A. But you will not be flying with full throttle whole time. So ESC’s have something called Burst rating. Burst rating is the maximum amount of current the ESC can handle for a small amount of time without damaging itself. It is better to get an ESC capable of high current at the cost of size and expense than an ESC that might be damaged by the large current. Voltage rating determines the maximum amount of voltage an ESC can handle. Low-cost ESC’s are rated up to 4S. But nowadays most ESC’s are rated up to 6S. Capacitors: Before few years ESC’s often comes with included electrolytic capacitors. As mini quads gain huge popularity.The size of ESC is reduced, so most ESCs no longer came with large electrolytic capacitors. Capacitors act to smooth out the power to the drones. Adding a capacitor to PDB (power distribution board) will help absorb power spikes generated by the brushless motors during braking. The most commonly used capacitors are low ESR capacitors. Adding a capacitor to the battery leads at the PDB can improve performance. CONCLUSION: The Electronic Speed Controllers are crucial component of drones. There are hundreds of ESC’s to choose from in the markets. All perform exceptionally with one better over the other. Unless you buy older generation ESC’s you won’t face any problems. Related topics:Introduction to drones

Line Follower Robot

Line Follower Robot Welcome to robotic electronics. Here, we begin with a Line Follower Robot. Once, a person in England thought of making a  mobile bot as a line follower robot and prepared an Electro-Light-Sensitive-Internal-External(ELSIE) in 1953, which follows a light source using a mechanical feedback system with no intelligence. There kickoff the evolution of our Line Follower bot. DEFINITION  A line follower bot is a mobile bot that follows a given white or black line over a white or black background by sending and receiving Infra-Red rays by using IR sensors. These are used in the factories to carry the finished products to the whare house with no human intervention. And now are you interested in building one! Here we go.. One can readily build a Line Follower Robot in short LFR by using the following elements 1.Chassis: Chassis is the body of the bot, we can use a metal chassis or a wooden board to fasten all other elements 2.Motors: The motor is a prime mover or actuator mainly used for the motion of the bot. We can use center shaft motor, N120 motor, or a basic operation (BO) motor. 3.Wheels:            Wheels of different sizes are available in the market, we can use wheels of small size for easy movement of the bot, we can use a freewheel in the front 4.IR sensors: IR sensor is the main component in the LFR. We can use an IR array of individual IR sensors for this purpose. One can make a basic LFR by 3 IR sensors. 5.MicroController: It links the IR sensors to the actuators ie; motors. We can use an Arduino Uno or Arduino Nano for this LFR. 6.Battery:                The battery is the power source for the MC, we can use a lithium-ion battery or a lithium-polymer battery for less weight of the bot. We can also use a lead-acid battery. 7.Motor driver:   A Motor driver is an element that provides the required current input for the motors. Arduino output will be the Motor driver’s input. L298n is a motor driver used to control two motors, with a heat sink.  8.Jumper wires: A jumper wire is used for the current to flow from the battery to other elements. 9.Fasteners: Fasteners such as double tape, motor clamps, screws, nuts, and bolts are needed. PROCESS OF MAKING A LINE FOLLOWER ROBOT First, take the chassis and attach the two motors on both sides by using clamps with screws. Then attach the wheels to the motor shafts by screw. Place the Micro Controller on the chassis and fasten it by screws Place the IR sensors in the front by leaving 3 mm gap between the ground If three IRs are used then place one in the middle and other two at sides Place the Motor driver, Battery at the designed place on the chassis Place the freewheel in the front bottom part seeing the body is parallel to the ground. Now start connections of the IR sensors to the Arduino, Motors to the  Motor driver then to the Arduino, Battery to the Motor driver. Now the bot is mechanically ready for functioning. For having intelligence to follow a white or black line it needed to be coded CODING: The code goes in this way, After coding is done in your pc you need to dump it into the Arduino by using a connecting cable. CONCLUSION After checking the connections as per code you’ve made, the Line Follower Robot is ready to follow the line.

Brushless motors

BRUSHLESS MOTORS Hello guys, In the previous tutorial we have learned about propellers and physics behind how the drone flies. In this tutorial, we are going to learn about the drone’s brushless motors and I will guide you to choose correct motors for your drone. A key concept behind the functioning of motors is electromagnetism. ELECTROMAGNETISM: Most of us have learned about electromagnetism in schools and college, now let us know how this concept applies in motors. Here the use of an electromagnet is to convert electrical energy into kinetic energy. When an electromagnet is electrically charged, it produces a magnetic field around it.When this temporary magnetic field interacts with a permanent magnet, attractive and repulsive forces are generated which leads to rotation of a motor shaft. DIFFERENCE BETWEEN BRUSHED AND BRUSHLESS MOTORS: Both works with the same principle of electromagnetism BRUSHED MOTORS Brushed DC motor consists of armature coil, brushes, commutator, an axle, and a permanent magnet. In brushed motors, the stator is provided with permanent magnets around the rotor. The rotor consists of electromagnets. the commutator is a split-ring device that is around the axle and physically in contact with brushes that are connected to DC power supply. The efficiency of a brushed motor less due to the greater thermal insulation of the internal mechanism.Brushed motors wear out quickly because of the presence of brushes. These motors are mostly used in micro drones. Their small size, low weight, and simple driving technique make it more suitable for micro drones. BRUSHLESS MOTORS As the name implies, these motors don’t have any brushes. A brushless motor consists of two main components motor and rotor. As you can see in the above fig the permanent magnets are attached to the rotor. The stator part consists of an electromagnet which is directly connected to the DC power supply.The efficiency of these motors is about 85-90%. Whereas a brushed motor is 75-80%. These motors have more life than the brushed motor because there are no brushes to wear out. These motors are mostly used in mini drones and small drones where high efficiency and power are required. SIZE OF BRUSHLESS MOTORS: The size of the Brushless motor is identified by the four-digit code which is based on the size of the stator. For example, if the motor size is 2207, it means stator height is 07mm, and width is 22mm.   DIFFERENCE BETWEEN 2207 AND 2306 STATOR SIZE 2207 has a narrow stator, so it has smaller inertia which allows for faster RPM changes. Taller stator creates a large surface area which leads to an increase in magnets size, therefore more magnetic fields are created. 2306 has a wider stator, so the coil size increases more than the permanent magnet. Which leads to more torque and an increase in efficiency of the motor.   Comparing stator volume:                         2306: (23/2) ^ 2 x 3.14 x 6 = 2491.59 2207: (22/2) ^ 2 x 3.14 x 7 = 2659.58 2207 motor has 6.3% of more volume than 2306, so 2207 has more weight than in 2306.It is impossible to say which motor perform better because it is purely based on the design and material used for motor.But based on stator size, 2207 has more top-end power and can change RPM effectively at a high throttle range. Whereas 2306 has better power and response at mid and low throttle range. KV – VELOCITY CONSTANT:KV represents the speed of motor per every voltage applied to the motor.i.e., KV = RPM per 1 volt           K = KV rating of the motor.                  Eg.2300           V = input voltage                 Eg.16.5 VExample:2300(kv rating)* 16.5(input voltage) = 37,950(Revolution Per Minute)KV of the motor is defined by the strength of the magnetic field at the stator and no of turns in the winding.Motors with high KV values suited for lightweight propellers. A low KV value motor best suited for driving heavy propellers. N AND P NUMBER: As you shop around for brushless motor you will notice a code as shown in fig. Where 12N represents the number of the electromagnet in the stator and 14P represents no permanent magnets in the rotor. A typical 22## and 23## motors have 12 poles and 14 magnets. THRUST: Thrust plays a crucial role in choosing a motor. The thrust of a motor is usually measured in grams. The value of thrust depends upon how fast the motor is spinning and the propeller which is rotating. Before the drone can accelerate, a certain amount of thrust is needed to pull the gravity and overcome the drag force. THRUST TO WEIGHT RATIO: The general thrust to weight ratio is 2:1. You are not going to do any racing with this ratio. The thrust and weight ratio mostly depends upon the weight of the drone. Diatone Crusader GT has about 8:1 thrust to weight ratio. Some people have achieved 13:1. But there are some limitations in the motor because they spin so fast and spinning them faster makes the motor inefficient. TORQUE: Torque is a measurement of how quickly a motor can reach a certain RMP. Torque improves the accuracy of movements like flip and roll.  Heavier propeller requires more torque to spin than lighter propellers. Factors affecting the motor torque: Bigger the stator size higher the torque. Quality of magnets and copper windings. The air gap between rotor and stator. EFFICIENCY: The efficiency is calculated by the ratio of thrust produced by the motor at 100% throttle and power produced by the brushless motor. Efficiency is measured in grams per watt(g/w). higher the ratio the more efficient is the motor. We are not going to fly with 100% throttle whole time. Better to calculate efficiency of the motor through the whole throttle range from 0 to 100% throttle. Some motor is efficient at the lower end of throttle and some are efficient at higher of the throttle. So choose the right motor as per your requirement. TEMPERATURE: Temperature and heat decrease the life span of motors. If the motor