circuitdigestDetail3

Must Watch!



MustWatch



DIY Speedometer using Arduino and Processing Android App

Yes, you can also use this as a power bank for your mobiles on the go as the 18650 has high charge density and can easily be charged and discharged. and tested. The cool feature here is that you can customize your android app for your personalisation and add more features according to your creativity. But, if you do not want to build the app by yourself and just build the Arduino part then no worries, just download the APK file (read further) and install in your Android mobile phone. Also check the full Video at the end. So let’s see what materials we would need to build this project, and plan our budget. All these components are easily available; if you have trouble buying any of these let me know in the comment section.

Hardware Requirements:

Arduino Pro Mini (5V 16MHz) FTDI board (for programming mini you can also use UNO) 3V to 5V DC-DC Boost converter with USB output charger TP4056 Lithium battery Module Bluetooth Module (HC-05/HC-06) Hall effect sensor (US1881/04E) 18650 Lithium Cell Small piece of magnets Perf Board Berg sticks connectors (Male and Female) Soldering Kit Small enclosure boxes to mount the kit.

Programming Requirements:

Arduino IDE Processing IDE with android ADK (Only if you want to code your own app.) Windows/Mac PC Android Mobile Phone. It might look like a handful of components and materials, but trust me once you complete this project you would feel they are worth the time the effort.

Measuring Speed using Hall Sensor and Arduino:

To measure the speed we have to stick a small piece of magnet onto the wheel of the vehicle, each time the magnet crosses the hall sensor it will detect it and sends the information to the Arduino. An interrupt will be received by the Arduino each time the magnet is detected. We run a continuous timer by using millis() function and calculate the time taken for the wheel to complete two rotations (to minimise error) by using the below formulae: Timetaken = millis() ᾠpevtime; Once we know the time taken we can calculate the rpm by using the below formulae: rpm = (1000/timetaken) * 60; Where (1000/timetaken) gives the rps (Revolutions per second) and it is multiplied by 60 to convert rps to rpm (Revolutions per minute). After calculating the rpm we can calculate the velocity of the vehicle using the below formulae provided we know the radius of the wheel. v= radius_of_wheel * rpm * 0.37699;

Schematics and Hardware Part:

The complete Circuit diagram of the project is given below: This module has over charge/discharge protection and Reverse polarity protection. Hence the battery can be easily charged using a normal micro USB charger and can be safely discharged till it reaches the under voltage cut off limits. Some important details of the TP4056 charge module is given in the table below.
2.4V
4.2V
1A
Over Voltage and reverse polarity protection
TP4056 (charger IC) and DW01 Protection IC
Red- Charging in Progress Green ᾠCharge Complete
This board just contains two components one it the 10K resistor and the other is the hall sensor. The connections can be made as shown in the schematics above. Once the board is ready, connect them using jumper wires as per the schematics. Once it is done it should look something like this. using a wire. Since Li+ cells are explosive it is highly not recommended to use a soldering iron over these cells. Although people have done it, it is highly risky and can easily end up in a big mess. Hence the easy way to do it, is to use magnets as shown below of the battery (they get attracted to terminals very well) as shown above. You might use some duck tap to further secure the position of the magnet.

Programming the Arduino:

and explained using the comment lines. This is the place where the rpm of the vehicle is calculated. function. Once the code is ready lets dump it to our Arduino pro mini and test its working as shown in the Video given at the end.

Android Mobile Application for Speedometer:

The Android application for this project is made using software called Processing. If you are not interested in making your own Android application and would like to just install the one used here, you can download the APK file and install it directly in your Smart Phone by following the below steps. This APK file is made for Android version 4.4.2 and above (Kitkat an above). Extract the APK file from the zip file. 2. Transfer the .Apk file from your computer to your mobile phone. 3. Enable installing application from Unknown sources in your android settings. 4. Install the application. Ῡnstalled on your phone as shown below: The program is self-explained using the comment lines. But if you have any problem or if you want to get your application a modified a bit please use the comment section and I will help you out. The android program establishes a connection with our Bluetooth module during start up of the application and receives the speed of the vehicle which was calculated and broadcasted by the Arduino Pro mini. I have created a small graphics also to display the speed using a Analog speedometer to make it look a bit attractive. You can come up with your own ideas and tweak the code to personalize it for your needs. Also check our other Processing Projects to learn more about it: Ping Pong Game using Arduino Smart Phone Controlled FM Radio using Processing. Arduino Radar System using Processing and Ultrasonic Sensor Once you have installed the application to your mobile phone its time to test our project. But we have not yet mounted our kit to a vehicle yet. Let’s do it.

Mounting the Speedometer kit to a vehicle:

and connections and mounted it to your vehicle. One common important thing to note is that the magnet should be stuck to the rim of the wheel and the hall sensor should be mounted as close as possible to the magnet so that each time the magnet crosses the hall sensor it should be able to detect it, the arrangement is shown below. If you have decided to use my design files and print your enclosures then make sure your main perf board is close to the below dimensions If the board is similar to what is have made here then you can directly 3D print your enclosures using the given STL files or else you can use the Design files and modify it according to your board. Print the enclosure, place the circuit into it and harness your wires though the hole provided and then mount it to your vehicle so that the hall sensor is near the magnet as shown below. the enclosure for it so that we can make sure it fits in properly, because trust me it would be nightmare when you print your enclosure for 6 long hours and in the end it won’t fit into your perf board. The model board for my main perf board is shown below. I have designed the main box in two files, so that one part of the box will hold the electronics and the other will be permanently fixed to the cycle using clamps and bolts. These two parts can easily be fixed to gather to make a complete enclosure and then be separated when we need to recharge our lithium battery or work on our electronics. Once the first part of the enclosure is designed and printed lets place all our components inside as shown below and it should look something like this.. As you can see there are two openings in front of the box, one is used for the USB through which we can charge our mobile phone. The other is for the micro USB using which we can charge our lithium battery. Now let us print the second part of the main enclosure and check if it fits the first part as expected. Once we are satisfied with the parts we can mount the second part of the enclosure using a C-clamp and some nuts and bolt as shown below: Now let us connect the battery to our main circuit using magnets and tape as discussed above and keep it permanently safe inside our enclosure. That is it our hardware is ready for the final mounting. Simply connect the hall sensor module with the main board and slide the movable enclose into the fixed enclosure and it’s ready for action.

Working Explanation:

After making sure your lithium battery is charged up, simply turn on the kit by using the toggle switch and open your Android application. If everything goes well you should get the below screen and it should display that your app has connected to your Bluetooth module HC-05 as shown below. Remember to pair your Bluetooth module with phone before opening the application. Now simply ride your vehicle and you should notice the speedometer showing the current speed of your vehicle. You can also charge you mobile phone while riding by using a normal charger cable. Once you are done with your ride, you can slide off the box from the cycle and charge it from AC mains by using any smart phone mobile charger. Hope, you enjoyed the project. You can add app a lot more feature to this project, just by tweaking the codes. You can calculate the distance covered by your ride, the top and the average speed of your ride etc. Let me know if you have any quires through the comments and I will be happy to help you out. Code /*Arduino Code for measuring speed of the Vechile using Hall Sensor * Coded by Circuitdigest.com * On 14-04-2017 */ /*CONNECTION DETIALS * Arduino D11 -> RX of BT Module * Arduino D12 -> Tx of BT * Arduino D2 -> Hall sensor 3rd pin */ #include <SoftwareSerial.h>// import the serial library SoftwareSerial Cycle_BT(11, 12); // RX, TX int ledpin=13; // led on D13 will show blink on / off int BluetoothData; // the data given from Computer float radius_of_wheel = 0.33; //Measure the radius of your wheel and enter it here volatile byte rotation; // variale for interrupt fun must be volatile float timetaken,rpm,dtime; int v; unsigned long pevtime; void setup() { Cycle_BT.begin(9600); //start the Bluetooth communication at 9600 baudrate //pinMode(ledpin,OUTPUT); //LED pin aoutput for debugging attachInterrupt(0, magnet_detect, RISING); //secound pin of arduino used as interrupt and magnet_detect will be called for each interrupt rotation = rpm = pevtime = 0; //Initialize all variable to zero } void loop() { /*To drop to zero if vehicle stopped*/ if(millis()-dtime>1500) //no magnet found for 1500ms { rpm= v = 0; // make rpm and velocity as zero Cycle_BT.write(v); dtime=millis(); } v = radius_of_wheel * rpm * 0.37699; //0.33 is the radius of the wheel in meter } void magnet_detect() //Called whenever a magnet is detected { rotation++; dtime=millis(); if(rotation>=2) { timetaken = millis()-pevtime; //time in millisec for two rotations rpm=(1000/timetaken)*60; //formulae to calculate rpm pevtime = millis(); rotation=0; Cycle_BT.write(v); //Cycle_BT.println("Magnet detected...."); //enable while testing the hardware } } Video microcontroller-projects/arduino-radar-using-android-and-ultrasonic-sensor

Arduino Radar System using Processing Android App and Ultrasonic Sensor

that has night mode with tilt and pan option will burn a big hole on our pockets. Hence let us make an economic device which does almost the same but without any video features. Also we are mounting the US (Ultra Sonic) sensor over a servo motor, this servo motor can be either be set to rotate automatically to scan the area or can be rotated manually using our Mobile app, so that we can focus the ultrasonic sensor in our required direction and sense the objects present over there. All the information sensed by the US sensor will be broadcasted to our Smart phone using Bluetooth Module (HC-05). So it will work like a Sonar or a Radar. Interesting right?? .... Let us see what we would require to do this project.

Requirements:

A +5V power supply ( I am using my Arduino (another) board for power supply) Arduino Mega (You can use anything from pro mini to Yun) Servo Motor (any rating) Bluetooth Module (HC-05) Ultra Sonic Sensor (HC-SR04) Breadboard (not mandatory) Connecting wires Android mobile Computer for programming Arduino Software Android SDK Processing Android (To create mobile application) for easy understanding. People who are new to processing need not fear much because the complete code is given at the end of the tutorial which can be used as such.

Downloading and InstallingSoftwares:

Download the software according to your OS and install it. The Arduino IDE will require a driver to communicate with your Arduino Hardware. This driver should get installed automatically once you connect your board with your computer. Try uploading a blink program from examples to make sure you Arduino is up and running.

Arduino Hardware part and Circuit Diagram:

If you do not have an external +5V supply at your reach, you can share the components between two Arduino boards as I have done. I have connected the Servos power rails to another Arduino board (red colour) and connected the Bluetooth module HC-05 and Ultrasonic sensor HC-SR04 to the Arduino mega. CAUTION: Powering up all these modules using one Arduino board will fry up the Arduino voltage regulator. is given below: Once the connections are made, mount the US sensor onto your Servo motor as shown below: I have used a small plastic piece that was in my junk and a double side tape to mount the sensor. You can come up with your own idea to do the same. There are also servo holders available in market which can be used for the same purpose. Once the Servo is mounted and the Connections are given, it should look something like this. Follow the schematics on top if get any connections wrong. Now let us start programming the Arduino Mega using the Arduino IDE.

Arduino Software Part:

and send it to our mobile application. We also have to write code for our servo motor to sweep and also get controlled from the data received by the Bluetooth module. But don’t worry the program is lot simpler than you can image, thanks to Arduino and its libraries. The complete code is given below in the code section. loops are used to achieve the same. The function us() is called inside both functions to calculate the distance in between the sensor and the object and broadcast it to the Bluetooth. A delay of 50 ms is given to make the servo rotate slowly. The slower the motor rotates the accurate your readings become. //**Function for servo to sweep**// void servofun() { Serial.println("Sweeping"); //for debugging for(posc = 10;posc <= 170;posc++) // Using 10 to 170 degree is safe than 0 to 180 because some servo might not be operational at extreme angels { servo.write(posc); // set the position of servo motor delay(50); us(); //measure the distance of objects sing the US sensor } for(posc = 170;posc >= 10;posc--) { servo.write(posc); delay(50); us(); //measure the distance of objects sing the US sensor } Serial.println ("Scan Complete"); //for debugging flag=0; } //**End of Servo sweeping function**// //**Function to control Servo manually**// void manualservo() { us(); // Get value from user and control the servo if (Blueboy.available()) { BluetoothData=Blueboy.read(); Serial.println(BluetoothData); servo.write(BluetoothData); Serial.println("Written"); if (BluetoothData == 'p') { flag=0; } } } //__End of manual control function__// It works with a simple formulae that Speed = Distance/time. Since we know the speed of the US wave and the time taken the distance can be calculated using the above formulae. //**Function to measure the distance**// void us() { int duration, distance; digitalWrite(trigPin, HIGH); delayMicroseconds(1000); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration/2) / 29.1; // Calculates the distance from the sensor if (distance<200 && distance >0) Blueboy.write(distance); } //__End of distance measuring function__// at the end for complete working.

Android Mobile Application for Ultrasonic Radar:

If you do not want to make your own application and instead just want to install the same application used in this tutorial you can follow the steps below. This APK file is made for Android version 4.4.2 and above (Kitkat an above). Extract the APK file from the zip file. 2. Transfer the .Apk file from your computer to your mobile phone. 3. Enable installing application from Unknown sources in your android settings. 4. Install the application. installed on your phone as shown below: If you have installed this APK, then you can skip the below part and jump to the next section. Either you can use the .APK file given above or you can build your own app using Processing as explained here. With little knowledge on programming it is also very easy to write your own code for your android application. However if you are just beginning then it is not advisable to start with this code since its a bit high than the beginner level. is used to plot graphs for our radar system. Do not forget to install the above mentioned libraries and do not copy paste the code part alone, because the code imports images from data folder which altogether is given in above attachment. Hence download and use only that.

Working Explanation:

Once the connection is established you will get the following screen: A blue graph is also plotted on the red background based on the measured distance. The closer the object gets the more the taller the blue area gets. The graph measured when some objects are placed near is also shown in the second figure above. To do these, simply click on stop button. This will stop your servo from sweeping automatically. You can also find a circular wheel at the bottom of the screen which when swiped will rotate in clock or anti clock wise direction. By swiping this wheel you can also make your servo motor turn in that particular direction. The wheel and the graph updated when swiped are shown in the picture below. is given below and the APK file for android Application is here. The working of the complete project is shown in the video below. Hope you understood the project. If you have any quires, kindly use the comment section below. Code /* * DIY-RADAR * by www.circuitdigest.com * * US Sensor * trigpin >> 4 * echopin >> 5 * * Servo motor * signal pin >> 9 * * Hc-05 * tx >> 10 * Rx >> 11 * * WARNING * Do not power up all your modules to a single Arduino the current drawn will fry your arduino board. Use separate supply. * */ //*Include the required header files**// #include <Servo.h> #include <SoftwareSerial.h> //__End of including headers__// //**Defining pins for US sensor**// #define trigPin 4 #define echoPin 5 ///__End of defaniton__// SoftwareSerial Blueboy(10, 11); //Naming our Bluetooth module as Blueboy and defiing the RX and TX pins as 10 and 11 Servo servo; //Initializing a servo object called servo //**Global variabel declarations**// int BluetoothData; int posc = 0; int flag=10; //__End of global variable declartion__// void setup() //Runce only once { servo.attach(9); //Servo is connected to pin 9 pinMode(trigPin, OUTPUT); //trigpin of US sensor is output pinMode(echoPin, INPUT); //echopin of US sensor is Input Serial.begin(38400); //Serial monitor is started at 38400 baud rate for debugging Blueboy.begin(9600); //Bluetooth module works at 9600 baudrate Blueboy.println("Blueboy is active"); //Conformation from Bluetooth } void loop() //The infinite loop { //**Program to start or stop the Survilance devide**// if (Blueboy.available()) { Serial.println("Incoming"); //for debugging BluetoothData=Blueboy.read(); //read data from bluetooth Serial.println(BluetoothData); //for debugging if (BluetoothData == 'p') //if the mobile app has sent a 'p' { flag=0; //play the device in auto mode } if (BluetoothData == 's') //if the mobile app has sent a 's' { flag=1; //stop the device and enter manual mode } Serial.println(flag); //for debugging } if (flag==0) servofun(); //Servo sweeps on own if (flag==1) manualservo(); //Manual sweeping } //_End of loop program__// //**Function for servo to sweep**// void servofun() { Serial.println("Sweeping"); //for debugging for(posc = 10;posc <= 170;posc++) // Using 10 to 170 degree is safe than 0 to 180 because some servo might not be operational at extreme angels { servo.write(posc); // set the position of servo motor delay(50); us(); //measure the distance of objects sing the US sensor } for(posc = 170;posc >= 10;posc--) { servo.write(posc); delay(50); us(); //measure the distance of objects sing the US sensor } Serial.println ("Scan Complete"); //for debugging flag=0; } //**End of Servo sweeping function**// //**Function to control Servo manually**// void manualservo() { us(); // Get value from user and control the servo if (Blueboy.available()) { BluetoothData=Blueboy.read(); Serial.println(BluetoothData); servo.write(BluetoothData); Serial.println("Written"); if (BluetoothData == 'p') { flag=0; } } } //__End of manual control function__// //**Function to measure the distance**// void us() { int duration, distance; digitalWrite(trigPin, HIGH); delayMicroseconds(1000); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration/2) / 29.1; // Calculates the distance from the sensor if (distance<200 && distance >0) Blueboy.write(distance); } //__End of distance measuring function__// Video microcontroller-projects/arduino-weight-measurement-using-load-cell

Arduino Weight Measurement using Load Cell and HX711 Module

, having a capacity of measuring up to40kg. This limit can be further increased by using the Load cell of higher capacity. etc, you can also check them out if interested.

Required Components to build an Arduino Weight Scale:

Arduino Uno Load cell (40kg) HX711 Load cell Amplifier Module 16x2 LCD Connecting wires USB cable Breadboard Nut bolts, Frame, and base

Load Cell and HX711 WeightSensor Module:

The magnitude of this electrical output is directly proportional to the force being applied. Load cells have a strain gauge, which deforms when pressure is applied to it. And then strain gauge generates an electrical signal on deformation as its effective resistance changes on deformation. A load cell usually consists of four strain gauges in a Wheatstone bridge configuration. Load cell comes in various ranges like 5kg, 10kg, 100kg and more, here we have used Load cell, which can weigh up to40kg. of Load cells and then this amplified & digitally converted signal is fed into the Arduino to derive the weight. The load cell is connected with the HX711 Load cell Amplifier using four wires. These four wires are Red, Black, White, and Green/Blue. There may be a slight variation in the colors of wiresfrom module to module. Below the connection details and diagram: RED Wire is connected to E+ BLACK Wire is connected to E- WHITE Wire is connected to A- GREEN Wire is connected to A+ A base is also required to fix the load cell over it by using nuts and bolts. Here we have used hard cardboard for the frame for placing things over it and a wooden board as a Base. Now do the connections as shown in the circuit diagram and you are ready to go.

Circuit Explanation:

pins RS, EN, d4, d5, d6, and d7 are connected with pin numbers 8, 9, 10, 11, 12, and 13 of Arduino respectively. HX711 Module’s DT and SCK pins are directly connected with Arduino's pins A0 and A1. Load cell connections with the HX711 module are already explained earlier and also shown in the below circuit diagram.

Working Explanation:

for calibration purposes, check the code below. then put the 100g weight over the load cell and wait. After some seconds the calibration process will be finished. After calibration user may put any weight (max 40kg) over the load cell and can get the value over LCD in grams. at the end of this tutorial.

Arduino Weighing Scale Code:

We have just followed the datasheet of HX711 and application notes. Although there are some libraries present for this purpose, where you only need to include that library and you can get the weight using one line of code. First of all, we have included a header file for LCD and defined the pins for the same. And for push-button also. Then declared some variables for calculation purpose. #include <LiquidCrystal.h> LiquidCrystal lcd(8, 9, 10, 11, 12, 13); #define DT A0 #define SCK A1 #define sw 2 long sample=0; float val=0; long count=0; After it, we have created the below function for reading data from the HX711 module and return its output. unsigned long readCount(void) { unsigned long Count; unsigned char i; pinMode(DT, OUTPUT); digitalWrite(DT,HIGH); digitalWrite(SCK,LOW); Count=0; pinMode(DT, INPUT); while(digitalRead(DT)); for (i=0;i<24;i++) { digitalWrite(SCK,HIGH); Count=Count<<1; digitalWrite(SCK,LOW); if(digitalRead(DT)) Count++; } digitalWrite(SCK,HIGH); Count=Count^0x800000; digitalWrite(SCK,LOW); return(Count); } void setup() { Serial.begin(9600); pinMode(SCK, OUTPUT); pinMode(sw, INPUT_PULLUP); lcd.begin(16, 2); lcd.print(" Weight "); lcd.setCursor(0,1); lcd.print(" Measurement "); delay(1000); lcd.clear(); calibrate(); } function, we have read data from HX711 module and converted this data into weight (grams) and sent it to the LCD. void loop() { count= readCount(); int w=(((count-sample)/val)-2*((count-sample)/val)); Serial.print("weight:"); Serial.print((int)w); Serial.println("g"); lcd.setCursor(0,0); lcd.print("Weight "); lcd.setCursor(0,1); lcd.print(w); lcd.print("g "); if(digitalRead(sw)==0) { val=0; sample=0; w=0; count=0; calibrate(); } } Before this, we have created a calibration function in which we have calibrated the system by placing the 100gm weight over the Load cell. void calibrate() { lcd.clear(); lcd.print("Calibrating..."); lcd.setCursor(0,1); lcd.print("Please Wait..."); for(int i=0;i<100;i++) { count=readCount(); sample+=count; Serial.println(count); } ..... .... ..... ..... to measure the weights. In our text tutorials, we will create some applications based on weight measurement like Smart container, Automatic gate etc. Code #include <LiquidCrystal.h> LiquidCrystal lcd(8, 9, 10, 11, 12, 13); #define DT A0 #define SCK A1 #define sw 2 long sample=0; float val=0; long count=0; unsigned long readCount(void) { unsigned long Count; unsigned char i; pinMode(DT, OUTPUT); digitalWrite(DT,HIGH); digitalWrite(SCK,LOW); Count=0; pinMode(DT, INPUT); while(digitalRead(DT)); for (i=0;i<24;i++) { digitalWrite(SCK,HIGH); Count=Count<<1; digitalWrite(SCK,LOW); if(digitalRead(DT)) Count++; } digitalWrite(SCK,HIGH); Count=Count^0x800000; digitalWrite(SCK,LOW); return(Count); } void setup() { Serial.begin(9600); pinMode(SCK, OUTPUT); pinMode(sw, INPUT_PULLUP); lcd.begin(16, 2); lcd.print(" Weight "); lcd.setCursor(0,1); lcd.print(" Measurement "); delay(1000); lcd.clear(); calibrate(); } void loop() { count= readCount(); int w=(((count-sample)/val)-2*((count-sample)/val)); Serial.print("weight:"); Serial.print((int)w); Serial.println("g"); lcd.setCursor(0,0); lcd.print("Weight "); lcd.setCursor(0,1); lcd.print(w); lcd.print("g "); if(digitalRead(sw)==0) { val=0; sample=0; w=0; count=0; calibrate(); } } void calibrate() { lcd.clear(); lcd.print("Calibrating..."); lcd.setCursor(0,1); lcd.print("Please Wait..."); for(int i=0;i<100;i++) { count=readCount(); sample+=count; Serial.println(count); } sample/=100; Serial.print("Avg:"); Serial.println(sample); lcd.clear(); lcd.print("Put 100g & wait"); count=0; while(count<1000) { count=readCount(); count=sample-count; Serial.println(count); } lcd.clear(); lcd.print("Please Wait...."); delay(2000); for(int i=0;i<100;i++) { count=readCount(); val+=sample-count; Serial.println(sample-count); } val=val/100.0; val=val/100.0; // put here your calibrating weight lcd.clear(); } Video microcontroller-projects/arduino-solar-panel-tracker

Sun Tracking Solar Panel using Arduino

, in which we will use two LDRs (Light-dependent resistor) to sense the light and a servo motor to automatically rotate the solar panel in the direction of the sunlight. The advantage of this project is that the Solar panels will always follow the sunlight will always face the sun to get charge all the time and can provide the supply the maximum power. The prototype is very easy to build. Below you will find the complete description of how it works and how the prototype is made.

Required Components for Arduino Solar Tracker:

The followingare the component requires to build asolar tracking system using Arduino, most of the components should be available in your local shop. Servo Motor (sg90) Solar panel Arduino Uno LDR’s X 2 (Light Dependent Resistor) 10K resistors X 2 Battery (6 to 12V)

How does a single axis solar tracker work?

at the end of this Article.

How to build a rotating solar panel using Arduino:

To make the prototype, you will have to follow the below steps: First of all, take a small piece of cardboard and make a hole at one end. We will insert the screw in it to fix it with the servo later on. Now fix two small pieces of cardboard with each other in a V shape with help of glue or hot gun and place solar panel on it. Then attach the bottom side of the V shape to the other end of small piece of cardboard in which you made a hole in first step. Now insert the screw in the hole you made on card board and insert it through the hole into the servo. The screw comes with the servo motor when you buy it. Now place the servo on another piece of cardboard. The size of the cardboard should be larger enough so that you can place a Arduino Uno, a breadboard and a battery on it. Attach the LDRs on the two sides of the solar panel with the help of glue. Make sure you have soldered the wires with the legs of the LDR’s. You will have to connect these with the resistors later on. Now place the Arduino, battery and the breadboard on the cardboard and make the connection as described in the Circuit diagram and Explanation section below. The final prototype is shown below.

Circuit Diagram and Explanation:

The complete circuit diagram for the solar tracking arduino project is shown below. As you can see the circuit is very simple and can easily be builtwith help of a small breadboard. , Arduino is powered by the 9V battery and all the other parts are powered by the Arduino. Arduino recommended input voltage is from 7 to 12 volts but you can power it within the range of 6 to 20 volts which is the limit. Try to power it within the recommended input voltage. So connect the positive wire of the battery to the Vin of the Arduino and the negative wire of the battery to the ground of the Arduino. Connect the positive wire of the servo to the 5V of Arduino and ground wire to the ground of the Arduino and then connect the signal wire of Servo to the digital pin 9 of Arduino. The servo will help in moving the solar panel. Connect one end of the LDR to the one end of the 10k resistor and also connect this end to the A0 of the Arduino and connect the other end of that resistor to the ground and connect the other end of LDR to the 5V. Similarly, connect the one end of the second LDR to the one end of the other 10k resistor and also connect that end to the A1 of Arduino and connect the other end of that resistor to the ground and connect the other end of LDR to 5V of Arduino.

Single-axis solar tracker using Arduino code:

is easy and well explained by comments. First of all, we will include the library for servo motor. Then we will initialize the variable for the initial position of the servo motor. After that, we will initialize the variables to read from the LDR sensors and Servo. #include <Servo.h> //including the library of servo motor Servo sg90; //initializing a variable for servo named sg90 int initial_position = 90; //Declaring the initial position at 90 int LDR1 = A0; //Pin at which LDR is connected int LDR2 = A1; //Pin at which LDR is connected int error = 5; //initializing variable for error int servopin=9; command will read Servo from the pin 9 of Arduino. Next, we set the LDR pins as input pins so that we can read the values from the sensors and move the solar panel according to that. Then we set the servo motor at 90 degree which is the initial position for the servo. void setup() { sg90.attach(servopin); // attaches the servo on pin 9 pinMode(LDR1, INPUT); //Making the LDR pin as input pinMode(LDR2, INPUT); sg90.write(initial_position); //Move servo at 90 degree delay(2000); // giving a delay of 2 seconds } and its value is 5, the use of this variable is that if the difference between the two LDRs will be under 5 then the servo will not move. If we will not do this then the servo will keep on rotating. And if the difference is greater than error value (5) then the servo will move the solar panel in the direction of the LDR, on which light is falling. Check the Full Code and demo Video below. int R1 = analogRead(LDR1); // reading value from LDR 1 int R2 = analogRead(LDR2); // reading value from LDR 2 int diff1= abs(R1 - R2); // Calculating the difference between the LDR's int diff2= abs(R2 - R1); if((diff1 <= error) || (diff2 <= error)) { //if the difference is under the error then do nothing } else { if(R1 > R2) { initial_position = --initial_position; //Move the servo towards 0 degree } if(R1 < R2) { initial_position = ++initial_position; //Move the servo towards 180 degree } } , which will automatically move towards the light like a sunflower. Here we have used the low power solar panel to reduce the weight, if you are planning to use high power or heavy solar panel then you need to choose the Servo motor accordingly. Code /* Arduino solar tracker code */ #include <Servo.h> //including the library of servo motor Servo sg90; //initializing a variable for servo named sg90 int initial_position = 90; //Declaring the initial position at 90 int LDR1 = A0; //Pin at which LDR is connected int LDR2 = A1; //Pin at which LDR is connected int error = 5; //initializing variable for error int servopin=9; void setup() { sg90.attach(servopin); // attaches the servo on pin 9 pinMode(LDR1, INPUT); //Making the LDR pin as input pinMode(LDR2, INPUT); sg90.write(initial_position); //Move servo at 90 degree delay(2000); // giving a delay of 2 seconds } void loop() { int R1 = analogRead(LDR1); // reading value from LDR 1 int R2 = analogRead(LDR2); // reading value from LDR 2 int diff1= abs(R1 - R2); // Calculating the difference between the LDR's int diff2= abs(R2 - R1); if((diff1 <= error) || (diff2 <= error)) { //if the difference is under the error then do nothing } else { if(R1 > R2) { initial_position = --initial_position; //Move the servo towards 0 degree } if(R1 < R2) { initial_position = ++initial_position; //Move the servo towards 180 degree } } sg90.write(initial_position); // write the position to servo delay(100); } Video microcontroller-projects/arduino-smoke-detector-on-pcb-using-mq2-gas-sensor

Smoke Detector using MQ2 Gas Sensor and Arduino

is also sensible to LPG, Alcohol, and Methane etc. We have explained the whole process in this Article and also provided PCB layout for this Arduino Shield so that you can also order this Shield if you need.

Components Required:

Arduino UNO Smoke Detector Arduino Shield (Self Designed) Power Supply Smoke Sensor (MQ2) Resistors (10K and 1K) Buzzer 16x2 LCD 10k POT LED LM358 Burg strips

Designing Smoke Detector Shield for Arduino:

we have used EasyEDA, in which first we have designed a Schematic and then converted that into the PCB layout by Auto Routing feature of EasyEDA. for making Schematics, PCB layouts, Simulating the Circuits etc. : Below is the Snapshot of Top layer of PCB layout from EasyEDA, you can view any Layer (Top, Bottom, Topsilk, bottomsilk etc) of the PCB by selecting the layer form the ‘LayersᾠWindow. , where we have explained the process step by step.

Ordering the PCB online:

or download Gerber files of your PCB and send them to any manufacturer, it’s also a lot easier (and cheaper) to order it directly in EasyEDA. Here you can select the number of PCBs you want to order, how manycopper layers you need, the PCB thickness, copper weight, and even the PCB color. Afteryou have selected all of theoptions, click “Save to Cartᾠand complete your order, to receive yourPCBs within few days. After few days of ordering the PCB, we got our Smoke Detector Arduino Shield PCB, and we found the PCBs in nice packaging and the quality of PCB is quite impressive. and burg strips over the PCB, you can have a final look here: Align the Pins of this Shield with the Arduino and firmly press it over the Arduino. Now just upload the code to the Arduino and power on circuit and you are done! Your Smoke Detector is ready to test. Check the Video at the endfor demonstration.

Circuit Explanation:

is placed as an alarm which gets triggered when smoke level goes beyond 1000 PPM. for comparing output voltage of smoke sensor with preset voltage (output connected at pin D7). Also smoke sensor output is connected at an analog pin of Arduino (A0). Buzzer is connected at Pin D9. And LCD connections are same as Arduino LCD examples that are available in Arduino IDE (12, 11, 5, 4, 3, 2). Remaining connections are shown in the circuit diagram. Note: In the circuit we need to short all the three pin of J2 header to calculate PPM of smoke.

Programming Explanation:

with respect to clean air. After reading datasheet, we get some values that we will need in the Code to calculate ppm of smoke in air. Here mostly we need curve values (we take two points from the curve), sensor resistance (will be calculated in code), clean air constant (9.83) and Load Resistance (I used 10K). We can find curve values from the datasheet and we can put load resistance 5k-54k and then we will calculate sensor resistance by these value and smoke samples. Take two points from the curve and take log of them like point one: (lg200, lg3.4)=(2.3,0.53) and point two: (lg10000,lg0.63)=(4,-0.20). Then find slope of the curve using Formula: (y2-y1)/(x2-x1), then take one point and slope (-0.44) and use them in the Program (x, y, slope). Further check the Code below to understand the Calculation. First we need to include header file for LCD and define pins for the same. Then define curve values and load resistance. #include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); #define buzzer 9 #define sensor A0 #define load_Res 10 #define air_factor 9.83 float SmokeCurve[3] ={2.3,0.53,-0.44}; float Res=0; function: void setup() { lcd.begin(16,2); lcd.print("Calibrating....."); Res = SensorCalibration(); lcd.print("Calibration done."); lcd.setCursor(0,1); lcd.print("Res="); lcd.print(Res); lcd.print("kohm"); delay(2000); lcd.clear(); pinMode(buzzer, OUTPUT); } float SensorCalibration() { int i; float val=0; val=resistance(50,500); val = val/air_factor; return val; } Function: void loop() { lcd.setCursor(0,0); lcd.print("SMOKE:"); float res=resistance(5,50); res/=Res; int result=pow(10,(((log(res)-SmokeCurve[1])/SmokeCurve[2]) + SmokeCurve[0])); lcd.print(result); lcd.print( " ppm "); if(result>1000) { digitalWrite(buzzer, HIGH); delay(2000); } else digitalWrite(buzzer, LOW); delay(500); } float resistance(int samples, int interval) { int i; float res=0; for (i=0;i<samples;i++) { int adc_value=analogRead(sensor); res+=((float)load_Res*(1023-adc_value)/adc_value); delay(interval); } res/=samples; return res; } Note: Before calibrating the module, leave the project for 10 minute in clean air with power On and then start the calibration. This calibration process will take at least 25 seconds. below. PCB designing services, and made those PCB layouts Public so that anyone can use them to order this Smoke Detector Shield. Code #include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); #define buzzer 9 #define sensor A0 #define load_Res 10 #define air_factor 9.83 float SmokeCurve[3] ={2.3,0.53,-0.44}; // (x, y, slope) x,y coordinate of one point and the slope between two points float Res=0; void setup() { lcd.begin(16,2); lcd.print("Calibrating....."); Res = SensorCalibration(); lcd.print("Calibration done."); lcd.setCursor(0,1); lcd.print("Res="); lcd.print(Res); lcd.print("kohm"); delay(2000); lcd.clear(); pinMode(buzzer, OUTPUT); } void loop() { lcd.setCursor(0,0); lcd.print("SMOKE:"); float res=resistance(5,50); res/=Res; int result=pow(10,(((log(res)-SmokeCurve[1])/SmokeCurve[2]) + SmokeCurve[0])); lcd.print(result); lcd.print( " ppm "); if(result>1000) { digitalWrite(buzzer, HIGH); delay(2000); } else digitalWrite(buzzer, LOW); delay(500); } float resistance(int samples, int interval) { int i; float res=0; for (i=0;i<samples;i++) { int adc_value=analogRead(sensor); res+=((float)load_Res*(1023-adc_value)/adc_value); delay(interval); } res/=samples; return res; } float SensorCalibration() { int i; float val=0; val=resistance(50,500); val = val/air_factor; return val; } Video microcontroller-projects/diy-arduino-robotic-arm-tutorial

Arduino Based Robotic Arm

or we can convert it into a Crane by doing some easy tweaks. This project will be helpful for beginners who want to learn to develop a Simple Robot in low cost or just want to learn working with Arduino and servo motors.

Components Required

Arduino Uno 1000uF Capacitor (4 pieces) 100nF Capacitor (4 pieces) Servo Motor (SG 90- four pieces) 10K pot- Variable Resistor (4 pieces) Power Supply (5v- preferably two) to learn more about it. In Arduino we have predefined libraries to control the Servo, so it is very easy to control servo, which you will learn along with this tutorial.

Construction of Robotic Arm

Take a flat and stable surface, like a table or a hard card board. Next place a servo motor in the middle and glue it in place. Make sure the degree of rotation is in the area presented in figure. This servo acts as base of arm. on this piece of board and glue it in place. The servo rotation must match the diagram. in the first hole. Now cut another cardboard piece with lengths shown in figure below and glue another gear at the bottom of this piece. at the edge of second piece as shown in figure. With this, two pieces together looks like. When we attach this setup to the base it should look like, like a robotic hand. For hook, cut another two pieces of card board of lengths 1cmx7cm & 4cmx5cm. Glue them together as shown in figure and stick final gear at the very edge. With this, our basic robotic arm design got completed and that's how we have built our low cost robotic arm. Now connect the circuit in breadboard as per circuit diagram.

Circuit Diagram and Working Explanation:

is shown below. The voltage across variable resistors is not completely linear; it will be a noisy one. So to filter out this noise, capacitors are placed across each resistor as shown in figure. Now we will feed the voltage provided by these variable resistor (voltage which represents position control) into ADC channels of Arduino. We are going to use four ADC channels of UNO from A0 to A3 for this. After the ADC initialization, we will have digital value of pots representing the position needed by user. We will take this value and match it with servo position. , with the help of below functions: 1. analogRead(pin); 2. analogReference(); 3. analogReadResolution(bits); As default we get the maximum board ADC resolution which is 10bits, this resolution can be changed by using instruction (“analogReadResolution(bits);ᾩ. ) file takes care of all the duty ratio calculations internally. #include <Servo.h> servo servo0; servo0.attach(3); servo0.write(degrees); as we are going to use four. Third statement states where the servo signal pin is connected; this must be a PWM pin. Here we are using PIN3 for first servo. Fourth statement gives commands for positioning servo motor in degrees. If it is given 30, the servo motor rotates 30 degrees. Now, we have SG90 servo position from 0 to 180 and the ADC values are from 0-1023. We will use a special function which matches both values automatically. sensorvalue0 = map(sensorvalue0, 0, 1023, 0, 180); below.

How to Operate Robotic Arm:

Code #include <Servo.h> Servo servo0; Servo servo1; Servo servo2; Servo servo3; int sensorvalue0; int sensorvalue1; int sensorvalue2; int sensorvalue3; void setup() { pinMode(A0,INPUT); pinMode(3,OUTPUT); servo0.attach(3); pinMode(A1,INPUT); pinMode(5,OUTPUT); servo1.attach(5); pinMode(A2,INPUT); pinMode(6,OUTPUT); servo2.attach(6); pinMode(A3,INPUT); pinMode(9,OUTPUT); servo3.attach(9); } void loop() { sensorvalue0 = analogRead(A0); sensorvalue0 = map(sensorvalue0, 0, 1023, 0, 180); servo0.write(sensorvalue0); sensorvalue1 = analogRead(A1); sensorvalue1 = map(sensorvalue1, 0, 1023, 0, 180); servo1.write(sensorvalue1); sensorvalue2 = analogRead(A2); sensorvalue2 = map(sensorvalue2, 0, 1023, 0, 180); servo2.write(sensorvalue2); sensorvalue3 = analogRead(A3); sensorvalue3 = map(sensorvalue3, 0, 1023, 0, 180); servo3.write(sensorvalue3); } Video microcontroller-projects/g-sensor-controlled-robot-car-arduino

Mobile Phone Controlled Robot Car using G-Sensor and Arduino

for this G-Sensor Controlled Robot. RemoteXY app is used to create the interface in the Smart Phone for controlling the Robot. We will add the joystick in the interface so that Robot can also be controlled by Joystick as well as by tilting the phone.

Required Components:

Two wheel robot car chassis Arduino UNO L298N Motor Controller HC-06 Bluetooth module (HC-05 will work too) Power supply or Cells Connecting wires

Creating Interface for Robot using RemoteXY app:

For creating the interface to control the Robot Car using RemoteXY app, you will have to go to following link The webpage will look like this The button will turn on the light at pin 13 which is connected internally in the Arduino and the joystick will move the robot car. The webpage after placing the switch and the joystick will look like this. along with the joystick, so that we can move the Robot Car by tilting the phone in left, right, up and down direction. Using that button we can enable and disable G sensor, when G sensor is disabled Car can be controlled by moving the Joystick. So to place the G sensor enable/disable button, click on the joystick you placed in the interface and on the left side there will be a properties section, there will be a option in the end for placing the G sensor button near the joystick, so place the G sensor button where ever you will like. The webpage after this will look like this. or go to the Play Store and download RemoteXY app from there for you Android Smart Phone.

Circuit Diagram and Explanation:

First of all, we will interface the L298N motor controller with the Arduino. Connect the ENA and ENB pin of the motor controller to the Arduino pin 12 and 11 respectively. These two pins are for the PWM control of the motor. Using theses pins, we can increase or decrease the speed of car. Then connect the IN1, IN2, IN3 and IN4 to the Arduino pins 10, 9, 8 and 7 respectively. These pins will rotate the motors in both directions (clockwise and anti-clockwise). To power the motor, connect the positive and negative of the battery to the 12V and the ground of the motor controller. Then connect the 5V and the ground from the motor controller to the Arduino Vin and the ground. to learn more about using Bluetooth with Arduino.

Code Explanation:

is given below in Code section, here we will understand how this code is working. First of all, we have included the libraries for Software Serial and RemoteXY. The RemoteXY library will help us in setting the app with Arduino, through which we will control the robot car. After that, we have defined the pins for the Bluetooth module, TX from the Bluetooth module is connected to the pin 2 of Arduino which is the RX pin of Arduino and the RX from the Bluetooth module is connected to the pin 3 of the Arduino which is the TX pin of Arduino and set the baud rate of the Bluetooth module at 9600. #define REMOTEXY_MODE__SOFTWARESERIAL #include <SoftwareSerial.h> //Including the software serial library #include <RemoteXY.h> //Including the remotexy library /* RemoteXY connection settings */ #define REMOTEXY_SERIAL_RX 2 //defining the pin 2 as RX pin #define REMOTEXY_SERIAL_TX 3 //defining the pin 3 as TX pin #define REMOTEXY_SERIAL_SPEED 9600 //setting baudrate at 9600 The following code will increase or decrease the motor speed. When the joystick will be at the center, the speed will be zero and when it will be in the forward direction then the speed will increase from zero to 100. The speed will be decrease from 0 to -100 when the car will move in the reverse direction. The car can also be moved specific speed, this can be done by giving the PWM signal. The pwm signal will be given to the motors according to the rotation of the joystick. if (motor_speed>100) motor_speed=100; if (motor_speed<-100) motor_speed=-100; if (motor_speed>0) { digitalWrite(pointer[0], HIGH); digitalWrite(pointer[1], LOW); analogWrite(pointer[2], motor_speed*2.55); } else if (motor_speed<0) { digitalWrite(pointer[0], LOW); digitalWrite(pointer[1], HIGH); analogWrite(pointer[2], (-motor_speed)*2.55); } else { digitalWrite(pointer[0], LOW); digitalWrite(pointer[1], LOW); analogWrite(pointer[2], 0); } function will be called. void loop() { RemoteXY_Handler (); digitalWrite (ledpin, (RemoteXY.switch_1==0)?LOW:HIGH); Speed (first_motor, RemoteXY.joystick_1_y - RemoteXY.joystick_1_x); Speed (second_motor, RemoteXY.joystick_1_y + RemoteXY.joystick_1_x); }

How to run it:

Add the library of the RemoteXY to the Arduino libraries and upload the code in the Arduino IDE. Then download the app in your mobile phone and then turn on the Bluetooth. The interface of the app will look like this Then go to Bluetooth and turn on the Bluetooth there. After turning it on, it will show you the Bluetooth devices. Select your HC-06 Bluetooth module from there, it will take you to the interface, from where you can control the Robot Car. in between (like Arduino). Code #define REMOTEXY_MODE__SOFTWARESERIAL #include <SoftwareSerial.h> //Including the software serial library #include <RemoteXY.h> //Including the remotexy library /* RemoteXY connection settings */ #define REMOTEXY_SERIAL_RX 2 //defining the pin 2 as RX pin #define REMOTEXY_SERIAL_TX 3 //defining the pin 3 as TX pin #define REMOTEXY_SERIAL_SPEED 9600 //setting baudrate at 9600 unsigned char RemoteXY_CONF[] = //remotexy configuration { 3,0,23,0,1,5,5,15,41,11 ,43,43,1,2,0,6,5,27,11,5 ,79,78,0,79,70,70,0 }; struct { //Function for declaring the variables signed char joystick_1_x; //joystick x-axis signed char joystick_1_y; //joystick y-axis unsigned char switch_1; //variables for switch unsigned char connect_flag; } RemoteXY; //defining the pins for first motor #define IN1 10 #define IN2 9 #define ENA 12 //defining the pins for second motor #define IN3 8 #define IN4 7 #define ENB 11 //defining the LED pin #define ledpin 13 unsigned char first_motor[3] = {IN1, IN2, ENA}; unsigned char second_motor[3] = {IN3, IN4, ENB}; void Speed (unsigned char * pointer, int motor_speed) { if (motor_speed>100) motor_speed=100; if (motor_speed<-100) motor_speed=-100; if (motor_speed>0) { digitalWrite(pointer[0], HIGH); digitalWrite(pointer[1], LOW); analogWrite(pointer[2], motor_speed*2.55); } else if (motor_speed<0) { digitalWrite(pointer[0], LOW); digitalWrite(pointer[1], HIGH); analogWrite(pointer[2], (-motor_speed)*2.55); } else { digitalWrite(pointer[0], LOW); digitalWrite(pointer[1], LOW); analogWrite(pointer[2], 0); } } void setup() { //defining the motor pins as the output pins pinMode (IN1, OUTPUT); pinMode (IN2, OUTPUT); pinMode (IN3, OUTPUT); pinMode (IN4, OUTPUT); pinMode (ledpin, OUTPUT); RemoteXY_Init (); } void loop() { RemoteXY_Handler (); digitalWrite (ledpin, (RemoteXY.switch_1==0)?LOW:HIGH); Speed (first_motor, RemoteXY.joystick_1_y - RemoteXY.joystick_1_x); Speed (second_motor, RemoteXY.joystick_1_y + RemoteXY.joystick_1_x); } Video microcontroller-projects/iot-web-controlled-servo-motor

Web Controlled Servo using Arduino and Wi-Fi

The ESP8266 will establish a connection between the servo and the web browser through the IP address and then by moving the Slider on the web page, the servo will move accordingly. Even by setting Port Forwarding in your router, you can control the Servo from anywhere in the world over the internet, we will explain that later in this tutorial.

Required Components:

The components used in this project are as follows Servo (sg90) Arduino Uno Wi-Fi module ESP8266 Three 1K resistors Connecting wires

Circuit Diagram and Connections:

ESP8266 runs on 3.3V and if you will give it 5V from the Arduino then it won’t work properly and it may get damage. Connect the VCC and the CH_PD to the 3.3V pin of Arduino. The RX pin of ESP8266 works on 3.3V and it will not communicate with the Arduino when we will connect it directly to the Arduino. So, we will have to make a voltage divider for it which will convert the 5V into 3.3V. This can be done by connecting three resistors in series like we did in the circuit. Connect the TX pin of the ESP8266 to the pin 4 of the Arduino and the RX pin of the ESP8266 to the pin 5 of Arduino through the resistors. are very easier. Connect the VCC and the ground pin of the servo motor to the 5V and the ground of the Arduino and the signal pin of the servo motor to the pin 9 of the Arduino.

How to run it:

that will open a web page. For that, you will have to copy below given HTML code (check downwards) and save it in a notepad. There should be ᾮhtmlᾠat the end of the file, means file must be saved with ᾮhtmlᾠextension. So, if you want to name the file as ‘servoᾠthen it should be as ‘servo.htmlᾠso that it can be easily get opened in the web browser. , extract this zip file and use them directly. jQuery is the library of Java Script which has many JS functions which makes DOM manipulation (Document Object Model), event handling and use of Ajax easy-to-use. Now open the html file in the web browser, it will look like this.

HTML Code Explanation:

, we will get through it line by line: <!DOCTYPE html > <html> <head> <title>Web controlled Servo</title> <script src="jquery.js"></script> </head> <body> <h1> <b> Web Controlled Servo by circuitdigest.com </b> </h1> <h4> <b> Enter the IP address of esp8266 shown in the serial monitor below </b> </h4> <div > <FORM NAME="form" ACTION="" METHOD="GET"> ESP8266 IP Address: <INPUT TYPE="text" NAME="inputbox" VALUE="192.168.0.9"> </FORM> </div> <h3> Scroll it to move servo 1 </h3> <input type="range" min="20" max="170" onmouseup="servo1(this.value)" /> </body> <script> $.ajaxSetup({timeout:1000}); function servo1(angle) { TextVar = form.inputbox.value; ArduinoVar = "http://" + TextVar + ":80"; $.get( ArduinoVar, { "sr1": angle }) ; {Connection: close}; } </script> </html> tag will tell the web browser that which version of html we have used to write the html. This should be written at the top. Everything will be written after that. ᾮ tags are used to include the jQuery. The jQuery is the JavaScript library and it greatly simplifies our code. tags are used to define all the elements onto the webpage like textbox, range slider, button, text area etc. We can also define sizes for the elements. The h1, h2, h3, h4, h5 and h6 headings are used to write the data in different sizes. In our code, we have used the h1, h3 and h4 headings. from angle 20 to 170 for moving the slider. function servo1(angle) { TextVar = form.inputbox.value; ArduinoVar = "http://" + TextVar + ":80"; $.get( ArduinoVar, { "sr1": angle }) ; {Connection: close}; } to move the servo and will close the connections.

Arduino Code Explanation:

is given below in Code section. First of all we will include the Software Serial and the servo libraries. If you don’t have these libraries, then install it before uploading the code. Then define the pins where we have connected the ESP8266.The ‘DEBUG trueᾠwill display the messages of the ESP8266 on the Serial Monitor. Then define the servo pin and declare a variable for servo. #include <SoftwareSerial.h> #include <Servo.h> SoftwareSerial esp(4, 5); //set ESP8266 RX pin = 5, and TX pin = 4 #define DEBUG true //display ESP8266 messages on Serial Monitor #define servopin 9 //servo 1 on digital port 9 Servo ser; //servo 1 Then tell the Arduino that at which pin we have connected the servo and set it to max position. Then set the baud rate of serial monitor and the ESP8266 at ᾱ15200ᾮ ser.attach(servopin); ser.write(maxpos); ser.detach(); Serial.begin(115200); esp.begin(115200); Below code will connect the ESP8266 to the Wi-Fi of your router which you have entered in the code and will tell you the IP address at which it will communicate with the webpage and will receive the data. sendData("AT+RST\r\n", 2000, DEBUG); //reset module sendData("AT+CWMODE=1\r\n", 1000, DEBUG); //set station mode sendData("AT+CWJAP=\"Arsenal\",\"12345678\"\r\n", 2000, DEBUG); //connect wifi network while(!esp.find("OK")) { //wait for connection } sendData("AT+CIFSR\r\n", 1000, DEBUG); //show IP address sendData("AT+CIPMUX=1\r\n", 1000, DEBUG); //allow multiple connections sendData("AT+CIPSERVER=1,80\r\n", 1000, DEBUG); //start web server on port 80 function, ESP8266 will check that if the data is arrived or not. If the data is arrived then it will read this data and will show it on the serial monitor and also will move the servo according to this data. if (esp.available()) //check if there is data available on ESP8266 { if (esp.find("+IPD,")) //if there is a new command { String msg; esp.find("?"); //run cursor until command is found msg = esp.readStringUntil(' '); //read the message String command = msg.substring(0, 3); //command is informed in the first 3 characters "sr1" String valueStr = msg.substring(4); //next 3 characters inform the desired angle int value = valueStr.toInt(); //convert to integer if (DEBUG) { Serial.println(command); Serial.println(value); } function is used to send the commands to the ESP8266 and to check their response. String sendData(String command, const int timeout, boolean debug) { String response = ""; esp.print(command); long int time = millis(); while ( (time + timeout) > millis()) { while (esp.available()) { char c = esp.read(); response += c; } } if (debug) { Serial.print(response); } return response; } (192.168*) of you device. After port forwarding all the incoming connections will be forwarded to this local address and you can just open the given HTML file and enter the public IP address of your internet in the Textbox on webpage. You can forward the port by logging into your router (192.168.1.1) and find the option to setup the port forwarding. Code #include <SoftwareSerial.h> //Including the software serial library #include <Servo.h> //including the servo library SoftwareSerial esp(4, 5); #define DEBUG true //This will display the ESP8266 messages on Serial Monitor #define servopin 9 //connect servo on pin 9 Servo ser; //variable for servo int current_pos = 170; int v = 10; int minpos = 20; int maxpos = 160; void setup() { ser.attach(servopin); ser.write(maxpos); ser.detach(); Serial.begin(115200); esp.begin(115200); sendData("AT+RST\r\n", 2000, DEBUG); //This command will reset module sendData("AT+CWMODE=1\r\n", 1000, DEBUG); //This will set the esp mode as station mode sendData("AT+CWJAP=\"wifi-name\",\"wifi-password\"\r\n", 2000, DEBUG); //This will connect to wifi network while(!esp.find("OK")) { //this will wait for connection } sendData("AT+CIFSR\r\n", 1000, DEBUG); //This will show IP address on the serial monitor sendData("AT+CIPMUX=1\r\n", 1000, DEBUG); //This will allow multiple connections sendData("AT+CIPSERVER=1,80\r\n", 1000, DEBUG); //This will start the web server on port 80 } void loop() { if (esp.available()) //check if there is data available on ESP8266 { if (esp.find("+IPD,")) //if there is a new command { String msg; esp.find("?"); //run cursor until command is found msg = esp.readStringUntil(' '); //read the message String command = msg.substring(0, 3); //command is informed in the first 3 characters "sr1" String valueStr = msg.substring(4); //next 3 characters inform the desired angle int value = valueStr.toInt(); //convert to integer if (DEBUG) { Serial.println(command); Serial.println(value); } delay(100); //move servo to desired angle if(command == "sr1") { //limit input angle if (value >= maxpos) { value = maxpos; } if (value <= minpos) { value = minpos; } ser.attach(servopin); //attach servo while(current_pos != value) { if (current_pos > value) { current_pos -= 1; ser.write(current_pos); delay(100/v); } if (current_pos < value) { current_pos += 1; ser.write(current_pos); delay(100/v); } } ser.detach(); //dettach } } } } String sendData(String command, const int timeout, boolean debug) { String response = ""; esp.print(command); long int time = millis(); while ( (time + timeout) > millis()) { while (esp.available()) { char c = esp.read(); response += c; } } if (debug) { Serial.print(response); } return response; } Video microcontroller-projects/iot-heartbeat-monitoring-using-arduino

Heart Beat Monitoring over Internet using Arduino and ThingSpeak

is a great source for displaying the data online and you can access the data from ThingSpeak at any time and at any place.

Components Required:

Pulse sensor Wi-Fi module ESP8266 Arduino Uno LCD Bread Board 10k potentiometer 1k resistors 220 ohm resistors LED Connecting wires

Circuit Diagram and Explanation:

ESP8266 runs on 3.3V and if you will give it 5V from the Arduino then it won’t work properly and it may get damage. Connect the VCC and the CH_PD to the 3.3V pin of Arduino. The RX pin of ESP8266 works on 3.3V and it will not communicate with the Arduino when we will connect it directly to the Arduino. So, we will have to make a voltage divider for it which will convert the 5V into 3.3V. This can be done by connecting three resistors in series like we did in the circuit. Connect the TX pin of the ESP8266 to the pin 9 of the Arduino and the RX pin of the ESP8266 to the pin 10 of Arduino through the resistors. The connections of the pulse sensor are very easy. Pulse sensor has three pins. Connect 5V and the ground pin of the pulse sensor to the 5V and the ground of the Arduino and the signal pin to the A0 of Arduino. Then connect the LED to pin 13 of Arduino. You do not have to connect a resistor with because the Arduino has built in resistor at pin 13. The connections of the LCD are as follows Connect pin 1 (VEE) to the ground. Connect pin 2 (VDD or VCC) to the 5V. Connect pin 3 (V0) to the middle pin of the 10K potentiometer and connect the other two ends of the potentiometer to the VCC and the GND. The potentiometer is used to control the screen contrast of the LCD. Potentiometer of values other than 10K will work too. Connect pin 4 (RS) to the pin 12 of the Arduino. Connect pin 5 (Read/Write) to the ground of Arduino. This pin is not often used so we will connect it to the ground. Connect pin 6 (E) to the pin 11 of the Arduino. The RS and E pin are the control pins which are used to send data and characters. The following four pins are data pins which are used to communicate with the Arduino. Connect pin 11 (D4) to pin 5 of Arduino. Connect pin 12 (D5) to pin 4 of Arduino. Connect pin 13 (D6) to pin 3 of Arduino. Connect pin 14 (D7) to pin 2 of Arduino. Connect pin 15 to the VCC through the 220 ohm resistor. The resistor will be used to set the back light brightness. Larger values will make the back light much more darker. Connect pin 16 to the Ground.

ThingSpeak Setup:

Now write the name of the Channel and name of the Fields. Also tick the check box for ‘Make Publicᾠoption below in the form and finally Save the Channel. Now your new channel has been created. at the end.

Working Explanation:

through that organ. The Arduino will then convert this change into the heart beat per minute (BPM). The LED connected at pin 13 will also blink according the Heart Beat. The ESP8266 will then communicate with the Arduino and will send the data to ThingSpeak. The ESP8266 will connect the network of your router that you will provide in the code and will send the data of the sensor online. This data on the ThingSpeak will be shown in a Graph form showing the past readings too and can be accessed from anywhere over internet. The LCD connected will also show you the BPM.

Code Explanation:

and declare the pins at which you have connected the LCD. #include <SoftwareSerial.h> #define DEBUG true SoftwareSerial esp8266(9,10); #include <LiquidCrystal.h> #include <stdlib.h> LiquidCrystal lcd(12,11,5,4,3,2); Enter the Wi-Fi name, password and IP address of ESP8266. Then enter the API key from ThingSpeak that you saved earlier. #define SSID "Your Wifi Name" #define PASS "Your Wifi Password" #define IP "184.106.153.149" String msg = "GET /update?key=9YS21NU0HY5YS1IKU"; The following code will start the LCD and will set the baud rate. Enter the baud rate according to your ESP8266. Every ESP8266 has its own baud rate. Some have baud rate of 9600, some have 115200 or other. void setup() { lcd.begin(16, 2); lcd.print("circuitdigest.com"); delay(100); lcd.setCursor(0,1); lcd.print("Connecting..."); Serial.begin(9600); //or use default 115200. esp8266.begin(9600); Serial.println("AT"); esp8266.println("AT"); delay(5000); if(esp8266.find("OK")){ connectWiFi(); } interruptSetup(); } will send the data at the IP address that we have entered and also will set the data in the field we set for heart beat. void updatebeat(){ String cmd = "AT+CIPSTART=\"TCP\",\""; cmd += IP; cmd += "\",80"; Serial.println(cmd); esp8266.println(cmd); delay(2000); if(esp8266.find("Error")){ return; } cmd = msg ; cmd += "&field1="; cmd += BPM; ..... ..... ...... ..... The following code will connect the ESP8266 with the Wi-Fi network that you entered earlier and then it will use this network to send the data to the ThingSpeak. boolean connectWiFi(){ Serial.println("AT+CWMODE=1"); esp8266.println("AT+CWMODE=1"); delay(2000); String cmd="AT+CWJAP=\""; cmd+=SSID; cmd+="\",\""; cmd+=PASS; cmd+="\""; .... ..... ..... ..... The following code will read the sensor and will convert the output of the sensor into heart beat per minute (BPM). It will also blink the LED connected at the pin 13 according to the BPM. ISR(TIMER2_COMPA_vect){ cli(); Signal = analogRead(pulsePin); sampleCounter += 2; int N = sampleCounter - lastBeatTime; if(Signal < thresh && N > (IBI/5)*3){ if (Signal < T){ T = Signal; ... .... ...... .. below, code has been well explained by comments can be easily understandable. Code #include <SoftwareSerial.h> #define DEBUG true SoftwareSerial esp8266(9,10); #include <LiquidCrystal.h> #include <stdlib.h> LiquidCrystal lcd(12,11,5,4,3,2); #define SSID "Your Wifi Name" // "SSID-WiFiname" #define PASS "Your Wifi Password" // "password" #define IP "184.106.153.149"// thingspeak.com ip String msg = "GET /update?key=9YS21NU0HY5YS1IKU"; //change it with your api key like "GET /update?key=Your Api Key" //Variables float temp; int hum; String tempC; int error; int pulsePin = 0; // Pulse Sensor purple wire connected to analog pin 0 int blinkPin = 13; // pin to blink led at each beat int fadePin = 5; int fadeRate = 0; // Volatile Variables, used in the interrupt service routine! volatile int BPM; // int that holds raw Analog in 0. updated every 2mS volatile int Signal; // holds the incoming raw data volatile int IBI = 600; // int that holds the time interval between beats! Must be seeded! volatile boolean Pulse = false; // "True" when heartbeat is detected. "False" when not a "live beat". volatile boolean QS = false; // becomes true when Arduino finds a beat. // Regards Serial OutPut -- Set This Up to your needs static boolean serialVisual = true; // Set to 'false' by Default. Re-set to 'true' to see Arduino Serial Monitor ASCII Visual Pulse volatile int rate[10]; // array to hold last ten IBI values volatile unsigned long sampleCounter = 0; // used to determine pulse timing volatile unsigned long lastBeatTime = 0; // used to find IBI volatile int P =512; // used to find peak in pulse wave, seeded volatile int T = 512; // used to find trough in pulse wave, seeded volatile int thresh = 525; // used to find instant moment of heart beat, seeded volatile int amp = 100; // used to hold amplitude of pulse waveform, seeded volatile boolean firstBeat = true; // used to seed rate array so we startup with reasonable BPM volatile boolean secondBeat = false; // used to seed rate array so we startup with reasonable BPM void setup() { lcd.begin(16, 2); lcd.print("circuitdigest.com"); delay(100); lcd.setCursor(0,1); lcd.print("Connecting..."); Serial.begin(9600); //or use default 115200. esp8266.begin(9600); Serial.println("AT"); esp8266.println("AT"); delay(5000); if(esp8266.find("OK")){ connectWiFi(); } interruptSetup(); } void loop(){ lcd.clear(); start: //label error=0; lcd.setCursor(0, 0); lcd.print("BPM = "); lcd.print(BPM); delay (100); lcd.setCursor(0, 1); // set the cursor to column 0, line 2 delay(1000); updatebeat(); //Resend if transmission is not completed if (error==1){ goto start; //go to label "start" } delay(1000); } void updatebeat(){ String cmd = "AT+CIPSTART=\"TCP\",\""; cmd += IP; cmd += "\",80"; Serial.println(cmd); esp8266.println(cmd); delay(2000); if(esp8266.find("Error")){ return; } cmd = msg ; cmd += "&field1="; cmd += BPM; cmd += "\r\n"; Serial.print("AT+CIPSEND="); esp8266.print("AT+CIPSEND="); Serial.println(cmd.length()); esp8266.println(cmd.length()); if(esp8266.find(">")){ Serial.print(cmd); esp8266.print(cmd); } else{ Serial.println("AT+CIPCLOSE"); esp8266.println("AT+CIPCLOSE"); //Resend... error=1; } } boolean connectWiFi(){ Serial.println("AT+CWMODE=1"); esp8266.println("AT+CWMODE=1"); delay(2000); String cmd="AT+CWJAP=\""; cmd+=SSID; cmd+="\",\""; cmd+=PASS; cmd+="\""; Serial.println(cmd); esp8266.println(cmd); delay(5000); if(esp8266.find("OK")){ Serial.println("OK"); return true; }else{ return false; } } void interruptSetup(){ TCCR2A = 0x02; // DISABLE PWM ON DIGITAL PINS 3 AND 11, AND GO INTO CTC MODE TCCR2B = 0x06; // DON'T FORCE COMPARE, 256 PRESCALER OCR2A = 0X7C; // SET THE TOP OF THE COUNT TO 124 FOR 500Hz SAMPLE RATE TIMSK2 = 0x02; // ENABLE INTERRUPT ON MATCH BETWEEN TIMER2 AND OCR2A sei(); // MAKE SURE GLOBAL INTERRUPTS ARE ENABLED } ISR(TIMER2_COMPA_vect){ // triggered when Timer2 counts to 124 cli(); // disable interrupts while we do this Signal = analogRead(pulsePin); // read the Pulse Sensor sampleCounter += 2; // keep track of the time in mS int N = sampleCounter - lastBeatTime; // monitor the time since the last beat to avoid noise // find the peak and trough of the pulse wave if(Signal < thresh && N > (IBI/5)*3){ // avoid dichrotic noise by waiting 3/5 of last IBI if (Signal < T){ // T is the trough T = Signal; // keep track of lowest point in pulse wave } } if(Signal > thresh && Signal > P){ // thresh condition helps avoid noise P = Signal; // P is the peak } // keep track of highest point in pulse wave // NOW IT'S TIME TO LOOK FOR THE HEART BEAT // signal surges up in value every time there is a pulse if (N > 250){ // avoid high frequency noise if ( (Signal > thresh) && (Pulse == false) && (N > (IBI/5)*3) ){ Pulse = true; // set the Pulse flag when there is a pulse digitalWrite(blinkPin,HIGH); // turn on pin 13 LED IBI = sampleCounter - lastBeatTime; // time between beats in mS lastBeatTime = sampleCounter; // keep track of time for next pulse if(secondBeat){ // if this is the second beat secondBeat = false; // clear secondBeat flag for(int i=0; i<=9; i++){ // seed the running total to get a realistic BPM at startup rate[i] = IBI; } } if(firstBeat){ // if it's the first time beat is found firstBeat = false; // clear firstBeat flag secondBeat = true; // set the second beat flag sei(); // enable interrupts again return; // IBI value is unreliable so discard it } word runningTotal = 0; // clear the runningTotal variable for(int i=0; i<=8; i++){ // shift data in the rate array rate[i] = rate[i+1]; // and drop the oldest IBI value runningTotal += rate[i]; // add up the 9 oldest IBI values } rate[9] = IBI; // add the latest IBI to the rate array runningTotal += rate[9]; // add the latest IBI to runningTotal runningTotal /= 10; // average the last 10 IBI values BPM = 60000/runningTotal; // how many beats can fit into a minute? that's BPM! QS = true; // set Quantified Self flag // QS FLAG IS NOT CLEARED INSIDE THIS ISR } } if (Signal < thresh && Pulse == true){ // when the values are going down, the beat is over digitalWrite(blinkPin,LOW); // turn off pin 13 LED Pulse = false; // reset the Pulse flag so we can do it again amp = P - T; // get amplitude of the pulse wave thresh = amp/2 + T; // set thresh at 50% of the amplitude P = thresh; // reset these for next time T = thresh; } if (N > 2500){ // if 2.5 seconds go by without a beat thresh = 512; // set thresh default P = 512; // set P default T = 512; // set T default lastBeatTime = sampleCounter; // bring the lastBeatTime up to date firstBeat = true; // set these to avoid noise secondBeat = false; // when we get the heartbeat back } sei(); // enable interrupts when youre done! }// end isr Video microcontroller-projects/arduino-automatic-plant-watering-system

Arduino based Automatic Plant Irrigation System with Message Alert

, which automatically provides water to your plants and keep you updated by sending message to your cell phone. and there is no need for any human intervention.

Required Components forArduinoPlant Watering System Project

Arduino Uno GSM Module Transistor BC547 (2) Connecting wires 16x2 LCD (optional) Power supply 12v 1A Relay 12v Water cooler pump Soil Moisture Sensor Resistors (1k, 10k) Variable Resister (10k, 100k) Terminal connector Voltage Regulator IC LM317 The SIM800 is a complete Quad-band GSM/GPRS Module which can be embedded easily by customer or hobbyist. SIM900 GSM Module provides an industry-standard interface; the SIM800 delivers GSM/GPRS 850/900/1800/1900MHz performance for voice, SMS, Data with low power consumption. The design of this SIM800 GSM Module is slim and compact. It is easily available in the market or online from eBay. Quad - band GSM/GPRS module in small size. GPRS Enabled TTL Output for properly understand their interfacing.

Circuit Explanation:

according to the Picture shown below. One side of the probe is directly connected to Vcc and other probe terminal goes to the base of BC547 transistor. A potentiometer is connected to the base of the transistor to adjust the sensitivity of the sensor. The output of soil sensor circuit is directly connected to digital pin D7 of Arduino. A LED is used at the sensor circuit, this LED’s ON state indicates the presence of moisture in the soil and OFF state indicates the absense of moisture in the soil. : If user wants to use SIM900 TTL Module then he should use 5V and if the user wants to use SIM900 Module then apply 12v in the DC Jack slot of the board. is used to control the 220VAC small water pump. The relay is driven by a BC547 Transistor which is further connected to digital pin 11 of Arduino. and driven by Arduino’s inbuilt LCD library. :

Working Explanation:

and there is no need of manpower to control the system. Arduino is used for controlling the whole process and GSM module is used for sending alert messages to user on his Cellphone. If moisture is present in soil then there is conduction between the two probes of Soil Moisture sensor and due to this conduction, transistor Q2 remains in triggered/on state and Arduino Pin D7 remains Low. When Arduino reads LOW signal at D7, then it sends SMS to user about “Soil Moisture is Normal. Motor turned OFFᾠand water pump remains in Off state. (given at the end) for better understanding the project working process.

Programming Explanation:

for LCD. Then we defined some variables for motor, soil moisture sensor, LED etc. #include<SoftwareSerial.h> SoftwareSerial Serial1(2,3); #include<LiquidCrystal.h> LiquidCrystal lcd(14,15,16,17,18,19); int led=13; int flag=0; String str=""; #define motor 11 #define sensor 7 function is called for initialize the GSM module. Serial1.begin(9600); Serial.begin(9600); pinMode(led, OUTPUT); pinMode(motor, OUTPUT); pinMode(sensor, INPUT_PULLUP); lcd.print("Water Irrigaton"); lcd.setCursor(4,1); delay(2000); lcd.clear(); lcd.print("Circuit Digest"); lcd.setCursor(0,1); lcd.print("Welcomes You"); delay(2000); gsmInit(); function. Check the various functions in full code given at the end. void loop() { lcd.setCursor(0,0); lcd.print("Automatic Mode "); if(digitalRead(sensor)==1 && flag==0) { delay(1000); if(digitalRead(sensor)==1) { digitalWrite(led, HIGH); sendSMS("Low Soil Moisture detected. Motor turned ON"); lcd.begin(16,2); lcd.setCursor(0,1); .... ...... ..... ...... , where firstly GSM module is checked whether it is connected or not by sending ‘ATᾠcommand to GSM module. If response OK is received, means it is ready. System keeps checking for the module until it becomes ready or until ‘OKᾠis received. Then ECHO is turned off by sending the ATE0 command, otherwise GSM module will echo all the commands. Then finally Network availability is checked through the ‘AT+CPIN?ᾠcommand, if inserted card is SIM card and PIN is present, it gives the response READY. This is also check repeatedly until the network is found. This can be clearly understood by the Video below. void gsmInit() { lcd.clear(); lcd.print("Finding Module.."); boolean at_flag=1; while(at_flag) { Serial1.println("AT"); while(Serial1.available()>0) { if(Serial1.find("OK")) at_flag=0; } delay(1000); } .... ..... ..... ..... , you don’t need to worry about your plants when you are away from your home. It can be further enhanced to be operated and monitored over the internet. Code #include<SoftwareSerial.h> SoftwareSerial Serial1(2,3); #include<LiquidCrystal.h> LiquidCrystal lcd(14,15,16,17,18,19); int led=13; int flag=0; String str=""; #define motor 11 #define sensor 7 void setup() { lcd.begin(16,2); Serial1.begin(9600); Serial.begin(9600); pinMode(led, OUTPUT); pinMode(motor, OUTPUT); pinMode(sensor, INPUT_PULLUP); lcd.print("Water Irrigaton"); lcd.setCursor(4,1); delay(2000); lcd.clear(); lcd.print("Circuit Digest"); lcd.setCursor(0,1); lcd.print("Welcomes You"); delay(2000); gsmInit(); lcd.clear(); lcd.print("System Ready"); } void loop() { lcd.setCursor(0,0); lcd.print("Automatic Mode "); if(digitalRead(sensor)==1 && flag==0) { delay(1000); if(digitalRead(sensor)==1) { digitalWrite(led, HIGH); sendSMS("Low Soil Moisture detected. Motor turned ON"); lcd.begin(16,2); lcd.setCursor(0,1); lcd.print("Motor ON "); digitalWrite(motor, HIGH); delay(2000); flag=1; } } else if(digitalRead(sensor)==0 && flag==1) { delay(1000); if(digitalRead(sensor)==0) { digitalWrite(led, LOW); sendSMS("Soil Moisture is Normal. Motor turned OFF"); digitalWrite(motor, LOW); lcd.begin(16,2); lcd.print("Motor OFF"); lcd.setCursor(0,1); lcd.print("Motor OFF"); delay(2000); flag=0; } } } void sendSMS(String msg) { lcd.clear(); lcd.print("Sending SMS"); Serial1.println("AT+CMGF=1"); delay(500); Serial1.print("AT+CMGS="); Serial1.print('"'); Serial1.print("+919610126059"); // number Serial1.print('"'); Serial1.println(); delay(500); Serial1.println(msg); delay(500); Serial1.write(26); delay(1000); lcd.clear(); lcd.print("SMS Sent"); delay(1000); lcd.begin(16,2); } void gsmInit() { lcd.clear(); lcd.print("Finding Module.."); boolean at_flag=1; while(at_flag) { Serial1.println("AT"); while(Serial1.available()>0) { if(Serial1.find("OK")) at_flag=0; } delay(1000); } Serial1.println("ATE0"); lcd.clear(); lcd.print("Finding Network.."); boolean net_flag=1; while(net_flag) { Serial1.println("AT+CPIN?"); while(Serial1.available()>0) { if(Serial1.find("READY")) net_flag=0; break; } delay(1000); } Serial1.println("AT+CNMI=2,2,0,0,0"); delay(1000); Serial1.println("AT+CMGF=1"); delay(1000); Serial1.println("AT+CSMP=17,167,0,0"); lcd.clear(); Serial1.flush(); } Video microcontroller-projects/iot-air-pollution-monitoring-using-arduino

IoT based Air Pollution Monitoring System using Arduino

and will trigger a alarm when the air quality goes down beyond a certain level, means when there are sufficient amount of harmful gases are present in the air like CO2, smoke, alcohol, benzene and NH3. It will show the air quality in PPM on the LCD and as well as on webpage so that we can monitor it very easily. , you can monitor the pollution level from anywhere using your computer or mobile. We can install this system anywhere and can also trigger some device when pollution goes beyond some level, like we can switch on the Exhaust fan or can send alert SMS/mail to the user.

Required Components:

MQ135 Gas sensor Arduino Uno Wi-Fi module ESP8266 16X2 LCD Breadboard 10K potentiometer 1K ohm resistors 220 ohm resistor Buzzer

Circuit Diagram and Explanation:

ESP8266 runs on 3.3V and if you will give it 5V from the Arduino then it won’t work properly and it may get damage. Connect the VCC and the CH_PD to the 3.3V pin of Arduino. The RX pin of ESP8266 works on 3.3V and it will not communicate with the Arduino when we will connect it directly to the Arduino. So, we will have to make a voltage divider for it which will convert the 5V into 3.3V. This can be done by connecting three resistors in series like we did in the circuit. Connect the TX pin of the ESP8266 to the pin 10 of the Arduino and the RX pin of the esp8266 to the pin 9 of Arduino through the resistors. Connect the VCC and the ground pin of the sensor to the 5V and ground of the Arduino and the Analog pin of sensor to the A0 of the Arduino. Connect a buzzer to the pin 8 of the Arduino which will start to beep when the condition becomes true. The connections of the LCD are as follows Connect pin 1 (VEE) to the ground. Connect pin 2 (VDD or VCC) to the 5V. Connect pin 3 (V0) to the middle pin of the 10K potentiometer and connect the other two ends of the potentiometer to the VCC and the GND. The potentiometer is used to control the screen contrast of the LCD. Potentiometer of values other than 10K will work too. Connect pin 4 (RS) to the pin 12 of the Arduino. Connect pin 5 (Read/Write) to the ground of Arduino. This pin is not often used so we will connect it to the ground. Connect pin 6 (E) to the pin 11 of the Arduino. The RS and E pin are the control pins which are used to send data and characters. The following four pins are data pins which are used to communicate with the Arduino. Connect pin 11 (D4) to pin 5 of Arduino. Connect pin 12 (D5) to pin 4 of Arduino. Connect pin 13 (D6) to pin 3 of Arduino. Connect pin 14 (D7) to pin 2 of Arduino. Connect pin 15 to the VCC through the 220 ohm resistor. The resistor will be used to set the back light brightness. Larger values will make the back light much more darker. Connect pin 16 to the Ground.

Working Explanation:

When we will connect it to Arduino then it will sense the gases, and we will get the Pollution level in PPM (parts per million). MQ135 gas sensor gives the output in form of voltage levels and we need to convert it into PPM. So for converting the output in PPM, here we have used a library for MQ135 sensor, it is explained in detail in “Code Explanationᾠsection below. Sensor was giving us value of 90 when there was no gas near it and the safe level of air quality is 350 PPM and it should not exceed 1000 PPM. When it exceeds the limit of 1000 PPM, then it starts cause Headaches, sleepiness and stagnant, stale, stuffy air and if exceeds beyond 2000 PPM then it can cause increased heart rate and many other diseases. When the value will be less than 1000 PPM, then the LCD and webpage will display “Fresh Airᾮ Whenever the value will increase 1000 PPM, then the buzzer will start beeping and the LCD and webpage will display “Poor Air, Open Windowsᾮ If it will increase 2000 then the buzzer will keep beeping and the LCD and webpage will display “Danger! Move to fresh Airᾮ

Code Explanation:

Using this library you can directly get the PPM values, by just using the below two lines: MQ135 gasSensor = MQ135(A0); float air_quality = gasSensor.getPPM(); value. #include "MQ135.h" void setup (){ Serial.begin (9600); } void loop() { MQ135 gasSensor = MQ135(A0); // Attach sensor to pin A0 float rzero = gasSensor.getRZero(); Serial.println (rzero); delay(1000); } Now we can begin the actual code for our Air quality monitoring project. value. #include <SoftwareSerial.h> #define DEBUG true SoftwareSerial esp8266(9,10); #include <LiquidCrystal.h> LiquidCrystal lcd(12,11, 5, 4, 3, 2); const int sensorPin= 0; int air_quality; pinMode(8, OUTPUT); lcd.begin(16,2); lcd.setCursor (0,0); lcd.print ("circuitdigest "); lcd.setCursor (0,1); lcd.print ("Sensor Warming "); delay(1000); Then we will set the baud rate for the serial communication. Different ESP’s have different baud rates so write it according to your ESP’s baud rate. Then we will send the commands to set the ESP to communicate with the Arduino and show the IP address on the serial monitor. Serial.begin(115200); esp8266.begin(115200); sendData("AT+RST\r\n",2000,DEBUG); sendData("AT+CWMODE=2\r\n",1000,DEBUG); sendData("AT+CIFSR\r\n",1000,DEBUG); sendData("AT+CIPMUair_quality=1\r\n",1000,DEBUG); sendData("AT+CIPSERVER=1,80\r\n",1000,DEBUG); pinMode(sensorPin, INPUT); lcd.clear(); function returns the ASCII decimal value and the first decimal number which is 0 starts at 48. if(esp8266.available()) { if(esp8266.find("+IPD,")) { delay(1000); int connectionId = esp8266.read()-48; String webpage = "<h1>IOT Air Pollution Monitoring System</h1>"; webpage += "<p><h2>"; webpage+= " Air Quality is "; webpage+= air_quality; webpage+=" PPM"; webpage += "<p>"; and will send the data & message strings to the webpage to show. sendData(cipSend,1000,DEBUG); sendData(webpage,1000,DEBUG); cipSend = "AT+CIPSEND="; cipSend += connectionId; cipSend += ","; cipSend +=webpage.length(); cipSend +="\r\n"; The following code will print the data on the LCD. We have applied various conditions for checking air quality, and LCD will print the messages according to conditions and buzzer will also beep if the pollution goes beyond 1000 PPM. lcd.setCursor (0, 0); lcd.print ("Air Quality is "); lcd.print (air_quality); lcd.print (" PPM "); lcd.setCursor (0,1); if (air_quality<=1000) { lcd.print("Fresh Air"); digitalWrite(8, LOW); and will print it on the webpage. String sendData(String command, const int timeout, boolean debug) { String response = ""; esp8266.print(command); // send the read character to the esp8266 long int time = millis(); while( (time+timeout) > millis()) { while(esp8266.available()) { // The esp has data so display its output to the serial window char c = esp8266.read(); // read the next character. response+=c; } } if(debug) { Serial.print(response); } return response; }

Testing and Output of the Project:

Before uploading the code, make sure that you are connected to the Wi-Fi of your ESP8266 device. After uploading, open the serial monitor and it will show the IP address like shown below. Type this IP address in your browser, it will show you the output as shown below. You will have to refresh the page again if you want to see the current Air Quality Value in PPM. (192.168*) of you device. After port forwarding all the incoming connections will be forwarded to this local address and you can open above shown webpage by just entering the public IP address of your internet from anywhere. You can forward the port by logging into your router (192.168.1.1) and find the option to setup the port forwarding. Code #include "MQ135.h" #include <SoftwareSerial.h> #define DEBUG true SoftwareSerial esp8266(9,10); // This makes pin 9 of Arduino as RX pin and pin 10 of Arduino as the TX pin const int sensorPin= 0; int air_quality; #include <LiquidCrystal.h> LiquidCrystal lcd(12,11, 5, 4, 3, 2); void setup() { pinMode(8, OUTPUT); lcd.begin(16,2); lcd.setCursor (0,0); lcd.print ("circuitdigest "); lcd.setCursor (0,1); lcd.print ("Sensor Warming "); delay(1000); Serial.begin(115200); esp8266.begin(115200); // your esp's baud rate might be different sendData("AT+RST\r\n",2000,DEBUG); // reset module sendData("AT+CWMODE=2\r\n",1000,DEBUG); // configure as access point sendData("AT+CIFSR\r\n",1000,DEBUG); // get ip address sendData("AT+CIPMUair_quality=1\r\n",1000,DEBUG); // configure for multiple connections sendData("AT+CIPSERVER=1,80\r\n",1000,DEBUG); // turn on server on port 80 pinMode(sensorPin, INPUT); //Gas sensor will be an input to the arduino lcd.clear(); } void loop() { MQ135 gasSensor = MQ135(A0); float air_quality = gasSensor.getPPM(); if(esp8266.available()) // check if the esp is sending a message { if(esp8266.find("+IPD,")) { delay(1000); int connectionId = esp8266.read()-48; /* We are subtracting 48 from the output because the read() function returns the ASCII decimal value and the first decimal number which is 0 starts at 48*/ String webpage = "<h1>IOT Air Pollution Monitoring System</h1>"; webpage += "<p><h2>"; webpage+= " Air Quality is "; webpage+= air_quality; webpage+=" PPM"; webpage += "<p>"; if (air_quality<=1000) { webpage+= "Fresh Air"; } else if(air_quality<=2000 && air_quality>=1000) { webpage+= "Poor Air"; } else if (air_quality>=2000 ) { webpage+= "Danger! Move to Fresh Air"; } webpage += "</h2></p></body>"; String cipSend = "AT+CIPSEND="; cipSend += connectionId; cipSend += ","; cipSend +=webpage.length(); cipSend +="\r\n"; sendData(cipSend,1000,DEBUG); sendData(webpage,1000,DEBUG); cipSend = "AT+CIPSEND="; cipSend += connectionId; cipSend += ","; cipSend +=webpage.length(); cipSend +="\r\n"; String closeCommand = "AT+CIPCLOSE="; closeCommand+=connectionId; // append connection id closeCommand+="\r\n"; sendData(closeCommand,3000,DEBUG); } } lcd.setCursor (0, 0); lcd.print ("Air Quality is "); lcd.print (air_quality); lcd.print (" PPM "); lcd.setCursor (0,1); if (air_quality<=1000) { lcd.print("Fresh Air"); digitalWrite(8, LOW); } else if( air_quality>=1000 && air_quality<=2000 ) { lcd.print("Poor Air, Open Windows"); digitalWrite(8, HIGH ); } else if (air_quality>=2000 ) { lcd.print("Danger! Move to Fresh Air"); digitalWrite(8, HIGH); // turn the LED on } lcd.scrollDisplayLeft(); delay(1000); } String sendData(String command, const int timeout, boolean debug) { String response = ""; esp8266.print(command); // send the read character to the esp8266 long int time = millis(); while( (time+timeout) > millis()) { while(esp8266.available()) { // The esp has data so display its output to the serial window char c = esp8266.read(); // read the next character. response+=c; } } if(debug) { Serial.print(response); } return response; } Video microcontroller-projects/scrolling-text-display-on-8x8-led-matrix-arduino

Scrolling Text Display on 8x8 LED Matrix using Arduino

, which will show scrolling alphabets. (Light Emitting Diodes) which are arranged in the form of a matrix, hence the name is LED matrix. We are going to make this Matrix by soldering these 64 LEDs on to the perfboard or DOT PCB. The LEDs can be of any color, choose the ones which are available with you. Then we will write a program for Arduino to control these 64 LEDs matrix. The UNO, according to program, powers appropriate LEDs to show characters in scrolling fashion.

Components Required:

Arduino Uno 64 LEDs Perfboard with other soldering tools 1K resistor (8 pieces) Power Supply (5v)

Circuit and Working Explanation:

for all 8 LED in that row. It is shown in below figure, So for 8 rows we have 8 common positive terminals. Consider the first row, as seen in the figure, 8 LEDs from D57 to D64 have a common positive terminal and are denoted by ‘POSITIVE0ᾮ Now if we want glow one or all LEDs in the first ROW of matrix, then we should power the PIN0 of LED Matrix. Likewise if we want to glow any LED (or all) in any ROW then we need to power the corresponding Common Positive Terminal Pin of that respective Row. like all the negative terminals in first column are connected together to the PIN-A1 (NEGATIVE7). This is shown in below figure: One should pay attention to these pins while soldering the LEDs on Perfboard. Now if we need to ground any LED in the first column then we will ground the PIN-A1 (NEGATIVE7) of the MATRIX, and it will ground all the LEDs in first column. The same process goes for all the other seven common negative columns. will look like this: in detail; go through that article for detailed explanation. Here we are explaining the Multiplexing briefly. Let’s say for example, we want to only turn on LED57 and LED50 without turning on D49 and D58. Trick is, we will first provide power to first row to turn ON LED57 and wait for 1mSEC, and then we will turn it OFF. Then we will provide power to second row to turn on LED50 and wait for 1mSEC then will turn it OFF. The cycle goes continuously with high frequency and LED57 & LED50 will getting On and Off rapidly and both the LEDs will appear to be continuously ON to our eye. Means we are only providing power to the one row at a time, eliminating the chances of turning on other LEDs in other rows. We will use this technique to show all characters. for more detail.

Programming Explanation:

and programmed these values into the Arduino. The program has written to shift these values to next row for every 0.2 sec, this will be seen as scrolling of characters upwards, it’s very simple. array according to the character values given below, 24,60,102,126,102,102,102,0,0,0, // A 124,102,102,124,102,102,124,0,0,0, // B 60,102,96,96,96,102,60,0, 0,0, // C 120,108,102,102,102,108,120,0, 0,0, // D 126,96,96,120,96,96,126,0, 0,0, // E 126,96,96,120,96,96,96,0, 0,0, // F 60,102,96,110,102,102,60,0, 0,0, // G 102,102,102,126,102,102,102,0, 0,0, // H 60,24,24,24,24,24,60,0, 0,0, // I 30,12,12,12,12,108,56,0, 0,0, // J 102,108,120,112,120,108,102,0, 0,0, // K 96,96,96,96,96,96,126,0, 0,0, // L 99,119,127,107,99,99,99,0, 0,0, // M 102,118,126,126,110,102,102,0, 0,0, // N 60,102,102,102,102,102,60,0, 0,0, // O 124,102,102,124,96,96,96,0, 0,0, // P 60,102,102,102,102,60,14,0, 0,0, // Q 124,102,102,124,120,108,102,0, 0,0, // R 60,102,96,60,6,102,60,0, 0,0, // S 126,24,24,24,24,24,24,0, 0,0, // T 102,102,102,102,102,102,60,0, 0,0, // U 102,102,102,102,102,60,24,0, 0,0, // V 99,99,99,107,127,119,99,0, 0,0, // W 102,102,60,24,60,102,102,0, 0,0, // X 102,102,102,60,24,24,24,0, 0,0, // Y 126,6,12,24,48,96,126,0, 0,0, // Z array by putting values for characters D,A and D from the above list: char ALPHA[] = {0,0,0,0,0,0,0,0,0,0,0, 120,108,102,102,102,108,120,0,0,0, 24,60,102,126,102,102,102,0,0,0, 120,108,102,102,102,108,120,0,0,0, 0,0,0,0,0,0,0,0,0,0,0}; Total values are now 5*10=50 values, so Replace, for(int x=0;x<142;x++) //150-8(to stop overflow) {…‐󬬍 With, for(int x=0;x<42;x++) //50-8(to stop overflow) {…‐󬬍 So you just need to change the number. Code char ground[8] = {8,9,10,11,12,13,A0,A1}; char ALPHA[] = {0,0,0,0,0,0,0,0,0,0,0, 60,102,96,96,96,102,60,0,0,0, 60,24,24,24,24,24,60,0,0,0, 124,102,102,124,120,108,102,0,0,0, 60,102,96,96,96,102,60,0,0,0, 102,102,102,102,102,102,60,0,0,0, 60,24,24,24,24,24,60,0,0,0, 126,24,24,24,24,24,24,0,0,0, 120,108,102,102,102,108,120,0,0,0, 60,24,24,24,24,24,60,0,0,0, 60,102,96,110,102,102,60,0,0,0, 126,96,96,120,96,96,126,0,0,0, 60,102,96,60,6,102,60,0,0,0, 126,24,24,24,24,24,24,0,0,0, 0,0,0,0,0,0,0,0,0,0,0 }; void setup() { for (int x=8;x<14;x++) { pinMode(x, OUTPUT); } pinMode(A0, OUTPUT); pinMode(A1, OUTPUT); for (int i=0;i<8;i++) { digitalWrite(ground[i],HIGH); } DDRD = 0xFF; PORTD =0; } void loop() { for(int x=0;x<142;x++) { for(int a=0;a<20;a++) { for (int i=0;i<8;i++) { digitalWrite(ground[i],LOW); PORTD = ALPHA[i+x]; delay(1); digitalWrite(ground[i],HIGH); } } } delay(1000); } Video microcontroller-projects/iot-garbage-monitoring-using-arduino-esp8266

IOT Based Dumpster Monitoring using Arduino & ESP8266

which will tell us that whether the trash can is empty or full through the webserver and you can know the status of your ‘Trash Canᾠor 'Dumpsters' from anywhere in the world over the Internet. It will be very useful and can be installed in the Trash Cans at public places as well as at home. for connecting the Arduino to the webserver. Here we have used Local webserver to demonstrate the working of this Garbage Monitoring System.

Components Required:

Arduino Uno (you can use any other) ESP8266 Wi-Fi module HC-SR04 Ultrasonic sensor 1K Resistors Breadboard Connecting wires

HC-SR04 Ultrasonic Sensor:

is used to measure the distance with high accuracy and stable readings. It can measure distance from 2cm to 400cm or from 1 inch to 13 feet. It emits an ultrasound wave at the frequency of 40KHz in the air and if the object will come in its way then it will bounce back to the sensor. By using that time which it takes to strike the object and comes back, you can calculate the distance. The ultrasonic sensor has four pins. Two are VCC and GND which will be connected to the 5V and the GND of the Arduino while the other two pins are Trig and Echo pins which will be connected to any digital pins of the Arduino. The trig pin will send the signal and the Echo pin will be used to receive the signal. To generate an ultrasound signal, you will have to make the Trig pin high for about 10us which will send a 8 cycle sonic burst at the speed of sound and after striking the object, it will be received by the Echo pin. Further check below projects to properly understand the working of Ultrasonic sensor and to measure the distance of any object using it: Arduino Based Distance Measurement using Ultrasonic Sensor Distance Measurement using HC-SR04 and AVR Microcontroller

ESP8266 Wi-Fi Module:

It is a very cheap device but it will make your projects very powerful. It can communicate with any microcontroller and make the projects wireless. It is in the list of most leading devices in the IOT platform. It runs on 3.3V and if you will give it 5V then it will get damage. The RX pin works on 3.3V so you will have to make a voltage divider for it as we made in our project.

Circuit Diagram and Explanation:

First of all we will connect the ESP8266 with the Arduino. ESP8266 runs on 3.3V and if you will give it 5V from the Arduino then it won’t work properly and it may get damage. Connect the VCC and the CH_PD to the 3.3V pin of Arduino. The RX pin of ESP8266 works on 3.3V and it will not communicate with the Arduino when we will connect it directly to the Arduino. So, we will have to make a voltage divider for it. Three 1k resistors connected in series will do the work for us. Connect the RX to the pin 11 of the Arduino through the resistors as shown in the figure below and also the TX of the Arduino to the pin 10 of the Arduino. Now it’s time to connect the HC-SR04 ultrasonic sensor with the Arduino. Connections of the ultrasonic sensor with the Arduino are very simple. Connect the VCC and the ground of the ultrasonic sensor to the 5V and the ground of the Arduino. Then connect the TRIG and ECHO pin of ultrasonic sensor to the pin 8 and 9 of the Arduino respectively.

Code Explanation:

Before uploading the code, make sure that you are connected to the Wi-Fi of your ESP8266 device. You can check the full code in Code section below, code has been well explained by the comments, further we have also explained some important functions below. digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance= duration*0.034/2; and if the distance will be greater than 5cm then it will show the message “Basket is Emptyᾠon webpage. if(esp8266.available()) { if(esp8266.find("+IPD,")) { delay(1000); int connectionId = esp8266.read()-48; String webpage = "<h1>IOT Garbage Monitoring System</h1>"; webpage += "<p><h2>"; if (distance<5) { webpage+= " Trash can is Full"; } else{ webpage+= " Trash can is Empty"; } webpage += "</h2></p></body>"; and will print it on the webpage. String sendData(String command, const int timeout, boolean debug) { String response = ""; esp8266.print(command); long int time = millis(); while( (time+timeout) > millis()) { while(esp8266.available()) { char c = esp8266.read(); response+=c; } } if(debug) { Serial.print(response); } return response; }

Testing and Output of the Project:

After uploading the code, open the Serial Monitor and it will show you an IP address as shown below. Type this IP address in your browser, it will show you the output as shown below. You will have to refresh the page again if you want to see again that the trash can is empty or not. works, this project can be further enhanced by adding few more features in it like we can set one more message when the Trash Can is half filled or we can trigger a Email/SMS to alert the user when Trash Basket is full. Code #include <SoftwareSerial.h> // including the library for the software serial #define DEBUG true SoftwareSerial esp8266(10,11); /* This will make the pin 10 of arduino as RX pin and pin 11 of arduino as the TX pin Which means that you have to connect the TX from the esp8266 to the pin 10 of arduino and the Rx from the esp to the pin 11 of the arduino*/ const int trigPin = 8; // Making the arduino's pin 8 as the trig pin of ultrasonic sensor const int echoPin = 9; // Making the arduino's pin 9 as the echo pin of the ultrasonic sensor // defining two variable for measuring the distance long duration; int distance; void setup() { Serial.begin(9600); // Setting the baudrate at 9600 esp8266.begin(9600); // Set the baudrate according to you esp's baudrate. your esp's baudrate might be different from mine pinMode(trigPin, OUTPUT); // Setting the trigPin as Output pin pinMode(echoPin, INPUT); // Setting the echoPin as Input pin sendData("AT+RST\r\n",2000,DEBUG); // command to reset the module sendData("AT+CWMODE=2\r\n",1000,DEBUG); // This will configure the mode as access point sendData("AT+CIFSR\r\n",1000,DEBUG); // This command will get the ip address sendData("AT+CIPMUX=1\r\n",1000,DEBUG); // This will configure the esp for multiple connections sendData("AT+CIPSERVER=1,80\r\n",1000,DEBUG); // This command will turn on the server on port 80 } void loop() { digitalWrite(trigPin, LOW); // Making the trigpin as low delayMicroseconds(2); // delay of 2us digitalWrite(trigPin, HIGH); // making the trigpin high for 10us to send the signal delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); // reading the echopin which will tell us that how much time the signal takes to come back distance= duration*0.034/2; // Calculating the distance and storing in the distance variable if(esp8266.available()) // This command will that check if the esp is sending a message { if(esp8266.find("+IPD,")) { delay(1000); int connectionId = esp8266.read()-48; /* We are subtracting 48 from the output because the read() function returns the ASCII decimal value and the first decimal number which is 0 starts at 48*/ String webpage = "<h1>IOT Garbage Monitoring System</h1>"; webpage += "<p><h2>"; if (distance<5) { webpage+= " Trash can is Full"; } else{ webpage+= " Trash can is Empty"; } webpage += "</h2></p></body>"; String cipSend = "AT+CIPSEND="; cipSend += connectionId; cipSend += ","; cipSend +=webpage.length(); cipSend +="\r\n"; sendData(cipSend,1000,DEBUG); sendData(webpage,1000,DEBUG); String closeCommand = "AT+CIPCLOSE="; closeCommand+=connectionId; closeCommand+="\r\n"; sendData(closeCommand,3000,DEBUG); } } } String sendData(String command, const int timeout, boolean debug) { String response = ""; esp8266.print(command); long int time = millis(); while( (time+timeout) > millis()) { while(esp8266.available()) { char c = esp8266.read(); response+=c; } } if(debug) { Serial.print(response); } return response; } Video microcontroller-projects/12v-battery-charger-circuit-diagram-using-lm317

12v Battery Charger Circuit using LM317 (12v Power Supply)

that can be easily understood and built from home. This project will save yourself from investing in a battery charger and help you to extend your battery life. So let's get started!!!! The current can be adjusted based on the present Ah rating of the battery.

Components Required:

Transformer 12V 1Amp IC LM317 (2) Diode Bridge W005 Connector Terminal Block (2) Capacitor 1000uF, 1uF Capacitor 0.1uF (5) Variable resistor 100R Resistor 1k (5) Resistor 10k Diode- Nn007 (3) LM358 ᾠOpamp 0.05R - Shunt Resistor/wire LCD-16*2 (optional) Arduino Nano (optional)

Circuit Explanation:

are shown below: , one is used to control the voltage and the other is used to limit the current. Here, in our circuit the IC U1 is used to control the current and the IC U3 is used to control the voltage. I would strongly recommend you to read the datasheet of LM317 and understand it, so that it comes in handy while trying similar projects since LM317 is a most used Variable regulator. to calculate the value of R2. Based on these formulae the value of pot RV1 is selected as 100R. through connector P1. The rating of the transformer is 12V 1 Amps. This circuit alone is sufficient for us to make a simple circuit, but with help of few additional set up we can monitor the current and voltage of our charger on LCD, which is explained below.

Display Voltage and Current on LCD using Arduino:

But, how can we do this!! , to display the Voltage on LCD using Arduino Nano. Now if we are able to measure the voltage drop across the resistor R4, we would be able to calculate the current through the circuit using our Arduino. But, this voltage drop is very minimal for our Arduino to read it. Hence an Amplifier circuit is constructed using Op-amp LM358 as shown in the figure above, the output of this Op-Amp is given to our Arduino through an R-C circuit to measure the current and display in on the LCD.

Building up the Battery Charger:

is shown below. is also attached in the zip file given above, so that you can purchase and assemble them at ease. After assembling our Charger should look something like this....

Testing of Battery Charger:

for the charger to operate. They are used only for monitoring purpose. You can mount them using Bergstick as shown above, so that you can remove them when you need them for another project. For testing purpose remove the Arduino and connect your transformer, now adjust the output voltage to our required voltage using the POT RV2. Verify the voltage using a multimeter and connect it to the battery as shown below. That is it our charger is now operational. given Below. to charge cell phone. If you have any doubt please feel free to use the comment section. We are always ready to help you!! Code #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(11, 12, 10, 9, 8, 7); float voltage,current; void setup() { Serial.begin(9600); // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print("12V Charger"); lcd.setCursor(0, 1); lcd.print("-Circuit Digest"); delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Voltage = "); lcd.setCursor(0, 1); lcd.print("Current = "); } void loop() { voltage = (analogRead(A0)) * 0.0140625; current = (analogRead(A1)) * 0.35; lcd.setCursor(10,0); lcd.print(voltage); lcd.setCursor(10,1); lcd.print(current); delay(1000); } Video microcontroller-projects/arduino-propeller-display

Arduino Propeller LED Display

, LEDs and a DC motor. In this Propeller Display, text will appear to be rotating in propeller fashion in a circular shape. (POV), in which many still images are moved quickly one by one in a sequence, which gives a perception of animation or a moving image. How this is done is explained in the tutorial given below.

Components Required:

Arduino Uno DC Motor +3.6V LI-ION battery LED (8 pieces) 1K resistor (8 pieces)

Construction of Propeller Display:

; I used a old PC DVD DRIVE which was lying around. You can get a wooden plank or a cardboard box. Then make a hole in the middle of DVD Drive (base) and insert the DC motor axis in it. Make sure the hole is tight enough to hold the motor and motor can rotate freely. I used Feviquick to put the axis in place. I used a dot board over it and used quick glue again to stick it with DC motor. If you don’t have LI-ION battery of same size, just leave it. After that take each LED and test it with button cell or any other source. Then take some resistors and solder them with LEDs as per the picture and circuit diagram shown below. as shown in below figure and circuit diagram. will look like below:

Circuit and Working Explanation:

is very simple, we simply connected 8 LEDs with Arduino Uno as per circuit diagram below. PORTD, PIN0 ------------------LED8 POSITIVE TERMINAL PORTD, PIN1 ------------------ LED7 POSITIVE TERMINAL PORTD, PIN2 ------------------ LED6 POSITIVE TERMINAL PORTD, PIN3 ------------------ LED5 POSITIVE TERMINAL PORTD, PIN4 ------------------ LED4 POSITIVE TERMINAL PORTD, PIN5 ------------------ LED3POSITIVE TERMINAL PORTD, PIN6 ------------------ LED2 POSITIVE TERMINAL PORTD, PIN7 ------------------ LED1POSITIVE TERMINAL to extend the display, in the same way instead of adding more LED COLUMNS we move the first LED COLUMN to the second LED COLUMN place by using the motion of DC MOTOR. is the Column of 8 LEDs. Now we will power the motor and it will start running. At t=0ms: the needle will be at POSITION 1. At this position all the eight LEDs, from TOP LED (MSB) to BOTTOM LED (LSB), are powered on. At t=1ms: the needle will be at POSITION 2. Same as Position 1, at this position all the eight LEDs, from TOP LED (MSB) to BOTTOM LED (LSB), are powered on. At t=2ms: the needle will be at POSITION 3. At this position only LED7, LED6 & LED3 stay ON and remaining LEDs are turned OFF. At t=3ms: the needle will be at POSITION 4. Same as Position 3, at this position only LED7, LED6 & LED3 stay ON and remaining LEDs are turned OFF. At t=4ms: the needle will be at POSITION 5. Same as Position 3 & 4, at this position only LED7, LED6 & LED3 stay ON. Remaining LEDs are turned OFF. At t=5ms: the needle will be at POSITION 6. At this position all the eight LEDs are again powered on, TOP led (MSB) to BOTTOM led (LSB) are turned ON. At t=6ms: the needle will be at POSITION 7. Same as Position 6, at this position all the eight LEDs remain on. If the speed of movement of needle is slow we can see each LED column separately. But when the speed of motor is high and needle is moving too fast then the display will be seen as continuously showing “Aᾠcharacter.

Programming Explanation:

We have programmed the Arduino to power the appropriate LED at appropriate times while rotating so that LED column will show the text “CIRCUIT DIGESTᾠin circular position. This Array consists 8 positions of the needle to display each of the 26 alphabets that makes it array of 26x8. 26 rows in Array represent the 26 alphabets and 8 columns in each row represent the eight position of needle to display the character while rotating. Now each cell consist a binary number which represents the on/off status of 8 LEDs in a particular position of Needle. Remember needle here refers to line of 8 LEDs connected to Arduino as explained above. below with a demonstration video. like a Text is rotating like a Propeller. Code volatile char ALPHA[26][8]={{0,0b01111111,0b11111111,0b11001100,0b11001100,0b11001100,0b11111111,0b01111111}, {0,0b00111100,0b01111110,0b11011011,0b11011011,0b11011011,0b11111111,0b11111111}, {0,0b11000011,0b11000011,0b11000011,0b11000011,0b11100111,0b01111110,0b00111100}, {0,0b01111110,0b10111101,0b11000011,0b11000011,0b11000011,0b11111111,0b11111111}, {0,0b11011011,0b11011011,0b11011011,0b11011011,0b11011011,0b11111111,0b11111111}, {0,0b11011000,0b11011000,0b11011000,0b11011000,0b11011000,0b11111111,0b11111111}, {0b00011111,0b11011111,0b11011000,0b11011011,0b11011011,0b11011011,0b11111111,0b11111111}, {0,0b11111111,0b11111111,0b00011000,0b00011000,0b00011000,0b11111111,0b11111111}, {0b11000011,0b11000011,0b11000011,0b11111111,0b11111111,0b11000011,0b11000011,0b11000011}, {0b11000000,0b11000000,0b11000000,0b11111111,0b11111111,0b11000011,0b11001111,0b11001111}, {0,0b11000011,0b11100111,0b01111110,0b00111100,0b00011000,0b11111111,0b11111111}, {0b00000011,0b00000011,0b00000011,0b00000011,0b00000011,0b00000011,0b11111111,0b11111111}, {0b11111111,0b11111111,0b01100000,0b01110000,0b01110000,0b01100000,0b11111111,0b11111111}, {0b11111111,0b11111111,0b00011100,0b00111000,0b01110000,0b11100000,0b11111111,0b11111111}, {0b01111110,0b11111111,0b11000011,0b11000011,0b11000011,0b11000011,0b11111111,0b01111110}, {0,0b01110000,0b11111000,0b11001100,0b11001100,0b11001100,0b11111111,0b11111111}, {0b01111110,0b11111111,0b11001111,0b11011111,0b11011011,0b11000011,0b11111111,0b01111110}, {0b01111001,0b11111011,0b11011111,0b11011110,0b11011100,0b11011000,0b11111111,0b11111111}, {0b11001110,0b11011111,0b11011011,0b11011011,0b11011011,0b11011011,0b11111011,0b01110011}, {0b11000000,0b11000000,0b11000000,0b11111111,0b11111111,0b11000000,0b11000000,0b00000000}, {0b11111110,0b11111111,0b00000011,0b00000011,0b00000011,0b00000011,0b11111111,0b11111110}, {0b11100000,0b11111100,0b00011110,0b00000011,0b00000011,0b00011110,0b11111100,0b11100000}, {0b11111110,0b11111111,0b00000011,0b11111111,0b11111111,0b00000011,0b11111111,0b11111110}, {0b01000010,0b11100111,0b01111110,0b00111100,0b00111100,0b01111110,0b11100111,0b01000010}, {0b01000000,0b11100000,0b01110000,0b00111111,0b00111111,0b01110000,0b11100000,0b01000000}, {0b11000011,0b11100011,0b11110011,0b11111011,0b11011111,0b11001111,0b11000111,0b11000011}}; void setup() { DDRD = 0xFF; //a,b,c,d,e,f,g,...z } void loop() { for (int i=7;i>0;i--) { PORTD = ALPHA[2][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[8][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[17][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[2][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[20][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[8][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[19][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[3][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[8][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[6][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[4][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[18][i]; delay(1); PORTD=0; } delay(2); for (int i=7;i>0;i--) { PORTD = ALPHA[19][i]; delay(1); PORTD=0; } delay(19); } Video microcontroller-projects/smart-phone-controlled-arduino-home-automation

Smart Phone Controlled Home Automation Using Arduino

Automation is the essence of today’s world. Automation can make our life easy and secure. There are many ways to obtain automation. Automation can be achieved by Wi-Fi, IR, GSM, Bluetooth and many other technologies. using different technologies like: DTMF Based Home Automation GSM Based Home Automation using Arduino PC Controlled Home Automation using Arduino Bluetooth Controlled Home Automation using 8051 IR Remote Controlled Home Automation using Arduino home automation project using MATLAB and Arduino RF Remote Controlled LEDs Using Raspberry Pi We will show here that how to control electric appliances by simply sending data from Android Smart phone to Arduino.

Required Components:

Arduino Mega (any model) Android Phone HC05 Bluetooth Modules Bluetooth terminal App L293D IC Two 6V relays Two bulbs Breadboards 12 v,1A Adapter 16x2 LCD

Circuit Diagram:

are connected to Arduino. is generally used to increase the current. The Vcc2 or VS pin of L293D should be connected to VIN pin (input voltage pin or Vcc) of Arduino. Input 1 and Input 2 pins of IC are connected to 10 and 11 pin of Arduino and output pins are connected to relays pins.

Working Explanation:

to serially receive the data sent by Bluetooth terminal App through Android Smart Phone. A 16x2 LCD is used to display the On and Off status of Electronic Appliances. And L293D IC is used to drive two Relay which are directly connected to two Bulbs. 12v Adapter is used to power the Arduino and the circuit. Whenever we send data by Android phone, Arduino checks for the character sent and puts appropriate pins high or low according to Code. These pins control the relays which in turns control the Appliances. The operation of our project is as follows: If we send ‘aᾠthrough Bluetooth Terminal App then Bulb1 will be On and Bulb2 will be off. If we send ‘bᾠthrough Bluetooth Terminal App then Bulb2 will be On and Bulb1 will be off. If we send ‘cᾠthrough Bluetooth Terminal App then both the bulbs will be switched On. If we send ‘dᾠthrough Bluetooth Terminal App then both the bulbs will be switched Off. character ‘dᾠcan be used to switch off individual bulbs too. at the end.

Programming Explanation:

Program for this Project is very simple and can be easily understandable. header file in your Arduino Code, it is necessary for working of LCD. #include <LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); for communication between Arduino and Android phone via Bluetooth Module HC05. void setup() { pinMode(11, OUTPUT); pinMode(10, OUTPUT); Serial.begin(9600); lcd.begin(16, 2); lcd.print("**AUTOMATION**"); } void loop() { if (Serial.available() > 0) { char c = Serial.read(); if (c == 'a') { Serial.print("in a code"); ..... ....... ....... ...... below. Code #include <LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); void setup() { pinMode(11, OUTPUT); pinMode(10, OUTPUT); Serial.begin(9600); lcd.begin(16, 2); lcd.print("**AUTOMATION**"); } void loop() { if (Serial.available() > 0) { char c = Serial.read(); if (c == 'a') { Serial.print("in a code"); digitalWrite(10,HIGH); digitalWrite(11,LOW); Serial.print("10 HIGH"); lcd.clear(); lcd.print("**BULB1 ON**"); } if(c=='b') { digitalWrite(11,HIGH); digitalWrite(10,LOW); Serial.print("11 HIGH"); lcd.clear(); lcd.print("**BULB2 ON**"); } if(c=='c') { digitalWrite(10,HIGH); digitalWrite(11,HIGH); lcd.clear(); lcd.print("**BULB 1,2 ON**"); } if(c=='d') { digitalWrite(10,LOW); digitalWrite(11,LOW); lcd.clear(); lcd.print("**BULB 1,2 OFF**"); } } } Video microcontroller-projects/diy-arduino-vu-meter-shield

DIY LED VU Meter as Arduino Shield

online PCB simulator and designer.

Components Required:

Arduino UNO VU Meter Arduino Shield (Self Designed) Power Supply 3.5mm Audio Jack SMD type Resistors 100 ohm (10) LEDs Burg strips

Designing Volume Meter (VU) Shield for Arduino:

we have used EasyEDA, in which first we have designed a Schematic and then converted that into the PCB layout by Auto Routing feature of EasyEDA. for making Schematics, PCB layouts, simulating the Circuits etc. Further they are soon going to launch its Desktop version, which can be downloaded and installed on your computer for offline use. Below is the Snapshot of Top layer of PCB layout from EasyEDA, you can view any Layer (Top, Bottom, Topsilk, bottomsilk etc) of the PCB by selecting the layer form the ‘LayersᾠWindow. , where we have explained the process step by step.

Ordering the PCB online:

or download Gerber files of your PCB and send them to any manufacturer, it’s also a lot easier (and cheaper) to order it directly in EasyEDA. Here you can select the number of PCBs you want to order, how manycopper layers you need, the PCB thickness, copper weight, and even the PCB color. Afteryou have selected all of theoptions, click “Save to Cartᾠand complete you order, then you will get your PCBs a few days later. After few days of ordering the PCB, we got our VU Meter Arduino Shield PCB, and we found the PCBs in nice packaging and the quality of PCB is quite impressive. and burg strips over the PCB, you can have a final look here: at the end for demonstration.

Circuit Explanation:

that are resistors and LEDs. Also we have two options to apply audio signal to this board that are direct to pins or by using audio jack. Circuit for this project is very simple, we have a connected 8 LEDs at pin numbers D3-D10. Audio Jack is directly connected at analog pin A5 of Arduino. If you need to connect LCD then you can connect the LCD at J1 and J7 (see below circuit) with connections like lcd(14, 15,16,17,18,2).

Programming Explanation:

is very easy. Here in this code we haven’t given any name to particular LED. I just keep in mind the connection and write code directly. will initialize the pin D3-D10 of Arduino. void setup() { for(i=3;i<11;i++) pinMode(i, OUTPUT); } is divided by 10 to get a result and this result is directly used to get pin no of Arduino using for loop. void loop() { int value=analogRead(A5); value/=10; for(i=3;i<=value;i++) digitalWrite(i, HIGH); for(i=value+1;i<=10;i++) digitalWrite(i, LOW); } It can be explained by example, like suppose the analog value is 50, now divide it by 10, we will get: Value = 50 Value = value/10 Value = 50/10 = 5 like: for(i=3;i<=value;i++) digitalWrite(i, HIGH); In above ‘forᾠloop i=3 is D3 and Value=5 means D5. So it means loop will go from D3 to D5 and LEDs that are connected at D3, D4 and D5 will be ‘ONᾍ means value=5+1 means D6 and i<=10 means D10. for(i=value+1;i<=10;i++) digitalWrite(i, LOW); Means loop will go from D6 to D10 and LEDs that are connected at D6-D10 will be ‘OFFᾮ , in which LEDs will glow according to the intensity of the sound like you can check in Video below. You can directly provide input from your mobile or laptop by using 3.5 mm audio jack or AUX cable and have fun with the beautiful lighting effect. Code int i=0; int value1=0; void setup() { for(i=3;i<11;i++) pinMode(i, OUTPUT); } void loop() { int value=analogRead(A5); value/=10; for(i=3;i<=value;i++) digitalWrite(i, HIGH); for(i=value+1;i<=10;i++) digitalWrite(i, LOW); } Video microcontroller-projects/0-24v-variable-dc-power-supply-using-arduino

0-24v 3A Variable Power Supply using LM338

However in practical we got up to 22.2v of output. Here the voltage level is controlled with help of a Potentiometer and voltage value is displayed on Liquid Crystal Display (LCD) which will be driven by an Arduino Nano.Also check out our previous Power supply circuits: 12v Battery Charger Circuit usingLM317 Variable Power Supply By Arduino Uno Cell Phone Charger Circuit

Materials Required:

Transformer - 24V 3A Dot board LM338K High Current Voltage Regulator Diode Bridge 10A Arduino Nano LCD 16*2 Resistor 1k and 220 ohms Capacitor 0.1uF and 0.001uF 7812 Voltage Regulator 5K variable Pot (Radio Pot) Berg stick (Female) Terminal Block

How it works:

are powered by a low current rating Voltage regulator IC like 7812. I will explain the circuit step by step as we go through our project.

Connecting LCD with Arduino to Display Voltage Level:

since it is compact and easy to use on a dot board Many people have faced issues in interfacing a LCD with Arduino, thats why we try this first so that it does not ruin our project in last minute. I have used the following to start with: for LCD, you can check it. The schematics for Arduino and LCD is given below. Arduino UNO is used here for schematics, but not to worry the Arduino NANO and UNO have the same pinouts and work the same. Once the connection the done you can upload below code directly to check the LCD working. The header file for LCD is given by Arduino by default, do not use any explicit headers as they tend to give errors. #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(7, 8, 9, 10, 11, 12); int a =5; void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); } void loop() { // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0, 1); // print the number of seconds since reset: lcd.print(a); } This should get your LCD to work, but if you still face issues try the following: 1. Check you pins definition in the program. 2. Directly ground the 3rd pin (VEE) and 5th pin (RW) of your LCD. 3. Make sure you LCD pins are placed in the right order, some LCD's have their pins is another direction. Once the program works it should look something like this. If you have any problems let us know by comments. I have used the mini USB cable to power the Arduino for now, but later we will power it using a voltage regulator. I soldered them to the dot board like this (PCB) it will be great since we are dealing with high currents.

Building 0-24v 3A Variable Power Supply Circuit:

since we are dealing directly with AC mains and high current. Check for continuity using a multimeter every time before you power you circuit. The bridge rectifier should will give you (root 2 times the input voltage) 33.9V, but don't be surprised if you get around 27 - 30 Volts. This is because of the Voltage drop across each diode in our bridge rectifier. Once we reach this stage we will solder it to our dot board and verify our output and use a terminal block so that we use it as a non regulated constant source if required. , this will be mostly available in metal body package, since it has to source high current. The schematics for variable voltage regulator are shown below. In our case we get R1 to be 110 ohms and R2 as 5K (POT). since the differential voltage is very high. isshown below, at the end.

Point to be kept in mind:

1. Be careful while soldering the connections any mismatch or carelessness will easily fry your components. 2. Ordinary solders might not be able to withstand 3A, this will lead eventually melt your solder and cause short circuit. Use thick copper wires or use more lead while connecting the high current tracks as shown in the picture. 3. Any short circuit or weak soldering will easily burn your transformer windings; hence check for continuity before powering up the circuit. For additional safety a MCB or fuse on Input side can be used. 4. High current voltage regulators mostly come in metal can packages, while using them on dot board do not place components close to them as their body acts as the output of the rectified Voltage, further will result in ripples. Also do not solder the wire to the metal can, instead use a small screw as shown in the picture given below. Solders don't stick to its body, and heating results in damaging the Regulator permanently. 5. Do not skip any filter capacitors from the schematics, this will damage you Arduino. 6. Do not overload the transformer more than 3A, stop when you hear a hissing noise from the transformer. It is good to operate between the ranges of 0 - 2.5A. 7. Verify the output of your 7812 before you connect it to your Arduino, check for overheating during first trial. If heating occurs it means your Arduino is consuming more current, reduce the backlight of the LCD to solve this.

Upgrade:

Since our circuited Dot board has both AC and DC in its trails, the noise will be high than that of other circuits. Hence a value of R=5.2K and C=100uf is used to filter out the noise in our signal. to our circuit to measure the output current of the RPS. The below schismatic shows how to connect the Sensor to the to Arduino Board. Code #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(7, 8, 9, 10, 11, 12); void setup() { Serial.begin(9600); // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.setCursor(0, 0); lcd.print("RPS"); lcd.setCursor(0, 1); lcd.print("-Circuit Digest"); delay(2000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Voltage = "); } int voltage; void loop() { int A1 = analogRead(A0); voltage = map(A1,0,1024,0,22); Serial.println(voltage); lcd.setCursor(10,0); lcd.print(voltage); delay(1000); } Video microcontroller-projects/door-alarm-using-arduino-ultrasonic-sensor

Door Alarm using Arduino and Ultrasonic Sensor

based on various technologies: Laser Security Alarm Circuit IR Based Security Alarm Burglar Alarm using PIR GSM Based Security System

Required Components:

Breadboard Ultrasonic Sensor Buzzer Arduino Mega (any model) Jumper Wires USB cable for Arduino or 12v, 1A adapter. is used hereto detect the presences of any person at the door. The sensor module consists of ultrasonic transmitter, receiver and the control circuit. Ultrasonic Sensorconsists of two circular eyes out of which one is used to transmit the ultrasonic wave and the other to receive it. We can calculate the distance of the object based on the time taken by ultrasonic wave to return back to the sensor. Since the time and speed of sound is known we can calculate the distance by the following formulae. Distance = (Time x Speed of Sound) / 2 library, and this library takes care of this calculation and we just need to use some key words, explanation is given in programing section below. Check the below project to measure the distance of any object and to properly understand the Ultrasonic sensor working: Arduino Based Distance Measurement using Ultrasonic Sensor Distance Measurement using HC-SR04 and AVR Microcontroller

Circuit Diagram and Explanation:

pin of Arduino.

Working Explanation:

is very easy. Whenever anyone comes in the path/range of Ultrasonic Sensor, microcontroller detects the distance of object from the sensor and if the object is in the defined range, it sends the High signal to the buzzer and buzzer starts beeping.

Programming Explanation:

, but this Library provides many good features for Ultrasonic sensor and it becomes easy to Code for ultrasonic sensor using this library. We can use ultrasonic sensor’s functions easily using this library without writing too many lines of code; it’s like other libraries which are used to handle the complexity at lower level. #include <NewPing.h> of this Library. Latest release of Library can be downloaded from the above given link. Further, we have downloaded the Library from below link, which is modified for Teensy: means that the distance up to which the sensor can detect the obstacle is 500 cm or 5m. #define TRIGGER_PIN 12 #define ECHO_PIN 11 #define MAX_DISTANCE 500 Below line states the Baud Rate at which the data is sent to the Arduino serial port from ultrasonic sensor. Serial.begin(115200); Pin no 10 is configured as output pin and is connected to buzzer. Other pin of buzzer is connected to GND of Arduino. pinMode(10, OUTPUT); is used to execute the buzzer when obstacle is in 50 cm range from the ultrasonic sensor. You can change this ‘distanceᾠaccording to your requirement or your door size. if ((sonar.ping_result / US_ROUNDTRIP_CM) < 50) flag = 1; else if ((sonar.ping_result / US_ROUNDTRIP_CM) > 50) flag = 0; library and can be easily understood. Further you can check the library page itself to get better understanding of it and can use this library to make complex project using ultrasonic sensor. Full code for this Door Alarm project is given below. Code #include <NewPing.h> #define TRIGGER_PIN 12 // Arduino pin tied to trigger pin on ping sensor. #define ECHO_PIN 11 // Arduino pin tied to echo pin on ping sensor. #define MAX_DISTANCE 500 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm. NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance. unsigned int pingSpeed = 50; // How frequently are we going to send out a ping (in milliseconds). 50ms would be 20 times a second. unsigned long pingTimer; int flag = 0; // Holds the next ping time. void setup() { Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results. pingTimer = millis(); pinMode(10, OUTPUT); // Start now. // Start now. } void loop() { // Notice how there's no delays in this sketch to allow you to do other processing in-line while doing distance pings. if (millis() >= pingTimer) { // pingSpeed milliseconds since last ping, do another ping. pingTimer += pingSpeed; // Set the next ping time. sonar.ping_timer(echoCheck); // Send out the ping, calls "echoCheck" function every 24uS where you can check the ping status. } if (flag == 1) { digitalWrite(10, HIGH); delay(500); digitalWrite(10, LOW); delay(500); digitalWrite(10, HIGH); delay(500); digitalWrite(10, LOW); delay(500); } else { digitalWrite(10, LOW); } } void echoCheck() { // Timer2 interrupt calls this function every 24uS where you can check the ping status. if (sonar.check_timer()) { // This is how you check to see if the ping was received. // Here's where you can add code. Serial.print("Ping: "); Serial.print(sonar.ping_result / US_ROUNDTRIP_CM); // Ping returned, uS result in ping_result, convert to cm with US_ROUNDTRIP_CM. Serial.println("cm"); if ((sonar.ping_result / US_ROUNDTRIP_CM) < 50) flag = 1; else if ((sonar.ping_result / US_ROUNDTRIP_CM) > 50) flag = 0; } } Video microcontroller-projects/diy-arduino-based-smart-vacuum-cleaning-robot

DIY Smart Vacuum Cleaning Robot using Arduino

Hi guys, are you a newbie to the world of Robotics or Electronic? OR Are you looking for a simple yet powerful project to make your friends and teachers impressed? Then this is the place. which is shown in the image below. Trust me people it's fun!!

Required Material and Components:

in mind and we know what we are up to. So let's look where we should start our execution. In order to build a robot of our idea we would first need to decide on the following: Microcontroller type Sensors required Motors required Robot chassis material Battery capacity Now, lets us decide on each of the above mentioned points. This way it will be helpful for you to not only build this home cleaning robotbut also any other robots which strikes your imagination. Like a Tablet cannot be designed on 8 bit Microcontroller and there is no worth of using ARM cortex m4 to design an electronic calculator. Microcontroller selection totally depends upon therequirements of the product: 1. Firstly technical requirements are identified like number of I/O pins required, flash size, number/type of communicationprotocols, any special features etc. 2. Then list of controllers are selected as per the technical requirements. This list contains controllers from different manufacturers. Many application specific controllers are available. 3. Then a controller is finalized based upon cost,availability and support from manufacturer. : DTMF Controlled Robot using Arduino Line Follower Robot using Arduino Computer Controlled Robot using Arduino WiFi Controlled Robot using Arduino Accelerometer Based Hand Gesture Controlled Robot using Arduino Bluetooth Controlled Toy Car using Arduino In our case our robot should be able to detect obstacles and avoid them. : consists of two circular eyes out of which one is used to transmit the US signal and the other to receive the US rays. The time taken by the rays to get transmitted and received back is calculated by the microcontroller. Now, since the time and speed of sound is known we can calculate the distance by the following formulae. Distance = Time x Speed of Sound divided by 2 But our battery is a bit bulky and heavy hence we use four motors to drive our robot all four being the same PMDC motors. But it is advisable to set into stepper and servo motors once you get comfortable with PMDC motors. is chosen that everyone can work on it with ease. This problem has totally vanished from the field after the introduction of the 3D printers. I am planning to 3D print parts someday and update you people with the same. So for now let’s use wooden sheets to build our robot. and its pretty bulky making our robot get four PMDC motors to pull this bulky guy. lets list them down Wooden sheets for chassis IR and US sensors Vacuum cleaner which runs on DC current Arduino Uno 12V 20Ah battery Motor driver IC (L293D) Working tools Connecting wires Enthusiastic energy to learn and work. Most of our components are covered in the description above, I will explain the left outs below. We will be using the same as shown in above picture. A motor driver is a intermediate module between Arduino and the Motor. This is because Arduino microcontroller will not be able to supply the current required for the motor to work it and can just supply 40mA, hence drawing more current will damage the controller permanently. So we trigger the motor driver which in turn controls the motor. which will be able to supply up to 1A, hence this driver will get the information from Arduino and make the motor work as desired. Thats it!! I have given most of the crucial information but before we start building the robot it is recommended to go through the datasheet of L293D and Arduino. If you have any doubts or problems you can contact us through the comment section.

Building and Testing the Robot:

Once you power on the robot the vacuum is also turned on. One tiring process of building our Robot is the wooden works. We have to carve our wood and drill some holes to place the sensors and vacuum cleaner. with the following code once you arrange the Motor and Motor driver, before connecting the Sensors. void setup() { Serial.begin(9600); pinMode(9,OUTPUT); pinMode(10,OUTPUT); pinMode(11,OUTPUT); pinMode(12,OUTPUT); } void loop() { delay(1000); Serial.print("forward"); digitalWrite(9,HIGH); digitalWrite(10,LOW); digitalWrite(11,HIGH); digitalWrite(12,LOW); delay(500); Serial.print("backward"); digitalWrite(9,LOW); digitalWrite(10,HIGH); digitalWrite(11,LOW); digitalWrite(12,HIGH); } given at the end. As you can see I have mounted an Ultrasonic sensor to the front and two IR sensors on both the side of the robot. The heat sink is fitted on to the L293D just in case the IC heats up fast. You can also add few extra parts like this one can be placed on both ends of the front part that will push the dust along the sides into the suction area. like this This smaller Robot is made on cardboard and runs on ATMega16 development board. The vacuum cleaner part was done by using a BLDC fan and enclosed in a box. You can adopt this if you want to keep your budget low. This idea also works but it's not efficient.

Circuit Diagram:

below. Further, I am also planning to completely 3D Printed the parts in its next version. I am also going to be adding few cool features and complex algorithms so that it covers the whole carpet area and easy to handle and compact in size. So stay tuned for future updates. Code #define trigPin 12 #define echoPin 13 #define ir1 7 #define ir2 6 void setup() { Serial.begin(9600); pinMode(8,OUTPUT); pinMode(9,OUTPUT); pinMode(10,OUTPUT); pinMode(11,OUTPUT); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(ir1, INPUT); pinMode(ir2,INPUT); } void loop() { int duration, distance; int flag,val1,val2; val1=digitalRead(ir1); val2=digitalRead(ir2); Serial.println(val1); Serial.println(val2); digitalWrite(trigPin, HIGH); delayMicroseconds(1000); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration/2) / 29.1; if (distance >= 200 || distance <= 0){ Serial.println("Out of range"); } else { Serial.print(distance); Serial.println(" cm"); } delay(500); if (distance >=20) { delay(100); Serial.println("forward"); digitalWrite(8,HIGH); digitalWrite(9,LOW); digitalWrite(10,HIGH); digitalWrite(11,LOW); delay(150); Serial.println("STOP"); digitalWrite(8,LOW); digitalWrite(9,LOW); digitalWrite(10,LOW); digitalWrite(11,LOW); } if (distance<=20) { if (val1==1 ) { Serial.print("turn right"); digitalWrite(8,LOW); digitalWrite(9,LOW); digitalWrite(10,HIGH); digitalWrite(11,LOW); delay(2000); } if (val2==1) { Serial.print("turn left"); digitalWrite(8,HIGH); digitalWrite(9,LOW); digitalWrite(10,LOW); digitalWrite(11,LOW); delay(500); } } if(distance<=10) { Serial.print("rearrange back"); digitalWrite(8,LOW); digitalWrite(9,HIGH); digitalWrite(10,LOW); digitalWrite(11,HIGH); delay(1000); Serial.print("rearranged left"); digitalWrite(8,LOW); digitalWrite(9,LOW); digitalWrite(10,HIGH); digitalWrite(11,LOW); delay(100); } if (distance<=20) { Serial.print("Algorithum"); Serial.print("free right"); digitalWrite(8,HIGH); digitalWrite(9,LOW); digitalWrite(10,LOW); digitalWrite(11,LOW); if(val2==0) { Serial.print("smart adjust"); digitalWrite(8,LOW); digitalWrite(9,HIGH); digitalWrite(10,LOW); digitalWrite(11,LOW); delay(500); } } } Video microcontroller-projects/smart-phone-controlled-fm-radio-using-arduino-and-processing

Smart Phone Controlled FM Radio using Arduino and Processing

using the same procedure. Every electronic device operates with the help of signals. These signals might be in terms of voltages or currents. The signals can either be triggered manually with the help of user interaction directly or with the help of a wireless device. To achieve this we will have to do two main things. 1. Predict how the signals are generated in the existing mechanical button system. 2. Find out a way to trigger the same signal with help of a small add-on circuit. So, Let's get started...

Components Required:

Reverse Engineering:

which stopped working a long time ago. And when I opened it I found that the buttons on it have stopped working. This will be a perfect device for us to work because we won't need the buttons anymore as we are going to make it wireless completely. The below picture shows the Radio which I opened. This was the button setup of my radio (above picture). As you can see there are eight buttons from which the radio takes input. You can also notice that there are eight resistors on the board. What can you conclude from this‐󽟙es each resister is connected to a switch. Now let's take a look on the back side of the board: You can trace out the connection with the help of the PCB tracks, but if you are still confused you can use your millimetre in connectivity more and figure out the circuit. This board has three terminals (circled in red) which gives signals to the main FM radio board. These pins were marked as S1, S2, and 1.7V. This means that constant voltage of 1.7 Volts is sent form the main board to this board and as the user presses any button, there will be a voltage drop across the corresponding resistor and through the pins S1 and S2 a variable voltage will be sent back. This is how most of the buttons in our electronic devices work. Now since we have figured out how it worked, let’s make it wireless.

Working Explanation:

and ground out the main board. There are few ways, using which you can mimic these button setup using a microcontroller. We can use a Digital potentiometer and make it provide the resistance on the board as programmed and when required. But this will make things complicated and costly as working with Digipot requires SPI and Digipots are costly. We can also use a transistor resistor network in which each resistor of different values are activated by a transistor which in turn is controlled by the microcontroller itself. But again to do this for eight buttons the circuit will get complicated. A low pass filter is shown above, the key component here is the capacitor which will ground the entire pulsating signal and a pure DC is sent as output. So the PWM signals from the Arduino have to be sent through a low pass filter and then given to the signal board of the FM radio. The circuit is easy to build on a dot board as shown above. Here the Black wire is for ground and the Blue and Green wires on the left will be sent to our FM boards S1(Green) and S2(blue), and the wires to the right will receive PWM signals from Arduino’s Pin 9 & 10 (see picture above) and pass to the FM board via a Low pass filter. The Bluetooth module uses pins 11 and 12 as Rx and TX. and find out how our Radio behaves for different voltage levels. The next step is to make this thing wireless.

Circuit Connections:

Arduino Program:

Once we are confident with its working, we can jump into making our own Android app.

Using Processing to Make Android App:

It is cool to make our device wireless, but we can also add some personal touch to our device by creating our own Android app. We can control the device on automatic scheduled times or control it based on your wake up alarms. You can even make your radio play your favourite channel when you get home. Imagination is your limit here. But for now we will create a simple user interface using processing, this app will only have few buttons using which you can control your FM radio. is open source software which is used by artists for Graphics designing. This software is used to develop software and Android applications. is given here: Android App Processing Code to control the FM Radio for the same. Right click on it and click on ‘Save link as..ᾠto download the code file. Then open the file in 'Processing' software and click on ‘Runᾠbutton to check how it will look in the Phone. You need to install 'Processing' software to open *.pde files. to make it an Android App. We have already provided the full Android Code in above link, so you can directly use it. Below are some Header files to enable Bluetooth functions: import android.content.Intent; import android.os.Bundle; import ketai.net.bluetooth.*; import ketai.ui.*; import ketai.net.*; import android.bluetooth.BluetoothAdapter; import android.view.KeyEvent; BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter(); KetaiBluetooth bt; Below part of the code will trigger a request to the user asking them to Turn on the Bluetooth on app start up. //To start BT on start********* void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); bt = new KetaiBluetooth(this); } void onActivityResult(int requestCode, int resultCode, Intent data) { bt.onActivityResult(requestCode, resultCode, data); } //********** expect a device name from our setup function. Since our Bluetooth device is named as 'HC-05ᾬ below line is added in the setup. This name will differ based on your Bluetooth modules name. //To select bluetooth device********** void onKetaiListSelection(KetaiList klist) { String selection = klist.getSelection(); bt.connectToDeviceByName(selection); //dispose of list for now klist = null; } //********** bt.connectToDeviceByName("HC-05"); on your phone. Now click on the Play button on the processing window in PC, the application will be directly installed on your Android Phone and will be launched automatically. It’s that easy, so go ahead and try it out. to understand and run the Code in Android Phone as well as in computer. that can be controlled by our Android Application. I hope this will help people to get to work but if you need any guidance as always you can use the comment section and we will be glad to help you. Code int outvalue =0;; const int GPWM = 9; const int BPWM = 10; int invalue; #include <SoftwareSerial.h>// import the serial library SoftwareSerial Genotronex(11, 12); // TX, RX int BluetoothData; // the data given from Computer void setup() { Serial.begin(57600); Genotronex.begin(9600); Serial.println("Enter Value to write (60-195)"); TCCR2B = (TCCR2B & 0xF8) | 0x01;// timer frequency is 4khz } void loop() { if (Genotronex.available()) { BluetoothData=Genotronex.read(); invalue= BluetoothData; if (invalue == 'u') { Serial.println("Volume up"); outvalue= 45; GreenDigibutton(); } if (invalue == 'd') { Serial.println("Volume down"); outvalue= 35; GreenDigibutton(); } if (invalue == 'm') { Serial.println("Mode change"); outvalue= 65; GreenDigibutton(); } if (invalue == 's') { Serial.println("Stop"); outvalue= 75; GreenDigibutton(); } if (invalue == 'p') { Serial.println("Prev. Channel"); outvalue= 35; BlueDigibutton(); } if (invalue == 'n') { Serial.println("Next Channel"); outvalue= 45; BlueDigibutton(); } } } void GreenDigibutton() { analogWrite(GPWM, outvalue); delay(200); analogWrite(GPWM, 0); delay(200); Serial.println("DONE"); } void BlueDigibutton() { analogWrite(BPWM, outvalue); delay(200); analogWrite(BPWM, 0); delay(200); Serial.println("DONE"); } Video microcontroller-projects/neopixel-rgb-led-strip-with-arduino

How to Use NeoPixel LED Strip with Arduino and TFT LCD

Any color is made up of three colors: Red, Green and Blue, using a simple RGB LED you can generate any color. But the limitation of RGB LED is that it has three separate LEDs inside it and requires three Pins of any microcontroller to operate one RGB LED. So it is not possible to connect hundreds of LEDs with one microcontroller. . and can control this system by LCD lying near to you.

Required components:

Arduino Mega or any other Arduino model 2.4 inch TFT LCD Shield with SPFD5408 controller NeoPixel RGB LED Strip Connecting Wires USB Cable or 12 V 1A adapter

Circuit Connections:

such that GND of MEGA lies beneath GND of LCD and 5V pin of Arduino connects to 5V pin of LCD. Take care not to interchange GND and 5V pin of NeoPixel LED strip while connecting it to Arduino, otherwise it will damage the NeoPixel LED strip. Also note that here we have used Arduino Mega but you can use any other Arduino model. Connections to Arduino to NeoPixel RGB LED Strip:
5v5v
GNDGND
Digital Pin no. 36DI (data in)

Working Explanation:

at the end of this article. When any button is tapped on the LCD, data is sent to Arduino and Arduino further sends instruction to NeoPixel Strip to light accordingly. For example NeoPixel LED strip glows in Green color when we tap the Green button on the LCD and LED strip glows in Red color when we press the Red button and so on.

Programming Explanation:

Click on ‘Clone or downloadᾠand ‘Download ZIPᾠfile and add to your Arduino library folder. This library is needed for proper functioning of TFT LCD. #include <SPFD5408_Adafruit_GFX.h> // Core graphics library #include <SPFD5408_Adafruit_TFTLCD.h> // Hardware-specific library #include <SPFD5408_TouchScreen.h> by burning Arduino with examples codes given in the Library and check if codes are working properly. First check the graphics test, then calibrate test and finally paint test. If you find that all features all working fine then start with code given in this tutorial. #include <Adafruit_NeoPixel.h> As described earlier Digital Pin 36 of MEGA is connected to DI pin of NeoPixel LED Strip as shown in code below. Also the numbers of LEDs in the Strip are 30 so as is written in code: #define PIN 36 #define NUM_LEDS 30 Display colors of LCD buttons are denoted by some Codes. You can change these codes according to your LCD. #define BLACK 0x0000 #define YELLOW 0x001F #define GREEN 0xF800 #define RED 0x07E0 #define CYAN 0x07FF #define MAGENTA 0xF81F #define BLUE 0xFFE0 #define WHITE 0xFFFF Some parameters for the buttons like size and position are defined in the code: uint16_t width = 0; uint16_t height = 0; uint16_t x = 40; uint16_t y = height - 20; uint16_t w = 75; uint16_t h = 20; h parameter is used to adjust the size of button on LCD. If you make it 40, then the size of button will get doubled. y parameter is y coordinate of LCD. Touch buttons are denoted by numbers as shown in code: #define BUTTONS 9 #define BUTTON_Red 0 #define BUTTON_DarkRed 1 #define BUTTON_RED 2 #define BUTTON_DarkGreen 3 #define BUTTON_DeepRed 4 #define BUTTON_Blue 5 #define BUTTON_LightBlue 6 #define BUTTON_LightBlue1 7 Some functions are used to emit the color out of NeoPixel like: void EmitCyan(); void EmitWhite(); void EmitGreen(); void EmitYellow(); void EmitPink(); void EmitBlack(); Just enter the color you want your NeoPixel strip to glow, find the RGB values for that color and put in above functions. function is used for giving text and color to buttons and also for placing them at required place on LCD. void initializeButtons() { uint16_t x = 40; uint16_t y = height - 20; uint16_t w = 75; uint16_t h = 40; uint8_t spacing_x = 5 ..... ..... .... ...... function is used to draw the buttons on the LCD. void showCalibration() { tft.setCursor (40, 0); for (uint8_t i = 0; i < 8; i++) { buttons[i].drawButton(); } } is given below. Code is bit lengthy but simple, you can understand the code easily. Code #include <Adafruit_NeoPixel.h> #include <math.h> #include <SPFD5408_Adafruit_GFX.h> // Core graphics library #include <SPFD5408_Adafruit_TFTLCD.h> // Hardware-specific library #include <SPFD5408_TouchScreen.h> // *** SPFD5408 change -- End #if defined(__SAM3X8E__) #undef __FlashStringHelper::F(string_literal) #define F(string_literal) string_literal #endif #define YP A1 // must be an analog pin, use "An" notation! #define XM A2 // must be an analog pin, use "An" notation! #define YM 7 // can be a digital pin #define XP 6 // can be a digital pin #define PIN 36 #define NUM_LEDS 30 #define BRIGHTNESS 80 // Calibrate values #define TS_MINX 125 #define TS_MINY 85 #define TS_MAXX 965 #define TS_MAXY 905 // For better pressure precision, we need to know the resistance // between X+ and X- Use any multimeter to read it // For the one we're using, its 300 ohms across the X plate TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); #define LCD_CS A3 #define LCD_CD A2 #define LCD_WR A1 #define LCD_RD A0 // optional #define LCD_RESET A4 // Assign human-readable names to some common 16-bit color values: #define BLACK 0x0000 #define YELLOW 0x001F #define GREEN 0xF800 #define RED 0x07E0 #define CYAN 0x07FF #define MAGENTA 0xF81F #define BLUE 0xFFE0 #define WHITE 0xFFFF void EmitCyan(); void EmitWhite(); void EmitGreen(); void EmitYellow(); void EmitPink(); void EmitBlack(); uint16_t width = 0; uint16_t height = 0; uint16_t x = 40; uint16_t y = height - 20; uint16_t w = 75; uint16_t h = 20; Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800); #define BOXSIZE 40 #define PENRADIUS 3 #define BUTTONS 9 #define BUTTON_Red 0 #define BUTTON_DarkRed 1 #define BUTTON_RED 2 #define BUTTON_DarkGreen 3 #define BUTTON_DeepRed 4 #define BUTTON_Blue 5 #define BUTTON_LightBlue 6 #define BUTTON_LightBlue1 7 Adafruit_GFX_Button buttons[BUTTONS]; uint16_t buttons_y = 0; #define MINPRESSURE 10 #define MAXPRESSURE 1000 void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial.println(F("Paint!")); tft.reset(); tft.begin(0x9341); // SDFP5408 strip.begin(); strip.show(); // Initialize all pixels to 'off' tft.setRotation(0); // Need for the Mega, please changed for your choice or rotation initial tft.fillScreen(BLACK); tft.setCursor (40, 20); tft.setTextSize (5); tft.setTextColor(WHITE); tft.println("COLORS"); tft.setCursor (65, 85); width = tft.width() - 1; height = tft.height() - 100; initializeButtons(); showCalibration(); } void loop() { // put your main code here, to run repeatedly: // Test of calibration int i = 0; TSPoint p; // Wait a touch digitalWrite(13, HIGH); p = waitOneTouch(); digitalWrite(13, LOW); p.x = mapXValue(p); p.y = mapYValue(p); for (uint8_t b = 0; b <BUTTONS; b++) { if (buttons[b].contains(p.x, p.y)) { // Action switch (b) { case BUTTON_Red: EmitPink(); showCalibration(); break; case BUTTON_DarkRed: EmitCyan(); showCalibration(); break; case BUTTON_RED: EmitBlack(); showCalibration(); break; case BUTTON_DarkGreen: EmitGreen(); showCalibration(); break; case BUTTON_Blue: EmitBlue(); showCalibration(); break; case BUTTON_LightBlue: EmitYellow(); showCalibration(); break; case BUTTON_DeepRed: EmitDeepRed(); showCalibration(); break; } } } } void initializeButtons() { uint16_t x = 40; uint16_t y = height - 20; uint16_t w = 75; uint16_t h = 40; uint8_t spacing_x = 5; uint8_t textSize = 2; char buttonlabels[7][20] = {"PINK", "CYAN", "WHITE", "GREEN", "RED", "BLUE", "YELLOW"}; uint16_t buttoncolors[15] = {RED, GREEN, BLACK, MAGENTA, CYAN, BLUE, YELLOW}; for (uint8_t b = 0; b < 9; b++) { if (b < 3) { buttons[b].initButton(&tft, // TFT object x + b * (w + spacing_x), y, // x, y, w, h, BLACK, buttoncolors[b], WHITE, // w, h, outline, fill, buttonlabels[b], textSize); Serial.print( h); }// text if (b == 3) { uint16_t x = 40; uint16_t y = height + 30 ; uint16_t w = 75; uint16_t h = 40; buttons[b].initButton(&tft, // TFT object x + 0 * (w + spacing_x) , y, // x, y, w, h, BLACK, buttoncolors[b], WHITE, // w, h, outline, fill, buttonlabels[b], textSize); } if (b == 4) { uint16_t x = 40; uint16_t y = height + 30 ; uint16_t w = 75; uint16_t h = 40; buttons[b].initButton(&tft, // TFT object x + 1 * (w + spacing_x) , y, // x, y, w, h, BLACK, buttoncolors[b], WHITE, // w, h, outline, fill, buttonlabels[b], textSize); } if (b == 5) { uint16_t x = 40; uint16_t y = height + 30 ; uint16_t w = 75; uint16_t h = 40; buttons[b].initButton(&tft, // TFT object x + 2 * (w + spacing_x) , y, // x, y, w, h, BLACK, buttoncolors[b], WHITE, // w, h, outline, fill, buttonlabels[b], textSize); } if (b == 6) { uint16_t x = 40; uint16_t y = height + 80 ; uint16_t w = 75; uint16_t h = 20; buttons[b].initButton(&tft, // TFT object x + 0 * (w + spacing_x) , y, // x, y, w, h,BLACK, buttoncolors[b], WHITE, // w, h, outline, fill, buttonlabels[b], textSize); } if (b == 7) { uint16_t x = 40; uint16_t y = height + 80 ; uint16_t w = 75; uint16_t h = 40; buttons[b].initButton(&tft, // TFT object x + 2 * (w + spacing_x) , y, // x, y, w, h,BLACK, buttoncolors[b], WHITE, // w, h, outline, fill, buttonlabels[b], textSize); } } // Save the y position to avoid draws buttons_y = y; } // Map the coordinate X uint16_t mapXValue(TSPoint p) { uint16_t x = map(p.x, TS_MINX, TS_MAXX, 0, tft.width()); //Correct offset of touch. Manual calibration //x+=1; return x; } uint16_t mapYValue(TSPoint p) { uint16_t y = map(p.y, TS_MINY, TS_MAXY, 0, tft.height()); //Correct offset of touch. Manual calibration //y-=2; return y; } TSPoint waitOneTouch() { TSPoint p; do { p = ts.getPoint(); pinMode(XM, OUTPUT); //Pins configures again for TFT control pinMode(YP, OUTPUT); } while ((p.z < MINPRESSURE ) || (p.z > MAXPRESSURE)); return p; } void showCalibration() { tft.setCursor (40, 0); for (uint8_t i = 0; i < 8; i++) { buttons[i].drawButton(); } } void EmitDeepRed() { for(int i=0;i<30;i++) { strip. setPixelColor(i, 255, 0, 0); strip.show(); } } void EmitCyan() { for(int i=0;i<30;i++) { strip. setPixelColor(i,0, 255, 255); strip.show(); } } void EmitWhite() { for(int i=0;i<30;i++) { strip. setPixelColor(i,255, 255, 255); strip.show(); } } void EmitGreen() { for(int i=0;i<30;i++) { strip. setPixelColor(i,0, 255, 0); strip.show(); } } void EmitBlue() { for(int i=0;i<30;i++) { strip. setPixelColor(i,0, 0, 255); strip.show(); } } void EmitYellow() { for(int i=0;i<30;i++) { strip. setPixelColor(i,255, 255, 0); strip.show(); } } void EmitPink() { for(int i=0;i<30;i++) { strip. setPixelColor(i,255, 0, 255); strip.show(); } } void EmitBlack() { for(int i=0;i<30;i++) { strip. setPixelColor(i,255, 255, 255); strip.show(); } } Video microcontroller-projects/ping-pong-game-using-arduino-accelerometer

Ping Pong Game using Arduino and Accelerometer

that helps us to play the game using our body movements and gestures, this way the gaming experience has increased a lot and user feels more involved into the game.

Overview:

to feed it serially to our computer / Laptop. So let's go shopping!!!!

Components Required:

Arduino (any version or model) Accelerometer Connecting wires Interest (Lolz)

Circuit Explanation:

But there is few things to be taken care of as mentioned below: 1. Your Accelerometer cannot handle 5V, so always connect the Vcc of accelerometer to your 3.3V pin of Arduino. 2. Every Accelerometer suffers from the effect of gravity which has to be handled while programming (simply using a filter). With this in mind let's look into the working of an Accelerometer and how we use it.

Working of Accelerometer:

is a device which can convert acceleration in any direction to its respective variable voltage. This is accomplished by using capacitors (refer image), as the Accel moves, the capacitor present inside it, will also undergo changes (refer image) based on the movement, since the capacitance is varied, a variable voltage can also be obtained. So, as mentioned above every accelerometer suffers from the problem of gravity effect. No matter how accurate your sensor is calibrated (even your apple phones Accel.), it will be affected by gravity. A more technical explanation for this problem is given below. Now, in Arduino we can reduce the effect of gravity by using a Simple Filter. This filter will consist of two arrays, one is used to store the sample values from sensor and the other is used to sort the sample values, and find the most repeated value. Let us implement this algorithm in our Arduino and get our hardware ready.

Programming Arduino:

The Arduino program is given below in Code section. There is no critical data that has to be modified. But you might want to consider the following: Increase the sample size if your Accel still shows random values. #define Samplesize 13 // filterSample number Play with the 9600 baud rate to increase the speed of communication between Arduino and Processing. But make sure you change them in both the software (Programs). void setup(){ Serial.begin(9600); } My Accelerometer on X-axis gives 193 on far left end and 280 on far right end, measure them for your Accel and update the value. toSend = map (smoothData1, 193, 280, 0, 255); The values are mapped into a single byte of data for serial communication. to understand it clearly.

Programming Processing:

is open source software which is used by artists for Graphics designing. This software is used to develop software and Android applications. It is quite easy to develop and very much similar to the Android Development IDE. Hence I have shortened the explanation. is given here: Processing Code for Arduino Ping Ball Game Right click on it and click on ‘Save link as..ᾠto download the code file. Then open the file in 'Processing' software and click on ‘Runᾠbutton to play the Game. You need to install 'Processing' software to open *.pde files.Comment section is open for queries and also check the comments in the Program to better understand it. Below line, in the void setup() function of Processing code is important, as it decides from which port to data from. port = new Serial(this,Serial.list()[4],9600); //Reads the 4th PORT at 9600 baudrate Here I have read data from the 4th port from my Arduino. So for Example if you have COM[5] COM[2] COM[1] COM [7] COM[19] Then the above code will read data from COM[7].

Testing:

will guide you through the complete project. Once you have understood the program you can create many similar games and play them using your Arduino, Further the Y-axis and Z-axis may also be included for gaming. Code /* * Program for filtering the X-axis values of accel and transmitting it serially * Programmed by B.Aswinth Raj * Dated: 21-08-206 */ #define AccelPin A0 // A0 is connected to X-axis of Accel #define Samplesize 13 // filterSample number int Array1 [Samplesize]; // array for holding raw sensor values for sensor int rawData1, smoothData1; // variables for sensor data int toSend; void setup(){ Serial.begin(9600); } void loop() { rawData1 = analogRead(AccelPin); // read X-axis of accelerometer smoothData1 = digitalSmooth(rawData1, Array1); toSend = map (smoothData1, 193, 280, 0, 255); // the data from accelerometer mapped to form a byte Serial.write (toSend); delay(100); } int digitalSmooth(int rawIn, int *sensSmoothArray){ // "int *sensSmoothArray" passes an array to the function - the asterisk indicates the array name is a pointer int j, k, temp, top, bottom; long total; static int i; static int sorted[Samplesize]; boolean done; i = (i + 1) % Samplesize; // increment counter and roll over if necc. - % (modulo operator) rolls over variable sensSmoothArray[i] = rawIn; // input new data into the oldest slot for (j=0; j<Samplesize; j++){ // transfer data array into anther array for sorting and averaging sorted[j] = sensSmoothArray[j]; } done = 0; // flag to know when we're done sorting while(done != 1){ // simple swap sort, sorts numbers from lowest to highest done = 1; for (j = 0; j < (Samplesize - 1); j++){ if (sorted[j] > sorted[j + 1]){ // numbers are out of order - swap temp = sorted[j + 1]; sorted [j+1] = sorted[j] ; sorted [j] = temp; done = 0; } } } bottom = max(((Samplesize * 15) / 100), 1); top = min((((Samplesize * 85) / 100) + 1 ), (Samplesize - 1)); // the + 1 is to make up for asymmetry caused by integer rounding k = 0; total = 0; for ( j = bottom; j< top; j++){ total += sorted[j]; // total remaining indices k++; } return total / k; // divide by number of samples } Video microcontroller-projects/call-and-message-using-arduino-sim900-gsm

Call and Message using Arduino and GSM Module

, with all the Code needed to operate any Phone’s basic functions.

Components Required:

Arduino Uno GSM Module SIM900 16x2 LCD 4x4 Keypad Breadboard or PCB Connecting jumper wire Power supply Speaker MIC SIM Card

Working Explanation:

is used for showing messages, instructions and alerts. below. below to properly understand the process. Here we are going to explain all the four features of the projects below.

Explaining Four Features of Arduino Mobile Phone:

To make a call by using our Arduino based Phone, we have to press ‘Cᾠand then need to enter the Mobile Number on which we want to make a call. Number will be entered by using alphanumeric keypad. After entering the number we again need to press ‘Cᾮ Now Arduino will process for connecting the call to the entered number by using AT command: ATDxxxxxxxxxx; <Enter> where xxxxxxxxx is entered Mobile Number. Receiving a call is very easy. When someone is calling to your system SIM number, which is there in GSM Module, then your system will show ‘Incoming…ᾠmessage over the LCD with incoming number of caller. Now we just need to Press ‘Aᾠto attend this call. When we press ‘Aᾬ Arduino will send given command to GSM Module: ATA <enter> When we want to send a SMS using our Arduino based Mobile Phone, then we need to Press ‘Bᾮ Now System will ask for Recipient Number, means ‘to whomᾠwe want to send SMS. After entering the number we need to press ‘Dᾠand now LCD asks for message. Now we need to type the message, like we enter in normal mobile, by using keypad and then after entering the message we need to press ‘Dᾠto send SMS. To Send SMS Arduino sends given command: AT+CMGF=1 <enter> AT+CMGS=”xxxxxxxxxxᾠ<enter> where: xxxxxxxxxx is entered mobile number And send 26 to GSM to send SMS. is: +CMTI: “SM” <SMS stored location> +CMTI: “SMᾬ6 Where 6 is message location where it stored in SIM card. And show a ‘New Message Symbolᾠover the LCD. AT+CMGR=<SMS stored location><enter> AT+CMGR=6 Now GSM sends stored message to Arduino and then Arduino extract main SMS and display it over the LCD and then after reading this SMS Arduino Clear the ‘New SMS symbolᾠfrom the LCD. Note: There is no coding for MIC and Speaker. below to properly understand the process.

Circuit Diagram and Explanation:

is given above. 16x2 LCD pins RS, EN, D4, D5, D6 and D7 are connected with pin number 14, 15, 16, 17, 18 and 19 of Arduino respectively. GSM Module’s Rx and Tx pins are directly connected with Arduino’s pin D3 and D2 respectively (Ground of Arduino and GSM must be connected with each other). 4x4 keypad Row pins R1, R2, R3, R4 are directly linked to pin number 11,10, 9, 8 of Arduino and Colum pins of keypad C1, C2, C3 are linked with pin number 7, 6, 5, 4 of Arduino. MIC is directly connected at mic+ and mic- of GSM Module and Speaker is directly connected at SP+ and SP- pins for GSM Module.

Programming Explanation:

Means we have made every key multi functioning and we can enter any character or integer by using only 10 keys. Like if we press key 2 (abc2), it will show ‘aᾠand if we presses it again then it will replace ‘aᾠto ‘bᾠand if again we press three times then it will show ‘cᾠat same place in LCD. If we wait for some time after pressing key, cursor will automatic move to next position in LCD. Now we can enter next char or number. The same procedure is applied for other keys. #include <Keypad.h> const byte ROWS = 4; //four rows const byte COLS = 4; //four columns char hexaKeys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} }; byte rowPins[ROWS] = {11, 10, 9, 8}; //connect to the row pinouts of the keypad byte colPins[COLS] = {7, 6, 5, 4}; //connect to the column pinouts of the keypad //initialize an instance of class NewKeypad Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); void alfakey() { int x=0,y=0; int num=0; while(1) { lcd.cursor(); char key=customKeypad.getKey(); if(key) { if(key=='1') { num=0; lcd.setCursor(x,y); .... ..... ........ .... All the functions are self-explanatory and understandable. Code #include <SoftwareSerial.h> SoftwareSerial Serial1(2, 3); // RX, TX #include<LiquidCrystal.h> LiquidCrystal lcd(14,15,16,17,18,19); byte back[8] = { 0b00000, 0b00000, 0b11111, 0b10101, 0b11011, 0b11111, 0b00000, 0b00000 }; String number=""; String msg=""; String instr=""; String str_sms=""; String str1=""; int ring=0; int i=0,temp=0; int sms_flag=0; char sms_num[3]; int rec_read=0; int temp1=0; #include <Keypad.h> const byte ROWS = 4; //four rows const byte COLS = 4; //four columns char hexaKeys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} }; byte rowPins[ROWS] = {11, 10, 9, 8}; //connect to the row pinouts of the keypad byte colPins[COLS] = {7, 6, 5, 4}; //connect to the column pinouts of the keypad //initialize an instance of class NewKeypad Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); String ch="1,.?!@abc2def3ghi4jkl5mno6pqrs7tuv8wxyz90 "; void setup() { Serial1.begin(9600); lcd.begin(16,2); lcd.createChar(1, back); lcd.print("Simple Mobile "); lcd.setCursor(0,1); lcd.print("System Ready.."); delay(1000); gsm_init(); lcd.clear(); lcd.print("System Ready"); delay(2000); } void loop() { serialEvent(); if(sms_flag==1) { lcd.clear(); lcd.print("New Message"); int ind=instr.indexOf("+CMTI: \"SM\","); ind+=12; int k=0; lcd.setCursor(0,1); lcd.print(ind); while(1) { while(instr[ind]!= 0x0D) { sms_num[k++]=instr[ind++]; } break; } ind=0; sms_flag=0; lcd.setCursor(0,1); lcd.print("Read SMS --> D"); delay(4000); instr=""; rec_read=1; temp1=1; i=0; } if(ring == 1) { number=""; int loc=instr.indexOf("+CLIP: \""); if(loc > 0) { number+=instr.substring(loc+8,loc+13+8); } lcd.setCursor(0,0); lcd.print("Incomming... "); lcd.setCursor(0,1); lcd.print(number); instr=""; i=0; } else { serialEvent(); lcd.setCursor(0,0); lcd.print("Call --> C "); lcd.setCursor(0,1); lcd.print("SMS --> B "); if(rec_read==1) { lcd.write(1); lcd.print(" "); } else lcd.print(" "); } char key=customKeypad.getKey(); if(key) { if(key== 'A') { if(ring==1) { Serial1.println("ATA"); delay(5000); } } else if(key=='C') { call(); } else if(key=='B') { sms(); } else if(key == 'D' && temp1==1) { rec_read=0; lcd.clear(); lcd.print("Please wait..."); Serial1.print("AT+CMGR="); Serial1.println(sms_num); int sms_read_flag=1; str_sms=""; while(sms_read_flag) { while(Serial1.available()>0) { char ch=Serial1.read(); str_sms+=ch; if(str_sms.indexOf("OK")>0) { sms_read_flag=0; //break; } } } int l1=str_sms.indexOf("\"\r\n"); int l2=str_sms.indexOf("OK"); String sms=str_sms.substring(l1+3,l2-4); lcd.clear(); lcd.print(sms); delay(5000); } delay(1000); } } void call() { number=""; lcd.clear(); lcd.print("After Enter No."); lcd.setCursor(0,1); lcd.print("Press C to Call"); delay(2000); lcd.clear(); lcd.print("Enter Number:"); lcd.setCursor(0,1); while(1) { serialEvent(); char key=customKeypad.getKey(); if(key) { if(key=='C') { lcd.clear(); lcd.print("Calling........"); lcd.setCursor(0,1); lcd.print(number); Serial1.print("ATD"); Serial1.print(number); Serial1.println(";"); long stime=millis()+5000; int ans=1; while(ans==1) { while(Serial1.available()>0) { if(Serial1.find("OK")) { lcd.clear(); lcd.print("Ringing...."); int l=0; str1=""; while(ans==1) { while(Serial1.available()>0) { char ch=Serial1.read(); str1+=ch; if(str1.indexOf("NO CARRIER")>0) { lcd.clear(); lcd.print("Call End"); delay(2000); ans=0; return; } } char key=customKeypad.getKey(); if(key == 'D') { lcd.clear(); lcd.print("Call End"); delay(2000); ans=0; return; } if(ans==0) break; } } } } } else { number+=key; lcd.print(key); } } } } void sms() { lcd.clear(); lcd.print("Initilising SMS"); Serial1.println("AT+CMGF=1"); delay(400); lcd.clear(); lcd.print("After Enter No."); lcd.setCursor(0,1); lcd.print("Press D "); delay(2000); lcd.clear(); lcd.print("Enter Rcpt No.:"); lcd.setCursor(0,1); Serial1.print("AT+CMGS=\""); while(1) { serialEvent(); char key=customKeypad.getKey(); if(key) { if(key=='D') { //number+='"'; Serial1.println("\""); break; } else { //number+=key; Serial1.print(key); lcd.print(key); } } } lcd.clear(); lcd.print("After Enter MSG "); lcd.setCursor(0,1); lcd.print("Press D to Send "); delay(2000); lcd.clear(); lcd.print("Enter Your Msg"); delay(1000); lcd.clear(); lcd.setCursor(0,0); alfakey(); } void alfakey() { int x=0,y=0; int num=0; while(1) { lcd.cursor(); char key=customKeypad.getKey(); if(key) { if(key=='1') { num=0; lcd.setCursor(x,y); lcd.print(ch[num]); for(int i=0;i<3000;i++) { lcd.noCursor(); char key=customKeypad.getKey(); if(key=='1') { num++; if(num>5) num=0; lcd.setCursor(x,y); lcd.print(ch[num]); i=0; delay(200); } } x++; if(x>15) { x=0; y++; y%=2; } msg+=ch[num]; } else if(key=='2') { num=6; lcd.setCursor(x,y); lcd.print(ch[num]); for(int i=0;i<3000;i++) { lcd.noCursor(); char key=customKeypad.getKey(); if(key=='2') { num++; if(num>9) num=6; lcd.setCursor(x,y); lcd.print(ch[num]); i=0; delay(200); } } x++; if(x>15) { x=0; y++; y%=2; } msg+=ch[num]; } else if(key=='3') { num=10; lcd.setCursor(x,y); lcd.print(ch[num]); for(int i=0;i<3000;i++) { lcd.noCursor(); char key=customKeypad.getKey(); if(key=='3') { num++; if(num>13) num=10; lcd.setCursor(x,y); lcd.print(ch[num]); i=0; delay(200); } } x++; if(x>15) { x=0; y++; y%=2; } msg+=ch[num]; } else if(key=='4') { num=14; lcd.setCursor(x,y); lcd.print(ch[num]); for(int i=0;i<3000;i++) { lcd.noCursor(); char key=customKeypad.getKey(); if(key=='4') { num++; if(num>17) num=14; lcd.setCursor(x,y); lcd.print(ch[num]); i=0; delay(200); } } x++; if(x>15) { x=0; y++; y%=2; } msg+=ch[num]; } else if(key=='5') { num=18; lcd.setCursor(x,y); lcd.print(ch[num]); for(int i=0;i<3000;i++) { lcd.noCursor(); char key=customKeypad.getKey(); if(key=='5') { num++; if(num>21) num=18; lcd.setCursor(x,y); lcd.print(ch[num]); i=0; delay(200); } } x++; if(x>15) { x=0; y++; y%=2; } msg+=ch[num]; } else if(key=='6') { num=22; lcd.setCursor(x,y); lcd.print(ch[num]); for(int i=0;i<3000;i++) { lcd.noCursor(); char key=customKeypad.getKey(); if(key=='6') { num++; if(num>25) num=22; lcd.setCursor(x,y); lcd.print(ch[num]); i=0; delay(200); } } x++; if(x>15) { x=0; y++; y%=2; } msg+=ch[num]; } else if(key=='7') { num=26; lcd.setCursor(x,y); lcd.print(ch[num]); for(int i=0;i<3000;i++) { lcd.noCursor(); char key=customKeypad.getKey(); if(key=='7') { num++; if(num>30) num=26; lcd.setCursor(x,y); lcd.print(ch[num]); i=0; delay(200); } } x++; if(x>15) { x=0; y++; y%=2; } msg+=ch[num]; } else if(key=='8') { num=31; lcd.setCursor(x,y); lcd.print(ch[num]); for(int i=0;i<3000;i++) { lcd.noCursor(); char key=customKeypad.getKey(); if(key=='8') { num++; if(num>34) num=31; lcd.setCursor(x,y); lcd.print(ch[num]); i=0; delay(200); } } x++; if(x>15) { x=0; y++; y%=2; } msg+=ch[num]; } else if(key=='9') { num=35; lcd.setCursor(x,y); lcd.print(ch[num]); for(int i=0;i<3000;i++) { lcd.noCursor(); char key=customKeypad.getKey(); if(key=='9') { num++; if(num>39) num=35; lcd.setCursor(x,y); lcd.print(ch[num]); i=0; delay(200); } } x++; if(x>15) { x=0; y++; y%=2; } msg+=ch[num]; } else if(key=='0') { num=40; lcd.setCursor(x,y); lcd.print(ch[num]); for(int i=0;i<3000;i++) { lcd.noCursor(); char key=customKeypad.getKey(); if(key=='0') { num++; if(num>41) num=40; lcd.setCursor(x,y); lcd.print(ch[num]); i=0; delay(200); } } x++; if(x>15) { x=0; y++; y%=2; } msg+=ch[num]; } else if(key=='D') { lcd.clear(); lcd.print("Sending SMS...."); // Serial1.print("AT+CMGS="); // Serial1.print(number); // delay(2000); Serial1.print(msg); Serial1.write(26); delay(5000); lcd.clear(); lcd.print("SMS Sent to"); lcd.setCursor(0,1); lcd.print(number); delay(2000); number=""; break; } } } } void send_data(String message) { Serial1.println(message); delay(200); } void send_sms() { Serial1.write(26); } void lcd_status() { lcd.setCursor(2,1); lcd.print("Message Sent"); delay(2000); //lcd.setCursor() //lcd.print("") //return; } void back_button() { //lcd.setCursor(0,15); } void ok_button() { lcd.setCursor(0,4); lcd.print("OK"); } void call_button() { lcd.setCursor(0,4); lcd.print("CALL"); } void sms_button() { lcd.setCursor(0,13); lcd.print("SMS"); } void gsm_init() { lcd.clear(); lcd.print("Finding Module.."); boolean at_flag=1; while(at_flag) { Serial1.println("AT"); while(Serial1.available()>0) { if(Serial1.find("OK")) at_flag=0; } delay(1000); } lcd.clear(); lcd.print("Module Connected.."); delay(1000); lcd.clear(); lcd.print("Disabling ECHO"); boolean echo_flag=1; while(echo_flag) { Serial1.println("ATE1"); while(Serial1.available()>0) { if(Serial1.find("OK")) echo_flag=0; } delay(1000); } lcd.clear(); lcd.print("Echo OFF"); delay(1000); lcd.clear(); lcd.print("Finding Network.."); boolean net_flag=1; while(net_flag) { Serial1.println("AT+CPIN?"); while(Serial1.available()>0) { if(Serial1.find("+CPIN: READY")) net_flag=0; } delay(1000); } lcd.clear(); lcd.print("Network Found.."); delay(1000); lcd.clear(); } void serialEvent() { while(Serial1.available()) { char ch=Serial1.read(); instr+=ch; i++; if(instr[i-4] == 'R' && instr[i-3] == 'I' && instr[i-2] == 'N' && instr[i-1] == 'G' ) { ring=1; } if(instr.indexOf("NO CARRIER")>=0) { ring=0; i=0; } if(instr.indexOf("+CMTI: \"SM\"")>=0) { sms_flag=1; } } } Video microcontroller-projects/chatroom-using-arduino-and-processing

Create a Private Chat Room using Arduino, nRF24L01 and Processing

Creating a Local Network to share personnel and confidential data's has become almost impossible for a common man in our modern world. This is mainly because all common chat methods like Whatsapp, Facebook, Hangout and almost everything involves an internet connection. ? or Internet Connection? with our own imaginations? will guide you on setting up a low cost Chat Room in your local area. So let's jump in and see how it works.

Working Explanation:

and shock burst options which makes us feel relaxed of interference problems. Our Arduino and NRF24L01 are connected together to establish a Serial communication so that they could talk to each other. The NRF24L01 are half duplex transceiver modules, hence they can send and receive data. The data is collected from the user and transmitted this data can be received by any (or one particular) modules and display it on their screen. range depending upon the nRF24L01 Modules. So let's go shopping!!!!

Components Required:

Arduino (any version or model) - 2Nos nRF24L01+ Wireless Transceiver Module - 2Nos 3.3 Voltage Regulator - 2Nos. (Not mandatory) Connecting wires Interest (Lolz)

Circuit Diagram:

and their connections with nRF24L01 are shown above. You can use any Arduino Models.

Working with nRF24L01+ Wireless Transceiver Module:

can help you from getting hit on a wall. 1. Most of the nRF24L01+ modules in the market are fake. The cheap ones that we can find on Ebay and Amazon are the worst (Don’t worry, with few tweaks we can make them work) 2. The main problem is the power supply not your code. Most of the codes online will work properly, I myself have a working code which I personally tested, Let me know if you need them. 3. Pay attention because the modules which are printed as NRF24L01+ are actually Si24Ri (Yes a Chinese product). 4. The clone and fake modules will consume more power, hence do not develop your power circuit based on nRF24L01+ datasheet, because Si24Ri will have high current consumption about 250mA. 5. Beware of Voltage ripples and current surges, these modules are very sensitive and might easily burn up. (;-( fried up 2 modules so far) 6. Adding a couple capacitor ( 10uF and 0.1uF) across Vcc and Gnd of the module helps in making your supply pure and this works for most of the modules.

Programming the Arduinos:

The program for both Arduino Nano and Mega will be similar for the change in CE and CS pins. I will explain the program by splitting it into small segments. , and add them to your IDE. #include <SPI.h> #include "RF24.h" Our NRF modules are connected to pin 8 and 10 to CE and CS respectively. RF24 myRadio (8, 10); will be use to transmit data on air. struct package { char text[20]; //Text to transmit on air }; typedef struct package Package; Package data; function, we initialize the baud rate to 9600 and setup our modules to 115 with MIN power consumption and 250KBPS speed. You can fiddle around with these values later. void setup() { Serial.begin(9600); delay(1000); //Serial.print("Setup Initialized"); myRadio.begin(); myRadio.setChannel(115); //115 band above WIFI signals myRadio.setPALevel(RF24_PA_MIN); //MIN power low rage myRadio.setDataRate( RF24_250KBPS ) ; //Minimum speed } to transmit them. void loop() { while(Serial.available()>0) //Get values from user { val = Serial.peek(); if(index < 19) // One less than the size of the array { inChar = Serial.read(); // Read a character inData[index] = inChar; // Store it index++; // Increment where to write next inData[index] = '\0'; // Null terminate the string } if (val=='#') { strcpy( data.text, inData); WriteData(); //Put module in Transmit mode while (index!=0) { inData[index] = ' '; index--; } } } ReadData(); //Put module Receive mode } function writes the data on 0xF0F0F0F0AA address, this address is used as writing pipe on other module. void WriteData() { myRadio.stopListening(); //Stop Receiving and start transminitng myRadio.openWritingPipe(0xF0F0F0F066);//Sends data on this 40-bit address myRadio.write(&data, sizeof(data)); delay(300); } function writes the data on 0xF0F0F0F066 this address, this address is used as reading pipe on other module. void ReadData() { myRadio.openReadingPipe(1, 0xF0F0F0F0AA); //Which pipe to read, 40 bit Address myRadio.startListening(); //Stop Transminting and start Reveicing if ( myRadio.available()) { while (myRadio.available()) { myRadio.read( &data, sizeof(data) ); } Serial.println(data.text); } } , I have added comment lines to explain things much better.

Processing Program:

is open source software which is used by artists for Graphics designing. This software is used to develop software and Android applications. It is quite easy to develop and very much similar to the Android Development IDE. Hence I have shortened the explanation. is given here: Chat Screen 1 Processing Code Chat Screen 2 Processing Code Right click on them and click on ‘Save link as..ᾠto download them and open them in your computer after setting up the Arduinos. You need to install 'Processing' software to openthese *.pde files and then 'Run' them to openthe Chat Boxes.Comment section is open for queries. The Processing sketch for transmitter and Receiver module are identical. is important as it decides from which port to data from. void setup() { size(510,500); port = new Serial(this,Serial.list()[4],9600); //Reads the 4th PORT at 9600 baudrate println(Serial.list()); background(0); } Here I have read data from the 4th port from my Arduino. So for Example if you have COM[5] COM[2] COM[1] COM [7] COM[19] Then the above code will read data from COM[7].

Testing:

below for full demonstration. Code /********** Arduino Megawith NRF24l01 for Chatroom project Code by B.Aswinth Raj on 8-2016 ***********/ #include <SPI.h> #include "RF24.h" // Manicbug LIB to be downloaded RF24 myRadio (49, 53); // CE to 49 and 53 to CS struct package { char text[20]; //Text to transmit on air }; //byte addresses[][6] = {"0"}; char inData[20]; // Allocate some space for the string char inChar; // Where to store the character read byte index = 0; // Index into array; where to store the character int val; typedef struct package Package; Package data; void setup() { Serial.begin(9600); delay(1000); //Serial.print("Setup Initialized"); myRadio.begin(); myRadio.setChannel(115); //115 band above WIFI signals myRadio.setPALevel(RF24_PA_MIN); //MIN power low rage myRadio.setDataRate( RF24_250KBPS ) ; //Minimum speed } void loop() { while(Serial.available()>0) //Get values from user { val = Serial.peek(); if(index < 19) // One less than the size of the array { inChar = Serial.read(); // Read a character inData[index] = inChar; // Store it index++; // Increment where to write next inData[index] = '\0'; // Null terminate the string } if (val=='#') { strcpy( data.text, inData); WriteData(); //Put module in Transmit mode while (index!=0) { inData[index] = ' '; index--; } } } ReadData(); //Put module Receive mode } void ReadData() { myRadio.openReadingPipe(1, 0xF0F0F0F0AA); //Which pipe to read, 40 bit Address myRadio.startListening(); //Sopt Transminting and start Reveicing if ( myRadio.available()) { while (myRadio.available()) { myRadio.read( &data, sizeof(data) ); } // Serial.print("\nReceived:"); Serial.println(data.text); } } void WriteData() { myRadio.stopListening(); //Stop Receiving and start transminitng myRadio.openWritingPipe(0xF0F0F0F066);//Sends data on this 40-bit address myRadio.write(&data, sizeof(data)); //Serial.print("\nSent:"); //Serial.println(data.msg); delay(300); } /********** Arduino Nano with NRF24l01 for Chatroom project Code by B.Aswinth Raj on 8-2016 ***********/ #include <SPI.h> #include "RF24.h" // Manicbug LIB to be downloaded RF24 myRadio (8, 10); // CE to 8 and 10 to CS struct package { char text[20]; //Text to transmit on air }; typedef struct package Package; Package data; char inData[20]; // Allocate some space for the string char inChar; // Where to store the character read byte index = 0; // Index into array; where to store the character int val; void setup() { Serial.begin(9600); delay(1000); myRadio.begin(); myRadio.setChannel(115); //115 band above WIFI signals myRadio.setPALevel(RF24_PA_MIN); //MIN power low rage myRadio.setDataRate( RF24_250KBPS ) ; //Minimum speed //Serial.print("Setup Initialized"); } void loop() { while(Serial.available()>0) //Get values from user { val = Serial.peek(); if(index < 19) // One less than the size of the array { inChar = Serial.read(); // Read a character inData[index] = inChar; // Store it index++; // Increment where to write next inData[index] = '\0'; // Null terminate the string } if (val=='#') { strcpy( data.text, inData); WriteData(); //Put module in Transmit mode while (index!=0) { inData[index] = ' '; index--; } } } ReadData(); //Put module Receive mode } void WriteData() { myRadio.stopListening(); //Stop Receiving and start transminitng myRadio.openWritingPipe( 0xF0F0F0F0AA); //Sends data on this 40-bit address myRadio.write(&data, sizeof(data)); //Serial.print("\nSent:"); //Serial.println(data.text); delay(300); } void ReadData() { myRadio.openReadingPipe(1, 0xF0F0F0F066); // Which pipe to read, 40 bit Address myRadio.startListening(); //Stop Transminting and start Reveicing if ( myRadio.available()) { while (myRadio.available()) { myRadio.read( &data, sizeof(data) ); } //Serial.print("\nReceived:"); Serial.println(data.text); } } Video microcontroller-projects/smart-phone-controlled-digital-code-lock-arduino

Smart Phone Controlled Digital Code Lock using Arduino

, using your Android phone, within the range of normal Bluetooth that is 10 meters. User needs to enter the Predefined password from his Android Phone, if password is correct TFT LCD shows the “CORRECT PASSWORDᾠmessage and if password is wrong then LCD shows the “WRONG PASSWORDᾠmessage. By using this Lock, you can open the door lock, while walking, even before reaching to it. This will save your time and you don’t need to carry the keys and lock can be opened easily with your Phone.

Required Components:

Arduino MEGA HC05 BluetoothModule USB Cable Connecting wires Buzzer 2.4 inch TFT LCD Shield with SPFD5408 controller Android Mobile phone Bluetooth terminal App Breadboard

Circuit Diagram and Explanation:

HC05 is powered by Arduino Vcc and GND Pins, TX of HC05 is connected to RX1 of Arduino and RX of HC05 is connected to TX1 of Arduino. One pin of buzzer is connected to GND of Arduino and other to pin 22 of Arduino.

Configuring Bluetooth Terminal App for Arduino:

Bluetooth Terminal App is compatible with Arduino. This App can be downloaded from the Google Play Store, and can be easily configured by following below Steps: 1. First download it from Google Play Store and install it in your Android mobile phone. 2. Power up your ‘Bluetooth controlled Digital Lock system circuitᾮ 3. Open the app and go to option ‘connect securelyᾮ 4. You will find HC05 device to pair. 5. Give 1234 passkey to connect with your Android Phone, like we useto connect other Bluetooth Devices.

Working Description:

, we have used threemajor components which are Bluetooth Module HC05, Arduino Mega Board and 2.4 inch TFT LCD Shield. , shown at the end, to understand its operation. to our choice by changing the Arduino Code, it has been explained in ‘Programmingᾠsection below.

Programming Description:

Click on ‘Clone or downloadᾠand ‘Download ZIPᾠfile and add to your Arduino library folder. This library is needed for proper functioning of TFT LCD. #include <SPFD5408_Adafruit_GFX.h> // Core graphics library #include <SPFD5408_Adafruit_TFTLCD.h> // Hardware-specific library #include <SPFD5408_TouchScreen.h> and powered by 5V supply of Arduino Mega. function is used for clearing the LCD. void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial1.begin(9600); tft.reset(); tft.begin(0x9341); tft.setRotation(0); tft.fillScreen(WHITE); tft.setCursor (40, 50); tft.setTextSize (2); tft.setTextColor(BLACK); tft.println("E N T E R* P A S S W O R D "); delay(5000); tft.fillScreen(WHITE); pinMode(22,OUTPUT); } is the array in which we have stored the password entered by user from Android Phone. If password entered is same as the password stored, then the LCD will display “CORRECT PASSWORDᾠmessage and If it is not the same i.e. 1234, then the LCD will display “WRONG PASSWORDᾠmessage and the pin connected to buzzer becomes high and the buzzer beeps. void loop() { tft.setTextSize (4); tft.setTextColor(CYAN); // put your main code here, to run repeatedly: if (Serial1.available() > 0) { flag = 1; char c = Serial1.read(); if (flag == 1) { input[i] = c; .... ..... ..... ...... arrays. char arr[4] = {'1', '2', '3', '4'}; char input[4]; function. if (arr[0] == input[0] && arr[1] == input[1] && arr[2] == input[2] && arr[3] == input[3]) to get more about Electronic Door Lock. Code #include <SPFD5408_Adafruit_GFX.h> // Core graphics library #include <SPFD5408_Adafruit_TFTLCD.h> // Hardware-specific library #include <SPFD5408_TouchScreen.h> // *** SPFD5408 change -- End #if defined(__SAM3X8E__) #undef __FlashStringHelper::F(string_literal) #define F(string_literal) string_literal #endif #define YP A1 // must be an analog pin, use "An" notation! #define XM A2 // must be an analog pin, use "An" notation! #define YM 7 // can be a digital pin #define XP 6 // can be a digital pin // Original values //#define TS_MINX 150 //#define TS_MINY 120 //#define TS_MAXX 920 //#define TS_MAXY 940 // Calibrate values #define TS_MINX 125 #define TS_MINY 85 #define TS_MAXX 965 #define TS_MAXY 905 // For better pressure precision, we need to know the resistance // between X+ and X- Use any multimeter to read it // For the one we're using, its 300 ohms across the X plate TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); #define LCD_CS A3 #define LCD_CD A2 #define LCD_WR A1 #define LCD_RD A0 // optional #define LCD_RESET A4 // Assign human-readable names to some common 16-bit color values: #define BLACK 0x0000 #define BLUE 0x001F #define RED 0xF800 #define GREEN 0x07E0 #define CYAN 0x07FF #define MAGENTA 0xF81F #define YELLOW 0xFFE0 #define WHITE 0xFFFF char arr[4] = {'1', '2', '3', '4'}; char input[4]; char messageflagarr[4]; char result = '0', flag = 0, passwordflag = 0; int x = 40, i = 0; Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial1.begin(9600); tft.reset(); tft.begin(0x9341); tft.setRotation(0); tft.fillScreen(WHITE); tft.setCursor (40, 50); tft.setTextSize (2); tft.setTextColor(BLACK); tft.println("E N T E R* P A S S W O R D "); delay(5000); tft.fillScreen(WHITE); pinMode(22,OUTPUT); } void loop() { tft.setTextSize (4); tft.setTextColor(CYAN); // put your main code here, to run repeatedly: if (Serial1.available() > 0) { flag = 1; char c = Serial1.read(); if (flag == 1) { input[i] = c; i++; tft.println(c); delay(2000); if (i == 4) { passwordflag = 1; } flag = 0; } if (passwordflag == 1) { if (arr[0] == input[0] && arr[1] == input[1] && arr[2] == input[2] && arr[3] == input[3]) { tft.setCursor (40, 50); tft.setTextSize (2); tft.setTextColor(BLACK); tft.println("CORRECT PASSWORD"); delay(6000); tft.fillScreen(WHITE); i=0; } else { tft.setCursor (40, 50); tft.setTextSize (2); tft.setTextColor(BLACK); tft.println("WRONG PASSWORD"); digitalWrite(22,HIGH); delay(500); digitalWrite(22,LOW); delay(500); digitalWrite(22,HIGH); delay(500); digitalWrite(22,LOW); delay(500); digitalWrite(22,HIGH); delay(500); digitalWrite(22,LOW); delay(500); digitalWrite(22,HIGH); delay(500); digitalWrite(22,LOW); tft.fillScreen(WHITE); digitalWrite(22,LOW); i=0; } passwordflag=0; } } } Video microcontroller-projects/universal-ir-remote-control-using-arduino-android

Universal IR Remote Control using Arduino and Android App

to control various devices at home.

Components Required:

Arduino Uno IR LED TSOP-IR receiver (1838T) Bluetooth module (HC05) Android Device (Phone, Tablet, etc.)

Working Explanation:

so that TV can be controlled with the Phone, without touching any of the Remotes. just adds on to the convenience part of this project. The shield consists of a TSOP IR receiver (1838T), an IR LED and a Bluetooth module (HC-05), see the image below: You can either build the custom shield or can directly connect the components to the Arduino as shown in the ‘Circuit Diagramᾠin below section. T). On further involving into this topic one will recognize that there’s no fixed representation for zeros and ones in these IR data transmission methods. These codes make use of various encoding techniques which we study in our engineering syllabus (since I am an electronics engineering student). The significance of 38 KHz is that it is the frequency at which signal oscillates when logically high i.e. this is the carrier frequency of the signal. Have a look at the picture below; this is an example of NEC Protocol. This will make your concept more clear: ; a Android Phone with the custom made Android App sends the signal to Arduino circuit over Bluetooth, further the Arduino receives the signal through TSOP-IR receiver (1838T) and analyses it. Then Arduino commands the IR LED to blink in a particular pattern, corresponding to the button pressed on that Android Device App. This blinking pattern is captured by TV or Set-Top box’s IR receiver and it follows the instruction accordingly like changing the channel or increasing the volume. As mentioned earlier, in this project I have made use of two remotes, one which communicates with the TV while another is for the Set-top box connected to TV.

Circuit Diagram:

Decoding IR Remote Control Signals using Arduino:

The Arduino board here works in two phases, one is when you are using it to decode IR codes from remote and another is when you are using it as the IR blaster device. header file. This header file has many predefined examples/codes just to make it easier for us to work with IR codes: You first need to download and install the IR remote library from herehttps://github.com/z3t0/Arduino-IRremote. Unzip it, and place it in your Arduino ‘Librariesᾠfolder. Then rename the extracted folder to IRremote. Then burn the below provided code into Arduino, plug-in the custom shield as shown above and place a remote to be decoded in front of the TSOP IR receiver. Open up the serial monitor corresponding to this Arduino and press any desired button from the remote. You’ll see some information displayed over the terminal, this information involves the type of code, its value and the amount of bits involved with it. Here’s how it looks like: #include <IRremote.h> const int RECV_PIN = 6; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver irrecv.blink13(true); } void loop() { if (irrecv.decode(&results)) { if (results.decode_type == NEC) { Serial.print("NEC "); } else if (results.decode_type == SONY) { Serial.print("SONY "); } else if (results.decode_type == RC5) { Serial.print("RC5 "); } else if (results.decode_type == RC6) { Serial.print("RC6 "); } else if (results.decode_type == UNKNOWN) { Serial.print("UNKNOWN "); } Serial.print(" "); Serial.print(results.value, HEX); Serial.print(" "); Serial.println(results.bits); irrecv.resume(); // Receive the next value } } Once you are done with the desired decoding part, note down all the decode values and other information with their corresponding button name pressed. This will serve as a database for the next phase of Arduino. The above program is taken from IRremote library’s ‘examplesᾠfolder, you can check out more examples to learn more about using the IR remote. So that’s how we decoded the IR remote output. at the end, onto this same board. Congratulations, you are done with the first half of this project.

Building the Android App for IR Blaster:

for making such kind of apps. If you are an amateur in Android coding, this will save your time and provide good results. The main components used in making of this app are not much, just few buttons and a Bluetooth client package. While coding the app, provide the corresponding text to be sent for each button pressed on the screen which would ask Arduino to blink IR LED in the same manner as it would have been done by the individual remote; also make sure that you provide the correct address of your Bluetooth HC-05 module. This is how the final App will look in your Android Smart Phone: Here is the step by step process to build the app: , or try and search out MIT appinventor-2 on Google. Signing-in to AI2 requires a Google account, so if you don’t have, create one. Once you log-in with your Google account, you’ll be redirected to AI2 working webpage, which looks like this: Start a new project by clicking “Projectsᾠtab at the top and select “Start New ProjectᾮWhen you are done with the naming part and all, a blank screen will be displayed to you in which you can place buttons and text as shown above. This is the GUI screen, in which youdecide how the app would look like to a user. To use a button package, select “Buttonᾠtab on the left side of the screen under “User Interfaceᾠsection. Just drag any package from left-side menu and drop it onto the working screen. Similarly to display any text related stuff, make use of “Labelᾠpackage. After arranging all your buttons and labels, now it’s time to make a code for this app. But before that we need to select a Bluetooth package as well for communicating with the Arduino. You’ll notice that this package is not displayed on the screen rather it comes under “Non-visible Componentsᾮ These are the components that have no significance in GUI make-up. Next comes the coding section, in which you’ll define the function for components that you have selected and you want to work with. On the left side of screen you’ll notice all those packages that you have selected in the GUI section. The image above shows what all components are there in a particular package that you can make use of. Also notice that Bluetooth module’s address needs to be provided in a textual format. When you feel that app is ready to be used and there are no errors as well, click on the “Buildᾠtab as shown above and select the second option. This will download your own created app, onto the computer, in ᾮapkᾠformat. Then just transfer this .apk file to any Android device and click on it to install. So this is how you can control any IR remote controlled device with your Smart phone, you just need to decode the remote of any appliances which you want to control with your Phone and replace the decoded HEX code of remote buttons in the Arduino code. Code #include <IRremote.h> #include <SoftwareSerial.h> IRsend irsend; SoftwareSerial mySerial(9,10); // RX, TX char ch; int i=0; void setup() { // Serial.begin(9600); mySerial.begin(9600); } void loop() { ch=mySerial.read(); // TV buttons: ON/OFF, Mute, AV/TV, Vol+, Vol-, OK, UP, Down, Left, Right, Menu, Exit, Return // Set-top box buttons: ON/OFF, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, V+, V-, Ch+, Ch-, Back, OK, Up, Down, Left, Right, Menu, Fav switch(ch) { //TV case 'O': irsend.sendNEC(0x2FD48B7, 32); break; case 'X': irsend.sendNEC(0x2FD08F7, 32); break; case 'A': irsend.sendNEC(0x2FD28D7, 32); break; case '=': irsend.sendNEC(0x2FD58A7, 32); break; case '-': irsend.sendNEC(0x2FD7887, 32); break; case 'K': irsend.sendNEC(0x2FD847B, 32); break; case 'U': irsend.sendNEC(0x2FD9867, 32); break; case 'D': irsend.sendNEC(0x2FDB847, 32); break; case 'L': irsend.sendNEC(0x2FD42BD, 32); break; case 'R': irsend.sendNEC(0x2FD02FD, 32); break; case 'M': irsend.sendNEC(0x2FDDA25, 32); break; case 'E': irsend.sendNEC(0x2FDC23D, 32); break; case 'B': irsend.sendNEC(0x2FD26D9, 32); break; //Set-top box case 'o': irsend.sendNEC(0x80BF3BC4, 32); break; case '1': irsend.sendNEC(0x80BF49B6, 32); break; case '2': irsend.sendNEC(0x80BFC936, 32); break; case '3': irsend.sendNEC(0x80BF33CC, 32); break; case '4': irsend.sendNEC(0x80BF718E, 32); break; case '5': irsend.sendNEC(0x80BFF10E, 32); break; case '6': irsend.sendNEC(0x80BF13EC, 32); break; case '7': irsend.sendNEC(0x80BF51AE, 32); break; case '8': irsend.sendNEC(0x80BFD12E, 32); break; case '9': irsend.sendNEC(0x80BF23DC, 32); break; case '0': irsend.sendNEC(0x80BFE11E, 32); break; case '+': irsend.sendNEC(0x80BFBB44, 32); break; case '_': irsend.sendNEC(0x80BF31CE, 32); break; case 'C': irsend.sendNEC(0x80BF19E6, 32); break; case 'c': irsend.sendNEC(0x80BFE916, 32); break; case 'b': irsend.sendNEC(0x80BF43BC, 32); break; case 'k': irsend.sendNEC(0x80BF738C, 32); break; case 'u': irsend.sendNEC(0x80BF53AC, 32); break; case 'd': irsend.sendNEC(0x80BF4BB4, 32); break; case 'l': irsend.sendNEC(0x80BF9966, 32); break; case 'r': irsend.sendNEC(0x80BF837C, 32); break; case 'm': irsend.sendNEC(0x80BF11EE, 32); break; case 'f': irsend.sendNEC(0x80BFA35C, 32); break; } } Video microcontroller-projects/arduino-led-scroll-bar

DIY Arduino LED Scroll Bar

as shown in the above picture. Ten LED strips can flash in different effects by using an Arduinoboard.

Required Components:

LED strip Arduino Nano Dupont line Control board

Steps for making the LED Scroll Bar:

Cut the LED strip into 10 pieces and each piece has arbitrary number of LEDs. Then, weld the traverse at an interface of the LED strip. Here I prefer to use Dupont line to connect. and equipped with a keypad, we can make the LED strip flash in different patterns. for making Schematics, PCB layouts, Simulating the Circuits etc. Notes: The voltage of the LED strip is 12 V and Arduino Nano is 5V. Please remember to add a power regulator such as AMS1117-5.0. You can see the PCB layout in thefollowingdiagram: to download Gerber files of your PCB and send them to any manufacturer, it’s also a lot easier (and cheaper) to order it directly in EasyEDA. Here you can select the number of PCBs you want to order, how manycopper layers you need, the PCB thickness, copper weight, and even the PCB color. Afteryou have selected all of theoptions, click “Save to Cartᾠand complete you order, then you will get your PCBs a few days later. When I received the PCBs, I am quite impressed with the quality, they are pretty nice. It is very easy to make a control board. Just as the following picture described, as soon as the components are welded, it is completed. Connect the LED strip to the control board and at the same time please pay attention to the positive and negative of the terminals. As the picture showed below. Connect it to a 12 V power supply, download a program (Check the full code below) on the Arduino Nano and run it. Press the button to switch flash mode. by following the given link. Now I completed my project of scroll bar. Making your own LED Scroll Bar creates a lot of fun, and the results can beveryrewarding. Hopefully this articlewillhelp you make a LED Scroll Bar, You can also write a program to make the LED strip flash in the way you like. Code int RGB1 =12; int RGB2 =11; int RGB3 =10; int RGB4 =9; int RGB5 =8; int RGB6 =7; int RGB7 =6; int RGB8 =5; int RGB9 =4; int RGB10 =3; int key1 =A3; int key2 =A2; int key3 =A1; int key4 =A0; void setup() { Serial.begin(9600); pinMode(RGB1, OUTPUT); pinMode(RGB2, OUTPUT); pinMode(RGB3, OUTPUT); pinMode(RGB4, OUTPUT); pinMode(RGB5, OUTPUT); pinMode(RGB6, OUTPUT); pinMode(RGB7, OUTPUT); pinMode(RGB8, OUTPUT); pinMode(RGB9, OUTPUT); pinMode(RGB10, OUTPUT); pinMode(key1, INPUT_PULLUP); pinMode(key2, INPUT_PULLUP); pinMode(key3, INPUT_PULLUP); pinMode(key4, INPUT_PULLUP); } void loop() { int key1Value = analogRead(key1); int key2Value = analogRead(key2); int key3Value = analogRead(key3); int key4Value = analogRead(key4); if (key1Value <= 100) { delay(30); if (key1Value <= 100) { digitalWrite(RGB5,HIGH); digitalWrite(RGB6, HIGH); delay(50); digitalWrite(RGB4, HIGH); digitalWrite(RGB7,HIGH); delay(50); digitalWrite(RGB3, HIGH); digitalWrite(RGB8, HIGH); delay(50); digitalWrite(RGB2,HIGH); digitalWrite(RGB9, HIGH); delay(50); digitalWrite(RGB1, HIGH); digitalWrite(RGB10, HIGH); delay(1000); } else { digitalWrite(RGB1, LOW); digitalWrite(RGB2, LOW); digitalWrite(RGB3, LOW); digitalWrite(RGB4, LOW); digitalWrite(RGB5, LOW); digitalWrite(RGB6, LOW); digitalWrite(RGB7, LOW); digitalWrite(RGB8, LOW); digitalWrite(RGB9, LOW); digitalWrite(RGB10, LOW); } } if (key2Value <= 100) { digitalWrite(RGB1,HIGH); digitalWrite(RGB6, HIGH); delay(40); digitalWrite(RGB2, HIGH); digitalWrite(RGB7,HIGH); delay(40); digitalWrite(RGB3, HIGH); digitalWrite(RGB8, HIGH); delay(40); digitalWrite(RGB4,HIGH); digitalWrite(RGB9, HIGH); delay(40); digitalWrite(RGB5, HIGH); digitalWrite(RGB10, HIGH); delay(1000); } else { digitalWrite(RGB1, LOW); digitalWrite(RGB2, LOW); digitalWrite(RGB3, LOW); digitalWrite(RGB4, LOW); digitalWrite(RGB5, LOW); digitalWrite(RGB6, LOW); digitalWrite(RGB7, LOW); digitalWrite(RGB8, LOW); digitalWrite(RGB9, LOW); digitalWrite(RGB10, LOW); } if (key3Value <= 100) { digitalWrite(RGB1,HIGH); delay(90); digitalWrite(RGB1, LOW); digitalWrite(RGB2, HIGH); delay(90); digitalWrite(RGB2, LOW); digitalWrite(RGB3, HIGH); delay(90); digitalWrite(RGB3, LOW); digitalWrite(RGB4, HIGH); delay(90); digitalWrite(RGB4, LOW); digitalWrite(RGB5,HIGH); delay(90); digitalWrite(RGB5, LOW); digitalWrite(RGB6,HIGH); delay(90); digitalWrite(RGB6, LOW); digitalWrite(RGB7,HIGH); delay(90); digitalWrite(RGB7, LOW); digitalWrite(RGB8,HIGH); delay(90); digitalWrite(RGB8, LOW); digitalWrite(RGB9,HIGH); delay(90); digitalWrite(RGB9, LOW); digitalWrite(RGB10,HIGH); delay(1000); } else { digitalWrite(RGB1, LOW); digitalWrite(RGB2, LOW); digitalWrite(RGB3, LOW); digitalWrite(RGB4, LOW); digitalWrite(RGB5, LOW); digitalWrite(RGB6, LOW); digitalWrite(RGB7, LOW); digitalWrite(RGB8, LOW); digitalWrite(RGB9, LOW); digitalWrite(RGB10, LOW); } if (key4Value <= 100) { digitalWrite(RGB1,HIGH); delay(50); digitalWrite(RGB1, LOW); digitalWrite(RGB2, HIGH); delay(50); digitalWrite(RGB2, LOW); digitalWrite(RGB3, HIGH); delay(50); digitalWrite(RGB3, LOW); digitalWrite(RGB4,HIGH); delay(50); digitalWrite(RGB4, LOW); digitalWrite(RGB5, HIGH); delay(50); digitalWrite(RGB5, LOW); digitalWrite(RGB6, HIGH); delay(50); digitalWrite(RGB6, LOW); digitalWrite(RGB7,HIGH); delay(50); digitalWrite(RGB7, LOW); digitalWrite(RGB8, HIGH); delay(50); digitalWrite(RGB8, LOW); digitalWrite(RGB9, HIGH); delay(50); digitalWrite(RGB9, LOW); digitalWrite(RGB10,HIGH); delay(50); digitalWrite(RGB10, LOW); digitalWrite(RGB9, HIGH); delay(50); digitalWrite(RGB9, LOW); digitalWrite(RGB8, HIGH); delay(50); digitalWrite(RGB8, LOW); digitalWrite(RGB7,HIGH); delay(50); digitalWrite(RGB7, LOW); digitalWrite(RGB6, HIGH); delay(50); digitalWrite(RGB6, LOW); digitalWrite(RGB5, HIGH); delay(50); digitalWrite(RGB5, LOW); digitalWrite(RGB4,HIGH); delay(50); digitalWrite(RGB4, LOW); digitalWrite(RGB3, HIGH); delay(50); digitalWrite(RGB3, LOW); digitalWrite(RGB2, HIGH); delay(50); digitalWrite(RGB2, LOW); digitalWrite(RGB1, HIGH); delay(50); digitalWrite(RGB1, LOW); delay(1000); } else { digitalWrite(RGB1, LOW); digitalWrite(RGB2, LOW); digitalWrite(RGB3, LOW); digitalWrite(RGB4, LOW); digitalWrite(RGB5, LOW); digitalWrite(RGB6, LOW); digitalWrite(RGB7, LOW); digitalWrite(RGB8, LOW); digitalWrite(RGB9, LOW); digitalWrite(RGB10, LOW); } } Video microcontroller-projects/arduino-alarm-clock

Arduino Based Digital Alarm Clock

to display the time in -"hour, minute, seconds, date, month and year" format. AnAlarm option is also added and we can set up the alarm time. Once alarm time it saved in internal EEPROM of arduino, it remains saved even after reset or electricity failure. Real time clocks arecommonly used in our computers, houses, offices and electronics device for keeping them updated with realtime. It can be used to communicate 127 devices to a single device or processor. Most of I2C devices run on100Khz frequency. Steps for data writingmaster to slave (slave receiving mode) Sends START condition to slave. Sends slave address to slave. Send write bit (0) to slave. Received ACK bit from slave Sends words address to slave. Received ACK bit from slave Sends data to slave. Received ACK bit from slave. And last sends STOP condition to slave. Steps for data reading from slave to master (slave transmitting mode) Sends START condition to slave. Sends slave address to slave. Send read bit (1) to slave. Received ACK bit from slave Received data from slave Received ACK bit from slave. Sends STOP condition to slave. digitalclock, we have used hereArduino Pro Mini, but you can also use any other Arduino model such as Arduino Uno or Arduino Nano. Along with the Arduino board, DS1307 RTC IC, we have used 16x2 LCD module to display the time and date, a crystal osciallator, 7805 voltage regulator, a buzzer and few transistors and resistors.

Circuit Diagram and Description

In this Arduino based digital clockcircuit, we have used threemajor components which are IC DS1307, Arduino Pro Mini Board and 16x2 LCD module. Here arduino is used for reading time from ds1307 and display it on 16x2 LCD. DS1307 sends time/date using 2 lines to arduino. A buzzer is also used for alarm indication, which beeps when alarm is activated. A block diagram is shown below to understand the working of this Real Time Clock. (BAT) of DS1307 which keeps time running after electricity failure. 16x2 LCD is connected with arduino in 4-bit mode. Control pin RS, RW and En are directly connected to arduino pin 2, GND and 3. And data pin D0-D7 is connected to 4, 5, 6, 7 of arduino. A buzzer is connected with arduino pin number 13 through a NPN BC547 transistor having a 1 k resistor at its base.

Program Description

To program for this real time clock, we have used some libraries for extracting time/date from DS1307 and for displaying on LCD, whichare given below: And initialization of RTC, LCD and input output are performed in setup loop. Rest of things like reading time, setting alarm is performed in void loop section. Code /* ----- C Program for Arduino based Alarm Clock ---- */ #include <Wire.h> #include<EEPROM.h> #include <RTClib.h> #include <LiquidCrystal.h> LiquidCrystal lcd(3, 2, 4, 5, 6, 7); RTC_DS1307 RTC; int temp,inc,hours1,minut,add=11; int next=10; int INC=11; int set_mad=12; #define buzzer 13 int HOUR,MINUT,SECOND; void setup() { Wire.begin(); RTC.begin(); lcd.begin(16,2); pinMode(INC, INPUT); pinMode(next, INPUT); pinMode(set_mad, INPUT); pinMode(buzzer, OUTPUT); digitalWrite(next, HIGH); digitalWrite(set_mad, HIGH); digitalWrite(INC, HIGH); lcd.setCursor(0,0); lcd.print("Real Time Clock"); lcd.setCursor(0,1); lcd.print("Circuit Digest "); delay(2000); if(!RTC.isrunning()) { RTC.adjust(DateTime(__DATE__,__TIME__)); } } void loop() { int temp=0,val=1,temp4; DateTime now = RTC.now(); if(digitalRead(set_mad) == 0) //set Alarm time { lcd.setCursor(0,0); lcd.print(" Set Alarm "); delay(2000); defualt(); time(); delay(1000); lcd.clear(); lcd.setCursor(0,0); lcd.print(" Alarm time "); lcd.setCursor(0,1); lcd.print(" has been set "); delay(2000); } lcd.clear(); lcd.setCursor(0,0); lcd.print("Time:"); lcd.setCursor(6,0); lcd.print(HOUR=now.hour(),DEC); lcd.print(":"); lcd.print(MINUT=now.minute(),DEC); lcd.print(":"); lcd.print(SECOND=now.second(),DEC); lcd.setCursor(0,1); lcd.print("Date: "); lcd.print(now.day(),DEC); lcd.print("/"); lcd.print(now.month(),DEC); lcd.print("/"); lcd.print(now.year(),DEC); match(); delay(200); } void defualt() { lcd.setCursor(0,1); lcd.print(HOUR); lcd.print(":"); lcd.print(MINUT); lcd.print(":"); lcd.print(SECOND); } /*Function to set alarm time and feed time into Internal eeprom*/ void time() { int temp=1,minuts=0,hours=0,seconds=0; while(temp==1) { if(digitalRead(INC)==0) { HOUR++; if(HOUR==24) { HOUR=0; } while(digitalRead(INC)==0); } lcd.clear(); lcd.setCursor(0,0); lcd.print("Set Alarm Time "); //lcd.print(x); lcd.setCursor(0,1); lcd.print(HOUR); lcd.print(":"); lcd.print(MINUT); lcd.print(":"); lcd.print(SECOND); delay(100); if(digitalRead(next)==0) { hours1=HOUR; EEPROM.write(add++,hours1); temp=2; while(digitalRead(next)==0); } } while(temp==2) { if(digitalRead(INC)==0) { MINUT++; if(MINUT==60) {MINUT=0;} while(digitalRead(INC)==0); } // lcd.clear(); lcd.setCursor(0,1); lcd.print(HOUR); lcd.print(":"); lcd.print(MINUT); lcd.print(":"); lcd.print(SECOND); delay(100); if(digitalRead(next)==0) { minut=MINUT; EEPROM.write(add++, minut); temp=0; while(digitalRead(next)==0); } } delay(1000); } /* Function to chack medication time */ void match() { int tem[17]; for(int i=11;i<17;i++) { tem[i]=EEPROM.read(i); } if(HOUR == tem[11] && MINUT == tem[12]) { beep(); beep(); beep(); beep(); lcd.clear(); lcd.print("Wake Up........"); lcd.setCursor(0,1); lcd.print("Wake Up......."); beep(); beep(); beep(); beep(); } } /* function to buzzer indication */ void beep() { digitalWrite(buzzer,HIGH); delay(500); digitalWrite(buzzer, LOW); delay(500); } Video microcontroller-projects/iot-temperature-humidity-monitoring-using-arduino

Live Temperature and Humidity Monitoring over Internet using Arduino and ThingSpeak

and displayed the data on LCD. from anywhere in the world.

Working and ThingSpeak Setup:

is also used to display the Temperature and Humidity. : option on the same page for further process. , fill in the Name and Description as per your choice. Then fill ‘Humidityᾠand ‘Temperatureᾠin Field 1 and Field 2 labels, tick the checkboxes for both Fields. Also tick the check box for ‘Make Publicᾠoption below in the form and finally Save the Channel. Now your new channel has been created. in the Code. , which is: as “update?api_key=SIWOYBX26OXQ1WMS&field1=0ᾠand then send data using data feed or update request address. to send the data to server. Check the full Code Below. sprintf(postUrl, "update?api_key=%s&field1=%s&field2=%s",api_key,humidStr,tempStr); httpGet("api.thingspeak.com", postUrl, 80); section, at the end of this Article. Working of this project is based on single wire serial communication for fetching data from DHT11. First Arduino sends a start signal to DHT module and then DHT gives a response signal with containing data. Arduino collects and extracts the data in two parts first is humidity and second is temperature and then send it to 16x2 LCD and ThingSpeak server. ThingSpeak displays the Data in form of Graph as below: here.

Circuit Description:

is used for displaying Temperature and Humidity, which is directly connected to Arduino in 4-bit mode. Pins of LCD namely RS, EN, D4, D5, D6 and D7 are connected to Arduino digital pin number 14, 15, 16, 17, 18 and 19. This LCD is optional. in detail.

Programming Part:

Programming part of this project plays a very important role to perform all the operations. First of all we include required libraries and initialize variables. #include"dht.h" // Including library for dht #include<LiquidCrystal.h> LiquidCrystal lcd(14,15,16,17,18,19); #include<Timer.h> Timer t; #include <SoftwareSerial.h> SoftwareSerial Serial1(2, 3); After it enter your Write API key and take some strings. char *api_key="SIWOYBX26OXQ1WMS"; // Enter your Write API key from ThingSpeak static char postUrl[150]; int humi,tem; void httpGet(String ip, String path, int port=80); function we reads temperature and humidity and then show those readings on the LCD. function is used to send the data to server. Send2server function is a timer interrupt service routine, calling in every 20 seconds. When we call update function, timer interrupt service routine is called. void send2server() { char tempStr[8]; char humidStr[8]; dtostrf(tem, 5, 3, tempStr); dtostrf(humi, 5, 3, humidStr); sprintf(postUrl, "update?api_key=%s&field1=%s&field2=%s",api_key,humidStr,tempStr); httpGet("api.thingspeak.com", postUrl, 80); } Code #include"dht.h" // Including library for dht #include<LiquidCrystal.h> LiquidCrystal lcd(14,15,16,17,18,19); #include<Timer.h> Timer t; #include <SoftwareSerial.h> SoftwareSerial Serial1(2, 3); #define dht_dpin 12 #define heart 13 dht DHT; char *api_key="SIWOYBX26OXQ1WMS"; // Enter your Write API key from ThingSpeak static char postUrl[150]; int humi,tem; void httpGet(String ip, String path, int port=80); void setup() { lcd.begin(16, 2); lcd.clear(); lcd.print(" Humidity "); lcd.setCursor(0,1); lcd.print(" Measurement "); delay(2000); lcd.clear(); lcd.print("Circuit Digest "); lcd.setCursor(0,1); lcd.print("Welcomes You"); delay(2000); Serial1.begin(9600); Serial.begin(9600); lcd.clear(); lcd.print("WIFI Connecting"); lcd.setCursor(0,1); lcd.print("Please wait...."); Serial.println("Connecting Wifi...."); connect_wifi("AT",1000); connect_wifi("AT+CWMODE=1",1000); connect_wifi("AT+CWQAP",1000); connect_wifi("AT+RST",5000); connect_wifi("AT+CWJAP=\"1st floor\",\"muda1884\"",10000); Serial.println("Wifi Connected"); lcd.clear(); lcd.print("WIFI Connected."); pinMode(heart, OUTPUT); delay(2000); t.oscillate(heart, 1000, LOW); t.every(20000, send2server); } void loop() { DHT.read11(dht_dpin); lcd.setCursor(0,0); lcd.print("Humidity: "); humi=DHT.humidity; lcd.print(humi); // printing Humidity on LCD lcd.print(" % "); lcd.setCursor(0,1); lcd.print("Temperature:"); tem=DHT.temperature; lcd.print(tem); // Printing temperature on LCD lcd.write(1); lcd.print("C "); delay(1000); t.update(); } void send2server() { char tempStr[8]; char humidStr[8]; dtostrf(tem, 5, 3, tempStr); dtostrf(humi, 5, 3, humidStr); sprintf(postUrl, "update?api_key=%s&field1=%s&field2=%s",api_key,humidStr,tempStr); httpGet("api.thingspeak.com", postUrl, 80); } void httpGet(String ip, String path, int port) { int resp; String atHttpGetCmd = "GET /"+path+" HTTP/1.0\r\n\r\n"; //AT+CIPSTART="TCP","192.168.20.200",80 String atTcpPortConnectCmd = "AT+CIPSTART=\"TCP\",\""+ip+"\","+port+""; connect_wifi(atTcpPortConnectCmd,1000); int len = atHttpGetCmd.length(); String atSendCmd = "AT+CIPSEND="; atSendCmd+=len; connect_wifi(atSendCmd,1000); connect_wifi(atHttpGetCmd,1000); } void connect_wifi(String cmd, int t) { int temp=0,i=0; while(1) { lcd.clear(); lcd.print(cmd); Serial.println(cmd); Serial1.println(cmd); while(Serial1.available()) { if(Serial1.find("OK")) i=8; } delay(t); if(i>5) break; i++; } if(i==8) { Serial.println("OK"); lcd.setCursor(0,1); lcd.print("OK"); } else { Serial.println("Error"); lcd.setCursor(0,1); lcd.print("Error"); } } Video microcontroller-projects/arduino-vehicle-tracker-on-google-maps-using-esp8266

Track A Vehicle on Google Maps using Arduino, ESP8266 & GPS

is used to make GPS and Wi-Fi talk to each other.

How it Works:

And then Arduino extract the required data from received data by GPS. at the end.

Components Required:

Arduino UNO Wi-Fi Module ESP8266 GPS module USB Cable Connecting wires Laptop Power supply 16x2 LCD Bread Board Wi-Fi router

Circuit Explanation:

optionally connected for displaying the status. This LCD is connected at 14-19 (A0-A5) Pins of Arduino. ᾠand get the coordinates. ᾠbefore doing this project. Below is the picture of ESP8266: ESP8266 has two LEDs, one is Red, for indicating Power and second is Blue that is Data Communication LED. Blue LED blinks when ESP sends some data via its Tx pin. Also, do not connect ESP to +5 volt supply otherwise your device may damage. Here in this project, we have selected 9600 baud rate for all the UART communications. User can also see the communication between Wi-Fi module ESP8266 and Arduino, on the Serial Monitor, at the baud rate of 9600: Also check the Video at the end of this project, for detailed workingprocess.

GPS Degree Minute to Decimal Degree Converison of Coordinates:

So first we need to convert coordinates from Degree Minute Format to Decimal Degree Format by using given formula. Suppose 2856.3465 (ddmm.mmmm) is the Latitude that we receive form the GPS Module. Now first two numbers are Degrees and remaining are Minutes. So 28 is degree and 56.3465 is minute. Now here, no need to convert Degree part (28), but only need to convert Minute part into Decimal Degree by dividing 60: Decimal Degree Coordinate = Degree + Minute/60 Decimal Degree Coordinate = 28 + 56.3465/60 Decimal Degree Coordinate = 28 + 0.94 Decimal Degree Coordinate = 28.94 We have converted coordinates from Degree Minute to Decimal Degree by using above formulae in Arduino Sketch: float minut= lat_minut.toFloat(); minut=minut/60; float degree=lat_degree.toFloat(); latitude=degree+minut; minut= long_minut.toFloat(); minut=minut/60; degree=long_degree.toFloat(); logitude=degree+minut;

Programming Explanation:

In this code, we have used SerialSoftware library to interface ESP8266 and GPS module with Arduino. Then we have defined different pins for both and initialize UART with 9600 baud rate. Also included LiquidCrystal Library for interface LCD with Arduino. #include<SoftwareSerial.h> SoftwareSerial Serial1(2,3); //make RX arduino line is pin 2, make TX arduino line is pin 3. SoftwareSerial gps(10,11); #include<LiquidCrystal.h> LiquidCrystal lcd(14,15,16,17,18,19); After it, we need to define or declare variable and string for different purpose. String webpage=""; int i=0,k=0; int gps_status=0; String name="<p>1. Name: Your Name </p>"; //22 String dob="<p>2. DOB: 12 feb 1993</p>"; //21 String number="<p>4. Vehicle No.: RJ05 XY 4201</p>";//29 String cordinat="<p>Coordinates:</p>"; //17 String latitude=""; String logitude=""; String gpsString=""; char *test="$GPGGA"; Then we have made some functions for different purposes like: Function for getting GPS data with coordinates: void gpsEvent() { gpsString=""; while(1) { while (gps.available()>0) { char inChar = (char)gps.read(); gpsString+= inChar; if (i < 7) { if(gpsString[i-1] != test[i-1]) { i=0; ..... .... ..... ..... Function for extracting data from GPS string and convert that data to decimal degree format from the decimal minute format, as explained earliar. void coordinate2dec() { String lat_degree=""; for(i=18;i<20;i++) lat_degree+=gpsString[i]; String lat_minut=""; for(i=20;i<28;i++) lat_minut+=gpsString[i]; ..... .... ..... ..... Function for sending commands to ESP8266 for configuring and connecting it with WIFI. void connect_wifi(String cmd, int t) { int temp=0,i=0; while(1) { Serial.println(cmd); Serial1.println(cmd); while(Serial1.available()>0) ..... .... ..... ..... function for getting IP address. Function for sending information string to webpage using UART. function Arduino continuously wait for request form webpage (Refreshing web page). void loop() { k=0; Serial.println("Please Refresh Ur Page"); lcd.setCursor(0,0); lcd.print("Please Refresh "); lcd.setCursor(0,1); lcd.print("Your Web Page.. "); while(k<1000) ..... .... ..... ..... Code #include<SoftwareSerial.h> SoftwareSerial Serial1(2,3); //make RX arduino line is pin 2, make TX arduino line is pin 3. SoftwareSerial gps(10,11); #include<LiquidCrystal.h> LiquidCrystal lcd(14,15,16,17,18,19); boolean No_IP=false; String IP=""; String webpage=""; int i=0,k=0; int gps_status=0; String name="<p>1. Name: Your Name </p>"; //22 String dob="<p>2. DOB: 12 feb 1993</p>"; //21 String number="<p>4. Vehicle No.: RJ05 XY 4201</p>";//29 String cordinat="<p>Coordinates:</p>"; //17 String latitude=""; String logitude=""; String gpsString=""; char *test="$GPGGA"; void check4IP(int t1) { int t2=millis(); while(t2+t1>millis()) { while(Serial1.available()>0) { if(Serial1.find("WIFI GOT IP")) { No_IP=true; } } } } void get_ip() { IP=""; char ch=0; while(1) { Serial1.println("AT+CIFSR"); while(Serial1.available()>0) { if(Serial1.find("STAIP,")) { delay(1000); Serial.print("IP Address:"); while(Serial1.available()>0) { ch=Serial1.read(); if(ch=='+') break; IP+=ch; } } if(ch=='+') break; } if(ch=='+') break; delay(1000); } lcd.clear(); lcd.print(IP); lcd.setCursor(0,1); lcd.print("Port: 80"); Serial.print(IP); Serial.print("Port:"); Serial.println(80); delay(1000); } void connect_wifi(String cmd, int t) { int temp=0,i=0; while(1) { Serial.println(cmd); Serial1.println(cmd); while(Serial1.available()>0) { if(Serial1.find("OK")) { i=8; } } delay(t); if(i>5) break; i++; } if(i==8) { Serial.println("OK"); } else { Serial.println("Error"); } delay(1000); } void setup() { Serial1.begin(9600); Serial.begin(9600); lcd.begin(16,2); lcd.print("Vehicle Tracking"); lcd.setCursor(0,1); lcd.print(" System "); delay(2000); lcd.clear(); lcd.print("WIFI Connecting.."); // lcd.setCursor(0,1); // lcd.print("Please Wait..."); delay(1000); connect_wifi("AT",1000); connect_wifi("AT+CWMODE=3",1000); connect_wifi("AT+CWQAP",1000); connect_wifi("AT+RST",5000); check4IP(5000); if(!No_IP) { Serial.println("Connecting Wifi...."); connect_wifi("AT+CWJAP=\"1st floor\",\"muda1884\"",7000); //AT+CWJAP=”wifi_usernameᾬ”wifi_passwordᾍ } else { } Serial.println("Wifi Connected"); lcd.clear(); lcd.print("WIFI Connected"); delay(2000); lcd.clear(); lcd.print("Getting IP"); get_ip(); delay(2000); connect_wifi("AT+CIPMUX=1",100); connect_wifi("AT+CIPSERVER=1,80",100); Serial1.end(); lcd.clear(); lcd.print("Waiting For GPS"); lcd.setCursor(0,1); lcd.print(" Signal "); delay(2000); gps.begin(9600); get_gps(); show_coordinate(); gps.end(); Serial1.begin(9600); delay(2000); lcd.clear(); lcd.print("GPS is Ready"); delay(1000); lcd.clear(); lcd.print("System Ready"); Serial.println("System Ready.."); } void loop() { k=0; Serial.println("Please Refresh Ur Page"); lcd.setCursor(0,0); lcd.print("Please Refresh "); lcd.setCursor(0,1); lcd.print("Your Web Page.. "); while(k<1000) { k++; while(Serial1.available()) { if(Serial1.find("0,CONNECT")) { Serial1.end(); gps.begin(9600); get_gps(); gps.end(); Serial1.begin(9600); Serial1.flush(); /* lcd.clear(); lcd.print("Sending Data to "); lcd.setCursor(0,1); lcd.print(" Web Page ");*/ Serial.println("Start Printing"); Send(); show_coordinate(); Serial.println("Done Printing"); delay(5000); lcd.clear(); lcd.print("System Ready"); delay(1000); k=1200; break; } } delay(1); } } void gpsEvent() { gpsString=""; while(1) { while (gps.available()>0) //Serial incoming data from GPS { char inChar = (char)gps.read(); gpsString+= inChar; //store incoming data from GPS to temporary string str[] i++; if (i < 7) { if(gpsString[i-1] != test[i-1]) //check for right string { i=0; gpsString=""; } } if(inChar=='\r') { if(i>65) { gps_status=1; break; } else { i=0; } } } if(gps_status) break; } } void get_gps() { gps_status=0; int x=0; while(gps_status==0) { gpsEvent(); int str_lenth=i; latitude=""; logitude=""; coordinate2dec(); i=0;x=0; str_lenth=0; } } void show_coordinate() { lcd.clear(); lcd.print("Latitide:"); lcd.print(latitude); lcd.setCursor(0,1); lcd.print("Longitude:"); lcd.print(logitude); Serial.print("Latitude:"); Serial.println(latitude); Serial.print("Longitude:"); Serial.println(logitude); } void coordinate2dec() { //j=0; String lat_degree=""; for(i=18;i<20;i++) //extract latitude from string lat_degree+=gpsString[i]; String lat_minut=""; for(i=20;i<28;i++) lat_minut+=gpsString[i]; String long_degree=""; for(i=30;i<33;i++) //extract longitude from string long_degree+=gpsString[i]; String long_minut=""; for(i=33;i<41;i++) long_minut+=gpsString[i]; float minut= lat_minut.toFloat(); minut=minut/60; float degree=lat_degree.toFloat(); latitude=degree+minut; minut= long_minut.toFloat(); minut=minut/60; degree=long_degree.toFloat(); logitude=degree+minut; } void Send() { webpage = "<h1>Welcome to Saddam Khan's Page</h1><body bgcolor=f0f0f0>"; webpage+=name; webpage+=dob; webpage+=number; webpage+=cordinat; webpage+="<p>Latitude:"; webpage+=latitude; webpage+="</p>"; webpage+="<p>Longitude:"; webpage+=logitude; webpage+="</p>"; webpage+= "<a href=\"http://maps.google.com/maps?&z=15&mrt=yp&t=k&q="; webpage+=latitude; webpage+='+'; //28.612953, 77.231545 //28.612953,77.2293563 webpage+=logitude; webpage+="\">Click Here for google map</a>"; sendwebdata(); webpage=""; while(1) { Serial.println("AT+CIPCLOSE=0"); Serial1.println("AT+CIPCLOSE=0"); while(Serial1.available()) { //Serial.print(Serial1.read()); if(Serial1.find("0,CLOSE")) { return; } } delay(500); i++; if(i>5) { i=0; } if(i==0) break; } } void sendwebdata() { i=0; while(1) { unsigned int l=webpage.length(); Serial1.print("AT+CIPSEND=0,"); Serial1.println(l+2); Serial.println(l+2); Serial.println(webpage); Serial1.println(webpage); while(Serial1.available()) { if(Serial1.find("OK")) { return; } } i++; if(i>5) i=0; if(i==0) break; delay(200); } } Video microcontroller-projects/arduino-frequency-counter-circuit

Frequency Counter using Arduino

and Schmitt trigger gate. for the measuring the frequency of signal, UNO is the heart of project here. The timer circuit generates a square wave which will be provided to UNO for testing. like sine wave, saw tooth wave etc.

Required Components:

555 timer IC and 74LS14 Schmitt trigger gate or NOT gate. 1K resistor(2 pieces), 100 resistor 100nF capacitor (2 pieces), 1000μF capacitor 16*2 LCD, 47K pot, Breadboard and some connectors.

Circuit Explanation:

Signal generator circuit and Schmitt trigger have been explained below.

Signal Generator using 555 Timer IC:

is given below: is given below, from which we have derived the above given Signal Generator Circuit. The output signal frequency depends on RA, RB resistors and capacitor C. The equation is given as, Frequency (F) = 1/ (Time period) = 1.44/ ((RA+RB*2)*C). Here RA and RB are resistance values and C is capacitance value. By putting the resistance and capacitance values in above equation we get the frequency of output square wave. One can see that RB of above diagram is replaced by a pot in the Signal Generator Circuit; this is done so that we can get variable frequency square wave at the output for better testing. For simplicity, one can replace the pot with a simple resistor.

Schmitt Trigger Gate:

Schmitt trigger gate is a digital logic gate, designed for arithmetic and logical operations. in it. These SIX gates are connected internally as shown in below figure. is show in below figure, with this we have to program the UNO for inverting the positive and negative time periods at its terminals. Now we will feed any type of signal to ST gate, we will have rectangular wave of inverted time periods at the output, we will feed this signal to UNO.

Arduino Frequency Counter Code Explanation:

which enables us to determine the positive state duration or negative state duration of a particular rectangular wave: Htime = pulseIn(8,HIGH); Ltime = pulseIn(8, LOW); function measures the time in micro seconds. In a given signal, we have high time = 10mS and low time = 30ms (with frequency 25 HZ). So 30000 will be stored in Ltime integer and 10000 in Htime. When we add them together we will have the Cycle Duration, and by inverting it we will have the Frequency. are given below. Code #include <LiquidCrystal.h> LiquidCrystal lcd(2, 3, 4, 5, 6, 7); int Htime; //integer for storing high time int Ltime; //integer for storing low time float Ttime; // integer for storing total time of a cycle float frequency; //storing frequency void setup() { pinMode(8,INPUT); lcd.begin(16, 2); } void loop() { lcd.clear(); lcd.setCursor(0,0); lcd.print("Frequency of signal"); Htime=pulseIn(8,HIGH); //read high time Ltime=pulseIn(8,LOW); //read low time Ttime = Htime+Ltime; frequency=1000000/Ttime; //getting frequency with Ttime is in Micro seconds lcd.setCursor(0,1); lcd.print(frequency); lcd.print(" Hz"); delay(500); } Video microcontroller-projects/arduino-raspberry-pi-interfacing

Interfacing Arduino with Raspberry Pi using Serial Communication

These boards have great powers, and one can build very complicated and Hi-fi project in few simple steps and little programming. and zero ADC channels, so when we do projects like 3D printer, PI cannot do all the interactions alone. So we need more output pins and additional functions, for adding more functions to PI, we establish a communication between PI and UNO. With that we can use all the function of UNO as they were PI functions. etc. They are ATMEGA controller based boards designed for Electronic Engineers and Hobbyists. Although there are many boards on Arduino platform, but Arduino Uno got many appreciations, for its ease of doing projects. Arduino based program development environment is an easy way to write the program when compared to others.

Components Required:

, other than that we need: Connecting pins 220 or 1Kresistor (2 pieces) LED Button

Circuit Explanation:

using USB cable. There are four USB ports for PI; you can connect it to any one of them. A button is connected to initialize the serial communication and LED (blink) to indicate that data is being sent.

Working and Programming Explanation:

First let’s program the UNO, Connect the UNO to the PC first and then write the program (Check Code section below)in the Arduino IDE software and upload the program to the UNO. Then disconnect the UNO from PC. Attach the UNO to the PI after programming and connect an LED and button to the UNO, as shown in circuit diagram. Now the program here initializes the Serial Communication of UNO. When we press the button attached to the UNO, the UNO sends few characters to the PI serially through USB port. The LED attached to the PI blinks to indicate the characters being sent. After that we have to write a program for PI (Check Code section below), to receive this data being sent by UNO. For that we need to understand a few commands stated below. We are going to import serial file from library, this function enables us to send or receive data serially or by USB port. import serial Now, we need to state the device port and the bit rate for the PI to receive the data from UNO without any errors. The below command states that, we are enabling the serial communication of 9600 bits per second on ACM0 port. ser = serial.Serial('/dev/ttyACM0', 9600) To find out the port which the UNO being attached to, go to the terminal of PI and enter ls /dev/tty* You will have the list of all attached devices on PI. Now connect the Arduino Uno to Raspberry Pi with USB cable and enter the command again. You can easily identify the UNO attached port from the displayed list. Below command is used as forever loop, with this command the statements inside this loop will be executed continuously. While 1: After receiving the data serially we will be displaying the characters on the screen of PI. print (ser.readline()) Code void setup() { pinMode(2,INPUT); // PIN2 is set for input pinMode(3,OUTPUT); // PIN3 is set for output Serial.begin(9600); // serial data rate is set for 9600bps(bits per second) } void loop() // execute the loop forever { if(digitalRead(2)==LOW) // if button attached to the UNO is pressed { digitalWrite(3,HIGH); // turn ON the LED at PIN3 Serial.println( "ButtonPressed" ); // send "ButtonPressed" string of characters serially out delay(200); // wait for 200 milli second digitalWrite(3,LOW); // turn OFF the LED } } import time import serial ser = serial.Serial('/dev/ttyACM0', 9600) # enable the serial port while 1: # execute the loop forever ser.readline() # read the serial data sent by the UNO print (ser.readline()) # print the serial data sent by UNO Video microcontroller-projects/how-to-make-arduino-board-diy

Make Your Own Homemade Arduino Board with ATmega328 Chip

series of microcontrollers) and a piece of softwareor IDE which runs on your computer andused to write and upload the codeto the microcontroller board. In Arduino UNO we use ATmega328 IC so that I select this one to demonstrate this project.

Components Required:

Arduino UNO Board with IC and cable Atmega328 IC Breadboard Connecting wires 16 MHz crystal oscillator 10 K resistor

Steps for Building your own Arduino Board:

at the end of the tutorial. In first step, arrange all the required things given in components list above Now remove “Arduino Original ICᾠfrom Arduino board with the help of Screw Driver. And insert “New Atmega328 ICᾠinto the Arduino board. Now open Arduino IDE and go to File -> example -> ArduinoISP and open it. from Tools -> Board -> Arduino Uno. from Tools -> Serial Port ->COM10 Now remove this New IC from the Arduino Board and insert the Arduino pre booted or Original Arduino IC into Arduino board and upload the same ArduinoISP sketch in it, like we have done in Step 3. Build the below given Circuit on the bread board with New IC on Breadbaord and Original IC on Original Arduino Board. ᾮ Now you can use this ‘New ICᾠin your Arduino board. below. Insert the ‘New ICᾠin this board and you are done. For LCD Interfacing, just connect your home made Arduino Board with Original Arduino Board using Rx, Tx, RST and GND pins of Original Arduino Board, as shown in below Fritzing Circuit or above Circuit Diagram. And upload the Below Given Code (Code section). , as we have done in above Fritzing Circuit. Code #include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { lcd.begin(16, 2); lcd.print("HomeMade Arduino"); lcd.setCursor(0,1); lcd.print("Circuit Digest"); } void loop() { } Video microcontroller-projects/arduino-tft-lcd-interfacing-tutorial

Interfacing TFT LCD with Arduino

etc.

Hardware and Software Requirements:

Arduino Uno TFT shield USB cable Arduino ide TFT library for Arduino (spfd5408)

Circuit Diagram:

User only needs to insert TFT Shield over the Arduino. Because TFT Shield is compatible with Arduino UNO and Arduino mega.

Steps for Installing TFT library in Arduino IDE:

Step 1: Download the TFT library for Arduino, from the below given link and make it zip (if not already zipped). Step 2: After this, copy and paste it in Arduino library folder in Program Files. Step 3: Now open Arduino IDE and select Sketch -> Include Library -> Add .ZIP Library. Then go to the Arduino Library in Program Files, where you have pasted the zipped downloaded library in Step 2-- and select and open zipped SPFD5408-Master library. My Computer -> C: Drive -> Program Files -> Arduino -> libraries Now after opening the SPFD5408Master Library,you can see that your library file has been installed in Arduino IDE. Step 4: Now in Arduino IDE go to, File -> Example -> SPFD5408-master -> spfd5408_graphictest Open it, compile it and then upload it in Arduino. Now you will get your results on TFT. Users can modify this code according to their requirements, like we have inserted some ‘Textᾠaccording to us. Note: Same steps can be followed to install any Library in Arduino IDE. Video microcontroller-projects/sending-arduino-data-to-webpage

How to Send Data from Arduino to Webpage using WiFi

: Sending Email using Arduino and ESP8266 WiFi Module WiFi Controlled Robot using Arduino Controlling RGB LED using Arduino and Wi-Fi For this we first need an IP address of either Global or Local server, here for the ease and demonstration purpose, we are using Local Server.

Components Required:

Arduino UNO ESP8266 Wi-Fi Module USB Cable Connecting wires Laptop Power supply

Circuit Connections:

in detail. here, we have allowed serial communication on pin 2 and 3, and made them Rx and Tx respectively. By default Pin 0 and 1 of Arduino are used for serial communication but by usingSoftwareSeriallibrary, we can allow serial communication on other digital pins of the Arduino. Note: To watch the response of ESP8266 on serial monitor, please open Serial Monitor of Arduino IDE.

Working Explanation:

First of all we need to connect our Wi-Fi module to Wi-Fi router for network connectivity. Then we will Configure the local server, Send the data to Web and finally Close the connection. This process and commands have been explained in below steps: , we have used Mode id =3. Mode ids: 1= Station mode (client) 2= AP mode (host) 3= AP + Station mode (Yes, ESP8266 has a dual mode!) as ESP8266 is default auto connected with any previously available Wi-Fi network command. This step is optional. 5. Now we need to connect ESP8266 to Wi-Fi router using given command 6. Now get IP Address by using given command: It will return an IP Address. (1 for multiple connection and 0 for single connection) (port may be 80). Now your Wi-Fi is ready. Here ᾱᾠis used to create the server and ᾰᾠto delete the server. 9. Now by using given command user can send data to local created server: Id = ID no. of transmit connection Length = Max length of data is 2 kb 11. After sending data we need close the connection by given command: Now data has been transmitted to local server. 12. Now type IP Address in Address Bar in web browser and hit enter. Now user can see transmitted data on webpage. Check the Video below for complete process.

Steps for Programming:

1. Include SoftwareSerialLibrary for allow serial communication on PIN 2 & 3 and declare some variables and strings. #include<SoftwareSerial.h> SoftwareSerial client(2,3); //RX, TX String webpage=""; int i=0,k=0; String readString; int x=0; boolean No_IP=false; String IP=""; char temp1='0'; 2. After this, we have to define some functions for performing our desired tasks. at the baud rate of 9600. void setup() { Serial.begin(9600); client.begin(9600); wifi_init(); Serial.println("System Ready.."); } function, we initialize the wifi module by sending some commands like reset, set mode, connect to router, configure connection etc. These commands have also been explained above in description part. void wifi_init() { connect_wifi("AT",100); connect_wifi("AT+CWMODE=3",100); connect_wifi("AT+CWQAP",100); connect_wifi("AT+RST",5000); ...... ..... ..... ..... function, we send commands data to ESP8266 and then read response from ESP8266 Wi-Fi module. void connect_wifi(String cmd, int t) { int temp=0,i=0; while(1) { Serial.println(cmd); ...... ..... ..... ..... function is used for sending data to Local Server or Webpage. void sendwebdata(String webPage) { int ii=0; while(1) { unsigned int l=webPage.length(); Serial.print("AT+CIPSEND=0,"); client.print("AT+CIPSEND=0,"); ...... ..... ..... ..... function. That will be further sent to webpage. void Send() { webpage = "<h1>Welcome to Circuit Digest</h1><body bgcolor=f0f0f0>"; sendwebdata(webpage); webpage=name; webpage+=dat; ...... ..... ..... ..... function is used for getting IP address of Local created server. function, we send instruction to user for refreshing the page and check whether the server is connected of not. When user refresh or request the webpage, data automatically transmitted to the same IP address. void loop() { k=0; Serial.println("Please Refresh your Page"); while(k<1000) .... ..... .... ..... etc. Code #include<SoftwareSerial.h> SoftwareSerial client(2,3); //RX, TX String webpage=""; int i=0,k=0; String readString; int x=0; boolean No_IP=false; String IP=""; char temp1='0'; String name="<p>Circuit Digest</p>"; //22 String dat="<p>Data Received Successfully.....</p>"; //21 void check4IP(int t1) { int t2=millis(); while(t2+t1>millis()) { while(client.available()>0) { if(client.find("WIFI GOT IP")) { No_IP=true; } } } } void get_ip() { IP=""; char ch=0; while(1) { client.println("AT+CIFSR"); while(client.available()>0) { if(client.find("STAIP,")) { delay(1000); Serial.print("IP Address:"); while(client.available()>0) { ch=client.read(); if(ch=='+') break; IP+=ch; } } if(ch=='+') break; } if(ch=='+') break; delay(1000); } Serial.print(IP); Serial.print("Port:"); Serial.println(80); } void connect_wifi(String cmd, int t) { int temp=0,i=0; while(1) { Serial.println(cmd); client.println(cmd); while(client.available()) { if(client.find("OK")) i=8; } delay(t); if(i>5) break; i++; } if(i==8) Serial.println("OK"); else Serial.println("Error"); } void wifi_init() { connect_wifi("AT",100); connect_wifi("AT+CWMODE=3",100); connect_wifi("AT+CWQAP",100); connect_wifi("AT+RST",5000); check4IP(5000); if(!No_IP) { Serial.println("Connecting Wifi...."); connect_wifi("AT+CWJAP=\"1st floor\",\"muda1884\"",7000); //provide your WiFi username and password here // connect_wifi("AT+CWJAP=\"vpn address\",\"wireless network\"",7000); } else { } Serial.println("Wifi Connected"); get_ip(); connect_wifi("AT+CIPMUX=1",100); connect_wifi("AT+CIPSERVER=1,80",100); } void sendwebdata(String webPage) { int ii=0; while(1) { unsigned int l=webPage.length(); Serial.print("AT+CIPSEND=0,"); client.print("AT+CIPSEND=0,"); Serial.println(l+2); client.println(l+2); delay(100); Serial.println(webPage); client.println(webPage); while(client.available()) { //Serial.print(Serial.read()); if(client.find("OK")) { ii=11; break; } } if(ii==11) break; delay(100); } } void setup() { Serial.begin(9600); client.begin(9600); wifi_init(); Serial.println("System Ready.."); } void loop() { k=0; Serial.println("Please Refresh your Page"); while(k<1000) { k++; while(client.available()) { if(client.find("0,CONNECT")) { Serial.println("Start Printing"); Send(); Serial.println("Done Printing"); delay(1000); } } delay(1); } } void Send() { webpage = "<h1>Welcome to Circuit Digest</h1><body bgcolor=f0f0f0>"; sendwebdata(webpage); webpage=name; webpage+=dat; sendwebdata(webpage); delay(1000); webpage = "<a href="http://circuitdigest.com/"; webpage+="\">Click Here for More projects</a>"; sendwebdata(webpage); client.println("AT+CIPCLOSE=0"); } Video microcontroller-projects/servo-motor-control-with-arduino-due

Servo Motor Control with Arduino Due

Servo Motors:

are known for their accurate shaft movement or position. These are not proposed for high speed applications. These are proposed for low speed, medium torque and accurate position application. These motors are used in robotic arm machines, flight controls and control systems. Servo motors are also used in some of printers and fax machines. in this tutorial. SG90 is a 180 degree servo motor. So with this servo we can position the axis from 0 to 180 degrees. A Servo Motor mainly has three wires, one is for positive voltage, another is for ground and last one is for position setting. The RED wire is connected to power, Brown wire is connected to ground and YELLOW wire (or WHITE) is connected to signal. is a combination of DC motor, position control system and gears. In servo, we have a control system which takes the PWM signal from signal pin. It decodes the signal and gets the duty ratio from it. After that it compares the ratio to the predefined positions values. If there is a difference in the values, it adjusts the position of the servo accordingly. So the axis position of the servo motor is based on the duty ratio of the PWM signal to the SIGNAL pin. However in this case, we need not even worry about with the Duty Ratio selection. In Arduino we have a special function; upon calling it we can adjust the position of servo, just by stating the angle. We will talk about that in the Working Section below.

Components:

Arduino Due, power supply (5v), Servo motor. )

Circuit Diagram and Working Explanation:

As said earlier in ARDUINO, we have predefined libraries, which will set the frequencies and duty ratios accordingly, once the header file is called or included. In ARDUINO we simply have to state the position of servo that needed and the DUE generates appropriate PWM signal for the servo. The things which we need to do for getting accurate position of servo are, #include <Servo.h> Servo myservo; myservo.attach(servo_signal_pin_attached_to); myservo.write(needed_position_ angle); includes all the special functions we need, upon calling it we no longer have to worry about the frequency of PWM nor about the DUTY RATIO of signal. With this the user can enter needed position of servo directly without any fuzz. is the name chosen, so while writing for position we are going to use this name, this feature comes in handy when we have many servos to control, we can control as many as 12 servos by this. , here we are telling the DUE that we have connected the signal pin of servo at PIN2. down below. Code #include <Servo.h> Servo myservo; // providing a name int angle = 0; // variable to store the servo position void setup() { myservo.attach(2); // attaches the servo on pin 2 to the servo object } void loop() { for (angle = 0; angle <= 180; angle += 1) { // goes from 0 degrees to 180 degrees, in steps of 1 degree myservo.write(angle); // tell servo to go to position in variable 'angle' delay(15); // waits 15ms for the servo to reach the position } for (angle = 180; angle >= 0; angle -= 1) { // goes from 180 degrees to 0 degrees myservo.write(angle); delay(15); // waits 15ms for the servo to reach the position } } Video microcontroller-projects/arduino-due-pwm-tutorial

PWM with Arduino Due

is an ARM controller based board designed for electronic engineers and hobbyists. ARM architecture is very influential in modern electronics, we use them everywhere like our mobiles, iPods and computers etc. If someone wants to design industrial systems it must on ARM controllers. ARM controllers are very important because of their agility. ) signal provides a variable voltage over constant power supply.

Pulse Width Modulation:

, and can be calculated as follows: Duty Cycle =Turn ON time/ (Turn ON time + Turn OFF time) Duty Cycle = (0.5/ (0.5+0.5)) = 50% So the average output voltage will be 50% of the battery voltage. This is the case for one second and we can see the LED being OFF for half second and LED being ON the other half second. If Frequency of ON and OFF times increased from ᾱ per secondᾠto ᾵0 per secondᾮ The human eye cannot capture this frequency of ON and OFF. For a normal eye the LED will be seen, as glowing with half of the brightness. So with further reduction of ON time the LED appears much lighter. We will program the DUE for getting a PWM and connect a LED to show its working. (Pin 2 to Pin 13) in the DUE and we can use any one or all of them. In this case we will stick to one PWM signal at PIN2.

Components:

Arduino Due Power supply (5v) LED Buttons (two pieces), 1K resistor (two pieces), 220 resistor

Circuit Diagram and Working Explanation:

The circuit is connected on breadboard as per the Circuit Diagram. However one must pay attention during connecting the LED terminals. Although the buttons can show bouncing effect but in this case it does not cause considerable errors, so we need not worry this time. By default all the header files and registers are predefined by Arduino IDE, we simply need to call them and that’s it, we will have a PWM output at appropriate pin. We also need to call certain commands to get a PWM signal, these are discussed below: pinMode(2, OUTPUT) analogWrite(pin, value) First we need to choose the PWM output channel or select a pin from 12 pins of DUE, after that we need to set that pin as output. Since we are using PIN2 as output, we will set it as OUTPUT as shown in first line. ᾮ In here ‘pinᾠrepresent the pin number where we need PWM output. We are putting it as ᾲᾬ so at PIN2 we are getting PWM output. “Valueᾠis the turn ON value, it varies between 0 (always off) and 255 (always on). We can write the appropriate value in this space for required brightness of LED. We attached a couple of button to the DUE board for varying this value. One button is for incrementing the brightness value and other is for decreasing the brightness value. Once the Due is done programming, we can adjust brightness by pressing these buttons. Code volatile int brightness = 0; //initializing a integer for incrementing and decrementing duty ratio. void setup() { // declare pin 2 to be an output: pinMode(2, OUTPUT); pinMode(14, INPUT); pinMode(15, INPUT); } // the loop routine runs over and over again forever: void loop() { if(digitalRead(14)==HIGH) { if(brightness<255) { brightness++; //if pin14 is pressed and the duty ratio value is less than 255, increase the ‘brightnessᾍ } delay(20); } if(digitalRead(15)==HIGH) { if(brightness>0) { brightness--; //if pin15 is pressed and the duty ratio value is greater than 0, decrement the ‘brightnessᾍ } delay(20); } analogWrite(2, brightness); } Video microcontroller-projects/getting-started-with-arduino-due

Getting Started with Arduino Due

is an ARM controller based board designed for electronic Engineers and Hobbyists. ARM architecture is very influential in modern electronics. We are using the ARM architecture based controllers everywhere. For example we are using ARM controllers in our mobiles, iPods and computers etc. If someone wants to design industrial systems, it must be on ARM controllers. ARM controllers are very important because of the frequency of their operation and data bus size. can achieve results better than normal controllers and they have more functions than a normal controller. With this, it is obvious that we must learn ARM controller for designing higher functions like image processing etc. , from beginner to advanced level and they cover almost all topics to learn Arduino from scratch. with it. The software and download, upload process are same for the Uno. , they are basically extensions for ARDUINO. These shields add additional features to the ARDUINO. These shields are stacked one over the other on ARDUINO.

Required Components:

Arduino Due board, connecting pins, 220 resistor, LED, bread board. Open the above given link, under download session, we have the latest version of ARDUINO software, which is 1.6.8 (at the time of writing this article). Even if you have the older version, download the newer version. In previous versions the DUE board libraries are not present. So the previous versions cannot detect the DUE board. You can update the previous version to get the DUE board working. Click on the windows installer button for the software: Now click on the just download button for the setup to start downloading. The setup file would be around 85 Mb. After download install the file by double click. Once the install is complete, you will get a icon on the desktop as shown below. Double click on the program to start. Now you see, there are two connectives on the DUE board. Now connect the USB plug and connect the other end to PC, you should see the power LED ON. Once the ARDUINO program is running, you should choose the ARDUINO DUE board from the ‘TOOLSᾠmenu of the program. Once you choose the DUE board you will see the selected board at the right bottom, as shown in the figure given below in next section. We connected the USB to NATIVE port, so we have to choose the ‘NATIVE portᾠin the software. This option will also be in ’TOOLSᾠoption. Once you select it, you are ready to upload the program.

Circuit and Working Explanation:

In here we are going to write a program to blink an LED for every 1000ms.We will connect an LED at PIN13 through a 220 current limiting resistor. Now upload the program by clicking on the Upload Button, shown in the figure (top left corner), Once you successfully upload the program, at the left bottom of the screen you will see ’DONE UPLOADINGᾠand LED will start blinking. It is important to remember that the GPIO of this board has a voltage limit of 3.3V. So we cannot expect voltages higher than 3.3V nor can we give voltages higher than 3.3V to any pin of this board. If voltage higher than 3.3v is given to board then it could damage the board permanently. Check the Code below to get better understanding. Code void setup() { // initialize digital pin 13 as an output. pinMode(13, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(13, HIGH); // turn the LED on (making the voltage level HIGH) delay(1000); // wait for a second digitalWrite(13, LOW); // turn the LED off (making the voltage level LOW) delay(1000); // wait for a second } Video microcontroller-projects/controlling-rgb-led-using-wifi-and-arduino

Controlling RGB LED using Arduino and Wi-Fi

, through a Android Phone, over the Wi-Fi. based project. This App can be downloaded from the Google Play Store, and can be easily configured.

Step for configuring Blynk App:

1. First download it from Google Play Store and install it in Android mobile phone. 2. After this, it is required to create an account. You may use your current Gmail account. 3. Now select Arduino Board and give a name for your project. 4. Note down the Auth Token Code or simply mail it to your Email Account and then copy and paste in Arduino sketch (Program Code). 5. Enter this Auth Token Code in Arduino sketch. // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "a20b235cfa794f07981d050950fb4429"; 6. Then click on create button in Blynk app. 7. Now Select the Large Slider and two buttons, configure them (see the Video at the end) and hit the back button. 8. After it press Play button at the right top of screen. , given in the end.

Required Components:

Arduino UNO ESP8266 Wi-Fi Module USB Cable Connecting wires RGB LED Android Mobile phone Blynk App

Circuit and Working Explanation:

in detail. Here we have used a Common Anode RGB LED. This RGB LED pins namely R, G, B and anode are connected at 11, 10, 9 and +5 volt Vcc. Common Anode pin has a 1K resistor with +5 volt for protecting the LED to be damaged. is simple, we have created three Sliders, using Blynk app, for controlling the intensity of three colors of RGB LED that is RED, GREEN and BLUE. And one button for Flashing the RGB LED in different pattern, according to Program code.

Programming Explanation:

First we need to download and install Blynk Library for Arduino. string. Here we are connecting Wi-Fi serial pin with Software Serial of Arduino. Selected pin 2 as RX and 3 as TX. #define BLYNK_PRINT Serial // Comment this out to disable prints and save space #include <ESP8266_SoftSer.h> #include <BlynkSimpleShieldEsp8266_SoftSer.h> // Set ESP8266 Serial object #include <SoftwareSerial.h> SoftwareSerial EspSerial(2, 3); // RX, TX ESP8266 wifi(EspSerial); // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "a20b235cfa794f07981d050950fb4429"; After it we have defined output pins for RGB LED #define red 11 #define green 10 #define blue 9 function we initialize all the required devices, begin serial communication, providing Wi-Fi username and password. void setup() { // Set console baud rate Serial.begin(9600); delay(10); // Set ESP8266 baud rate // 9600 is recommended for Software Serial EspSerial.begin(9600); delay(10); Blynk.begin(auth, wifi, "username", "password"); // wifi username and password } to flash the RGB LED. below, first one is just for controlling the intensity of three colors in RGB LED without flashing it and second one is for flashing the LED as well as controlling the three colors of RGB LED. We only need to define RGB Led pins in second program, i.e. Flashing LED program, because Flashing of LED is controlled by Arduino. On the other hand in first program, Colors of LED is controlled by Blynk app in Android phone, so we don’t need to define RGB LED pins. We can say that if we only want to change the color by Sliders and don’t want to use Button for flasher then we don’t need to define of RGB pins. The given function is for flashing the RGB LED when button is pressed from the Blynk App. BLYNK_WRITE(V1) { int x = param[0].asInt(); while(x==1) { x = param.asInt(); int i=0,j=0,k=0; analogWrite(red, 255); analogWrite(green, 255); ... ..... .... ..... in loop, to run the system. void loop() { Blynk.run(); } Two Codes have been given below. One is for just changing the colors of RGB LED without flasher and second one is for changing the colors with Flasher. Check the Video for more clarity. Code #define BLYNK_PRINT Serial // Comment this out to disable prints and save space #include <ESP8266_SoftSer.h> #include <BlynkSimpleShieldEsp8266_SoftSer.h> // Set ESP8266 Serial object #include <SoftwareSerial.h> SoftwareSerial EspSerial(2, 3); // RX, TX ESP8266 wifi(EspSerial); // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "a20b235cfa794f07981d050950fb4429"; void setup() { // Set console baud rate Serial.begin(9600); delay(10); // Set ESP8266 baud rate // 9600 is recommended for Software Serial EspSerial.begin(9600); delay(10); Blynk.begin(auth, wifi, "1st floor", "muda1884"); } void loop() { Blynk.run(); } #define BLYNK_PRINT Serial // Comment this out to disable prints and save space #include <ESP8266_SoftSer.h> #include <BlynkSimpleShieldEsp8266_SoftSer.h> // Set ESP8266 Serial object #include <SoftwareSerial.h> SoftwareSerial EspSerial(2, 3); // RX, TX ESP8266 wifi(EspSerial); // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "a20b235cfa794f07981d050950fb4429"; #define red 11 #define green 10 #define blue 9 void setup() { // Set console baud rate Serial.begin(9600); delay(10); // Set ESP8266 baud rate // 9600 is recommended for Software Serial EspSerial.begin(9600); delay(10); Blynk.begin(auth, wifi, "username", "password"); // wifi username and password } BLYNK_WRITE(V1) { int x = param[0].asInt(); while(x==1) { x = param.asInt(); int i=0,j=0,k=0; analogWrite(red, 255); analogWrite(green, 255); analogWrite(blue, 255); for(int j=0;j<20;j++) { analogWrite(red, 0); analogWrite(green, 255); analogWrite(blue, 255); delay(100); analogWrite(red, 255); analogWrite(green, 0); analogWrite(blue, 255); delay(100); analogWrite(red, 255); analogWrite(green, 255); analogWrite(blue, 0); delay(100); x = param.asInt(); if(x==0) break; } analogWrite(red, 255); analogWrite(green, 255); analogWrite(blue, 255); for(int z=0;z<10;z++) { for(i=0;i<=180;i++) { analogWrite(red, 180-i); delay(2); } analogWrite(red, 255); for(j=0;j<255;j++) { analogWrite(green, 255-j); delay(2); } analogWrite(green, 255); for(k=0;k<255;k++) { analogWrite(blue, 255-k); delay(2); } analogWrite(blue, 255); x = param.asInt(); if(x==0) break; } analogWrite(red, 255); analogWrite(green, 255); analogWrite(blue, 255); for(int z=0;z<5;z++) { for(j=0;j<255;j++) { analogWrite(green, 255-j); delay(20); } for(k=0;k<255;k++) { analogWrite(blue, 255-k); delay(20); } for(i=0;i<=180;i++) { analogWrite(red, 180-i); delay(20); } analogWrite(red,180); x = param.asInt(); if(x==0) break; } if(x==0) break; } analogWrite(red, 255); analogWrite(green, 255); analogWrite(blue, 255); } void loop() { Blynk.run(); } Video microcontroller-projects/arduino-wifi-controlled-robot

WiFi Controlled Robot using Arduino

There are many types of Robots, from the simple ones like a Toy car to the advanced ones like industrial Robots. We have already covered many types of Robots using different technologies, have a look at them: Line Follower Robot using 8051 Microcontroller Line Follower Robot using Arduino DTMF Controlled Robot using Arduino Cell Phone Controlled Robot using 8051 Microcontroller Computer Controlled Robot using Arduino RF Controlled Robot Edge Avoiding Robot Using 8051 Accelerometer Based Hand Gesture Controlled Robot using Arduino Bluetooth Controlled Toy Car using Arduino This Arduino based Robot can be controlled wirelessly using any Wi-Fi enabled Android smart phone. based project. This App can be downloaded from the Google Play Store, and can be easily configured.

Steps for configuring Blynk App:

1. First download it from Google Play Store and install it in Android mobile phone. 2. After this, it is required to create an account. You may use your current Gmail account. 3. Now select Arduino Board and give a name for your project. 4. Note down the Auth Token Code or simply mail it to your Email Account and then copy and paste in Arduino sketch (Program Code). 5.Enter this Auth Token Code in Arduino sketch. // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "caa17a11c0124d4083d0eaa995f45917"; 6. Then click on create button in Blynk app. 7.Now Select the Joystick Widget, Click on Joystick, Configure the Joystick (see the Video at the end) and hit the back button. 8. After it press Play button at the right top of screen. , given in the end.

Required Components:

Arduino UNO ESP8266 Wi-Fi Module USB Cable Connecting wires L293D DC Motors Batteries 10K POT (optional) Robot chassis plus wheel Roller caster Android Mobile phone Blynk App

Circuit Explanation:

in detail. is used for driving DC motors. Input pins of motor driver IC is directly connected to pin 8, 9, 10 and 11 of Arduino. And DC motors are connected at its output pins. Here we have used 9 Volt battery for driving the Circuit and DC motors.

Working Explanation:

in the direction, where we want to move the Robot. Like if we want to move the Robot in Forward direction then we need to Drag the Joystick ‘circleᾠin Forward direction. Likewise we can move the Robot in Left, Right and Backward direction by Dragging the joystick in respective direction. Now as soon as we release the Joystick, it will come back to centre and Robot stops. Blynk App sends values from Two Axis Joystick to Arduino, through Wi-Fi medium. Arduino receive the values, compare them with predefined values and move the Robot accordingly in that direction.

Programming Explanation:

Program is almost readymade available in Arduino IDE. We just need to download Blynk Library for Arduino. And after making some modifications, user can make own Wi-Fi controlled robot. string. Here we are connecting Wi-Fi serial pin with Software Serial of Arduino. Selected pin 2 as RX and 3 as TX. #define BLYNK_PRINT Serial // Comment this out to disable prints and save space #include <ESP8266_SoftSer.h> #include <BlynkSimpleShieldEsp8266_SoftSer.h> // Set ESP8266 Serial object #include <SoftwareSerial.h> SoftwareSerial EspSerial(2, 3); // RX, TX ESP8266 wifi(EspSerial); // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "caa17a11c0124d4083d0eaa995f45917"; function we initialise all the required devices, like giving direction to motor pins, begin serial communication, providing Wi-Fi username and password. void setup() { // Set console baud rate Serial.begin(9600); delay(10); // Set ESP8266 baud rate // 9600 is recommended for Software Serial EspSerial.begin(9600); delay(10); Blynk.begin(auth, wifi, "username", "password"); // wifi username and password pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); pinMode(m21, OUTPUT); pinMode(m22, OUTPUT); } to control the robot. As we have used marge option in app so we will get x and y axis values at same pin. BLYNK_WRITE(V1) { int x = param[0].asInt(); int y = param[1].asInt(); if(y>220) forward(); else if(y<35) backward(); else if(x>220) right(); else if(x<35) left(); else Stop(); } in loop, to run the system. void loop() { Blynk.run(); } Code #define BLYNK_PRINT Serial // Comment this out to disable prints and save space #include <ESP8266_SoftSer.h> #include <BlynkSimpleShieldEsp8266_SoftSer.h> // Set ESP8266 Serial object #include <SoftwareSerial.h> SoftwareSerial EspSerial(2, 3); // RX, TX ESP8266 wifi(EspSerial); // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "caa17a11c0124d4083d0eaa995f45917"; #define m11 8 #define m12 9 #define m21 10 #define m22 11 void forward() { digitalWrite(m11, HIGH); digitalWrite(m12,LOW); digitalWrite(m21,HIGH); digitalWrite(m22,LOW); } void backward() { digitalWrite(m11, LOW); digitalWrite(m12,HIGH); digitalWrite(m21,LOW); digitalWrite(m22,HIGH); } void right() { digitalWrite(m11, HIGH); digitalWrite(m12,LOW); digitalWrite(m21,LOW); digitalWrite(m22,LOW); } void left() { digitalWrite(m11, LOW); digitalWrite(m12,LOW); digitalWrite(m21,HIGH); digitalWrite(m22,LOW); } void Stop() { digitalWrite(m11, LOW); digitalWrite(m12,LOW); digitalWrite(m21,LOW); digitalWrite(m22,LOW); } void setup() { // Set console baud rate Serial.begin(9600); delay(10); // Set ESP8266 baud rate // 9600 is recommended for Software Serial EspSerial.begin(9600); delay(10); Blynk.begin(auth, wifi, "username", "password"); // wifi username and password pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); pinMode(m21, OUTPUT); pinMode(m22, OUTPUT); } BLYNK_WRITE(V1) { int x = param[0].asInt(); int y = param[1].asInt(); // Do something with x and y /* Serial.print("X = "); Serial.print(x); Serial.print("; Y = "); Serial.println(y);*/ if(y>220) forward(); else if(y<35) backward(); else if(x>220) right(); else if(x<35) left(); else Stop(); } void loop() { Blynk.run(); } Video microcontroller-projects/arduino-capacitance-meter-circuit

Capacitance Meter using Arduino

.

Required Components:

555 timer IC IC 74HC14 Schmitt trigger gate or NOT gate. 1K resistor (2 pieces), 10K resistor 100nF capacitor, 1000μF capacitor 16*2 LCD, Breadboard and some connectors.

Circuit Explanation:

to display the measured Capacitance of capacitor. A Square wave Generator Circuit (555 in Astable mode) is connected to Arduino, where we have connected the Capacitor whose capacitance needs to be measured. A Schmitt trigger gate (IC 74LS14) is used to ensure that only rectangular wave is fed to Arduino. For filtering the noise we have added couple of capacitors across power.

555 Timer IC Based Square Wave Generator:

We know that the capacitance of a capacitor cannot be measured directly in a digital circuit, in other words the UNO deals with digital signals and it cannot measure capacitance directly. So we use 555 square wave generator circuit for linking the capacitor to digital world. Simply speaking, the timer provides square wave output whose frequency directly implicates to the capacitance connected to it. So first we get the square wave signal whose frequency is the representative of the capacitance of the unknown capacitor, and feed this signal to UNO for getting the appropriate value. as a shown in below figure: The output signal frequency depends on RA, RB resistors and capacitor C. The equation is given as, Frequency (F) = 1/ (Time period) = 1.44/ ((RA+RB*2)*C). Here RA and RB are resistance values and C is capacitance value. By putting the resistance and capacitance values in above equation we get the frequency of output square wave. We are going to connect 1K as RA and 10K as RB. So the formula becomes, Frequency (F) = 1/ (Time period) = 1.44/ (21000*C). By rearranging the terms we have, In our Program Code (see below), for getting the capacitance value accurately we have calculated the result in nF by multiplying the obtained results (in farads) with ᾱ000000000ᾮ Also we have used ᾲ0800ᾠinstead of 21000, because the accurate resistances of RA and RB are 0.98K and 9.88K. So if we know the frequency of the square wave we can get the capacitance value.

Schmitt Trigger Gate:

The signals generated by the timer circuit are not completely safe to be directly given to the Arduino Uno. With the sensitivity of UNO in mind, we use Schmitt trigger gate. Schmitt trigger gate is a digital logic gate. in it. These SIX gates are connected internally as shown in below figure. is show in below figure, with this we have to program the UNO for inverting the positive and negative time periods at its terminals. We connect the signal generated by timer circuit to ST gate, we will have rectangular wave of inverted time periods at the output which is safe to be given to UNO.

Arduino measures the Capacitance:

which enables us to determine the positive state duration or negative state duration of a particular rectangular wave: Htime=pulseIn(8,HIGH); Ltime = pulseIn(8, LOW); function measures this High time (Htime) and Low Time (Ltime) in micro seconds. When we add Htime and Ltime together we will have the Cycle Duration, and by inverting it we will have the Frequency. Once we have the frequency, we can get the capacitance by using the formula we discussed earlier.

Summary and Testing:

So in summary, we connect the unknown capacitor to the 555 timer circuit, which generates a square wave output whose frequency is directly related to capacitance of capacitor. This signal is given to UNO through ST gate. The UNO measures the frequency. With frequency known, we program the UNO to calculate the capacitance by using formula discussed earlier. Let’s see some results I got, So that is how we can simply measure the Capacitance of any capacitor. Code #include <LiquidCrystal.h> LiquidCrystal lcd(2, 3, 4, 5, 6, 7); int32_t Htime; int32_t Ltime; float Ttime; float frequency; float capacitance; void setup() { pinMode(8,INPUT); //pin 8 as signal input lcd.begin(16, 2); lcd.setCursor(0,0); lcd.print("capacitance ="); } void loop() { for (int i=0;i<5;i++) //measure time duration five times { Ltime=(pulseIn(8,HIGH)+Ltime)/2; //get average for each cycle Htime=(pulseIn(8,LOW)+Htime)/2; } Ttime = Htime+Ltime; frequency=1000000/Ttime; capacitance = (1.44*1000000000)/(20800*frequency); //calculating the Capacitance in nF lcd.setCursor(0,1); lcd.print(capacitance); lcd.print(" nF "); delay(500); } Video microcontroller-projects/sending-email-using-arduino-and-esp8266-wi-fi-module

Sending Email using Arduino and ESP8266 WiFi Module

ᾮ For sending Email via Wi-Fi module and Arduino, first of all we need to have an Email account. So user can create email account at smtp2go.com. After signup, remember your new email address and password. We can understand the whole process in below Steps: Arduino UNO ESP8266 Wi-Fi module USB Cable Laptop 16x2 LCD (optional) 10K POT (optional) Power supply Connecting wires In this step we will connect ESP8266 Wi-Fi module with Arduino and give it power supply from 3.3v pin of Arduino. ). smtp2go.com provides the email services, to send the emails using outgoing email server. We will need Username and Password in base64 encoded format with utf-8 character set. For converting the Email and Password in base64 encoded format use below given link. Keep the encoded username and password handy, we need it in our program to login at smtp2go.com. Now start writing code for sending Email. ‘Programming Explanationᾠand Code is given at the end.

Circuit Explanation:

A 16x2 LCD is also connected for displaying the status messages. This LCD is optional. ESP8266’s Vcc and GND pins are directly connected to 3.3V and GND of Arduino and CH_PD is also connected with 3.3V. Tx and Rx pins of ESP8266 are directly connected to pin 2 and 3 of Arduino. And Pin 2 of Arduino is also shorted with Tx pin (Pin 1) of Arduino. This pin is shorted for displaying response of ESP8266 directly on Serial monitor of Arduino. Software Serial Library is used to allow serial communication on pin 2 and 3 of Arduino. Note: For watching the response of ESP8266 on Serial Monitor, don’t initialise the Serial.begin(9600) function.

Programming Explanation:

1.In programming part first we include libraries and define pins for LCD & software serial communication. By default Pin 0 and 1 of Arduino are used for serial communication but by usingSoftwareSeriallibrary, we can allow serial communication on other digital pins of the Arduino. Function is defined to Connect the Wi-Fi module to the Internet. void connect_wifi(String cmd, int t) { int temp=0,i=0; while(1) { Serial1.println(cmd); while(Serial1.available()) { if(Serial1.find("OK")) ... .... .... ... ..... 3. After it connect module to SMTP server by using given commands: lcd.print("Configuring Email.."); Serial1.println("AT+CIPSTART=4,\"TCP\",\"mail.smtp2go.com\",2525"); delay(2000); Serial1.println("AT+CIPSEND=4,20"); delay(2000); Serial1.println("EHLO 192.168.1.123"); delay(2000); Serial1.println("AT+CIPSEND=4,12"); Note: Many email servers will not accept email from a non-commercial, dhcp-issued ip address. 4. Now we will try to Login at smtp2go.co, using the base64 encoded User name and password, which we have derived in Step 4 above. lcd.print("Try To Login....."); Serial1.println("AUTH LOGIN"); delay(2000); Serial1.println("AT+CIPSEND=4,30"); delay(2000); Serial1.println("c2FkZGFtNDIwMUBnbWFpbC5jb20="); //base64 encoded username delay(2000); Serial1.println("AT+CIPSEND=4,18"); delay(2000); Serial1.println("Y2lyY3VpdDQyMDE="); //base64 encoded password 5. After this, enter your main message that user want to send. And send this email by ending line (sending) ᾮᾍ Serial1.println("Testing Success"); delay(2000); Serial1.println("AT+CIPSEND=4,3"); delay(2000); Serial1.println('.'); delay(10000); Serial1.println("AT+CIPSEND=4,6"); delay(2000); Serial1.println("QUIT"); ... ..... ....... Other functions and Code are self-explanatory and easy to understand. Code #include<LiquidCrystal.h> LiquidCrystal lcd(14,15,16,17,18,19); #include <SoftwareSerial.h> SoftwareSerial Serial1(2, 3); // RX, TX boolean No_IP=false; String IP=""; void check4IP(int t1) { int t2=millis(); Serial1.flush(); while(t2+t1>millis()) { while(Serial1.available()>0) { if(Serial1.find("WIFI GOT IP")) { No_IP=true; } } } } void get_ip() { IP=""; char ch=0; while(1) { Serial1.println("AT+CIFSR"); while(Serial1.available()>0) { if(Serial1.find("STAIP,")) { delay(1000); Serial.print("IP Address:"); while(Serial1.available()>0) { ch=Serial1.read(); if(ch=='+') break; IP+=ch; } } if(ch=='+') break; } if(ch=='+') break; delay(1000); } Serial.print(IP); Serial.print("Port:"); Serial.println(80); } void connect_wifi(String cmd, int t) { int temp=0,i=0; while(1) { Serial1.println(cmd); while(Serial1.available()) { if(Serial1.find("OK")) i=8; } delay(t); if(i>5) break; i++; } if(i==8) Serial.println("OK"); else Serial.println("Error"); } void setup() { Serial1.begin(9600); // Serial.begin(9600); lcd.begin(16,2); lcd.print("Sending Email by"); lcd.setCursor(0,1); lcd.print(" Arduino & WIFI "); delay(2000); lcd.clear(); lcd.print(" Circuit Digest "); delay(2000); lcd.clear(); lcd.print("Finding ESP8266"); connect_wifi("AT",100); connect_wifi("ATE1",100); lcd.clear(); lcd.print("Connected"); delay(1000); connect_wifi("AT+CWMODE=3",100); connect_wifi("AT+CWQAP",100); connect_wifi("AT+RST",5000); lcd.clear(); lcd.print("Connecting WiFi"); check4IP(5000); if(!No_IP) { Serial.println("Connecting Wifi...."); connect_wifi("AT+CWJAP=\"1st floor\",\"muda1884\"",7000); //provide your WiFi username and password here } else { } lcd.clear(); lcd.print("WIFI Connected..."); Serial.println("Wifi Connected"); delay(1000); lcd.clear(); lcd.print("Getting IP Add."); Serial.println("Getting IP Address...."); get_ip(); delay(1000); lcd.clear(); lcd.print("IP:"); lcd.print(IP); lcd.setCursor(0,1); lcd.print("PORT: 80"); connect_wifi("AT+CIPMUX=1",100); connect_wifi("AT+CIPSERVER=1,80",100); delay(2000); lcd.clear(); lcd.print("Configuring Email.."); Serial1.println("AT+CIPSTART=4,\"TCP\",\"mail.smtp2go.com\",2525"); delay(2000); Serial1.println("AT+CIPSEND=4,20"); delay(2000); Serial1.println("EHLO 192.168.1.123"); delay(2000); Serial1.println("AT+CIPSEND=4,12"); delay(2000); lcd.clear(); lcd.print("Try To Login....."); Serial1.println("AUTH LOGIN"); delay(2000); Serial1.println("AT+CIPSEND=4,30"); delay(2000); Serial1.println("c2FkZGFtNDIwMUBnbWFpbC5jb20="); //base64 encoded username delay(2000); Serial1.println("AT+CIPSEND=4,18"); delay(2000); Serial1.println("Y2lyY3VpdDQyMDE="); //base64 encoded password lcd.clear(); lcd.print("Login Success"); delay(2000); Serial1.println("AT+CIPSEND=4,34"); delay(2000); Serial1.println("MAIL FROM:<saddam4201@gmail.com>"); // use your email address delay(2000); Serial1.println("AT+CIPSEND=4,32"); delay(2000); lcd.clear(); lcd.print("Seniding Email 2"); lcd.setCursor(0,1); lcd.print("Saddam4201@gmail"); Serial1.println("RCPT To:<saddam4201@gmail.com>"); delay(2000); Serial1.println("AT+CIPSEND=4,6"); delay(2000); Serial1.println("DATA"); delay(2000); Serial1.println("AT+CIPSEND=4,24"); delay(2000); Serial1.println("Testing Success"); delay(2000); Serial1.println("AT+CIPSEND=4,3"); delay(2000); Serial1.println('.'); delay(10000); Serial1.println("AT+CIPSEND=4,6"); delay(2000); Serial1.println("QUIT"); delay(2000); lcd.clear(); lcd.print("Email Sent..."); } void loop() { } Video microcontroller-projects/gui-based-home-automation-using-matlab-and-arduino

GUI Based Home Automation System using Arduino and MATLAB

, please check: DTMF Based Home Automation GSM Based Home Automation using Arduino PC Controlled Home Automation using Arduino Bluetooth Controlled Home Automation using 8051 IR Remote Controlled Home Automation using Arduino

Components:

Arduino UNO USB Cable ULN2003 Relay 5 volt Bulb with holder Connecting wires Laptop Power supply PVT

Working Explanation:

ᾮ To do so follow the below steps or check the video below: Download the Arduino IO Package from here. You need to Sign up before download. Then Burn/upload the adioe.pde file to the Arduino using Arduino IDE. This adioe.pde file can be found in Arduino IO Package ᾠArduinoIO\pde\adioe\adioe.pde Then open the MATLAB software, go through the Arduino IO folder, open the install_arduino.m file and Run it in Matlab. You will see a message of “Arduino folders added to the pathᾠin command window of MATLAB, means MATLAB path is updated to Arduino folders. That’s how we make the Arduino, communicate with MATLAB. Above method is suitable for “MATLAB R2013b or earlier versionsᾬ if you are using the higher version of MATLAB (like R2015b or R2016a), you can directly click on Add-ons Tab in MATLAB and then click “Get Hardware Support Packagesᾬ from where you can install Arduino packages for MATLAB. for controlling the home appliances from computer. Buttons can be created by going into “Graphical User Interfaceᾠin “Newᾠmenu in MATLAB. Further we can set the name and colours of these buttons, we have created 8 buttons, in which six to ON and OFF three home appliances and two buttons to ON and OFF all the appliances simultaneously. (right clickand select Save link as...), or you can create them yourself like we have explained. After coding you can now finally Run the .m file from the code window, you will see “Attempting connection..ᾠin the command window. Then a “Arduino successfully connectedᾠmessage appears, if everything goes well. And finally you will see previously created GUI (buttons) in GUI window, from where you can control the home appliances by just clicking on the buttons in your Computer. Make sure that Arduino is connected to Arduino via USB cable. Here in this project we have used 3 bulbs for demonstration, which indicates Fan, Light and TV. Working of the wholeproject, from installing the Arduino MATLAB support package to Turn On or OFF the appliance, can be understood at the Video at the end.

Circuit Explanation:

for driving relays. Three 5 volt SPDT Relays are connected to Arduino pin number 3, 4 and 5, through relay driver ULN2003, for controlling LIGHT, FAN and TV respectively.

Programming Explanation:

When we press any button from the GUI window then it sends some commands to Arduino and then Arduino do that operation. After installing Arduino MATLAB IO support package, we can access Arduino from the MATLAB by using the same Arduino functions, with some little variation, like: In MATLAB we will use this function with the help of an object or variable like, and likewise so on. Before doing this we have to initialise variable like this: In this project, there is no Arduino code except the Arduino MATLAB support package code or file. As explained earlier that code file (.m file) is automatically generated while saving the GUI file (.fig file). There is already some code prewritten in .m file. Basically these are Callback functions for Push buttons, means we can define what should happen on clicking on these Push Buttons. In MATLAB code, first we initialise serial port and make it an object by using a variable. And then we can start programming like Arduino using the variable. clear ar; global ar; ar=arduino('COM13'); ar.pinMode(3, 'OUTPUT'); ar.pinMode(4, 'OUTPUT'); ar.pinMode(5, 'OUTPUT'); ar.pinMode(13, 'OUTPUT'); In the call back function of each button, we have written the related code for On or OFF the respective Home Appliances, connected to Arduino via Relay. Like for example, Callback function for Light ON is given below: function light_on_Callback(hObject, eventdata, handles) % hObject handle to light_on (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global ar; ar.digitalWrite(3, 1); ar.digitalWrite(13, 1); Likewise we can write the code in the Callback functions of all the buttons, to control the other connected Home Appliances, check the full MATLAB Code below (.m file). Code function varargout = Home_Automation_system(varargin) % HOME_AUTOMATION_SYSTEM MATLAB code for Home_Automation_system.fig % HOME_AUTOMATION_SYSTEM, by itself, creates a new HOME_AUTOMATION_SYSTEM or raises the existing % singleton*. % % H = HOME_AUTOMATION_SYSTEM returns the handle to a new HOME_AUTOMATION_SYSTEM or the handle to % the existing singleton*. % % HOME_AUTOMATION_SYSTEM('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in HOME_AUTOMATION_SYSTEM.M with the given input arguments. % % HOME_AUTOMATION_SYSTEM('Property','Value',...) creates a new HOME_AUTOMATION_SYSTEM or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before Home_Automation_system_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to Home_Automation_system_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help Home_Automation_system % Last Modified by GUIDE v2.5 28-Feb-2016 01:59:17 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @Home_Automation_system_OpeningFcn, ... 'gui_OutputFcn', @Home_Automation_system_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before Home_Automation_system is made visible. function Home_Automation_system_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to Home_Automation_system (see VARARGIN) % Choose default command line output for Home_Automation_system handles.output = hObject; % Update handles structure guidata(hObject, handles); clear ar; global ar; ar=arduino('COM13'); ar.pinMode(3, 'OUTPUT'); ar.pinMode(4, 'OUTPUT'); ar.pinMode(5, 'OUTPUT'); ar.pinMode(13, 'OUTPUT'); % UIWAIT makes Home_Automation_system wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Home_Automation_system_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on button press in light_on. function light_on_Callback(hObject, eventdata, handles) % hObject handle to light_on (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global ar; ar.digitalWrite(3, 1); ar.digitalWrite(13, 1); % --- Executes on button press in light_off. function light_off_Callback(hObject, eventdata, handles) % hObject handle to light_off (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global ar; ar.digitalWrite(3, 0); ar.digitalWrite(13, 0); % --- Executes on button press in fan_on. function fan_on_Callback(hObject, eventdata, handles) % hObject handle to fan_on (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global ar; ar.digitalWrite(4, 1); % --- Executes on button press in fan_off. function fan_off_Callback(hObject, eventdata, handles) % hObject handle to fan_off (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global ar; ar.digitalWrite(4, 0); % --- Executes on button press in tv_on. function tv_on_Callback(hObject, eventdata, handles) % hObject handle to tv_on (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global ar; ar.digitalWrite(5, 1); % --- Executes on button press in tv_off. function tv_off_Callback(hObject, eventdata, handles) % hObject handle to tv_off (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global ar; ar.digitalWrite(5, 0); % --- Executes on button press in all_on. function all_on_Callback(hObject, eventdata, handles) % hObject handle to all_on (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global ar; ar.digitalWrite(3, 1); ar.digitalWrite(4, 1); ar.digitalWrite(5, 1); % --- Executes on button press in all_off. function all_off_Callback(hObject, eventdata, handles) % hObject handle to all_off (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global ar; ar.digitalWrite(3, 0); ar.digitalWrite(4, 0); ar.digitalWrite(5, 0); Video microcontroller-projects/arduino-gps-clock

Arduino GPS Clock

is very accurate and provides the real time data with precision of milliseconds.

Components:

Arduino Uno GPS Module 16x2 LCD Connecting wires Power supply

Working Explanation:

to find the Latitude and Longitude Coordinates. Here is the GPS output: mainly contains velocity, time, date and position $GPRMC,123519.000,A,7791.0381,N,06727.4434,E,022.4,084.4,230394,003.1,W*6A $GPRMC,HHMMSS.SSS,A,latitude,N,longitude,E,speed,angle,date,MV,W,CMD
RMCRecommended Minimum sentence C
HHMMSS.SSSTime in hour minute seconds and milliseconds format.
AStatus // A=active and V= void
LatitudeLatitude 49 deg. 16.45 min. North
NDirection N=North, S=South
LongitudeLongitude(Coordinate)
EDirection E= East, W=West
Speedspeed in knots
AngleTracking angle in degrees
DateDATE in UTC
MVMagnetic Variation
WDirection of variation E/W
CMD (*6A)Checksum Data
We can extract Time and Date from $GPRMC string by counting the commas in the string. With the help of Arduino and programming, we find $GPRMC string and stores it in an array, then Time (24 hours format) can be found after one comma and Date can be found after nine commas. Time and date are further saved in strings. A GPS satellite provides Time and date in Coordinated Universal Time (UTC), so we need to convert it accordingly. To convert in according to Indian time, we have added 5:30 in UTC time, as Indian time is 5 and half hours ahead of UTC/GMT.

Circuit Diagram:

are simple. Arduino is used to control the whole process, it receives the GPS data from satellite through GPS module, extracts the Date and Time from the $GPRMC string and shows it on LCD.

Programming Explanation:

here, we have allowed serial communication on pin 10 and 11, and made them Rx and Tx respectively. By default Pin 0 and 1 of Arduino are used for serial communication but by usingSoftwareSeriallibrary, we can allow serial communication on other digital pins of the Arduino #include<LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); #include <SoftwareSerial.h> SoftwareSerial Serial1(10, 11); // RX, TX ... .... .... .... function and showed a welcome message on LCD. Then we have extracted time and date form the received string. while(x<str_lenth) { if(str[x]==',') comma++; if(comma==1) { x++; UTC_hour+=str[x++]; ... .... .... .... And then convert time and date to decimal and modify it to Indian time (UTC +5:30) int UTC_hourDec=UTC_hour.toInt(); int UTC_minutDec=UTC_minut.toInt(); int Second=UTC_second.toInt(); int Date=UTC_date.toInt(); int Month=UTC_month.toInt(); ... .... .... .... function, check the full Code below. Code #include<LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); #include <SoftwareSerial.h> SoftwareSerial Serial1(10, 11); // RX, TX char str[70]; char *test="$GPRMC"; int temp,i; void setup() { lcd.begin(16,2); Serial1.begin(9600); lcd.setCursor(0,0); lcd.print("GPS Updated Clock"); lcd.setCursor(0,1); lcd.print(" Circuit Digest "); delay(300); } void loop() { serial1Event(); if (temp) { lcd.clear(); int str_lenth=i; int x=0,comma=0; String UTC_hour=""; String UTC_minut=""; String UTC_second=""; String UTC_date=""; String UTC_month=""; String UTC_year=""; String str1=""; while(x<str_lenth) { if(str[x]==',') comma++; if(comma==1) { x++; UTC_hour+=str[x++]; UTC_hour+=str[x++]; UTC_minut+=str[x++]; UTC_minut+=str[x++]; UTC_second+=str[x++]; UTC_second+=str[x]; comma=2; } if(comma==10) { x++; UTC_date+=str[x++]; UTC_date+=str[x++]; UTC_month+=str[x++]; UTC_month+=str[x++]; UTC_year+=str[x++]; UTC_year+=str[x]; } x++; } int UTC_hourDec=UTC_hour.toInt(); int UTC_minutDec=UTC_minut.toInt(); int Second=UTC_second.toInt(); int Date=UTC_date.toInt(); int Month=UTC_month.toInt(); int Year=UTC_year.toInt(); int Hour=UTC_hourDec+5; if(Hour>23) { Hour-=24; Date+=1; } int Minut=UTC_minutDec+30; if(Minut>59) Minut-=60; // UTC_ind_zone_time lcd.clear(); lcd.print("Date: "); lcd.print(Date); lcd.print("/"); lcd.print(Month); lcd.print("/"); lcd.print("20"); lcd.print(Year); lcd.setCursor(0,1); lcd.print("Time: "); lcd.print(Hour); lcd.print(":"); lcd.print(Minut); lcd.print(":"); lcd.print(Second); // delay(100); temp=0; // j=0; i=0; x=0; str_lenth=0; // k=0; } // delay(1000); } void serial1Event() { while(1) { while (Serial1.available()) //checking serial data from GPS { char inChar = (char)Serial1.read(); str[i]= inChar; //store data from GPS into str[] i++; if (i < 7) { if(str[i-1] != test[i-1]) //checking for $GPRMC sentence { i=0; } } if(i>65) { temp=1; break; } } if(temp) break; } } Video microcontroller-projects/reading-gps-data-using-computer-and-arduino

How to Use GPS with Arduino

? We can easily get the GPS data directly into our computer using Arduino. and used to detect the Latitude and Longitude of any location on the Earth, with exact UTC time (Universal Time Coordinated). This device receives the coordinates from the satellite for each and every second, with time and date. GPS offers great accuracy and also provides other data besides position coordinates, we will into look it shortly. and 12v/3.3v adaptor for power supply. Here we have used GPS receiver Module SKG13BL (shown in above figure). (Atmega chip) from the Arduino Board, as we only need the serial circuitry of the Arduino. This is called the Gateway mode. Removing the IC is shown in below figures: Now do the connection like given in below picture: GPS TX pin to Digital PIN 1 of Arduino (TXD) GPS Ground Pin to GND PIN of Arduino GPS Power (3.3v) Pin to 3.3v PIN of Arduino After connections, connect the USB cable to the computer,open your Arduino IDE software in computer, select com port and open serial monitor to listen the serial port and Power up the Arduino and GPS module. Now you will see GPS data on Arduino Serial Monitor Window like below. Below are two snapshots, first one is, when GPS is not in range and second one is, when GPS in range. $GPGGA: Global Positioning System Fix Data $GPGSV: GPS satellites in view $GPGSA: GPS DOP and active satellites $GPRMC: Recommended minimum specific GPS/Transit data These strings contain many GPS parameters like: Time, Date, Longitude, Latitude, speed, no. of satellites in used, altitude and many other things. For any location coordinates and time, we can use $GPGGA and $GPRMC. For Date and time we can use $GPRMC string. Only $GPGGA (Global Positioning System Fix Data) String is mostly used in programs and other strings are ignored. This string consist fix data as below: $GPGGA,104534.000,7791.0381,N,06727.4434,E,1,08,0.9,510.4,M,43.9,M,,*47 $GPGGA,HHMMSS.SSS,latitude,N,longitude,E,FQ,NOS,HDP,altitude,M,height,M,,checksum data
$GPGGAGlobal Positioning system fix data
HHMMSS.SSSTime in hour minute seconds and milliseconds format.
LatitudeLatitude (Coordinate)
NDirection N=North, S=South
LongitudeLongitude(Coordinate)
EDirection E= East, W=West
FQFix Quality Data
NOSNo. of Satellites being Used
HDPHorizontal Dilution of Precision
AltitudeAltitude (meters above from sea level)
MMeter
HeightHeight
ChecksumChecksum Data
mainly contains velocity, time, date and position $GPRMC,123519.000,A, 7791.0381,N, 06727.4434,E,022.4,084.4,230394,003.1,W*6A $GPRMC,HHMMSS.SSS,A,latitude,N,longitude,E,speed,angle,date,MV,W,CMD
RMCRecommended Minimum sentence C
HHMMSS.SSSTime in hour minute seconds and milliseconds format.
AStatus // A=active and V= void
LatitudeLatitude 49 deg. 16.45 min. North
NDirection N=North, S=South
LongitudeLongitude(Coordinate)
EDirection E= East, W=West
Speedspeed in knots
AngleTracking angle in degrees
DateTime stamp (Date in UTC)
MVMagnetic Variation
WDirection of variation E/W
CMD (*6A)Checksum Data
Mostly this string is used for taking time, date and speed. Video microcontroller-projects/vehicle-tracking-system-using-arduino-gps-and-gsm

Arduino based Vehicle Tracker using GPS and GSM

and can also be used as Accident Detection Alert System, Soldier Tracking System and many more, by just making few changes in hardware and software. previously, you can check them out if interested GPSVehicle Tracking and Accident Alert using Arduino Vehicle Tracking with Google Maps using Arduino and ESP8266 GPSVehicle Tracking and Accident Alert using MSP430 LoRa based GPS Vehicle Tracking using Arduino Location Tracker without GPS using SIM800 and Arduino

Components Required for Arduino based Vehicle Tracking system:

To build a simple vehicle tracking system suing Arduino we will need the following components. ArduinoUNO GSM Module GPS Module 16x2 LCD Power Supply Connecting Wires 10 K POT

Howcan GSM Module be used to track location:

and used to detect the Latitude and Longitude of any location on the Earth, with exact UTC time (Universal Time Coordinated). GPS module is the main component in our vehicle tracking system project. This device receives the coordinates from the satellite for each and every second, with time and date. We can extract coordinate from $GPGGA string by counting the commas in the string. Suppose you find $GPGGA string and stores it in an array, then Latitude can be found after two commas and Longitude can be found after four commas. Now these latitude and longitude can be put in other arrays. Below is the $GPGGA String, along with its description: $GPGGA,HHMMSS.SSS,latitude,N,longitude,E,FQ,NOS,HDP,altitude,M,height,M,,checksum data
$GPGGAGlobal Positioning system fix data
HHMMSS.SSSTime in hour minute seconds and milliseconds format.
LatitudeLatitude (Coordinate)
NDirection N=North, S=South
LongitudeLongitude(Coordinate)
EDirection E= East, W=West
FQFix Quality Data
NOSNo. of Satellites being Used
HPDHorizontal Dilution of Precision
AltitudeAltitude from sea level
MMeter
HeightHeight
ChecksumChecksum Data

Circuit Explanation for Interfacing GSM and GPS with Arduino:

here, we have allowed serial communication on pin 10 and 11, and made them Rx and Tx respectively and left the Rx pin of GPS Module open. By default Pin 0 and 1 of Arduino are used for serial communication but by usingSoftwareSeriallibrary, we can allow serial communication on other digital pins of the Arduino. 12 Volt supply is used to power the GPS Module. GSM module’s Tx and Rx pins of are directly connected to pin Rx and Tx of Arduino. GSM module is also powered by 12v supply. An optional LCD’s data pins D4, D5, D6 and D7 are connected to pin number 5, 4, 3, and 2of Arduino. Command pin RS and EN of LCD are connected with pin number 2 and 3 of Arduino and RW pin is directly connected with ground. A Potentiometer is also used for setting contrast or brightness of LCD.

GSM and GPS based Vehicle Tracking system using Arduino - Working

GPS Receiver is used for detecting coordinates of the vehicle, GSM module is used for sending the coordinates to user by SMS. And an optional 16x2 LCD is also used for displaying status messages or coordinates. We have used GPS Module SKG13BL and GSM Module SIM900A. Sent message is received by GSM module which is connected to the system and sends message data to Arduino. Arduino reads it and extract main message from the whole message. And then compare it with predefined message in Arduino. If any match occurs then Arduino reads coordinates by extracting $GPGGA String from GPS module data (GPS working explained above) and send it to user by using GSM module. This message contains the coordinates of vehicle location.

GAM and GPS Interfacing with Arduino Code to Track Vehicle Location

In programming part first we include libraries and define pins for LCD & software serial communication. Also define some variable with arrays for storing data. Software Serial Library is used to allow serial communication on pin 10 and 11. #include<LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); #include <SoftwareSerial.h> SoftwareSerial gps(10,11); // RX, TX char str[70]; String gpsString=""; ... .... .... .... is used to compare the right string that we need for coordinates. After it we have initialized serial communication, LCD, GSM & GPS module in setup function and showed a welcome message on LCD. void setup() { lcd.begin(16,2); Serial.begin(9600); gps.begin(9600); lcd.print("Vehicle Tracking"); lcd.setCursor(0,1); ... .... .... .... In loop function we receive message and GPS string. void loop() { serialEvent(); if(temp) { get_gps(); tracking(); } } function. has been used to extract the coordinates from the received string. is used for receiving GPS data into the Arduino. is used for receiving message from GSM and comparing the received message with predefined message (Track Vehicle). void serialEvent() { while(Serial.available()) { if(Serial.find("Track Vehicle")) { temp=1; break; } ... .... .... ... is used for initialising and configuring the GSM Module, where firstly, GSM module is checked whether it is connected or not by sending ‘ATᾠcommand to GSM module. If response OK is received, means it is ready. System keeps checking for the module until it becomes ready or until ‘OKᾠis received. Then ECHO is turned off by sending the ATE0 command, otherwise GSM module will echo all the commands. Then finally Network availability is checked through the ‘AT+CPIN?ᾠcommand, if inserted card is SIM card and PIN is present, it gives the response +CPIN: READY. This is also check repeatedly until the network is found. This can be clearly understood by the Video below. Check all the above functions in Code Section below. Code #include<LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); #include <SoftwareSerial.h> SoftwareSerial gps(10,11); // RX, TX //String str=""; char str[70]; String gpsString=""; char *test="$GPGGA"; String latitude="No Range "; String longitude="No Range "; int temp=0,i; boolean gps_status=0; void setup() { lcd.begin(16,2); Serial.begin(9600); gps.begin(9600); lcd.print("Vehicle Tracking"); lcd.setCursor(0,1); lcd.print(" System "); delay(2000); gsm_init(); lcd.clear(); Serial.println("AT+CNMI=2,2,0,0,0"); lcd.print("GPS Initializing"); lcd.setCursor(0,1); lcd.print(" No GPS Range "); get_gps(); delay(2000); lcd.clear(); lcd.print("GPS Range Found"); lcd.setCursor(0,1); lcd.print("GPS is Ready"); delay(2000); lcd.clear(); lcd.print("System Ready"); temp=0; } void loop() { serialEvent(); if(temp) { get_gps(); tracking(); } } void serialEvent() { while(Serial.available()) { if(Serial.find("Track Vehicle")) { temp=1; break; } else temp=0; } } void gpsEvent() { gpsString=""; while(1) { while (gps.available()>0) //checking serial data from GPS { char inChar = (char)gps.read(); gpsString+= inChar; //store data from GPS into gpsString i++; if (i < 7) { if(gpsString[i-1] != test[i-1]) //checking for $GPGGA sentence { i=0; gpsString=""; } } if(inChar=='\r') { if(i>65) { gps_status=1; break; } else { i=0; } } } if(gps_status) break; } } void gsm_init() { lcd.clear(); lcd.print("Finding Module.."); boolean at_flag=1; while(at_flag) { Serial.println("AT"); while(Serial.available()>0) { if(Serial.find("OK")) at_flag=0; } delay(1000); } lcd.clear(); lcd.print("Module Connected.."); delay(1000); lcd.clear(); lcd.print("Disabling ECHO"); boolean echo_flag=1; while(echo_flag) { Serial.println("ATE0"); while(Serial.available()>0) { if(Serial.find("OK")) echo_flag=0; } delay(1000); } lcd.clear(); lcd.print("Echo OFF"); delay(1000); lcd.clear(); lcd.print("Finding Network.."); boolean net_flag=1; while(net_flag) { Serial.println("AT+CPIN?"); while(Serial.available()>0) { if(Serial.find("+CPIN: READY")) net_flag=0; } delay(1000); } lcd.clear(); lcd.print("Network Found.."); delay(1000); lcd.clear(); } void get_gps() { gps_status=0; int x=0; while(gps_status==0) { gpsEvent(); int str_lenth=i; latitude=""; longitude=""; int comma=0; while(x<str_lenth) { if(gpsString[x]==',') comma++; if(comma==2) //extract latitude from string latitude+=gpsString[x+1]; else if(comma==4) //extract longitude from string longitude+=gpsString[x+1]; x++; } int l1=latitude.length(); latitude[l1-1]=' '; l1=longitude.length(); longitude[l1-1]=' '; lcd.clear(); lcd.print("Lat:"); lcd.print(latitude); lcd.setCursor(0,1); lcd.print("Long:"); lcd.print(longitude); i=0;x=0; str_lenth=0; delay(2000); } } void init_sms() { Serial.println("AT+CMGF=1"); delay(400); Serial.println("AT+CMGS=\"+91**********\""); // use your 10 digit cell no. here delay(400); } void send_data(String message) { Serial.println(message); delay(200); } void send_sms() { Serial.write(26); } void lcd_status() { lcd.clear(); lcd.print("Message Sent"); delay(2000); lcd.clear(); lcd.print("System Ready"); return; } void tracking() { init_sms(); send_data("Vehicle Tracking Alert:"); send_data("Your Vehicle Current Location is:"); Serial.print("Latitude:"); send_data(latitude); Serial.print("Longitude:"); send_data(longitude); send_data("Please take some action soon..\nThankyou"); send_sms(); delay(2000); lcd_status(); } Video microcontroller-projects/arduino-snake-game-using-8x8-led-matrix

Snake Game on 8x8 Matrix using Arduino

has been very popular since the beginning of the Mobile phones. Initially it was come in Black and white cell phones, and soon became very famous. Then with the advancement of the Cellphones, this game has also changed a lot, and now many graphical and colourful versions of this game are available. , with all its basic functionalities, while keeping it simple at the same time.

Components Used:

Arduino UNO 8x8 LED Dot Matrix Display Shift Register 74HC595 16x2 LCD POT 1K Push Buttons Connecting wires Bread Board Power Supply

Working Explanation:

with its original image has been given below: When we power up the circuit, first we show a welcome message and then a “Press Start To Playᾠhint on the LCD. After this, LCD shows the score as zero and dot matrix display shows two dots as snake and a single dot as food. Now user need to press the middle button to start the game and snake start moving in upward direction by default. Then user needs to give direction to snake by pressing the ‘Direction keysᾠaround the middle button. Here we have used five keys (push buttons) namely Left key, Right key, Up key, Down key and Start key. Whenever the snake reaches to the food dot or eats the food, score increases by 5 points each time and the Snake length is increased by one dot (LED) each time, also snake speed become faster than before. And whenever snake would strike at any wall or reach at the end of LED matrix, then it would end the game (“Game Overᾩ. Then user needs to start game again by pressing start key.

Circuit Explanation:

are directly connected to Arduino’s pin number 14 and 16 respectively. And DS pin of column shift register and row shift register are directly connected to pin number 15 and 17 of Arduino. Start button for start the game is connected at pin number 3, left direction button at pin 4, right direction button at pin 6, up direction button at pin 2 and down direction button at pin 5. A LCD is also connected in our hardware to show score. RS and EN pins are directly connected at pin 13 and 12. RW pin is directly ground. And data pins d4-d7 are connected at pin 11, 10, 9, 8 of Arduino. Rest of connection are shown in the circuit diagram.

Programming Explanation:

To write this Arduino snake game code, first of all we include header files and define pins for LCD. And then define some pins for direction buttons and data pin for shift registers. #include<LiquidCrystal.h> LiquidCrystal lcd(13,12,11,10,9,8); #define ds_col 15 #define sh_col 16 #define st_col 14 #define ds_row 17 #define start 3 #define up 2 #define down 5 #define left 4 #define right 6 function we initialize LCD, giving direction to input output pins, pull-up the bits and showing welcome message on LCD. void setup() { lcd.begin(16,2); pinMode(ds_col, OUTPUT); pinMode(sh_col, OUTPUT); pinMode(st_col, OUTPUT); pinMode(ds_row, OUTPUT); pinMode(start, INPUT); ... .... .... .... function. void show_snake(int temp) { for(int n=0;n<temp;n++) { int r,c; for(int k=0;k<21;k++) { ... .... .... .... Here we have used the below function for reading input direction from the push button. void read_button() { if(!digitalRead(left)) { move_r=0; move_c!=-1 ? move_c=-1 : move_c=1; while(!digitalRead(left)); ... .... .... .... below. Code #include<LiquidCrystal.h> LiquidCrystal lcd(13,12,11,10,9,8); #define ds_col 15 #define sh_col 16 #define st_col 14 #define ds_row 17 #define start 3 #define up 2 #define down 5 #define left 4 #define right 6 char Col[21],Row[21],move_c,move_r; int colum_data(int temp) { switch(temp) { case 1: return 1;break; case 2: return 2; break; case 3: return 4; break; case 4: return 8; break; case 5: return 16; break; case 6: return 32; break; case 7: return 64; break; case 8: return 128; break; default: return 0; break; } } int row_data(int temp) { switch(temp) { case 1: return 1;break; case 2: return 2; break; case 3: return 4; break; case 4: return 8; break; case 5: return 16; break; case 6: return 32; break; case 7: return 64; break; case 8: return 128; break; default: return 0; break; } } void read_button() { if(!digitalRead(left)) { move_r=0; move_c!=-1 ? move_c=-1 : move_c=1; while(!digitalRead(left)); } if(!digitalRead(right)) { move_r=0; move_c!=1 ? move_c=1 : move_c=-1; while(!digitalRead(right)); } if(!digitalRead(up)) { move_c=0; move_r!=-1 ? move_r=-1 : move_r=1; while(!digitalRead(up)); } if(!digitalRead(down)) { move_c=0; move_r!=1 ? move_r=1 : move_r=-1; while(!digitalRead(down)); } } void show_snake(int temp) { for(int n=0;n<temp;n++) { int r,c; for(int k=0;k<21;k++) { int temp1=Col[k]; c=colum_data(temp1); int temp2=Row[k]; r=0xff-row_data(temp2); for(int i=0;i<8;i++) { int ds=(c & 0x01); digitalWrite(ds_col, ds); ds=(r & 0x01); digitalWrite(ds_row, ds); digitalWrite(sh_col, HIGH); c>>=1; r>>=1; digitalWrite(sh_col, LOW); } digitalWrite(st_col, HIGH); digitalWrite(st_col, LOW); read_button(); delayMicroseconds(500); } } } void setup() { lcd.begin(16,2); pinMode(ds_col, OUTPUT); pinMode(sh_col, OUTPUT); pinMode(st_col, OUTPUT); pinMode(ds_row, OUTPUT); pinMode(start, INPUT); pinMode(up, INPUT); pinMode(down, INPUT); pinMode(left, INPUT); pinMode(right, INPUT); digitalWrite(up, HIGH); digitalWrite(down, HIGH); digitalWrite(left, HIGH); digitalWrite(right, HIGH); digitalWrite(start, HIGH); lcd.setCursor(0,0); lcd.print(" Snake game "); lcd.setCursor(0,1); lcd.print("Circuit Digest "); delay(2000); lcd.setCursor(0,0); lcd.print(" Press Start "); lcd.setCursor(0,1); lcd.print(" To Play "); delay(2000); } void loop() { int j,k,Speed=40,score=0; j=k=move_c=0; move_r=1; lcd.clear(); lcd.setCursor(0,0); lcd.print("Score: "); lcd.print(score); while(1) { for(int i=3;i<21;i++) { Row[i]=100; Col[i]=100; } Row[0]=rand()%8+1; Col[0]=rand()%8+1; Row[1]=1; Col[1]=1; Row[2]=2; Col[2]=1; j=2,k=1; while(k==1) { move_c=0; move_r=1; show_snake(1); lcd.setCursor(7,0); lcd.print(score); if(!digitalRead(start)) { k=2; Speed=40; score=0; } } while(k==2) { show_snake(Speed); if(Row[1]>8 || Col[1]>8 || Row[1]<0 || Col[1]<0) { Row[1]=1; Col[1]=1; k=1; lcd.setCursor(0,1); lcd.print("Game Over"); delay(5000); score=0; lcd.clear(); lcd.setCursor(0,0); lcd.print("Score: "); lcd.print(score); } if(Row[0]==Row[1]+move_r && Col[0]==Col[1]+move_c) { j++; Speed-=2; score=score+5; lcd.setCursor(7,0); lcd.print(score); Row[0]=rand()%8+1; Col[0]=rand()%8+1; } for(int i=j;i>1;i--) { Col[i]=Col[i-1]; Row[i]=Row[i-1]; } Col[1]=Col[2]+move_c; Row[1]=Row[2]+move_r; } } } Video microcontroller-projects/gsm-based-home-automation-using-arduino

GSM Based Home Automation using Arduino

Working Explanation

is used for controlling whole the process. Here we have used GSM wireless communication for controlling home appliances. We send some commands like ᾣA.light on*ᾬ ᾣA.light off*ᾠand so on for controlling AC home appliances. After receiving given commands by Arduino through GSM, Arduino send signal to relays, to switch ON or OFF the home appliances using a relay driver. Arduino UNO GSM Module ULN2003 Relay 5 volt Bulb with holder Connecting wires Bread board 16x2 LCD Power supply Cell phone Here we have used a prefix in command string that is ᾣA.ᾮ This prefix is used to identify that the main command is coming next to it and * at the end of string indicates that message has been ended. When we send SMS to GSM module by Mobile, then GSM receives that SMS and sends it to Arduino. Now Arduino reads this SMS and extract main command from the received string and stores in a variable. After this, Arduino compare this string with predefined string. If match occurred then Arduino sends signal to relay via relay driver for turning ON and OFF the home appliances. And relative result also prints on 16x2 LCD by using appropriate commands. Here in this project we have used 3 zero watt bulb for demonstration which indicates Fan, Light and TV. Below is the list of messages which we send via SMS, to turn On and Off the Fan, Light and TV:
S.no.MessageOperation
1#A.fan on*Fan ON
2#A.fan off*Fan OFF
3#A.light on*Light ON
4#A.light off*Light OFF
5#A.tv on*TV ON
6#A.tv off*TV Off
7#A.all on*All ON
8#A.all off*All OFF
, and can respond accordingly. The most basic command is “ATᾬ if GSM respond OK then it is working good otherwise it respond with “ERRORᾮ There are various AT commands like ATA for answer a call, ATD to dial a call, AT+CMGR to read the message, AT+CMGS to send the sms etc. AT commands should be followed by Carriage return i.e. \r (0D in hex), like “AT+CMGS\rᾮ We can use GSM module using these commands: ATE0 -For echo off AT+CNMI=2,2,0,0,0 <ENTER> -Auto opened message Receiving. (No need to open message) ATD<Mobile Number>; <ENTER> - making a call (ATD+919610126059;\r\n) AT+CMGF=1 <ENTER> -Selecting Text mode AT+CMGS=”Mobile Numberᾠ<ENTER> -Assigning recipient’s mobile number >>Now we can write our message >>After writing message Ctrl+Z send message command (26 in decimal). ENTER=0x0d in HEX whichdelivers GSM/GPRS 850/900/1800/1900MHz performance for voice, SMS andData with low power consumption.

Circuit Description

are quitesimple, here a liquid crystal display is used for displaying status of home appliances which is directly connected to arduino in 4-bit mode. Data pins of LCD namely RS, EN, D4, D5, D6, D7 are connected to arduino digital pin number 6, 7, 8, 9, 10, 11. And Rx and Tx pin of GSM module is directly connected at Tx and Rx pin of Arduino respectively. And GSM module is powered by using a 12 volt adaptor. 5 volt SPDT 3 relays are used for controlling LIGHT, FAN and TV. And relays are connected to arduino pin number 3, 4 and 5 through relay driver ULN2003 for controlling LIGHT, FAN and TV respectively.

Code Description

In programming part of this project, first of all in programming we includes library for liquid crystal display and then we defines data and control pins for LCD and home appliances. #include<LiquidCrystal.h> LiquidCrystal lcd(6,7,8,9,10,11); #define Fan 3 #define Light 4 #define TV 5 int temp=0,i=0; int led=13; After this serial communication is initialized at 9600 bps and gives direction to used pin. void setup() { lcd.begin(16,2); Serial.begin(9600); pinMode(led, OUTPUT); pinMode(Fan, OUTPUT); pinMode(Light, OUTPUT); pinMode(TV, OUTPUT); which reads the data that comes serially. while (Serial.available()) { char inChar=Serial.read(); After receiving data serially we have stored it in a string and then waiting for Enter. void serialEvent() { while(Serial.available()) { if(Serial.find("#A.")) { digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); while (Serial.available()) { char inChar=Serial.read(); str[i++]=inChar; if(inChar=='*') { temp=1; return; } When Enter comes program start to compare received string with already defined string and if string matched then a relative operation is performed by using appropriate command that are given in code. void check() { if(!(strncmp(str,"tv on",5))) { digitalWrite(TV, HIGH); lcd.setCursor(13,1); lcd.print("ON "); delay(200); } else if(!(strncmp(str,"tv off",6))) { digitalWrite(TV, LOW); lcd.setCursor(13,1); lcd.print("OFF "); delay(200); } Code #include<LiquidCrystal.h> LiquidCrystal lcd(6,7,8,9,10,11); #define Fan 3 #define Light 4 #define TV 5 int temp=0,i=0; int led=13; char str[15]; void setup() { lcd.begin(16,2); Serial.begin(9600); pinMode(led, OUTPUT); pinMode(Fan, OUTPUT); pinMode(Light, OUTPUT); pinMode(TV, OUTPUT); lcd.setCursor(0,0); lcd.print("GSM Control Home"); lcd.setCursor(0,1); lcd.print(" Automaton "); delay(2000); lcd.clear(); lcd.print("Circuit Digest"); delay(1000); lcd.setCursor(0,1); lcd.print("System Ready"); Serial.println("AT+CNMI=2,2,0,0,0"); delay(500); Serial.println("AT+CMGF=1"); delay(1000); lcd.clear(); lcd.setCursor(0,0); lcd.print("Fan Light TV "); lcd.setCursor(0,1); lcd.print("OFF OFF OFF "); } void loop() { lcd.setCursor(0,0); lcd.print("Fan Light TV"); if(temp==1) { check(); temp=0; i=0; delay(1000); } } void serialEvent() { while(Serial.available()) { if(Serial.find("#A.")) { digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); while (Serial.available()) { char inChar=Serial.read(); str[i++]=inChar; if(inChar=='*') { temp=1; return; } } } } } void check() { if(!(strncmp(str,"tv on",5))) { digitalWrite(TV, HIGH); lcd.setCursor(13,1); lcd.print("ON "); delay(200); } else if(!(strncmp(str,"tv off",6))) { digitalWrite(TV, LOW); lcd.setCursor(13,1); lcd.print("OFF "); delay(200); } else if(!(strncmp(str,"fan on",5))) { digitalWrite(Fan, HIGH); lcd.setCursor(0,1); lcd.print("ON "); delay(200); } else if(!(strncmp(str,"fan off",7))) { digitalWrite(Fan, LOW); lcd.setCursor(0,1); lcd.print("OFF "); delay(200); } else if(!(strncmp(str,"light on",8))) { digitalWrite(Light, HIGH); lcd.setCursor(7,1); lcd.print("ON "); delay(200); } else if(!(strncmp(str,"light off",9))) { digitalWrite(Light, LOW); lcd.setCursor(7,1); lcd.print("OFF "); delay(200); } else if(!(strncmp(str,"all on",6))) { digitalWrite(Light, HIGH); digitalWrite(Fan, HIGH); digitalWrite(TV, HIGH); lcd.setCursor(0,1); lcd.print("ON ON ON "); delay(200); } else if(!(strncmp(str,"all off",7))) { digitalWrite(Light, LOW); digitalWrite(Fan, LOW); digitalWrite(TV, LOW); lcd.setCursor(0,1); lcd.print("OFF OFF OFF "); delay(200); } } Video microcontroller-projects/prepaid-energy-meter-using-gsm-and-arduino

Prepaid Energy Meter using GSM and Arduino

to user’s mobile phone like low balance alert, cut off alert, resume alert and recharge alert.

Working explanation:

Arduino GSM Module 16x2 LCD Analogue Electricity Energy Meter Optocoupler 4n35 Resistors POT Connecting wires Bulb and holder SIM card Power supply Mobile Phone Now when we need to recharge our system, we can recharge it simply by sending a SMS to the system, through our Cellphone. Like if we want to recharge by 45 bucks then we will send #45*, here # and * are prefix and suffix to the recharge amount. System receives this message and extract recharge amount and update the balance of system. And system again turns On the electricity of the house or office. This flow of working can be understood through the video at the end.

Circuit Description:

for processing all the things used in project. A liquid crystal display is used for displaying the status of Units and remaining balance. Data pins of LCD namely RS, EN, D4, D5, D6, D7 are connected to Arduino digital pin number 7, 6, 5, 4, 3, 2. And Rx and Tx pins of GSM module are directly connected to the Tx and Rx pins of Arduino respectively. And GSM module is powered by using a 12 volt adaptor. A relay is used for switching electricity connection which is connected at pin 12 of Arduino though ULN2003 relay driver.

How to Connect Energy Meter with Arduino:

terminals (cathode and Anode). Now solder two wires at both the terminals and take it out from the energy meter and then close energy meter and tight the screws. and cathode terminal to pin 2. Pin number four of optocouper should be directly connected to ground. A LED and a Pull-up resistor are connected at pin number 5 of optocoupler. And same terminal should go to the Arduino pin 8 too.

Calculation of Pulses and Units:

Before proceeding for the calculations, first we have to keep in mind the pulse rate of energy meter. There are two pulse rates of energy meter first is 1600 imp/kwh and second is 3200 imp/kwh. So here we are using 3200 imp/kwh pulse rate energy meter. , for the load of 100 watts. Pulse= (Pluse_rate*watt*time)/ (1000*3600) So pulses for 100 watt bulb in 60 seconds, with energy meter of 3200 imp/kwh pulse rate can be calculated as below: Pulses=3200*100*60/1000*3600 Pulses = ~5.33 pulse per minute : PF= watt/(hour*Pulse) PF=100/60*5.33 PF=0.3125 watt in a single pulse Units= PF*Total pulse/1000 Total pulses in an hour is around 5.33*60=320 Units = 0.3125*320/1000 Units = 0.1 per hour then it will consume Units =0.1*24 Units = 2.4 Units And suppose unit rate is at your region is 5 rupees per unit then You have to pay for 2.4 Units Rs: Rupees= 2.4*5 = 12 rupees

Programing explanation:

First of all we include required library and Define pins & variables that are required in our project. This can be seen in first few lines of our program code below. After it we initialize the LCD, serial communication, GSM and display some message message. After this in loop function we read serial received data if any. And reads pulse from energy meter and show units and balance on LCD. void setup() { lcd.begin(16,2); Serial.begin(9600); pinMode(led, OUTPUT); .. ... ... .... lcd.print("Circuit Digest"); lcd.setCursor(0,1); delay(2000); lcd.print("GSM Initilizing..."); gsm_init(); .. ... ... .... After this in loop function we read serial received data if any. And reads pulse from energy meter and show units and balance on LCD. void loop() { serialEvent(); rupees=EEPROM.read(1); units=rupees/5.0; lcd.setCursor(0,0); lcd.print("Units:"); .. ... ... .... functions have been used to send SMS. function is used for initializing the GSM module for get ready to operate with the system. In this we first sends AT command to know whether GSMmodule is connected or not. After it we turned off the echo and then check thenetwork. void gsm_init() { lcd.clear(); lcd.print("Finding Module.."); boolean at_flag=1; while(at_flag) .. ... ... ... function system reads connection and Balance conditions; like whether electricity balance is greater than the defined limit. If balance is less than 15 , then it alerts the user by sending the SMS alert of ‘Low Balanceᾠand if balance is less than 5 rupees then system will cut the electricity and inform the user by sending SMS using GSM module. void check_status() { if(rupees>15) { digitalWrite(relay, HIGH); flag1=0; .. ... ... .... function is used for sending confirmation message to the user if recharge has been done and it also update the balance in the system. function is used for decoding the amount figure from the SMS message, by using the # and * as starting and ending character. function is used for reading pulse from the Energy meter through optocoupler IC. And update the unit and balance. void read_pulse() { if(!digitalRead(pulsein)) { digitalWrite(led, HIGH); if(units<1){} .. ... ... .... function is used for serial communication and receiving the message. Code #include<EEPROM.h> #include <LiquidCrystal.h> LiquidCrystal lcd(7,6,5,4,3,2); int led=13; #define pulsein 8 #define relay 12 unsigned int pusle_count=0; float units=0; unsigned int rupees=0; float watt_factor=0.3125; unsigned int temp=0,i=0,x=0,k=0; char str[70],flag1=0,flag2=0; String bal=""; void setup() { lcd.begin(16,2); Serial.begin(9600); pinMode(led, OUTPUT); pinMode(pulsein, INPUT); pinMode(relay, OUTPUT); digitalWrite(pulsein, HIGH); lcd.setCursor(0,0); lcd.print("Automatic Energy"); lcd.setCursor(0,1); lcd.print(" Meter "); delay(2000); lcd.clear(); lcd.print("Circuit Digest"); delay(2000); lcd.clear(); lcd.print("GSM Initilizing..."); gsm_init(); lcd.clear(); lcd.print("System Ready"); Serial.println("AT+CNMI=2,2,0,0,0"); init_sms(); send_data("System Ready"); send_sms(); delay(1000); digitalWrite(led, LOW); lcd.clear(); // EEPROM.write(1,0); // rupees=EEPROM.read(1); } void loop() { serialEvent(); rupees=EEPROM.read(1); units=rupees/5.0; lcd.setCursor(0,0); lcd.print("Units:"); lcd.print(units); lcd.print(" "); lcd.setCursor(0,1); if(rupees<15) lcd.print("LOW Balance:"); else lcd.print("Balance:"); lcd.print(rupees); lcd.print(" "); read_pulse(); check_status(); if(temp==1) { decode_message(); send_confirmation_sms(); } } void serialEvent() { while(Serial.available()) { char ch=(char)Serial.read(); str[i++]=ch; if(ch == '*') { temp=1; lcd.clear(); lcd.print("Message Received"); delay(500); break; } } } void init_sms() { Serial.println("AT+CMGF=1"); delay(200); Serial.println("AT+CMGS=\"+918287114222\""); delay(200); } void send_data(String message) { Serial.println(message); delay(200); } void send_sms() { Serial.write(26); } void read_pulse() { if(!digitalRead(pulsein)) { digitalWrite(led, HIGH); //count++; //units=watt_factor*count/1000; if(units<1){} else units--; rupees=units*5; EEPROM.write(1,rupees); while(!digitalRead(pulsein)); digitalWrite(led,LOW); // delay(2000); } } void check_status() { if(rupees>15) { digitalWrite(relay, HIGH); flag1=0; flag2=0; } if(rupees<15 && flag1==0) { lcd.setCursor(0,1); lcd.print("LOW Balance "); init_sms(); send_data("Energy Meter Balance Alert:"); send_data("Low Balance\n"); Serial.println(rupees); delay(200); send_data("Please recharge your energy meter soon.\n Thank you"); send_sms(); message_sent(); flag1=1; } if(rupees<5 && flag2==0) { digitalWrite(relay, LOW); lcd.clear(); lcd.print("Light Cut Due to"); lcd.setCursor(0,1); lcd.print("Low Balance"); delay(2000); lcd.clear(); lcd.print("Please Recharge "); lcd.setCursor(0,1); lcd.print("UR Energy Meter "); init_sms(); send_data("Energy Meter Balance Alert:\nLight cut due to low Balance\nPlease recharge your energy meter soon.\n Thank you"); send_sms(); message_sent(); flag2=1; } } void decode_message() { x=0,k=0,temp=0; while(x<i) { while(str[x]=='#') { x++; bal=""; while(str[x]!='*') { bal+=str[x++]; } } x++; } bal+='\0'; } void send_confirmation_sms() { int recharge_amount=bal.toInt(); rupees+=recharge_amount; EEPROM.write(1, rupees); lcd.clear(); lcd.print("Energy Meter "); lcd.setCursor(0,1); lcd.print("Recharged:"); lcd.print(recharge_amount); init_sms(); send_data("Energy Meter Balance Alert:\nYour energy meter has been recharged Rs:"); send_data(bal); send_data("Total Balance:"); Serial.println(rupees); delay(200); send_data("Eelctricity Has Been Connected\nThank you"); send_sms(); temp=0; i=0; x=0; k=0; delay(1000); message_sent(); } void message_sent() { lcd.clear(); lcd.print("Message Sent."); delay(1000); } void gsm_init() { lcd.clear(); lcd.print("Finding Module.."); boolean at_flag=1; while(at_flag) { Serial.println("AT"); while(Serial.available()>0) { if(Serial.find("OK")) at_flag=0; } delay(1000); } lcd.clear(); lcd.print("Module Connected.."); delay(1000); lcd.clear(); lcd.print("Disabling ECHO"); boolean echo_flag=1; while(echo_flag) { Serial.println("ATE0"); while(Serial.available()>0) { if(Serial.find("OK")) echo_flag=0; } delay(1000); } lcd.clear(); lcd.print("Echo OFF"); delay(1000); lcd.clear(); lcd.print("Finding Network.."); boolean net_flag=1; while(net_flag) { Serial.println("AT+CPIN?"); while(Serial.available()>0) { if(Serial.find("+CPIN: READY")) net_flag=0; } delay(1000); } lcd.clear(); lcd.print("Network Found.."); delay(1000); lcd.clear(); } Video microcontroller-projects/clap-switch-using-arduino

Clap Switch using Arduino

, using 555 Timer IC. On clapping there will be a peak signal at the MIC which is much higher than normal, this signal is fed to the amplifier, though a High Pass Filter. This amplified voltage signal is fed to ADC, which converts this high voltage into a number. So there will be a peak in the ADC reading of the UNO. On this peak detection we will toggle an LED on the board, on each clap. This project has been explained in detail below. , which basically converts sound energy into electrical energy, so with this sensor we have sound as changing voltage. We usually record or sense sound through this device. This transducer is used in all mobile phones and laptops. A typical MIC looks like, MIC has two terminals one is positive and another is negative. Mic polarity can be found using a Multi-Meter. Take the positive probe of Multi-Meter (put the meter in DIODE TESTING mode) and connect it to one terminal of MIC and the negative probe to the other terminal of MIC. If you get the readings on the screen then the terminal of positive (MIC) is at negative terminal of Multi-Meter. Or you can simply find the terminals by looking at it, the negative terminal has two or three soldering lines, connected to the metal case of the mic. This connectivity, from negative terminal to its metal case can also be tested using continuity tester, to find out the negative terminal.

Components Required:

: ARDUINO UNO, power supply (5v), a condenser mic (explained above) 2N3904 NPN transistor, 100nFcapacitors (2 pieces), one100uFcapacitor, 1K resistor, 1M resistor, 15K resistor (2 pieces), one LED, And Breadboard & Connecting wires.

Circuit Diagram and Working Explanation:

is shown in below figure: , that is: Filtration, Amplification, Analog-digital conversion and programming to toggle the LED , connected at PIN 7 of PORTD, each time ADC channel A0 goes beyond a particular level. A high pass filter is shown in the circuit. After this filter, voltage signal is fed to the transistor for amplification. Here we have designed a single transistor amplifier for amplifying the MIC voltages. This amplified voltage signal is further fed to the ADC0 channel of Arduino. Among those, any one or all of them can be used as inputs for analog voltage. The UNO ADC is of 10 bit resolution (so the integer values from (0-(2^10) 1023)).This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. So for every (5/1024= 4.9mV) per unit. , with the help of below functions: 1. analogRead(pin); 2. analogReference(); ();ᾍ , we have left this reference voltage to the default, so we can read value from ADC channel 0, by directly calling function “analogRead(pin);ᾬ here “pinᾠrepresents pin where we connected the analog signal, in this case it would be “A0ᾮ The value from ADC can be taken into an integer as “int sensorValue = analogRead(A0); ᾬ by this instruction the value from ADC gets stored in the integer “sensorValueᾮ Now, we have the transistor value in digital form, in the memory of UNO. Under normal instances, the MIC provides normal signals and so we have normal digital values in the UNO, but on clapping there a peak provided by the MIC, with this we have a peak digital value in the UNO, we can program the UNO to toggle an LED ON and OFF whenever there is a peak. So on first clap the LED turns ON and stays ON. On second clap the LED turns OFF and stays OFF until the next clap. With this we have the clapper circuit. Check the program Code below. Code const int analogInPin = A0; // Analog input pin 0 int sensorValue = 0; void setup() { DDRD = 0xFF; } void loop() { sensorValue = analogRead(analogInPin); //read ADC value on channel 0 if(sensorValue>60) { PORTD ^=(1<<7); //If there is a peak toggle the LED on and OFF on pin7. delay(250); } } Video microcontroller-projects/wireless-notice-board-using-gsm-and-arduino

Wireless Notice Board using GSM and Arduino

of your mobile handset. Whatever notice we want to display, just send the SMS of that text, with some prefix and suffix.

Working Explanation:

to display the message. We can send some message or notice like ᾣCircuit Digest*ᾬ ᾣWe Welcomes You*ᾠthrough the SMS. Here we have used a prefix in the message string that is ᾣᾮ This prefix is used to identify the starting of the message or notice. And ᾪᾠis used as suffix to indicate the end of the message or notice. When we send SMS from mobile phone to GSM module then GSM receives that SMS and sends it to Arduino. Now Arduino read this SMS and extract main notice message from the received string and stores in another string. And then sends the extracted message to 16x2 LCD by using appropriate commands. Further working of this system is explained in the ‘Code Descriptionᾠsection below. Before we get into programming details we should know about GSM module. , and can respond accordingly. The most basic command is “ATᾬ if GSM respond OK then it is working good otherwise it respond with “ERRORᾮ There are various AT commands like ATA for answer a call, ATD to dial a call, AT+CMGR to read the message, AT+CMGS to send the sms etc. AT commands should be followed by Carriage return i.e. \r (0D in hex), like “AT+CMGS\rᾮ We can use GSM module using these commands: ATE0 For echo off AT+CNMI=2,2,0,0,0 <ENTER> Auto opened message Receiving. (No need to open message) ATD<Mobile Number>; <ENTER> making a call (ATD+919610126059;\r\n) AT+CMGF=1 <ENTER> Selecting Text mode AT+CMGS=”Mobile Numberᾠ<ENTER> Assigning recipient’s mobile number >>Now we can write our message >>After writing message Ctrl+Z send message command (26 in decimal). ENTER=0x0d in HEX whichdelivers GSM/GPRS 850/900/1800/1900MHz performance for voice, SMS andData with low power consumption.

Circuit Description:

are simple and shown in the figure below. Here a liquid crystal display (LCD) is used for display the “Noticeᾠor message, which is sent though the mobile phone as SMS. Data pins of LCD namely RS, EN, D4, D5, D6, D7 are connected to arduino digital pin number 7, 6, 5, 4, 3, 2. And Rx and Tx pin of GSM module is directly connected at Tx and Rx pin of Arduino respectively. And GSM module is powered by using a 12 volt adaptor.

Code Description:

function gsm_init(), which is explained in the end. In the program, first of all we include library for liquid crystal display (LCD) and then we defines data and control pins for LCD and some variables. #include <LiquidCrystal.h> LiquidCrystal lcd(7,6,5,4,3,2); int led=13; int temp=0,i=0,x=0,k=0; char str[100],msg[32]; After this, serial communication is initialized at 9600 bps and gives direction to used pin. And initialize GSM Module in setup loop. void setup() { lcd.begin(16,2); Serial.begin(9600); pinMode(led, OUTPUT); digitalWrite(led, HIGH); lcd.print("GSM Initilizing..."); gsm_init(); lcd.setCursor(0,0); lcd.print("Wireless Notice"); For receiving data serially we use two functions, one is Serial.available which checks any serial data is coming or not and other one is Serial.read which reads the data that comes serially. void serialEvent() { while(Serial.available()) { char ch=(char)Serial.read(); str[i++]=ch; if(ch == '*') { temp=1; lcd.clear(); lcd.print("Message Received"); delay(1000); } } } After receiving data serially, we store it in a string and this string is checked for ᾣᾠand ᾪᾬ to find the starting and ending of the Notice or message. Then finally Notice is printed on LCD using lcd.print: void loop() { for(unsigned int t=0;t<60000;t++) { serialEvent(); if(temp==1) { x=0,k=0,temp=0; while(x<i) { while(str[x]=='#') { x++; while(str[x]!='*') { msg[k++]=str[x++]; ᾠfor GSM is important here, where firstly, GSM module is checked whether it is connected or not by sending ‘ATᾠcommand to GSM module. If response OK is received, means it is ready. System keeps checking for the module until it becomes ready or until ‘OKᾠis received. Then ECHO is turned off by sending the ATE0 command, otherwise GSM module will echo all the commands. Then finally Network availability is checked through the ‘AT+CPIN?ᾠcommand, if inserted card is SIM card and PIN is present, it gives the response +CPIN: READY. This is also check repeatedly until the network is found. This can be clearly understood by the Video below. void gsm_init() { lcd.clear(); lcd.print("Finding Module.."); boolean at_flag=1; while(at_flag) { Serial.println("AT"); while(Serial.available()>0) { if(Serial.find("OK")) at_flag=0; } delay(1000); } Code #include <LiquidCrystal.h> LiquidCrystal lcd(7,6,5,4,3,2); int led=13; int temp=0,i=0,x=0,k=0; char str[100],msg[32]; void setup() { lcd.begin(16,2); Serial.begin(9600); pinMode(led, OUTPUT); digitalWrite(led, HIGH); lcd.print("GSM Initilizing..."); gsm_init(); lcd.setCursor(0,0); lcd.print("Wireless Notice"); lcd.setCursor(0,1); lcd.print(" Board "); delay(2000); lcd.clear(); lcd.print("Circuit Digest"); delay(1000); lcd.setCursor(0,1); lcd.print("System Ready"); Serial.println("AT+CNMI=2,2,0,0,0"); delay(500); Serial.println("AT+CMGF=1"); delay(1000); digitalWrite(led, LOW); } void loop() { for(unsigned int t=0;t<60000;t++) { serialEvent(); if(temp==1) { x=0,k=0,temp=0; while(x<i) { while(str[x]=='#') { x++; while(str[x]!='*') { msg[k++]=str[x++]; } } x++; } msg[k]='\0'; lcd.clear(); lcd.print(msg); delay(1000); temp=0; i=0; x=0; k=0; } } lcd.scrollDisplayLeft(); } void serialEvent() { while(Serial.available()) { char ch=(char)Serial.read(); str[i++]=ch; if(ch == '*') { temp=1; lcd.clear(); lcd.print("Message Received"); delay(1000); } } } void gsm_init() { lcd.clear(); lcd.print("Finding Module.."); boolean at_flag=1; while(at_flag) { Serial.println("AT"); while(Serial.available()>0) { if(Serial.find("OK")) at_flag=0; } delay(1000); } lcd.clear(); lcd.print("Module Connected.."); delay(1000); lcd.clear(); lcd.print("Disabling ECHO"); boolean echo_flag=1; while(echo_flag) { Serial.println("ATE0"); while(Serial.available()>0) { if(Serial.find("OK")) echo_flag=0; } delay(1000); } lcd.clear(); lcd.print("Echo OFF"); delay(1000); lcd.clear(); lcd.print("Finding Network.."); boolean net_flag=1; while(net_flag) { Serial.println("AT+CPIN?"); while(Serial.available()>0) { if(Serial.find("+CPIN: READY")) net_flag=0; } delay(1000); } lcd.clear(); lcd.print("Network Found.."); delay(1000); lcd.clear(); } Video microcontroller-projects/making-3X3X3-led-cube-with-arduino

DIY 3X3X3 LED Cube with Arduino

and connect it to ArduinoUNO to get different patterns. For a beginner we will start with a simple pattern. A typical 3*3*3 LED cube connected to UNO is shown in the image above, the cube consists of 27 Light Emitting Diodes, these 27 LEDs are arranged in rows and columns forming a cube. For 4*4*4 LED cube the work almost triples because you need to do work for 64 LEDs. With each higher number, the work almost doubles or triples. But every cube more or less works on the same way. because there are some advantages to this design like, For this cube you need not to worry about power consumption or dissipation. Low Power supply demand. We don’t need any switching electronics for this cube. We need lesser logic terminals so we don’t need shift registers or anything like that. We need not worry about power drawn by LED because the LED usually stated to work at 20mA current but that is wrong, that number provides the maximum current allowed through the LED. Normally an LED works well from 2mA to 5mA. Anything higher than that, the LED will heat intensely and it will burn out. So we can drive 9 LEDs carrying 2mA current from a single pin of UNO with no problems. The UNO pins are capable of delivering 20-30mA. For the cube I chose clear white LED, because I have them spare. You can choose any LED type or color of your choice, but the LED with colored shall work great for this projects. For the cube we need to spare 12 pins of UNO.

Components Required:

ARDUINO UNO, 220 resisters (3 pieces), , power supply (5v), 27 white LEDs, Breadboard wire, Soldering Iron, Soldering wire and flux, SR2032 button cell, Some tools, And a empty cardboard box, pencil, ruler and some jumpers.

Building the Arduino 3x3x3 LED Cube:

, once the cube is done if there is any faulty LED present in the cube it would be very difficult to replace, so first we need to check each LED. This is done by button cell SR2032, it’s a lithium ion battery that has a terminal voltage of 3V it is perfect for checking LED, and one can also use MULTIMETER to check the LED. After confirming all the 27 LEDs are working keep it aside and lets move one to next step. , we can use any wire but breadboard connecting wires works great. After peeling off we will have something as shown in above figure, cut the conductor wire in a length of 7cm and continue the process until we have six 7cm conducting wires (figure below). These wires are used for bridging the LED layers, we will get to this point shortly. , as shown in the figure. The paper is just for marking the points clearly, there is no specific use for it. Just use cello tape or glue at the corners for holding the paper in place while marking and drilling the holes. forming a structure of cube as shown in below figure. Here we are using 2cm because; the negative terminal of LED is of length 2.5cm. So with 2cm apart, we will have 5mm for soldering one LED to another. Any length higher from it, the LED terminals soldering becomes troubling, with lower length the cube looks very clumsy after finishing. So 2cm would be very appropriate. , make sure you poke a hole just about the size of LED, first poke one hole take the LED fit it in, the LED should not fall through the hole nor the LED should the too tight. While soldering the pins we don’t the LED to move so it should not be lose. If the LED is fitted in the hole too tight we cannot wiggle it out easily, so each time you poke a hole, check it with the LED. as shown in below figure. This is shown in figure: as shown below, this pattern is used throughout the design and there would be no further changes. For more convenience one can bend all the 27 LEDs as done for first one and then can be proceed to the arranging and soldering. as shown below, , this results in three negative terminals, each representing one row. This is shown below. forming a complete matrix. After carefully wiggling out the layer one we will have a setup as shown below. Cutoff the extra ends and we will have one layer of LED cube. as done for this one. Second and third layer are shown below: This is shown in figure. For instance CP1 of first layer is soldered to CP1 of second layer; CP2 of first layer is soldered to CP2 of second layer and so on. Here we will slide the layers about 5mm, one top over the other, first we need to solder the ends of the layers so that it holds in place and for the layers to be aligned. After that, carefully solder the other terminals. After soldering we will have, , with this we have completed the cube. The soldering of third layer would be a bit difficult, as the cube terminal be sensitive, if the terminals are wiggled too much, a joint might break internally and soldering an internal joint would be impossible, until the cube is break down. So one should check every joint twice proceeding to the next one. , if the soldering iron is kept close to LED more than 5 sec, the LED will burn down and replacing it would be a pain, so one should pay attention while soldering the LEDs.

Circuit and Working Explanation

PIN2 ------------------CP1 (Common Positive) PIN3 ------------------CP2 (Common Positive) PIN4 ------------------CP3 (Common Positive) PIN5 ------------------CP4 (Common Positive) PIN6 ------------------CP5 (Common Positive) PIN7 ------------------CP6 (Common Positive) PIN8 ------------------CP7 (Common Positive) PIN9 ------------------CP8 (Common Positive) PIN10 ----------------CP9 (Common Positive) PIN A0 ------------------CN1 (Common Negative) PIN A1 ------------------CN2 (Common Negative) PIN A2 ------------------CN3 (Common Negative) below. If we want to turn On the single LED i.e. LED in the first layer-second column, we need to power the CP2 pin and ground the CN1. With the connections established, for the LED in the first layer-second column to glow, we need to program the UNO to pull up the PIN3 (which is connected to CP2) and pull down the PIN A0 (connected to CN1). All the LEDs are connected this way, so one can choose which LED to be lit, and the programming for the UNO is done appropriately. Here we will give a forever loop to UNO, to glow every LED one after the other continuously. This cycle goes on and on forever. Code void setup() { for (int i=0;i<11;i++) { pinMode(i,OUTPUT); // PINS0-10 are set as output } pinMode(A0,OUTPUT); //PIN A0 set as output pinMode(A1,OUTPUT); // PIN A1 set as output pinMode(A2,OUTPUT); // PIN A2 set as output digitalWrite(A0,HIGH); //pull up the A0 pin digitalWrite(A1,HIGH); // pull up the A1 pin digitalWrite(A2,HIGH); // pull up the A2 pin /* add setup code here, setup code runs once when the processor starts */ } void loop() { digitalWrite(A0,LOW); //layer 1 of cube is grounded for (int i=2;i<11;i++) { digitalWrite(i,HIGH); //turn ON each LED one after another in layer1 delay(200); delay(200); delay(200); digitalWrite(i,LOW); } digitalWrite(A0,HIGH); //layer1 is pulled up digitalWrite(A1,LOW); // layer 2 of cube is grounded for (int i=2;i<11;i++) { digitalWrite(i,HIGH); // turn ON each LED one after another in layer2 delay(200); delay(200); delay(200); digitalWrite(i,LOW); } digitalWrite(A1,HIGH); // layer2 is pulled up digitalWrite(A2,LOW); // layer 3 of cube is grounded for (int i=2;i<11;i++) { digitalWrite(i,HIGH); // turn ON each LED one after another in layer3 delay(200); delay(200); delay(200); digitalWrite(i,LOW); } digitalWrite(A2,HIGH); // layer3 is pulled up } Video microcontroller-projects/ir-remote-controlled-home-appliances

IR Remote Controlled Home Automation using Arduino

In this project, we are using IR based wireless communication for controlling home appliances. In this project, Arduino is used for controlling whole the process. We send some commands to the controlling system by using IR TV/DVD/MP3 remote for controlling AC home appliances. After receiving signal from IR remote, Arduino sends related signal to relays which are responsible for switching ON or OFF of the home appliances through a relay driver.

Working Explanation:

sensor and read by Arduino and then Arduino decodes received train of pulse into a hex value and compares that decoded value with the predefined hex value of the pressed button. If any match occurs then Arduino perform relative operation and the corresponding result is also displayed on 16x2 LCD by using appropriate commands. Here in this project we have used 3 bulbs of different colors, for demonstration which indicates Fan, Light and TV. Arduino UNO TSOP1738 IR TV/DVD Remote ULN2003 Relays 5 volt Bulb with holder Connecting wires Bread board 16x2 LCD Power supply PVT IC 7805 Here in this project we have used 7, 8 and 9 number button of IR remote,for controlling Fan, Light and TV respectively and ON/OFF button (Power button) is used for turning ON and OFF all the appliances simultaneously. is nothing but to get that whether the button is pressed even no of times or the odd no of times. This is found by getting the reminder after dividing it by 2 (i%2), if there is some reminder then device will be turned ON and if reminder is 0 then it will be turned OFF. Suppose Key 7 is pressed on the remote then remote sends a signal toArduinothroughTSOPIR Receiver. ThenArduinodecode it and store the decoded value into the results variable. Now results variable has a hex value0x1FE00FF, after matching it with the predefined hex value of key 7 (see above image),Arduinoturns ON the Fan. Now when we press the same key (key 7) again then IR sends the same code.Arduinogets same code and matched with same code like before but this time Fan turned OFF because of toggling the bit [EVEN ODD] (i%2).

Decoding IR Remote Control Signals using Arduino:

Here is a list of a DVD NEC type Remote decoded output codes: If you don’t know the Decoded output for your IR remote, it can be easily found, just follow these steps: Download the IR remote library from here https://github.com/z3t0/Arduino-IRremote. Unzip it, and place it in your Arduino ‘Librariesᾠfolder. Then rename the extracted folder to IRremote. Run the below program from your Arduino and open the Serial Monitor window in Arduino IDE. Now press any IR Remote button and see the corresponding decoded hex output in Serial Monitor window. * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv * An IR detector/demodulator must be connected to the input RECV_PIN. * Version 0.1 July, 2009 * Copyright 2009 Ken Shirriff * http://arcfn.com */ #include <IRremote.h> int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value } delay(100); } The above program is taken from IRremote library’s ‘examplesᾠfolder, you can check out more examples to learn more about using the IR remote. So that’s how we decoded the IR remote output.

Circuit Description:

Connections of this circuit is very simple here a liquid crystal display is used for displaying status of home appliances which is directly connected to arduino in 4-bit mode. Data pins of LCD namely RS, EN, D4, D5, D6, D7 are connected to arduino digital pin number 6, 7, 8, 9, 10, 11. And output pin of TSOP1738 is directly connected at digital pin number 14 (A) of Arduino. And Vcc pin is connected a +5 volt and GND pin connected at Ground terminal of circuit. A relay driver namely ULN2003 is also used for driving relays. 5 volt SPDT 3 relays are used for controlling LIGHT, FAN and TV. And relays are connected to arduino pin number 3, 4 and 5 through relay driver ULN2003 for controlling LIGHT, FAN and TV respectively.

Code Description:

In programming part of this project First of all in programming we includes library for IR remote which is easily available at Google. And define pin and declare variables. #include <IRremote.h> const int RECV_PIN=14; IRrecv irrecv(RECV_PIN); decode_results results; And then include a header for liquid crystal display and then we defines data and control pins for LCD and home appliances. #include<LiquidCrystal.h> LiquidCrystal lcd(6,7,8,9,10,11); #define Fan 3 #define Light 4 #define TV 5 After it we need to initialize the LCD and give direction of pin that are used for fan , light and TV. void setup() { Serial.begin(9600); lcd.begin(16,2); pinMode(Fan, OUTPUT); pinMode(Light, OUTPUT); pinMode(TV, OUTPUT); As already explained, below part of the code is used to compare the received hex value to already defined hex code of that button. If it matched then a relative operation is performed by using appropriate functions that are given in code. void loop() { if (irrecv.decode(&results)) { Serial.println(results.value,HEX); delay(100); lcd.setCursor(0,0); lcd.print("Fan Light TV"); if(results.value==0x1FE00FF) { i++; int x=i%2; digitalWrite(Fan, x); Code #include<LiquidCrystal.h> #include <IRremote.h> const int RECV_PIN=14; IRrecv irrecv(RECV_PIN); decode_results results; #include<LiquidCrystal.h> LiquidCrystal lcd(6,7,8,9,10,11); #define Fan 3 #define Light 4 #define TV 5 int i=0,j=0,k=0,n=0; void setup() { Serial.begin(9600); lcd.begin(16,2); pinMode(Fan, OUTPUT); pinMode(Light, OUTPUT); pinMode(TV, OUTPUT); //digitalWrite(13,HIGH); lcd.print("Remote Controlled"); lcd.setCursor(0,1); lcd.print("Home Automation"); delay(2000); lcd.clear(); lcd.print("Circuit Digest"); lcd.setCursor(0,1); delay(1000); lcd.print("System Ready..."); delay(1000); irrecv.enableIRIn(); // Start the receiver irrecv.blink13(true); lcd.clear(); lcd.setCursor(0,0); lcd.print("Fan Light TV "); lcd.setCursor(0,1); lcd.print("OFF OFF OFF"); } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value,HEX); delay(100); lcd.setCursor(0,0); lcd.print("Fan Light TV"); if(results.value==0x1FE00FF) { i++; int x=i%2; digitalWrite(Fan, x); lcd.setCursor(0,1); if(x) lcd.print("ON "); else lcd.print("OFF "); // delay(200); } else if(results.value==0x1FEF00F) // key 1 { j++; int x=j%2; digitalWrite(Light, x); lcd.setCursor(6,1); if(x) lcd.print("ON "); else lcd.print("OFF "); // delay(200); } if(results.value==0x1FE9867) { k++; int x=k%2; digitalWrite(TV, x); lcd.setCursor(13,1); if(x) lcd.print("ON "); else lcd.print("OFF"); // delay(200); } if(results.value==0x1FE48B7) { n++; int x=n%2; digitalWrite(TV, x); digitalWrite(Fan,x); digitalWrite(Light,x); lcd.setCursor(0,1); if(x) lcd.print("ON ON ON "); else lcd.print("OFF OFF OFF"); //delay(200); } irrecv.resume(); // Receive the next value //delay(100); } } Video microcontroller-projects/bluetooth-controlled-robot-car-using-arduino

Bluetooth Controlled Toy Car using Arduino

Here we used a Bluetooth module to control the car, and it is also an android based application.

Components

Arduino UNO DC Motors Bluetooth module HC-05 Motor Driver L293D 9 Volt Battery and 6 volt battery Battery Connector Toy Car is controlled by using Android mobile phone instead of any other method like buttons, gesture etc. Here only needs to touch button in android phone to control the car in forward, backwardd, left and right directions. So here android phone is used as transmitting device and Bluetooth module placed in car is used as receiver. Android phone will transmit command using its in-built Bluetooth to car so that it can move in the required direction like moving forward, reverse, turning left, turning right and stop. HC Bluetooth module consiststwo things one is Bluetooth serial interface module and a Bluetooth adaptor. Bluetooth serial module is used for converting serial port to Bluetooth. You can directly use the Bluetooth module after purchasing from market, because there is no need to change any setting of Bluetooth module. Default baud rate of new Bluetooth module is 9600 bps. You just need to connect rx and tx to controller or serial converter and give 5 volt dc regulated power supply to module. Bluetooth module has two modes one is master mode and second one is slave mode. User can set either mode by using some AT commands. Even user can set module’s setting by using AT command. Here is some commands uses are given: First of all user need to enter AT mode with 38400 bps baud rate by pressing EN button at Bluetooth module or by giving HIGH level at EN pin. Note: all commands should ends with \r\n (0x0d and 0x0a) or ENTER KEY from keyboard. After it if you send AT to module then module will respond with OK AT ⅔est Command AT+ROLE=0 ⅓lave Mode select AT+ROLE=1 ⅍aster Mode select AT+NAME=xyz ⅓et Bluetooth Name AT+PSWD=xyz ⅓et Password AT+UART=<value1>,<value2>,<value3> ⅳet Baud rate Eg. AT+UART=9600,0,0 STATE ⅏pen Rx ⅓erial receiving pin Tx ⅓erial transmitting pin GND Ⅷround VccÅ5volt dc EN ⅴo enter in AT mode

Working Explanation

This car have two dc motors at its front and rear side. Front side motor is used for giving direction to car means turning left or right side (like real car steering feature). And rear side motor is used for driving the car in forward and backward direction. A Bluetooth module is used to receive command from android phone and Arduino UNO is used for controlling the whole system. Bluetooth controlled car moves according to button touched in the android Bluetooth mobile app. Torun this project first we need to download Bluetooth app form Google play store. We can use any Bluetooth app that supporting or can send data. Here are some apps'name that mightwork correctly. - Bluetooth Spp pro - Bluetooth controller After installing app youneed to open it and then search Bluetooth device and select desired Bluetooth device. And then configure keys.Here in this project we have used Bluetooth controller app. Download and install Bluetooth Controller. Turned ON mobile Bluetooth. Now open Bluetooth controller app Press scan Select desired Bluetooth device Now set keys by pressing set buttons on screen.To set keys we need to press ‘set buttonᾠand set key according to picture given below: After setting keys press ok. When we touch forward button in Bluetooth controller app then car start moving in forward direction and moving continues forward until next command comes. When we touch backward button in Bluetooth controller app then car start moving in reverse direction and moving continues reverse until next command comes. When we touch left button in Bluetooth controller app then car start moving in left direction and moving continues left until next command comes. In this condition front side motor turns front side wheels in left direction and rear motor runs in forward direction. When we touch right button in Bluetooth controller app then car start moving in right direction and moving continues right until next command comes. In this condition front side motor turns front side wheels in right direction and rear motor runs in forward direction. And by touching stop button we can stop the car.

Circuit Diagram and Explanation

is shown in above figure.A Motor driver is connected to arduino torun the car. Motor driver’s input pins 2, 7, 10 and 15 are connected toarduino's digital pin number 12, 11, 10 and 9 respectively. Here we have used two DC motors to driver car in which one motor is connected at output pin of motor driver 3 and 6 and another motor is connected at 11 and 14. A 6 volt Battery is also used to power the motor driver for driving motors. Bluetooth module’s rx and tx pins are directly connected at tx and rx of Arduino. And vcc and ground pin of Bluetooth module is connected at +5 volt and gnd of Arduino. And a 9 volt battery is used for power the circuit at Arduino’s Vin pin

Program Explanation

In program first of all we have defined output pins for motors. #define m11 11 // rear motor #define m12 12 #define m21 10 // front motor #define m22 9 And then in setup, we gave directions to pin. void setup() { Serial.begin(9600); pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); pinMode(m21, OUTPUT); pinMode(m22, OUTPUT); } After thiswe readinput by using serial communication form Bluetooth module and perform the operation accordingly. void loop() { while(Serial.available()) { char ch=Serial.read(); str[i++]=ch; if(str[i-1]=='1') { Serial.println("Forward"); forward(); i=0; } else if(str[i-1]=='2') { Serial.println("Left"); right(); i=0; } else if(str[i-1]=='3') { Serial.println("Right"); left(); i=0; } whichare used to give the directions:
Stop0000Stop
Forward0001Forward
Backward0010Backward
Right1001Right
left0101Left
Code #define m11 11 // rear motor #define m12 12 #define m21 10 // front motor #define m22 9 char str[2],i; void forward() { digitalWrite(m11, LOW); digitalWrite(m12, LOW); digitalWrite(m21, HIGH); digitalWrite(m22, LOW); } void backward() { digitalWrite(m11, LOW); digitalWrite(m12, LOW); digitalWrite(m21, LOW); digitalWrite(m22, HIGH); } void left() { digitalWrite(m11, HIGH); digitalWrite(m12, LOW); delay(100); digitalWrite(m21, HIGH); digitalWrite(m22, LOW); } void right() { digitalWrite(m11, LOW); digitalWrite(m12, HIGH); delay(100); digitalWrite(m21, HIGH); digitalWrite(m22, LOW); } void Stop() { digitalWrite(m11, LOW); digitalWrite(m12, LOW); digitalWrite(m21, LOW); digitalWrite(m22, LOW); } void setup() { Serial.begin(9600); pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); pinMode(m21, OUTPUT); pinMode(m22, OUTPUT); } void loop() { while(Serial.available()) { char ch=Serial.read(); str[i++]=ch; if(str[i-1]=='1') { Serial.println("Forward"); forward(); i=0; } else if(str[i-1]=='2') { Serial.println("Left"); right(); i=0; } else if(str[i-1]=='3') { Serial.println("Right"); left(); i=0; } else if(str[i-1]=='4') { Serial.println("Backward"); backward(); i=0; } else if(str[i-1]=='5') { Serial.println("Stop"); Stop(); i=0; } delay(100); } } Video microcontroller-projects/arduino-servo-motor-control-by-force-sensor

Servo Position Control with Weight (Force Sensor)

In this tutorial we will develop a circuit using Force sensor, Arduino Uno and a servo motor. It will be a servo control system where the servo shaft position is determined by the weight present on the force sensor. Before going any further let’s talk aboutabout the servo and other components. are used where there is a need for accurate shaft movement or position. These are not proposed for high speed applications. These are proposed for low speed, medium torque and accurate position application. These motors are used in robotic arm machines, flight controls and control systems. Servo motors are also used in some of printers and fax machines. Servo motors are available at different shapes and sizes. A servo motor will have mainly there wires, one is for positive voltage another is for ground and last one is for position setting. The RED wire is connected to power, Black wire is connected to ground and YELLOW wire is connected to signal. A servo motor is a combination of DC motor, position control system, gears. The position of the shaft of the DC motor is adjusted by the control electronics in the servo, based on the duty ratio of the PWM signal the SIGNAL pin.Simply speaking the control electronics adjust shaft position by controlling DC motor. This data regarding position of shaft is sent through the SIGNAL pin.The position data to the control should be sent in the form of PWM signal through the Signal pin of servo motor. The frequency of PWM (Pulse Width Modulated) signal can vary based on type of servo motor. The important thing here is the DUTY RATIO of the PWM signal. Based on this DUTY RATION the control electronics adjust the shaft. As shown in below figure, for the shaft to be moved to 9o clock the TURN ON RATION must be 1/18.ie. 1milli second of ‘ON timeᾠand 17milli second of ‘OFF timeᾠin a 18ms signal. For the shaft to be moved to 12o clock the ON time of signal must be 1.5ms and OFF time should be 16.5ms. This ratio is decoded by control system in servo and it adjusts the position based on it. This PWM in here is generated by using ARDUINO UNO. So for now we know that, we can control the SERVO MOTOR shaft by varying the duty ratio of PWM signal generated by UNO. Now let’s talk about force sensor or weight sensor. ,we are going use 8 bit ADC (Analog to Digital Conversion) feature in arduno uno. A FORCE sensor is a transducer which changes its resistance when pressure is applied on surface. FORCE sensor is available in different sizes and shapes. is one of the cheapest force sensors in the market. The picture of FSR400 is shown in below figure. Now it is important to note that the FSR 400 is sensitive along the length, the force or weight should be concentrated on the maze on the middle of eye of sensor, as shown in figure. If the force is applied at wrong times the device could damage permanently. Another important thing to know that, the sensor can drive currents of high range. So keep in mind the driving currents while installing.Also the sensor has a limit on force that is 10Newtons. So we can apply only 1Kg of weight. If weights higher than 1Kg applied the sensor might show some deviations. If it’s increased more than 3Kg. the sensor might damage permanently. As told earlier this sensor is used to sense the changes in pressure. So when the weight is applied on top of FORCE sensor, the resistance is changed drastically.The resistance of FS400 over weight is shown in below graph: As shown in above figure, the resistance between the two contacts of sensor decreases with weight or the conductance between two contacts of sensor increases. The resistance of a pure conductor is given by: Where, p- Resistivity of conductor l= Length of conductor A= Area of conductor. Now consider a conductor with resistance “Rᾬ if some pressure is applied on top of conductor, the area on conductor decreases and the length of conductor increases as a result of pressure. So by formula the resistance of conductor should increase, as the resistance R is inversely proportional to area and also directly proportional to length l. So with this for a conductor under pressure or weight the resistance of conductor increases. But this change is small compared to overall resistance. For a considerable change many conductors are stacked together. This is what happens inside the Force Sensors shown in above figure. On looking closely one can sees many lines inside the sensor. Each of these lines represents a conductor. Sensitivity of sensor is in conductor numbers. But in this case the resistance will be decreasing with pressure because the material used here is not a pure conductor. The FSR here are robust polymer thick film (PTF) devices. So these are not pure conductor material devices. These are made up of a material, that exhibit a decrease in resistance with increase in force applied to the surface of the sensor. This material shows characteristics as shown in graph of FSR. This change in resistance can do no good unless we can read them. The controller at hand can only read the chances in voltage and nothing less, for this we are going to use voltage divider circuit, with that we can derive the resistance change as voltage change. Voltage divider is a resistive circuit and is shown in figure. In this resistive network we have one constant resistance and other variable resistance. As shown in figure, R1 here is a constant resistance and R2 is FORCE sensor which acts as a resistance. The midpoint of branch is taken to measurement. With R2 change, we have change at Vout. So with this we have a voltage which changes with weight. Now important thing to note here is, the input taken by the controller for ADC conversion is as low as 50μAmp. This loading effect of resistance based voltage divider is important as the current drawn from Vout of voltage divider increases the error percentage increases, for now we need not worry about loading effect. Now when the force is applied on the FORCE SENSOR, the voltage at divider end changes this pin as connected to ADC channel of UNO, we will get a different digital value from ADC of UNO, whenever force on sensor changes. This ADC digital value is matched to the duty ratio of PWM signal, so we have the SERVO position control in relation to force applied on sensor.

Components

UNO, power supply (5v), 1000uF capacitor, 100nF capacitor (3 pieces), 100K resistor, SERVO MOTOR (SG 90), 220 resistor, FSR400 force sensor. Atmel studio 6.2 or aurdino nightly.

Circuit Diagram and Working Explanation

is shown in below figure. The voltage across sensor is not completely linear; it will be a noisy one. To filter out the noise a capacitors are placed across each resistor in the divider circuit as shown in figure. Here we are going to take the voltage provided by the divider (voltage which represents weight linearly) and feed it into one of ADC channels of Arduino Uno. After conversion we are going to take that digital value (representing weight) and relate it to PWM value and provide this PWM signal to SERVO motor. So with weight we have a PWM value which changes its duty ratio depending on digital value. Higher the digital value higher the duty ratio of PWM. So with higher duty ratio PWM signal, the servo shaft should reach the far right or far left as per the figure provided in the introduction. If the weight is lower, we will have lower PWM duty ratio and as per the figure in introduction the servo should the reach the far right. With this we have a SERVO position control by WEIGHT or FORCE. For this to happened we need to establish few instructions in program and we will talk about them in detail below. ARDUINO has six ADC channels, as show in figure. In those any one or all of them can be used as inputs for analog voltage. The UNO ADC is of 10 bit resolution (so the integer values from (0-(2^10) 1023)).This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. So for every (5/1024= 4.9mV) per unit. Here we are going to use A0 of UNO. We need to know a few things.
analogRead(pin); analogReference(); analogReadResolution(bits);
channels has a default reference value of 5V. This means we can give a maximum input voltage of 5V for ADC conversion at any input channel. Since some sensors provide voltages from 0-2.5V, with a 5V reference we get lesser accuracy, so we have a instruction that enables us to change this reference value. So for changing the reference value we have (“analogReference();ᾩ For now we leave it as. As default we get the maximum board ADC resolution which is 10bits, this resolution can be changed by using instruction (“analogReadResolution(bits);ᾩ. This resolution change can come in handy for some cases. For now we leave it as. Now if the above conditions are set to default, the we can read value from ADC of channel ᾰᾠby directly calling function “analogRead(pin);ᾬ here “pinᾠrepresents pin where we connected analog signal, in this case it would be “A0ᾮThe value from ADC can be taken into an integer as “int SENSORVALUE = analogRead(A0); ᾬ by this instruction the value after ADC gets stored in the integer “SENSORVALUEᾮ The PWM of UNO can achieved at any of pins symbolized as ᾠ~ ᾠon the PCB board. There are six PWM channels in UNO. We are going to use PIN3 for our purpose.
analogWrite(3,VALUE);
From above condition we can directly get the PWM signal at the corresponding pin. The first parameter in brackets is for choosing the pin number of PWM signal. Second parameter is for writing duty ratio. The PWM value of Arduino Unocan be changed from 0 to 255. With ᾰᾠas lowest to ᾲ55ᾠas highest. With 255 as duty ratio we will get 5V at PIN3. If the duty ratio is given as 125 we will get 2.5V at PIN3. here. Now the sg90 can move from 0-180 degrees, we have ADC result 0-1024. So ADC is approximately six times the SERVO POSITION. So by divided the ADC result by 6 we will get the approximate SERVO hand position.Hence we have a PWM signal whose duty ratio changes linearly with WEIGHT or FORCE. This being given to servo motor, we can control the servo motor by force sensor. Code #include <Servo.h> //header for controller servo Servo servo; //keeping name of servo SERVO itself int sensorvalue =0; void setup() { pinMode(A0,INPUT); //force sensor value input pinMode(3,OUTPUT); //PWM output to servo servo.attach(3); //telling where signal pin of servo attached(must be a PWM pin) } void loop() { sensorvalue = analogRead(A0); //read analog value from sensor servo.write(sensorvalue/6); //set servo position based on ADC result } Video microcontroller-projects/uart-communication-between-atmega8-and-arduino-uno

How to establish UART communication between ATmega8 and Arduino Uno?

(Universal Asynchronous Receiver Transmitter) type. It’s serial communication. By this serial communication data can be shared between two controllers, which is a requiredin variousembedded system applications. In embedded systems we must have basic knowledge about system communications, so for this we are doing this project. In this project we will discuss basic communication system and we will send some data from transmitter to receiver in serial. ] In this project ATMEGA8 acts as a TRANSMITTER and ARDUINO UNO acts as a RECECIVER.In serial communication we will send data BIT BY BIT, until a BYTE of data is transferred completely. The data can be of 10bit size but we will keep to 8BITS for now.

Components Required

ATMEGA8, ARDUINO UNO, power supply (5v), AVR-ISP PROGRAMMER, 100uF capacitor (connected across power supply), 1K resistor (two pieces), LED , Button. Atmel studio 6.1, progisp or flash magic, ARDUINO NIGHTLY.

Circuit Diagram and Explanation

The ATMEGA here sends data to the UNO in serial as discussed earlier. Here we will connect the TXD (Transmitter) PIN of ATMEGA8 to RXD (Receiver) PIN of ARDUINO UNO The data communication established is programmed to have: Eight data bits Two stop bits No parity check bit Baud rate of 9600 BPS(Bits Per Second) Asynchronous communication(No clock share between ATMEGA8 and UNO (both have different clock units)) we need to program the setting accurately. For this we need to keep the above mentioned parameters same at both ends. In this one acts as TRANSMITTER and other acts as RECEIVER. We will discuss each side settings below. , the following features must be satisfied for the TRANSMITTER side (ATMEGA8): 1. The TXD pin (data receiving feature) of first controller must be enabled for TRANSMITTER. 2. Since the communication is serial we need to know whenever the data bye is received, so that we can stop the program until complete byte is received. This is done by enabling a data receive complete interrupt. 3. DATA is transmitted and received to controller in 8bit mode. So two characters will be sent to the controller at a time. 4. There are no parity bits, one stop bit in the data sent by the module. The above features are set in the controller registers; we are going to discuss them briefly: DARK GREY (UDRE): This bit not set during startup but it is used during working to check whether transmitter is ready to transmit or not. See the program on TRASMITTER SIDE for more details. VOILET (TXEN): This bit is set for enabling transmitter pin on TRASMITTER SIDE. YELLOW (UCSZ0, UCSZ1, and UCSZ2): These three bits are used for selecting the number of data bits we are receiving or sending in a single go. The communication between two SIDES is established as eight bit communication. By matching the communication with table we have, UCSZ0, UCSZ1 to one and UCSZ2 to zero. ORANGE (UMSEL): This bit is set based on whether the system is communicating asynchronously (both use different clock) or synchronously (both use same clock). Both the SYTEMS do not share any clock. Since both of them use internal clock of their own. So we need to set UMSEL to 0 in both controllers. GREEN (UPM1, UPM0): These two bits are adjusted based on bit parity we are using in communication. The data ATMEGA here is programmed to send data with no parity, as the data transmission length is small, we can clearly expect no data loss or error. So we are not setting any parity here. So we set both UPM1, UPM0 to zero or they are left, because all bits are 0 by default. BLUE (USBS): This bit is used for choosing the number of stop bits we are using during communication. The communication established her is of asynchronous type, so for getting more accurate data transmission and reception, we need to use two stop bits, Hence we set USBS to ᾱᾠin TRANSMITTER side.. The baud rate is set in controller by choosing the appropriate UBRRH: The UBRRH value is chosen by cross referring baud rate and CPU crystal frequency: So by cross reference UBRR value is seen as ᾶᾬ and so the baud rate is set. With this we have established settings on TRANSMITTER SIDE; we will talk about RECEIVING SIDE now. The serial communication enabling in UNO can be done by using a single command.
Serial.begin(9600); receiveddata = Serial.read();
The communication we presumed to establish is done by a BAUD rate of 9600 bits per second. So for UNO to establish such baud rate and to start serial communication we use command ”Serial.begin(9600);ᾮ Here 9600 is baud rate and is changeable. Now all left if to receive data, one a data is received by the UNO, it will be available for taking. This data is picked up by command “receiveddata = Serial.read();ᾮ By this command serial data is taken to ‘receiveddataᾠnamed integer. As shown in circuit a button in connected on transmitter side, when this button in pressed an eight bit data is sent by TRANSMITTER (ATMEGA8) and this data is received by RECEIVER (ARDUINO UNO). On receiving this data successfully it toggles the LED connected to it ON and OFF, to show successful data transfer between two controller. is successfully established. Code #include <avr/io.h> //header to enable data flow control over pins #define F_CPU 1000000UL //telling controller crystal frequency attached #include <util/delay.h> //header to enable delay function in program int main(void) { DDRB =0;//PORTB is set as INPUT DDRD |= 1 << PIND1;//pin1 of portD as OUTPUT DDRD &= ~(1 << PIND0);//pin0 of portD as INPUT PORTD |= 1 << PIND0; int UBBRValue = 6;//AS described before setting baud rate 9600BPS //Put the upper part of the baud number here (bits 8 to 11) UBRRH = (unsigned char) (UBBRValue >> 8); //Put the remaining part of the baud number here UBRRL = (unsigned char) UBBRValue; //Enable the receiver and transmitter UCSRB = (1 << RXEN) | (1 << TXEN); //Set 2 stop bits and data bit length is 8-bit UCSRC = (1 << USBS) | (3 << UCSZ0); while (1) { if (bit_is_clear(PINC,0))//once button is pressed { while (! (UCSRA & (1 << UDRE)) ); { UDR = 0b11110000;//once transmitter is ready sent eight bit data } _delay_ms(220); } int receiveddata =0; void setup() { Serial.begin(9600);//serial data rate is set for 9600BPS pinMode(0,INPUT);//RXD pin is set for INPUT pinMode(1,OUTPUT); pinMode(7,OUTPUT);//PIN1,PIN7 are set for output } void loop() { if (Serial.available() > 0) //if data received is available { receiveddata = Serial.read();//read serial data available if (receiveddata == 0)//compare the data received { PORTD^=(1<<7);//id data matches toggle the LED. } } } Video microcontroller-projects/arduino-tone-generator

Arduino Based Tone Generator

The tones can be increased up to 20. This gives thebest tone variation and much smoother changes.The intensity of the tone is changed by PWM (Pulse Width Modulation).An example of PWM is shown in below graph. In PWM, the frequency of signal or the time period of signal (Ton + Toff) is always constant. Only the ratio of TURN ON and TURN OFF time changes.For example in the second graph in above figure, the TURN ON time is 80% and TURN OFF time is20% of complete duration. In the third graph, the TURN ON time is 50% and TURN OFF time is 50% of complete duration.So in first case we have a duty ratioof 80% and in second case we have a duty ratioof 20%. With this change in duty ratiowe have a change in Vrms (Root Mean Square value of Voltage), when this voltage is given to the buzzer it makes a different noise whenever there is a change in duty ratio. at hand which generates a different tone with each button press.

Components Required

Arduino Uno, Power supply (5v), 1000uF capacitor, 100nF capacitor, Buzzer, buttons (8 pieces). AURDINO nightly or Atmel studio 6.2

Circuit Diagram and Working Explanation

The circuit for tone generator is shown in below diagram. To filter out the noise from supply voltage capacitors are placed across terminals as shown in the diagram. can achieved at any of pins symbolized as ᾠ~ ᾠon the PCB board. There are six PWM channels in UNO.However we cannot use PWM pins established over the PINS0-7, as the PINS are preferred for buttons interface. There is a reason for selecting PINS0-7 as inputs, because the PINS 0-7 represent the PORTD of microcontroller. So in the latter case we can take the complete BYTE of PORTD. Now for getting a different duty ratio PWM, we are going to use following command.
analogWrite(9,VALUE);
From above condition we can directly get the PWM signal at the corresponding pin. The first parameter in brackets is for choosing the pin number of PWM signal. Second parameter is for writing duty ratio. The PWM value of Arduino Uno can be changed from 0 to 255. With ᾰᾠas lowest to ᾲ55ᾠas highest. With 255 as duty ratio we will get 5V at PIN9. If the duty ratio is given as 125 we will get 2.5V at PIN9.We are going to divide the duty ratio of 0-250 among 8 buttons interfaced at PORTD of UNO. Here I choose 25 increments for every button, but it is of your choice. is explained step by step in C code given below. Code void setup() { for (int i=0;i<8;i++) { pinMode(i, INPUT_PULLUP);//take pins0-7 as inputs with default high or pulled up pins. } pinMode(9,OUTPUT);//buzzer output at pin9 } // the loop routine runs over and over again forever: void loop() { if (digitalRead(0)==LOW) { analogWrite(9,25);//if button 1 is pressed PWM of duty ratio(25*100)/255 is given to buzzer delay(100); analogWrite(9,0); } if (digitalRead(1)==LOW) { analogWrite(9,50); //if button 2 is pressed PWM of duty ratio(50*100)/255 is given to buzzer delay(100); analogWrite(9,0); } if (digitalRead(2)==LOW) { analogWrite(9,75);// /if button 3 is pressed PWM of duty ratio(75*100)/255 is given to buzzer delay(100); analogWrite(9,0); } if (digitalRead(3)==LOW) { analogWrite(9,100); /if button 4 is pressed PWM of duty ratio(100*100)/255 is given to buzzer delay(100); analogWrite(9,0); } if (digitalRead(4)==LOW) { analogWrite(9,125); delay(100); analogWrite(9,0); } if (digitalRead(5)==LOW) { analogWrite(9,150); delay(100); analogWrite(9,0); } if (digitalRead(6)==LOW) { analogWrite(9,175); delay(100); analogWrite(9,0); } if (digitalRead(7)==LOW) { analogWrite(9,200); delay(100); analogWrite(9,0); } } Video microcontroller-projects/arduino-variable-power-supply-circuit

Variable Power Supply By Arduino Uno

For that we are going use ADC (Analog to Digital Conversion) and PWM (Pulse Width Modulation) feature. Some digital electronic modules like accelerometer work on voltage 3.3V and some work on 2.2V. Some even work on lower voltages. With this we cannot get a regulator for every one of them.So here we will make a simple circuit which will provide a voltage output from 0-5 volts at a resolution of 0.05V. So with this we may provide voltages accurately for the other modules. contains button interface for the voltage programming. The working and circuit is explained below. Arduino Uno, Power supply (5v), 100uF capacitor (2 pieces), button (2 pieces), 1K resistor (3 pieces), 16*2 characters LCD, 2N2222 transistor. Atmel studio 6.2 or AURDINO nightly.

Circuit Diagram and Working Explanation

is shown in below diagram. The voltage across output is not completely linear; it will be a noisy one. To filter out the noisecapacitors are placed across output terminals as shown in figure.The two buttons here are for voltage increment and decrement.The display unit shows the voltage at the OUTPUT terminals. After conversion we are going to take that DIGITAL value and we will relate it to voltage and show the result in 16*2 display. This value on display represents the variable voltage value. ARDUINO has six ADC channels, as show in figure. In those any one or all of them can be used as inputs for analog voltage. The UNO ADC is of 10 bit resolution (so the integer values from (0-(2^10) 1023)).This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. So for every (5/1024= 4.9mV) per unit. Here we are going to use A0 of UNO.
analogRead(pin); analogReference(); analogReadResolution(bits);
First of all the UNO ADC channels has a default reference value of 5V. This means we can give a maximum input voltage of 5V for ADC conversion at any input channel. Since some sensors provide voltages from 0-2.5V, with a 5V reference we get lesser accuracy, so we have a instruction that enables us to change this reference value. So for changing the reference value we have (“analogReference();ᾩ For now we leave it as. As default we get the maximum board ADC resolution which is 10bits, this resolution can be changed by using instruction (“analogReadResolution(bits);ᾩ. This resolution change can come in handy for some cases. For now we leave it as. Now if the above conditions are set to default, the we can read value from ADC of channel ᾰᾠby directly calling function “analogRead(pin);ᾬ here “pinᾠrepresents pin where we connected analog signal, in this case it would be “A0ᾮ The value from ADC can be taken into an integer as “float VOLTAGEVALUE = analogRead(A0); ᾬ by this instruction the value after ADC gets stored in the integer “VOLTAGEVALUEᾮ The PWM of UNO can achieved at any of pins symbolized as ᾠ~ ᾠon the PCB board. There are six PWM channels in UNO. We are going to use PIN3 for our purpose.
analogWrite(3,VALUE);
From above condition we can directly get the PWM signal at the corresponding pin. The first parameter in brackets is for choosing the pin number of PWM signal. Second parameter is for writing duty ratio. The PWM value of UNO can be changed from 0 to 255. With ᾰᾠas lowest to ᾲ55ᾠas highest. With 255 as duty ratio we will get 5V at PIN3. If the duty ratio is given as 125 we will get 2.5V at PIN3 As said earlier there are two buttons connected to PIN4 and PIN5 of UNO. On press the duty ratio value of PWM will increase. When other button is pressed the duty ratio value of PWM decreases. So we are varying the duty ratio of PWM signal at PIN3. This PWM signal at PIN3 is fed to the base of NPN transistor. This transistor provides a variable voltage at its emitter, while acting as a switching device. With the variable duty ratio PWM at base there will be variable voltage at emitter output. With this we have a variable voltage source at hand. The voltage output is feed to UNO ADC, for the user to see the voltage output. Code #include <LiquidCrystal.h> LiquidCrystal lcd(8, 9, 10, 11, 12, 13);//RS,EN,D4,D5,D6,D7 int voltageadjust =125;//starting initial variable output at 2.5V float check =0; void setup() { pinMode(3,OUTPUT);//PWM output pin pinMode(4,INPUT);//button 1 pinMode(5,INPUT);//button 2 lcd.begin(16, 2);//number of characters on LCD // Print a logo message to the LCD. lcd.print(" CIRCUITDIGEST"); lcd.setCursor(0, 1); delay (2500); delay (2500); lcd.clear(); lcd.print("VOLTAGE= ");//printing name lcd.setCursor(9, 0); } void loop() { float VOLTAGEVALUE = (analogRead(A0));//read ADC value at A0 VOLTAGEVALUE = (VOLTAGEVALUE*5)/1024;//converting digital value to voltage if ((check > (VOLTAGEVALUE+0.05))|(check < (VOLTAGEVALUE-0.05))) // if voltage change is higher or lower than 0.5 of previous value (to avoid fluctuations) { lcd.print(VOLTAGEVALUE); lcd.print("V "); lcd.setCursor(9, 0);//go to position 9 on LCD check = VOLTAGEVALUE;//store previous value } analogWrite(3,voltageadjust);//provide PWM at PIN3 if (digitalRead(4)==LOW) { if (voltageadjust<250) { voltageadjust++;//if button1 is pressed and value is less than 250 increment the PWM value delay(30); } } if (digitalRead(5)==LOW) { if (voltageadjust>0) { voltageadjust--;// if button2 is pressed and value is greater than 0 decrement the PWM value delay(30); } } delay(200); } Video microcontroller-projects/servo-motor-control-by-flex-sensor-using-arduino

Servo Motor Control by Flex Sensor

where the servo shaft position is determined by the flex or bent or deviation of the FLEX sensor. Servo Motors are used where there is a need for accurate shaft movement or position. These are not proposed for high speed applications. These are proposed for low speed, medium torque and accurate position application. These motors are used in robotic arm machines, flight controls and control systems. Servo motors are used in embedded systems like vending machines etc. Servo motors are available at different shapes and sizes. A servo motor will have mainly there wires, one is for positive voltage another is for ground and last one is for position setting. The RED wire is connected to power, Black wire is connected to ground and YELLOW wire is connected to signal. A servo motor is a combination of DC motor, position control system, gears. The position of the shaft of the DC motor is adjusted by the control electronics in the servo, based on the duty ratio of the PWM signal the SIGNAL pin. Simply speaking the control electronics adjust shaft position by controlling DC motor. This data regarding position of shaft is sent through the SIGNAL pin.The position data to the control should be sent in the form of PWM signal through the Signal pin of servo motor. The frequency of PWM (Pulse Width Modulated) signal can vary based on type of servo motor. The important thing here is the DUTY RATIO of the PWM signal. Based on this DUTY RATION the control electronics adjust the shaft.For the shaft to be moved to 9o clock the TURN ON RATION must be 1/18.ie. 1milli second of ‘ON timeᾠand 17milli second of ‘OFF timeᾠin a 18ms signal. For the shaft to be moved to 12o clock the ON time of signal must be 1.5ms and OFF time should be 16.5ms.This ratio is decoded by control system in servo and it adjusts the position based on it. shaft by varying the duty ratio of PWM signal generated by Arduino Uno.The UNO has a special function which enables us to provide the position of SERVO without troubling the PWM signal. However it is important to know the PWM duty ration - servo position relation. We will talk more about it in description. .Tointerface a FLEX sensor to ARDUINO UNO, we are going use 8 bit ADC (Analog to Digital Conversion) feature to do the job.A FLEX sensor is a transducer which changes its resistance when its shape is changed. A FLEX sensor is of 2.2 inches long or of finger length. It is shown in figure. Flex sensor is a transducer which changes its resistance when the linear surface is bent. Hence the name flex sensor. Simply speaking the sensor terminal resistance increases when it’s bent. This is shown in below figure. , with that we can derive the resistance change as voltage change. Voltage divider is a resistive circuit and is shown in figure. In this resistive network we have one constant resistance and other variable resistance. As shown in figure, R1 here is a constant resistance and R2 is FLEX sensor which acts as a resistance. The midpoint of branch is taken to measurement. With R2 change, we have change at Vout. So with this we have a voltage which changes with weight. Now important thing to note here is, the input taken by the controller for ADC conversion is as low as 50μAmp. This loading effect of resistance based voltage divider is important as the current drawn from Vout of voltage divider increases the error percentage increases, for now we need not worry about loading effect. FLEX SENSOR when bent its resistance changes. With this transducer connected to a voltage divider circuit, we will have a changing voltage with FLEX on transducer. This variable voltage is FED to one of ADC channels, we will have a digital value relating to FLEX. We will match this digital value to servo position, with this we will have servo control by flex.

Components

Power supply (5v), 1000uF capacitor, 100nF capacitor (3 pieces), 100K resistor, SERVO MOTOR (SG 90), 220 resistor, FLEX sensor. Atmel studio 6.2 or Aurdino nightly.

Circuit Diagram and Explanation

is shown in below figure. are placed across each resistor in the divider circuit as shown in figure. We are going to use A0 for this.After the ADC initialization, we will have digital value representing the bent on sensor. We will take this value and match it with servo position. For this to happened we need to establish few instructions in program and we will talk about them in detail below. ARDUINO has six ADC channels, as show in figure. In those any one or all of them can be used as inputs for analog voltage. The UNO ADC is of 10 bit resolution (so the integer values from (0-(2^10) 1023)).This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. So for every (5/1024= 4.9mV) per unit. Here we are going to use A0 of UNO. We need to know a few things.
analogRead(pin); analogReference(); analogReadResolution(bits);
First of all the UNO ADC channels has a default reference value of 5V. This means we can give a maximum input voltage of 5V for ADC conversion at any input channel. Since some sensors provide voltages from 0-2.5V, with a 5V reference we get lesser accuracy, so we have a instruction that enables us to change this reference value. So for changing the reference value we have (“analogReference();ᾩ For now we leave it as. As default we get the maximum board ADC resolution which is 10bits, this resolution can be changed by using instruction (“analogReadResolution(bits);ᾩ. This resolution change can come in handy for some cases. For now we leave it as. Now if the above conditions are set to default, the we can read value from ADC of channel ᾰᾠby directly calling function “analogRead(pin);ᾬ here “pinᾠrepresents pin where we connected analog signal, in this case it would be “A0ᾮ The value from ADC can be taken into an integer as “int SENSORVALUE = analogRead(A0); ᾬ by this instruction the value after ADC gets stored in the integer “SENSORVALUEᾮ Now let’s talk about the SERVO, the UNO has a feature which enables us to control the servo position by just giving the degree value. Say if we want the servo to be at 30, we can directly represent the value in the program. The SERVO header file takes care of all the duty ratio calculations internally.
#include <Servo.h> Servo servo; servo.attach(3); servo.write(degrees);
First statement represents the header file for controlling the SERVO MOTOR. Second statement is naming the servo; we leave it as servo itself. Third statement states where the servo signal pin is connected; this must be a PWM pin. Here we are using PIN3. Fourth statement gives commands for positioning servo motor and is in degrees. If it is given 30, the servo motor rotates 30 degrees. Now the sg90 can move from 0-180 degrees, we have ADC result 0-1024 So ADC is approximately six times the SERVO POSITION. So by divided the ADC result by 6 we will get the approximate SERVO hand position. Code #include <Servo.h> // header for controller servo Servo servo; //keeping name of servo SERVO itself int sensorvalue =0; void setup() { pinMode(A0,INPUT);// voltage divider value input pinMode(3,OUTPUT);// PWM output to servo servo.attach(3);// telling where signal pin of servo attached(must be a PWM pin) } void loop() { sensorvalue = analogRead(A0); //read analog value from sensor servo.write((sensorvalue-250)/2); //to avoid initial positioning of servo we need to neutralize the default voltage provided by voltage divider( setting servo position based on ADC result) } Video microcontroller-projects/arduino-rgb-led-interfacing

RGB LED with Arduino

These LEDs are connected in parallel for reducing PIN usage of Uno. A typical RGB LED isshown in below figure: The RGB LED will have four pins as shown in figure. PIN1: Color 1 negative terminal or color1 positive terminal PIN2: Common positive for all three colors or common negative for all three colors PIN3: Color 2 negative terminal or color2 positive terminal PIN4: Color 3 negative terminal or color3 positive terminal , one is common cathode type (common negative) and other is common anode type (common positive) type.In CC (Common Cathode or Common Negative), there will be three positive terminals each terminal representing a color and one negative terminal representing all three colors. The internal circuit of a CC RGB LED can be represented as below. If we want RED to be on in above, we need to power the RED LED pin and ground the common negative. The same goes for all the LEDs.In CA (Common Anode or Common Positive), there will be three negative terminals each terminal representing a color and one positive terminal representing all three colors. The internal circuit of a CA RGB LED can be represented as shown in figure.. If we want RED to be on in above, we need to ground the RED LED pin and power the common positive. The same goes for all the LEDs.

Components

UNO, power supply (5v), 1K resistor (3 pieces), RGB (Red Green Blue) LED (5 pieces) Atmel studio 6.2 or Aurdino nightly.

Circuit and Working Explanation

is shown in below figure. Now for the tricky part, say we want to turn the RED led in SET1 and GREEN LED in SET2. We power the PIN8 and PIN9 of UNO, and ground PIN7, PIN6. With that flow we will have RED in first SET and GREEN in second SET ON, but we will have GREEN in SET1 and RED in SET2 ON with it. By simple analogy we can seen all four LEDs close the circuit with above configuration and so they all glow. So to eliminate this problem we will turn only one SET on at a time. Say at t=0m SEC, SET1 is tuned ON. At t = 1m SEC, SET1 is tuned OFF and SET2 is turned ON. Again at t=6m SEC, SET5 is turned OFF and SET1 is turned ON. This goes on. Here the trick is, the human eye cannot capture a frequency more than 30 HZ. That is if a LED goes ON and OFF continuously at a rate of 30HZ or more. The eye sees the LED as continuously ON. However this is not the case. The LED will be constantly turning ON and OFF. This technique is called multiplexing. Simply speaking we will power each common cathode of 5 SETs 1milli second, so in 5milli second we will have completed the cycle, after that the cycle starts from SET1 again, this goes on forever. Since the LED SETs are going ON and OFF too fast. The human predicts all the SETs are ON all the time. So when we power SET1 at t=0milli second, we ground the RED pin. At t=1milli second, we power the SET2 and ground the GREEN pin (at this time RED and BLUE are pulled up HIGH). The loop goes fast and the eye sees RED glow in FIRST SET and GREEN glow in SECOND SET. This is how we program a RGB LED, we will glow all the colors slowly in program to see how multiplexing works. Code void setup() { for (int i=0;i<11;i++)//all first 11 pins are set as OUTPUT { pinMode(i, OUTPUT); } for (int i=3;i<8;i++) { digitalWrite(i, LOW);//pins3-8 are set low } } // the loop routine runs over and over again forever: void loop() { for (int i=3;i<8;i++) { digitalWrite(i,HIGH);//power each set one time for (int j=8;j<11;j++) { digitalWrite(j,LOW); delay(100); digitalWrite(j,HIGH);//blink three colors of each set } digitalWrite(i,LOW);//pull down power set after blinking the colors. } } Video microcontroller-projects/arduino-8x8-led-matrix

8x8 LED Matrix using Arduino

, for that we are going to interface an 8x8 LED matrix module with Arduino Uno.An 8x8 LED matrix contains 64 LEDs (Light Emitting Diodes) which are arranged in the form of a matrix, hence the name LED matrix. These matrixes can be made by circuiting 64 LEDs,however that process is time consuming. Now a day they are available in compact forms as shown in below image. These compact modules are available in different sizes and many colors.The cost of module is same as cost of 64 LEDs, so for hobbyists this is easiest to work on. The bare LED matrix has 16 pin outs with 8 common positive and another 8 common negative. For connecting this matrix directly to a UNO, we need to spare 16 pins on the UNO.With the output pins low on UNO, we cannot spare 16 PINS. So we need to connect this matrix to a driver chip. This driver chip along with matrix comes as a set whichis shown in below figure. After downloading the Zip file, extract the contents to ARDUINO folder. (Go to local disk where ARDUINO NIGHTLY software is installed, open the folder, search for folder named “libraryᾬ extract the contents of zip file in that folder, restart the program you will now be able to use features for matrix interface)

Components Required

Arduino Uno, Power supply (5v), 100uF capacitor (connected across power supply) ArduinoNightly

Circuit Diagram and Explanation

is shown in below table. PIN2 ------------------LOAD or CHIPSELECT of LED module PIN3------------------CLOCK of LED module PIN4 ------------------DATAIN of LED module +5V ------------------VCC of LED module GND ------------------GND of LED module is shown in below figure. Now for using the special futures called by installing new library, we need to establish few commands in program and are stated below.
#include "LedControlMS.h" #define NBR_MTX 1 LedControl lc=LedControl(4,3,2, NBR_MTX); lc.writeString(0,"CIRCUITDIGEST"); lc.clearAll();
First we need to call the header file for interfacing a LED matrix to Arduino Uno. That isᾠ#include "LedControlMS.h"ᾬ this header file call the library special functions. We have a feature with these modules we can connect many number of modules in series and program them together as a single display. This feature comes in handy when we need a display unit which could display multiple characters at a time. So we need to tell the controller how many displays we are connecting. In this module there are mainly three pins; data flow from UNO to module takes places with these three pins. The pins are DATAIN (data receiving pin), CLOCK (clock pin), and CHIPSELECT (command receiving pin). Now we need to tell the UNO where we are connecting these pins. This is done by command “LedControl lc=LedControl(4,3,2, NBR_MTX); ᾮ“lc.writeString(0,"CIRCUITDIGEST");ᾬ this command is used for telling UNO which characters are to be displayed on the LED matrix. With the above the display showsᾠCIRCUITDIGESTᾬ with each character once. We need to clear the display chip memory before sending any other data, this is done by command ᾠlc.clearAll();". By this way we can easily interface a 8x8 LED matrix toArduino Uno. Code // Arduino 8x8 LED Matrix Code #include "LedControlMS.h" //pin 4 is connected to the DataIn // pin 3 is connected to the CLK //pin 2 is connected to LOAD #define NBR_MTX 1 //number of matrices attached is one LedControl lc=LedControl(4,3,2, NBR_MTX);// void setup() { for (int i=0; i< NBR_MTX; i++) { lc.shutdown(i,false); /* Set the brightness to a medium values */ lc.setIntensity(i,8); /* and clear the display */ lc.clearDisplay(i); delay(100); } } void loop() { lc.writeString(0,"CIRCUITDIGEST");//sending characters to display lc.clearAll();//clearing the display delay(1000); } Video microcontroller-projects/arduino-sound-generator-based-on-weight

Working of Force Sensor with Arduino

(Analog to Digital Conversion) feature to do the job.

Force Sensor or Force Sensitive Resistor

as its resistance changes according to the force or pressure applied to it. When pressure is applied to this force sensing resistor its resistance decreases that is, the resistance is inversely proportional to the force applied. So when no pressure is applied on it, the resistance of FSR will be very high. Now it is important to note that the FSR 400 is sensitive along the length, the force or weight should be concentrated on the maze on the middle of eye of sensor, as shown in figure.If the force is applied at wrong times the device could damage permanently. Another important thing to know that, the sensor can drive currents of high range. So keep in mind the driving currents while installing.Also the sensor has a limit on force that is 10Newtons. So we can apply only 1Kg of weight. If weights higher than 1Kg applied the sensor might show some deviations. If it’s increased more than 3Kg. the sensor might damage permanently. As told earlier this sensor is used to sense the changes in pressure. So when the weight is applied on top of FORCE sensor, the resistance is changed drastically.The resistance of FS400 over weight is shown in below graph, As shown in above figure, the resistance between the two contacts of sensor decreases with weight or the conductance between two contacts of sensor increases.The resistance of a pure conductor is given by: Where, p- Resistivity of conductor l= Length of conductor A= Area of conductor. Now consider a conductor with resistance “Rᾬ if some pressure is applied on top of conductor, the area on conductor decreases and the length of conductor increases as a result of pressure. So by formula the resistance of conductor should increase, as the resistance R is inversely proportional to area and also directly proportional to length l. So with this for a conductor under pressure or weight the resistance of conductor increases. But this change is small compared to overall resistance. For a considerable change many conductors are stacked together.This is what happens inside the Force Sensors shown in above figure. On looking closely one can sees many lines inside the sensor. Each of these lines represents a conductor. Sensitivity of sensor is in conductor numbers. But in this case the resistance will be decreasing with pressure because the material used here is not a pure conductor. The FSR here are robust polymer thick film (PTF) devices. So these are not pure conductor material devices. These are made up of a material, that exhibit a decrease in resistance with increase in force applied to the surface of the sensor.This material shows characteristics as shown in graph of FSR. This change in resistance can do no good unless we can read them. The controller at hand can only read the chances in voltage and nothing less, for this we are going to use voltage divider circuit, with that we can derive the resistance change as voltage change. Now important thing to note here is, the input taken by the controller for ADC conversion is as low as 50μAmp. This loading effect of resistance based voltage divider is important as the current drawn from Vout of voltage divider increases the error percentage increases, for now we need not worry about loading effect. Connect the two pins of FSR sensor to the multimeter without applying any force and check the resistance value, it will be very high. Then apply some force to its surface and see the decrement in resistance value. Force-sensing resistors are mainly used to create pressure-sensing "buttons". They are used in a variety of fields such as car occupancy sensors, resistive touch-pads, robotic fingertips, artificial limbs,keypads, Foot pronationsystems, musical instruments, Embedded Electronics, Testing and Measurement Equipment, OEM Development Kit andportable electronics, sports. They are also used in Augmented Realitysystemsas well as to enhance mobile interaction.

Components Required

Arduino Uno, Power supply (5v), 1000uFCapacitor, 100nF capacitor (3 pieces), 100K resistor, Buzzer, 220 resistor, FSR400Force sensor. Atmel studio 6.2 or Aurdino nightly

Circuit Diagram and Working Explanation

is shown in below diagram. The voltage across sensor is not completely linear; it will be a noisy one. To filter out the noise a capacitors are placed across each resistor in the divider circuit as shown in figure. Here we are going to take the voltage provided by the divider (voltage which represents weight linearly) and feed it into one of ADC channels of UNO. After conversion we are going to take that digital value (representing weight) and relate it to PWM value for driving the buzzer. So with weight we have a PWM value which changes its duty ratio depending on digital value. Higher the digital value higher the duty ratio of PWM so higher the noise generated by buzzer. So we related weight to sound. .ARDUINO has six ADC channels, as show in figure. In those any one or all of them can be used as inputs for analog voltage. The UNO ADC is of 10 bit resolution (so the integer values from (0-(2^10) 1023)).This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. So for every (5/1024= 4.9mV) per unit. Here we are going to use A0 of UNO. We need to knowfew things.
analogRead(pin); analogReference(); analogReadResolution(bits);
First of all the UNO ADC channels has a default reference value of 5V. This means we can give a maximum input voltage of 5V for ADC conversion at any input channel. Since some sensors provide voltages from 0-2.5V, with a 5V reference we get lesser accuracy, so we have a instruction that enables us to change this reference value. So for changing the reference value we have (“analogReference();ᾩ For now we leave it as. As default we get the maximum board ADC resolution which is 10bits, this resolution can be changed by using instruction (“analogReadResolution(bits);ᾩ. This resolution change can come in handy for some cases. For now we leave it as. Now if the above conditions are set to default, the we can read value from ADC of channel ᾰᾠby directly calling function “analogRead(pin);ᾬ here “pinᾠrepresents pin where we connected analog signal, in this case it would be “A0ᾮThe value from ADC can be taken into an integer as “int SENSORVALUE = analogRead(A0); ᾬ by this instruction the value after ADC gets stored in the integer “SENSORVALUEᾮ can achieved at any of pins symbolized as ᾠ~ ᾠon the PCB board. There are six PWM channels in UNO. We are going to use PIN3 for our purpose.
analogWrite(3,VALUE);
From above condition we can directly get the PWM signal at the corresponding pin. The first parameter in brackets is for choosing the pin number of PWM signal. Second parameter is for writing duty ratio. The PWM value of UNO can be changed from 0 to 255. With ᾰᾠas lowest to ᾲ55ᾠas highest. With 255 as duty ratio we will get 5V at PIN3. If the duty ratio is given as 125 we will get 2.5V at PIN3. Now we have 0-1024 value as ADC output and 0-255 as PWM duty ratio. So ADC is approximately four times the PWM ratio. So by divided the ADC result by 4 we will get the approximate duty ratio. Code int sensorvalue =0;// Interger for storing ADC result void setup() { pinMode(A0,INPUT); // ADC result input pinMode(3,OUTPUT); // PWM signal output pin } void loop() { sensorvalue = analogRead(A0); // Read analog value and store it in integer analogWrite(3,sensorvalue/4); // PWMduty ratio given } Video microcontroller-projects/water-level-indicator-project-using-arduino

Automatic Water Level Indicator and Controller using Arduino

for a simpler version of this project.

Components

Arduino Uno Ultrasonic sensor Module 16x2 LCD Relay 6 Volt ULN2003 7806 PVT Copper wire 9 volt battery or 12 Voltadaptor Connecting wires

Ultrasonic Sensor Module

Ultrasonic sensor HC-SR04 is used to measure distance in range of 2cm-400cm with accuracy of 3mm. The sensor module consists of ultrasonic transmitter, receiver and the control circuit. The ultrasonic sensor module works on the natural phenomenon of ECHO of sound. A pulse is sent for about 10us to trigger the module. After which the module automatically sends 8 cycles of 40 KHz ultrasound signal and checks its echo. The signal after striking with an obstacle returns back and is captured by the receiver. Thus the distance of the obstacle from the sensor is simply calculated by the formula given as Distance= (time x speed)/2. Here we have divided the product of speed and time by 2 because the time is the total time it took to reach the obstacle and return back. Thus the time to reach obstacle is just half the total time taken.

Working of Automatic Water Level Controller

Working of this project is very simple we have used Ultrasonic sensor module which sends the sound waves in the water tank and detects reflection of sound waves that is ECHO. First of all we needs to trigger the ultrasonic sensor module to transmit signal by using Arduino and then wait toreceive ECHO. Arduino reads the time between triggering and received ECHO. We know that speed of sound is around 340 m/s. so we can calculate distance by using given formula: Distance= (travel time/2) * speed of sound Where speed of sound is approximately340m per second. By using this methods we gets distance from sensor to water surface. After it we need to calculate water level. is shown in below block diagram.

Circuit Diagram and Explanation

for turning on or turning off the water motor pump. A voltage regulator 7805 is also used forproviding 5 volt to relay and to remaining circuit. In this circuit Ultrasonic sensor module is placed at the top of bucket (water tank) for demonstration. This sensor module will read the distance between sensor module and water surface, and it will show the distanceon LCD screen with message “Water Space in Tank is:ᾮ It means we are here showing empty place of distance or volume for water instead of water level. Because of this functionality we can use this system in any water tank. When empty water level reaches at distance about 30 cm then Arduino turnsON the water pump by driving relay. And now LCD will show “LOW Water Levelᾠ“Motor turned ONᾬ and Relay status LED will start glowing Now if the empty space reaches at distance about 12 cm arduinoturnsOFF the relay and LCD will show “Tank is fullᾠ“Motor Turned OFFᾮ Buzzer also beep for some time and relay status LED will turned OFF.

Programming

, first we define all the pin that we are going to use in the project for interfacing external devices like relay, LCD, buzzer etc. #define trigger 10 #define echo 11 #define motor 8 #define buzzer 12 Then we initialize all the devices used in project. lcd.begin(16,2); pinMode(trigger,OUTPUT); pinMode(echo,INPUT); pinMode(motor, OUTPUT); pinMode(buzzer, OUTPUT); lcd.print(" Water Level "); lcd.setCursor(0,1); lcd.print(" Indicator "); delay(2000); Now initialize the ultrasonic sensor module and read time of sending and receiving time of ultrasonic waves or sound by using pulseIn(pin). Then perform calculations and display theresult on 16x2LCD by using appropriate functions. digitalWrite(trigger,HIGH); delayMicroseconds(10); digitalWrite(trigger,LOW); delayMicroseconds(2); time=pulseIn(echo,HIGH); distance=time*340/20000; lcd.clear(); lcd.print("Water Space In "); lcd.setCursor(0,1); lcd.print("Tank is: "); lcd.print(distance); lcd.print("Cm"); After it we check conditions if water tank is full or water level is LOW, and take actions accordingly. if(distance<12 && temp==0) { digitalWrite(motor, LOW); digitalWrite(buzzer, HIGH); lcd.clear(); lcd.print("Water Tank Full "); lcd.setCursor(0,1); lcd.print("Motor Turned OFF"); delay(2000); digitalWrite(buzzer, LOW); delay(3000); temp=1; } else if(distance<12 && temp==1) { digitalWrite(motor, LOW); lcd.clear(); lcd.print("Water Tank Full "); lcd.setCursor(0,1); lcd.print("Motor Turned OFF"); delay(5000); } Code #include <LiquidCrystal.h> #define trigger 10 #define echo 11 #define motor 8 #define buzzer 12 LiquidCrystal lcd(7,6,5,4,3,2); float time=0,distance=0; int temp=0; void setup() { lcd.begin(16,2); pinMode(trigger,OUTPUT); pinMode(echo,INPUT); pinMode(motor, OUTPUT); pinMode(buzzer, OUTPUT); lcd.print(" Water Level "); lcd.setCursor(0,1); lcd.print(" Indicator "); delay(2000); } void loop() { lcd.clear(); digitalWrite(trigger,LOW); delayMicroseconds(2); digitalWrite(trigger,HIGH); delayMicroseconds(10); digitalWrite(trigger,LOW); delayMicroseconds(2); time=pulseIn(echo,HIGH); distance=time*340/20000; lcd.clear(); lcd.print("Water Space In "); lcd.setCursor(0,1); lcd.print("Tank is: "); lcd.print(distance); lcd.print("Cm"); delay(2000); if(distance<12 && temp==0) { digitalWrite(motor, LOW); digitalWrite(buzzer, HIGH); lcd.clear(); lcd.print("Water Tank Full "); lcd.setCursor(0,1); lcd.print("Motor Turned OFF"); delay(2000); digitalWrite(buzzer, LOW); delay(3000); temp=1; } else if(distance<12 && temp==1) { digitalWrite(motor, LOW); lcd.clear(); lcd.print("Water Tank Full "); lcd.setCursor(0,1); lcd.print("Motor Turned OFF"); delay(5000); } else if(distance>30) { digitalWrite(motor, HIGH); lcd.clear(); lcd.print("LOW Water Level"); lcd.setCursor(0,1); lcd.print("Motor Turned ON"); delay(5000); temp=0; } } microcontroller-projects/arduino-home-automation-project

PC Controlled Home Automation using Arduino

which is controlled by a computer to switch On and switch Off various electrical and electronics devices. For demonstrationwe have used 3 zero watt bulbs which indicates LIGHT, FAN and TV.It uses Arduino Uno board as a controller and a 5V relay to connectlight bulbs with the circuit. There could be various types of communications to control devices like home appliances, industrial appliances, etc. Broadly we can categorize them aswired and wireless. For example inwireless communication we transmitsignal using radio frequency (RF) and in wired communication we usewires. Wired communication can further be categorized as: Parallel communication Serial Communication In parallel communication we usemany wires depending on the data size in bits, i.e.if we need to transmit 8 bit then we would need a 8-bit wire.But in serial communication we only used two wires for transmitting data and receiving data as in serial communication data are transmittedserially i.e. bit by bit.

Components Required

Arduino UNO Serial Cable ULN2003 Relay 5 volt Bulb with holder Connecting wires Bread board 16x2 LCD Laptop Power supply PVT We need a relay to connect the circuits with higher voltageAC appliances like bulb, TV, fan, etc. Relay is a kind of switch which is usedfor electronic to electrical interfacing.Relays containa coil and some switching contact cores. There are different types of relays, like: Single Pole Single Through (SPST). Single Pole Double Through (SPDT). Double Pole single Through (DPST). Double Pole Double Through (DPDT). Here we have used single pole double through (SPDT)relay. SPDT relays contain five pins, in which 2 pin for coil and one is for pole and other two are namely "Normally Connected" (NC) and "Normally Open" (NO).

Circuit Diagram and Explanation

is also used for driving relays. 5 volt SPDT 3 relays are used for controlling LIGHT, FAN and TV. And relays are connected to arduino pin number 3, 4 and 5 through relay driver IC ULN2003 for controlling LIGHT, FAN and TV respectively. Here serial communication is used to control thehome appliances. We send commands like LIGHT ON, LIGHT OFF, FAN ON, FAN OFF, TV ON AND TV OFF to control AC home appliances. After receiving the given commands, arduino send signal to relays which are responsible for switching on or off of the appliances. When we press ENTER after typing one of any given command on hyper terminal or serial terminal,arduino performs relative task like turning on the “fanᾠand likewise other tasks. And a relevant message is also displayed on16x2 LCD which is programmed in the code. (See the code section in bottom)

Code Explanation

First of all we includelibrary for liquid crystal display and then we defines data and control pins for LCD and home appliances. After it serial communication is initialized at 9600 bps and gives direction to usepin. For receiving data serially we usetwo functions - one is Serial.available which checks any serial data is coming or not and other one is Serial,read which reads data that comes serially. After receiving data serially we storeit in a string and then waitfor Enter. When enter is pressed program start to compare received string with already defined string and if string matched then a relative operation is performed by using appropriate command that are given in code. For using compare string we have used a library that is string.h which has some keywords like strcmp, strncmp, strcpy etc. Code #include <LiquidCrystal.h> #include<string.h> LiquidCrystal lcd(13, 12, 11, 10, 9, 8); #define light 3 #define fan 4 #define TV 5 char temp; char str[10]; char i=0; void setup() { lcd.begin(16, 2); Serial.begin(9600); pinMode(light, OUTPUT); pinMode(fan, OUTPUT); pinMode(TV, OUTPUT); lcd.print(" Home Automation "); lcd.setCursor(0,1); lcd.print(" Using PC "); delay(2000); lcd.clear(); lcd.print("Keywords For "); lcd.setCursor(0,1); lcd.print("Controlling"); delay(2000); lcd.clear(); lcd.print("1. LIGHT ON"); lcd.setCursor(0,1); lcd.print("2. LIGHT OFF"); delay(2000); lcd.clear(); lcd.print("3. FAN ON"); lcd.setCursor(0,1); lcd.print("4. FAN OFF"); delay(2000); lcd.clear(); lcd.print("5. TV ON"); lcd.setCursor(0,1); lcd.print("6. TV OFF"); delay(2000); defualt(); delay(1000); } void loop() { if(temp==1) { if((strncmp(str,"FAN ON", 6))==0) { lcd.clear(); digitalWrite(fan, HIGH); lcd.clear(); lcd.print("Fan Turned On"); delay(3000); defualt(); } else if(strncmp(str, "FAN OFF", 7)==0) { digitalWrite(fan, LOW); lcd.clear(); lcd.print("Fan Turned OFF"); delay(3000); defualt(); } else if(strncmp(str, "LIGHT ON", 8)==0) { digitalWrite(light, HIGH); lcd.clear(); lcd.print("Light Turned ON"); delay(3000); defualt(); } else if(strncmp(str, "LIGHT OFF", 9)==0) { digitalWrite(light, LOW); lcd.clear(); lcd.print("Light Turned OFF"); delay(3000); defualt(); } else if(strncmp(str, "TV ON", 5)==0) { digitalWrite(TV, HIGH); lcd.clear(); lcd.print("TV Turned ON"); delay(3000); defualt(); } else if(strncmp(str, "TV OFF", 6)==0) { digitalWrite(TV, LOW); lcd.clear(); lcd.print("TV Turned OFF"); delay(3000); defualt(); } else { lcd.clear(); lcd.print(" Invalid Input"); lcd.setCursor(0,1); lcd.print(" Try Again "); delay(3000); defualt(); } } } void serialEvent() { while(Serial.available()) { char Inchar=Serial.read(); str[i]=Inchar; i++; lcd.print(Inchar); delay(50); if(Inchar == 0x0d) { temp=1; //Inchar=0; } } } void defualt() { lcd.clear(); lcd.print("Enter UR Choise:"); lcd.setCursor(0,1); lcd.cursor(); i=0; temp=0; } Video microcontroller-projects/pressure-sensor-bmp180-with-arduino

Pressure Sensor BMP180 Interfacing with Arduino Uno

After attaching that library, we can call special functions which will ease working with BMP180 sensor.

Components Required

, connecting pins, 220 resistor, BMP180 Barometric Pressure Sensor, 16x2 LCD, bread board. Arduino nightly

Circuit Diagram & Working Explanation

After calling for header we don't needto worry for establishing communication between Arduino Unoand BMP180 sensor. We can simplycall in special functions which will do that for us.We only need to Initialize an LCD and show the called values from SENSOR on it. pin for contrast control (VEE-controls how thick the characters should be shown) and3 control pins (RS&RW&E). In the circuit, you can observe thatI have only took two control pins, the contrast bit and READ/WRITE are not often used so they can be shorted to ground. This puts LCD in highest contrast and read mode. We just need to control ENABLE and RS pins to send characters and data accordingly. The connections which are done for LCD are given below: PIN1 or VSS to ground PIN2 or VDD or VCC to +5v power PIN3 or VEE to ground (gives maximum contrast best for a beginner) PIN4 or RS (Register Selection) to PIN8 of ARDUINO UNO PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for user) PIN6 or E (Enable) toPIN9 of ARDUINO UNO PIN11 or D4 to PIN10 of ARDUINO UNO PIN12 or D5 to PIN11 of ARDUINO UNO PIN13 or D6 to PIN12 of ARDUINO UNO PIN14 or D7 to PIN13 of ARDUINO UNO ] So from mere observation from above table we are connecting 6 pins of LCD to controller in which 4 pins are data pins and 2 pins for control. we need to do following:
#include <Adafruit_BMP085.h> #include <Wire.h> #include <LiquidCrystal.h> Serial.begin(9600); String PRESSUREVALUE = String(bmp.readPressure()); String TEMPARATUREVALUE = String(bmp.readTemperature());
First we need to call the header file for enabling special functions ᾣinclude<Adafruit_BMP085.h>ᾮ With this header file we can call functions that can read values from Sensor directly without any fuzz. Now we need to enable the C communication, this is done by calling ᾣinclude <Wire.h>ᾠheader file. We can read pressure by callingᾠString PRESSUREVALUE = String(bmp.readPressure());ᾮ Here the pressure value will be read from sensor and is stored in the string “PRESSUREVALUEᾮ We can read temparature by callingᾠString TEMPARATUREVALUE = String(bmp.readTemperature());ᾮ Here the pressure value will be read from sensor and is stored in the string “TEMPARATUREVALUEᾮ First we need to enable the header file (ᾣinclude<LiquidCrystal.h>ᾩ, this header file has instructions written in it, which enables the user to interface an LCD to UNO in 4 bit mode without any fuzz. With this header file we need not have to send data to LCD bit by bit, this will all be taken care of and we don’t have to write a program for sending data or a command to LCD bit by bit. Second we need to tell the board which type of LCD we are using here. Since we have so many different types of LCD (like 20*4, 16*2, 16*1 etc.). In here we are going to interface a 16*2 LCD to the UNO so we get ‘lcd.begin(16,2);ᾮ For 16*1 we get ‘lcd.begin(16,1);ᾮ In this instruction we are going to tell the board where we connected the pins, The pins which are connected are to be represented in order as “RS, En, D4, D5, D6, D7ᾮ These pins are to be represented correctly. Since we connected RS to PIN0 and so on as show in circuit diagram, We represent the pin number to board as “LiquidCrystallcd(0,1,8,9,10,11);ᾮ After above there all there is left is to send data, the data which needs to be displayed in LCD should be written as “cd.print("hello, world!");ᾮ With this command the LCD displays ‘hello, world!ᾮ As you can see we need not worry about any this else, we just have to initialize and the UNO will be ready to display data. We don’t have to write a program loop to send the data BYTE by BYTE here.After reading the value from sensor we are going to display them on 16x2 LCD. Code #include <Adafruit_BMP085.h> #include <Wire.h> #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 10, 11, 12, 13);//RS,EN,D4,D5,D6,D7 char PRESSURESHOW[4];// initializing a character of size 4 for showing the result char TEMPARATURESHOW[4];// initializing a character of size 4 for showing the temparature result Adafruit_BMP085 bmp; void setup() { lcd.begin(16, 2); // Print a logo message to the LCD. lcd.print(" CIRCUITDIGEST"); lcd.setCursor(0, 1); delay (2500); delay (2500); lcd.clear();//clear display // Print another message to the LCd Serial.begin(9600); if (!bmp.begin()) { Serial.println("ERROR");///if there is an error in communication while (1) {} } } void loop() { lcd.print("Pressure= "); // print name String PRESSUREVALUE = String(bmp.readPressure()); // convert the reading to a char array PRESSUREVALUE.toCharArray(PRESSURESHOW, 4); lcd.print(PRESSURESHOW); lcd.print("hPa "); lcd.setCursor(0, 1); //// set the cursor to column 0, line 1 lcd.print("Tempar.=");// print name String TEMPARATUREVALUE = String(bmp.readTemperature()); // convert the reading to a char array TEMPARATUREVALUE.toCharArray(TEMPARATURESHOW, 4); lcd.print(TEMPARATURESHOW); lcd.print("C "); lcd.setCursor(0, 0);/ set the cursor to column 0, line1 delay(1000); } Video microcontroller-projects/tachometer-using-arduino

DIY Tachometer using Arduino and IR Sensor

using IR sensor module to detect object for count rotation of any rotating body. As IR transmits IR rays which reflect back to IR receiver and then IR Module generates an output or pulse which is detected by the arduino controller when we press start button. Itcounts continuously for 5 seconds. After 5 seconds arduino calculate RPM for a minute using given formula. RPM= Count x12 for single object rotating body. But here we demonstrate this project using ceiling fan. So we have done some changes that is given below: RPM=count x12 / objects Where object = number of blade in fan.

Required Components for Arduino Tachometer

Arduino Pro Mini IR sensor Module 16x2 LCD Push button Bread board 9 volt battery Connecting wires

Circuit Diagram and Explanation

).The output of photo diode is connected to a comparator, which compare photo diode output with reference voltage and result is given asoutput to arduino. In code we have used digital read function to read output of IRsensor module and then calculate RPM. Code // Code for Arduino Tachometer using IR Sensor #include <LiquidCrystal.h> LiquidCrystal lcd(3, 2, 4, 5, 6, 7); #define sensor 18 #define start 10 int delay1() { //unsigned int long k; int i,j; unsigned int count=0; for(i=0;i<1000;i++) { for(j=0;j<1227;j++) { if(digitalRead(sensor)) { count++; while(digitalRead(sensor)); } } } return count; } void setup() { pinMode(sensor, INPUT); pinMode(start, INPUT); pinMode(13, OUTPUT); lcd.begin(16, 2); lcd.print("Techometer"); lcd.setCursor(0,1); lcd.print("Circuit Digest"); delay(2000); digitalWrite(start, HIGH); } void loop() { unsigned int time=0,RPM=0; lcd.clear(); lcd.print(" Please Press "); lcd.setCursor(0,1); lcd.print("Button to Start "); while(digitalRead(start)); lcd.clear(); lcd.print("Reading RPM....."); time=delay1(); lcd.clear(); lcd.print("Please Wait....."); RPM=(time*12)/3; delay(2000); lcd.clear(); lcd.print("RPM="); lcd.print(RPM); delay(5000); } Video microcontroller-projects/digital-code-lock-using-arduino

Digital Code Lock using Arduino

is imitated in this project using arduino board and a matrix keypad.

Components

Arduino Keypad Module Buzzer 16x2 LCD BC547 Transistor Resistor (1k) Bread board Power Connecting wires ] we have used keypad library so we do not need to make any multiplexing code for this system. We only need to use keypad library for providing input.

Circuit Description

Circuit of this project is very simple which contains Arduino, keypad module, buzzer and LCD. Arduino controls the complete processeslike taking password form keypad module, comparing passwords, driving buzzer and sending status to LCD display. Keypad is used for taking password. Buzzer is used for indications and LCD is used for displaying status or messages on it. Buzzer is driven by using a NPN transistor. Control pin RS, RW and En are directly connected to arduino pin 13, GND and 12. And data pin D4-D7 is connected to pins 11, 10, 9 and 8 of arduino. And one buzzer is connected at pin 14(A1) of arduino through a BC547 NPN transistor.

Working

We have used inbuilt arduino’s EEPROM to save password, so when we run this circuit first time program read a garbage data from inbuilt arduino’s EEPROM and compare it with input password and give a message on LCD that is Access Denied because password does not match. For solving this problem we need to set a default password for the first time by using programming given below: for(int j=0;j<4;j++) EEPROM.write(j, j+49); lcd.print("Enter Ur Passkey:"); lcd.setCursor(0,1); for(int j=0;j<4;j++) pass[j]=EEPROM.read(j); This will set password ᾱ234ᾠto EEPROM of Arduino. After running it first time weneed to remove this from program and again write the code in to the arduino and run. Now your system will run fine. And for your second time used password is now ᾱ234ᾮNow you can change it by pressing # button and then enter your current password and then enter your new password. When you will enter your password, system will compare your entered password with that password that is stored in EEPROM of arduino. If match isoccurred then LCD will show “access grantedᾠand if password is wrong then LCD will “Access Deniedᾠand buzzer continuously beep for some time.And buzzer is also beep a single time whenever userwill press any button from keypad.

Programming Description

In code we have used keypad library for interfacing keypad with arduino. #include <Keypad.h> #include<LiquidCrystal.h> #include<EEPROM.h> const byte ROWS = 4; //four rows const byte COLS = 4; //four columns char hexaKeys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} }; byte rowPins[ROWS] = {3, 2, 1, 0}; //connect to the row pinouts of the keypad byte colPins[COLS] = {4, 5, 6, 7}; //connect to the column pinouts of the keypad //initialize an instance of class NewKeypad Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); We have included LCD library for LCD interfacing and for interfacing EEPROM we have included library EEPROM.h., andthen initializedvariable and defined pins for components. #define buzzer 15 LiquidCrystal lcd(13,12,11,10,9,8); char password[4]; char pass[4],pass1[4]; int i=0; char customKey=0; And then we initialized LCD and give direction to pins in setup function void setup() { lcd.begin(16,2); pinMode(led, OUTPUT); pinMode(buzzer, OUTPUT); pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); lcd.print(" Electronic "); lcd.setCursor(0,1); lcd.print(" Keypad Lock "); delay(2000); lcd.clear(); lcd.print("Enter Ur Passkey:"); lcd.setCursor(0,1); After this we readkeypad in loop function customKey = customKeypad.getKey(); if(customKey=='#') change(); if (customKey) { password[i++]=customKey; lcd.print(customKey); beep(); } And then compare password with save password using string compare method. if(i==4) { delay(200); for(int j=0;j<4;j++) pass[j]=EEPROM.read(j); if(!(strncmp(password, pass,4))) { digitalWrite(led, HIGH); beep(); lcd.clear(); lcd.print("Passkey Accepted"); delay(2000); lcd.setCursor(0,1); lcd.print("#.Change Passkey"); delay(2000); lcd.clear(); lcd.print("Enter Passkey:"); lcd.setCursor(0,1); i=0; digitalWrite(led, LOW); } This is password change function and buzzer beep function void change() { int j=0; lcd.clear(); lcd.print("UR Current Passk"); lcd.setCursor(0,1); while(j<4) { char key=customKeypad.getKey(); if(key) { pass1[j++]=key; lcd.print(key); void beep() { digitalWrite(buzzer, HIGH); delay(20); digitalWrite(buzzer, LOW); } Code #include <Keypad.h> #include<LiquidCrystal.h> #include<EEPROM.h> #define buzzer 15 LiquidCrystal lcd(13,12,11,10,9,8); char password[4]; char pass[4],pass1[4]; int i=0; char customKey=0; const byte ROWS = 4; //four rows const byte COLS = 4; //four columns char hexaKeys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} }; byte rowPins[ROWS] = {3, 2, 1, 0}; //connect to the row pinouts of the keypad byte colPins[COLS] = {4, 5, 6, 7}; //connect to the column pinouts of the keypad //initialize an instance of class NewKeypad Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); void setup() { lcd.begin(16,2); pinMode(led, OUTPUT); pinMode(buzzer, OUTPUT); pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); lcd.print(" Electronic "); lcd.setCursor(0,1); lcd.print(" Keypad Lock "); delay(2000); lcd.clear(); lcd.print("Enter Ur Passkey:"); lcd.setCursor(0,1); for(int j=0;j<4;j++) EEPROM.write(j, j+49); for(int j=0;j<4;j++) pass[j]=EEPROM.read(j); } void loop() { customKey = customKeypad.getKey(); if(customKey=='#') change(); if (customKey) { password[i++]=customKey; lcd.print(customKey); beep(); } if(i==4) { delay(200); for(int j=0;j<4;j++) pass[j]=EEPROM.read(j); if(!(strncmp(password, pass,4))) { digitalWrite(led, HIGH); beep(); lcd.clear(); lcd.print("Passkey Accepted"); delay(2000); lcd.setCursor(0,1); lcd.print("#.Change Passkey"); delay(2000); lcd.clear(); lcd.print("Enter Passkey:"); lcd.setCursor(0,1); i=0; digitalWrite(led, LOW); } else { digitalWrite(buzzer, HIGH); lcd.clear(); lcd.print("Access Denied..."); lcd.setCursor(0,1); lcd.print("#.Change Passkey"); delay(2000); lcd.clear(); lcd.print("Enter Passkey:"); lcd.setCursor(0,1); i=0; digitalWrite(buzzer, LOW); } } } void change() { int j=0; lcd.clear(); lcd.print("UR Current Passk"); lcd.setCursor(0,1); while(j<4) { char key=customKeypad.getKey(); if(key) { pass1[j++]=key; lcd.print(key); beep(); } key=0; } delay(500); if((strncmp(pass1, pass, 4))) { lcd.clear(); lcd.print("Wrong Passkey..."); lcd.setCursor(0,1); lcd.print("Better Luck Again"); delay(1000); } else { j=0; lcd.clear(); lcd.print("Enter New Passk:"); lcd.setCursor(0,1); while(j<4) { char key=customKeypad.getKey(); if(key) { pass[j]=key; lcd.print(key); EEPROM.write(j,key); j++; beep(); } } lcd.print(" Done......"); delay(1000); } lcd.clear(); lcd.print("Enter Ur Passk:"); lcd.setCursor(0,1); customKey=0; } void beep() { digitalWrite(buzzer, HIGH); delay(20); digitalWrite(buzzer, LOW); } Video microcontroller-projects/arduino-color-sensor-tcs3200

Color Detector using Arduino Uno

TCS3200 is a color sensor which can detect any number of colors with right programming.TCS3200 contains RGB (Red Green Blue) arrays. As shown in figure on microscopic level one can see the square boxes inside the eye on sensor. These square boxes are arrays of RGB matrix. Each of these boxes contain Three sensors, One is for sensing RED light intensity, One is for sensing GREEN light intensity and the last in for sensing BLUE light intensity. .The module can be featured to sense the particular color and to leave the others. Itcontains filters for that selection purpose. There is forth mode that is no filter mode. With no filter mode the sensor detects white light.

Components Required

ARDUINO UNO, power supply (5v), LED, JHD_162ALCD (16*2LCD),TCS3200 color sensor. ARDUINO IDE (ARDUINO nightly).

Circuit Diagram and Working Explanation

pin for contrast control (VEE-controls how thick the characters should be shown), and 3 control pins (RS&RW&E) ] The connections which are done for LCD are given below: PIN1 or VSS to ground PIN2 or VDD or VCC to +5v power PIN3 or VEE to ground (gives maximum contrast best for a beginner) PIN4 or RS (Register Selection) to PIN8 of ARDUINO UNO PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for user) PIN6 or E (Enable) toPIN9 of ARDUINO UNO PIN11 or D4 to PIN7 of ARDUINO UNO PIN12 or D5 to PIN11 of ARDUINO UNO PIN13 or D6 to PIN12 of ARDUINO UNO PIN14 or D7 to PIN13 of ARDUINO UNO The connections which are done for color sensor are given below: VDD to +5V GND to GROUND OE (output Enable) to GND S0 to UNO pin 2 S1 to UNO pin 3 S2 to UNO pin 4 S3 to UNO pin 5 OUT to UNO pin 10 The color which needs to be sensed by the color sensor is selected by two pins S2 and S3. With these two pins logic control we can tell sensor which color light intensity is to be measured. Say we need to sense the RED color intensity we need to set both pins to LOW. Once that is done the sensor detects the intensity and sends the value to the control system inside the module.
LLRed
LHBlue
HLClear (no filter)
HHGreen
The control system inside the module is shown in figure. The light intensity measured by array is sent to current to frequency converter. What it does is, it puts out a square wave whose frequency is in relation to current sent by ARRAY. So we have a system which sends out a square wave whose frequency depends on light intensity of color which is selected by S2 and S3. The signal frequency sent by module can be modulated depending on use. We can change the output signal frequency bandwidth.
LLPower Down
LH2%
HL20%
HH100%
The frequency scaling is done by two bits S0 and S1. For convenience we are going to limit the frequency scaling to 20%. This is done by setting S0 to high and S1 to LOW. This feature comes in handy when we are using the module on system with low clock. The Array sensitivity to color is shown in below figure. Although different colors have different sensitivity, for a normal use it won’t make much difference. The UNO here send signal to module to detect colors and the data received by the module is shown in the 16*2 LCD connected to it. The UNO detects three color intensities separately and shows them on LCD. The Uno can detect the signal pulse duration by which we can get the frequency of square wave sent by module. With the frequency at hand we can match it with color on sensor.
Int frequency = pulseIn(10, LOW);
pin of UNO and stores it value in “frequencyᾠinteger. All three color intensities are shown by frequencies on 16x2 LCD. Code int OutPut= 10;//naming pin10 of uno as output unsigned int frequency = 0; #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 7, 11, 12, 13);//RS,EN,D4,D5,D6,D7 void setup() { // set up the LCD's number of columns and rows lcd.begin(16, 2); pinMode(2, OUTPUT); pinMode(3, OUTPUT);//PINS 2, 3,4,5 as OUTPUT pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(10, INPUT);//PIN 10 as input digitalWrite(2,HIGH); digitalWrite(3,LOW);//setting frequency selection to 20% } void loop() { lcd.print("R=");//printing name digitalWrite(4,LOW); digitalWrite(5,LOW);//setting for RED color sensor frequency = pulseIn(OutPut, LOW);//reading frequency lcd.print(frequency);//printing RED color frequency lcd.print(" "); lcd.setCursor(7, 0);//moving courser to position 7 delay(500); lcd.print("B=");// printing name digitalWrite(4,LOW); digitalWrite(5,HIGH);// setting for BLUE color sensor frequency = pulseIn(OutPut, LOW);// reading frequency lcd.print(frequency);// printing BLUE color frequency lcd.print(" "); lcd.setCursor(0, 1); delay(500); lcd.print("G=");// printing name digitalWrite(4,HIGH); digitalWrite(5,HIGH);// setting for GREEN color sensor frequency = pulseIn(OutPut, LOW);// reading frequency lcd.print(frequency);// printing GREEN color frequency lcd.print(" "); lcd.setCursor(0, 0); delay(500); } Video microcontroller-projects/automatic-room-light-controller-with-bidirectional-visitor-counter-using-arduino

Automatic Room Light Controller with Bidirectional Visitor Counter

by using Arduino Uno. Itis very interesting project for hobbyists and students for fun as well as learning.

Components

Arduino UNO Relay (5v) Resisters IR Sensor module 16x2 LCD display Bread Board Connecting Wires Led BC547 Transistor ᾠis based on the interfacing of some components such as sensors, motors etc. with arduinomicrocontroller.This counter can count people in both directions. This circuit can be used to count the number of persons entering a hall/mall/home/office in the entrance gate and it can count the number of persons leaving the hall by decrementing the count at same gate or exit gate and itdepends upon sensor placement in mall/hall. It can also be used at gates of parking areas and other public places. This project is divided in four parts: sensors, controller,counter display and gate. The sensor would observe an interruption and provide an input to the controller which would run the counter increment or decrement depending on entering or exiting of the person. And counting is displayed on a 16x2 LCD through the controller. When any one enters in the room, IRsensor will get interrupted by the object then other sensor will not work because we have added a delay for a while.

Circuit Explanation

There are some sections of whole visitor counter circuit that are sensor section, control section, display section and driver section. In this section we have used two IR sensor modules which contain IR diodes, potentiometer, Comparator (Op-Amp) and LED’s. Potentiometer is used for setting reference voltage at comparator’s one terminal and IR sensors sense the object or person and provide a change in voltage at comparator’s second terminal. Then comparator compares both voltages and generates a digital signal at output. Here in this circuit we have used two comparators for two sensors. LM358 is used as comparator. LM358 has inbuilt two low noise Op-amp. to learn more about operating relay with Arduino. Display section contains a 16x2 LCD. This section will display the counted number of people and light status when no one will in the room. Relay driver section consist a BC547 transistor and a 5 volt relay for controlling the light bulb. Transistor is used to drive the relay because arduino does not supply enough voltage and current to drive relay. So we added a relay driver circuit to get enough voltage and current for relay. Arduino sends commands to this relay driver transistor and then light bulb will turn on/off accordingly.

Visitor Counter Circuit Diagram

The outputs of IR Sensor Modules are directly connected to arduino digital pin number 14(A0) and 19(A5). And Relay driver transistor at digital pin 2. LCD is connected in 4 bit mode. RS and EN pin of LCD is directly connected at 13 and 12. Data pin of LCD D4-D7 is also directly connected to arduino at D11-D8 respectively. Rest of connections are shown in the below circuit diagram.

CodeExplanation

First we have included library for LCD and defined pin for the same. And also defined input output pin for sensors and ralay. Then given direction to input output pin and initialized LCD in setup loop. In loop function we readsensors input and increment or decrement the counting depending upon enter or exit operation. And also check for zero condition. Zero condition means no one in the room. If zero condition is true then arduino turn off the bulb by deactivating the relay through transistor. And if zero condition is false then arduino turnson the light.Here is two functions for enter and exit. Code #include<LiquidCrystal.h> LiquidCrystal lcd(13,12,11,10,9,8); #define in 14 #define out 19 #define relay 2 int count=0; void IN() { count++; lcd.clear(); lcd.print("Person In Room:"); lcd.setCursor(0,1); lcd.print(count); delay(1000); } void OUT() { count--; lcd.clear(); lcd.print("Person In Room:"); lcd.setCursor(0,1); lcd.print(count); delay(1000); } void setup() { lcd.begin(16,2); lcd.print("Visitor Counter"); delay(2000); pinMode(in, INPUT); pinMode(out, INPUT); pinMode(relay, OUTPUT); lcd.clear(); lcd.print("Person In Room:"); lcd.setCursor(0,1); lcd.print(count); } void loop() { if(digitalRead(in)) IN(); if(digitalRead(out)) OUT(); if(count<=0) { lcd.clear(); digitalWrite(relay, LOW); lcd.clear(); lcd.print("Nobody In Room"); lcd.setCursor(0,1); lcd.print("Light Is Off"); delay(200); } else digitalWrite(relay, HIGH); } Video microcontroller-projects/electronic-voting-machine-using-arduino

Electronic Voting Machine using Arduino

, you can check the link.

Components

Arduino Uno 16x2 LCD Push button Bread board Power Connecting wires

Arduino Electronic Voting Machine Circuit Diagram and Working

In this project we have used four push buttons for four different candidates. We can increase the number of candidate but for better understanding we have limited it to four. When any voter press any of four button then respecting voting value will increment by one each time. After whole voting we will press result button to see the results. As the "result" button is pressed,arduino calculates the total votes of each candidate andshow it on LCD display. Circuit of this project is quite easy which contains Arduino, push buttons and LCD. Arduino controls the complete processeslike reading button, incrementing vote value, generating result and sending vote and result to LCD. Here we have added five buttons in which first button is for BJP, second for INC, third is for AAP, forth is for OTH means others and last button is used for calculating or displaying results. Control pin RS, RW and En are directly connected to arduino pin 12, GND and 11. And data pin D4-D7 is connected to pins 5, 4, 3 and 2 of arduino.

Arduino EVM Code Description

First of all we include header and define pins for LCD and than initialize some variables and pin for taking candidate's voting input means switch. After it, initialize the LCD and give direction to input-output pins. and then make pullup the input pin by software. In code we have used digital read function to read Button pressed. And then displaying voting on the LCD with the candidate party’s Name. Code //Arduino based EVM Code #include<LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); #define sw1 15 #define sw2 16 #define sw3 17 #define sw4 18 #define sw5 19 int vote1=0; int vote2=0; int vote3=0; int vote4=0; void setup() { pinMode(sw1, INPUT); pinMode(sw2,INPUT); pinMode(sw3,INPUT); pinMode(sw4,INPUT); pinMode(sw5,INPUT); lcd.begin(16, 2); lcd.print("Voting Machine"); lcd.setCursor(0,1); lcd.print("Circuit Digest"); delay(3000); digitalWrite(sw1, HIGH); digitalWrite(sw2, HIGH); digitalWrite(sw3, HIGH); digitalWrite(sw4, HIGH); digitalWrite(sw5, HIGH); lcd.clear(); lcd.setCursor(0,0); lcd.print("BJP"); lcd.setCursor(4,0); lcd.print("INC"); lcd.setCursor(8,0); lcd.print("AAP"); lcd.setCursor(12,0); lcd.print("OTH"); } void loop() { lcd.setCursor(0,0); lcd.print("BJP"); lcd.setCursor(1,1); lcd.print(vote1); lcd.setCursor(4,0); lcd.print("INC"); lcd.setCursor(5,1); lcd.print(vote2); lcd.setCursor(8,0); lcd.print("AAP"); lcd.setCursor(9,1); lcd.print(vote3); lcd.setCursor(12,0); lcd.print("OTH"); lcd.setCursor(13,1); lcd.print(vote4); if(digitalRead(sw1)==0) vote1++; while(digitalRead(sw1)==0); if(digitalRead(sw2)==0) vote2++; while(digitalRead(sw2)==0); if(digitalRead(sw3)==0) vote3++; while(digitalRead(sw3)==0); if(digitalRead(sw4)==0) vote4++; while(digitalRead(sw4)==0); if(digitalRead(sw5)==0) { int vote=vote1+vote2+vote3+vote4; if(vote) { if((vote1 > vote2 && vote1 > vote3 && vote1 > vote4)) { lcd.clear(); lcd.print("BJP Wins"); delay(2000); lcd.clear(); } else if((vote2 > vote1 && vote2 > vote3 && vote2 > vote4)) { lcd.clear(); lcd.print("INC Wins"); delay(2000); lcd.clear(); } else if((vote3 > vote1 && vote3 > vote2 && vote3 > vote4)) { lcd.clear(); lcd.print("AAP Wins"); delay(2000); lcd.clear(); } else if(vote4 > vote1 && vote4 > vote2 && vote4 > vote3) { lcd.setCursor(0,0); lcd.clear(); lcd.print("OTH Wins"); delay(2000); lcd.clear(); } else if(vote4 > vote1 && vote4 > vote2 && vote4 > vote3) { lcd.setCursor(0,0); lcd.clear(); lcd.print("OTH Wins"); delay(2000); lcd.clear(); } else { lcd.clear(); lcd.print(" Tie Up Or "); lcd.setCursor(0,1); lcd.print(" No Result "); delay(1000); lcd.clear(); } } else { lcd.clear(); lcd.print("No Voting...."); delay(1000); lcd.clear(); } vote1=0;vote2=0;vote3=0;vote4=0,vote=0; lcd.clear(); } } Video microcontroller-projects/heartbeat-monitor-project-using-arduino

Arduino Based Heartbeat Monitor

which senses the heartbeat upon putting a finger on the sensor.

Components

Arduino Heart Beat sensor module 16x2 LCD Push button Bread board Power Connecting wires

Working of Heartbeat Monitor Project

Working of this project is quite easy but a little calculation for calculating heart rate is required. There are severalmethods for calculating heart rate, but here we have read only five pulses. Then we have calculated total heart beat in a minute by applying the below formula: Five_pusle_time=time2-time1; Single_pulse_time= Five_pusle_time /5; rate=60000/ Single_pulse_time; where time1 is first pulse counter value time2 is list pulse counter value rate is final heart rate. When first pulse comes,we startcounter by using timer counter function in arduino that is millis();. And takefirst pulse counter value form millis();. Then we wait for five pulses. After getting five pulses we again take counter value in time2 and then we substarct time1 from time2 to take original time taken by five pulses. And then divide this time by 5 times for getting single pulse time. Now we have time for single pulse and we can easily find the pulse in one minute, deviding 600000 ms by single pulse time. Rate= 600000/single pulse time. to detect Heart Beat. This sensor module contains an IR pair which actually detect heart beat from blood. Heart pumps the blood in body which is called heart beat, when it happensthe blood concentration in body changes. And we use this change to make a voltage or pulse electrically.

Circuit Diagram and Explanation

Circuit of heartbeat monitor is shown below,which contains arduino uno, heart beat sensor module, reset button and LCD. Arduino controls whole the process of system like reading pulses form Heart beat sensor module, calculating heart rate and sending this data to LCD.We can set the sensitivity of this sensor module by inbuilt potentiometer placed on this module. Control pin RS, RW and En are directly connected to arduino pin 12, GND and 11. And data pin D4-D7 is connected to pins 5, 4, 3 and 2 of arduino. And one push button is added for resetting reading and another is used to start the system for reading pulses. When we need to count heart rate, we press start button then arduino start counting pulses and also start counter for five seconds. This start push button is connected to pin 7 and reset push button is connected to pin 6 of arduino with respect to ground.

Program Description

In code we have used digital read function to read output of Heart Beat sensor module and millis() fuction for calculating time and then calculate Heart Rate. Before this we have initiazed all the components that we used in this project. and here we have pullup the push button line by using software pullup. Code #include<LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int in = 8; int Reset=6; int start=7; int count=0,i=0,k=0,rate=0; unsigned long time2,time1; unsigned long time; byte heart[8] = { 0b00000, 0b01010, 0b11111, 0b11111, 0b11111, 0b01110, 0b00100, 0b00000 }; void setup() { lcd.createChar(1, heart); lcd.begin(16,2); lcd.print("Heart Beat "); lcd.write(1); lcd.setCursor(0,1); lcd.print("Monitering"); pinMode(in, INPUT); pinMode(Reset, INPUT); pinMode(start, INPUT); digitalWrite(Reset, HIGH); digitalWrite(start, HIGH); delay(1000); } void loop() { if(!(digitalRead(start))) { k=0; lcd.clear(); lcd.print("Please wait......."); while(k<5) { if(digitalRead(in)) { if(k==0) time1=millis(); k++; while(digitalRead(in)); } } time2=millis(); rate=time2-time1; rate=rate/5; rate=60000/rate; lcd.clear(); lcd.print("Heart Beat Rate:"); lcd.setCursor(0,1); lcd.print(rate); lcd.print(" "); lcd.write(1); k=0; rate=0; } if(!digitalRead(Reset)) { rate=0; lcd.clear(); lcd.print("Heart Beat Rate:"); lcd.setCursor(0,1); lcd.write(1); lcd.print(rate); k=0; } } Video microcontroller-projects/led-chaser-using-arduino-rotary-encoder

LED Chaser using Arduino and Rotary Encoder

ARDUINO UNO is an ATMEGA controller based development board designed for electronic engineers and hobbyists. In ARDUINO we have 20 I/O pins, so we can program 20 pins of UNO to be used as either input or output. is used to know the position of movement and angular movement of a motor or axis. It’s a three terminal device usually, with power and ground pins there are total 5 terminals. A ROTARY ENCODER module is shown below. The pins of a rotary encoder are: Ground Positive connected to +5V Output signal A pin Output signal B pin Clock pin or common pin The ENCODER provides pulses representing the change in the shaft position for the systems to understand.Consider a ROTARY ENCODER is powered up and the shaft is moved. As shown in above table, consider the shaft is moved clock wise. With this there will be Falling Edge at the A terminal then at B terminal. Consider the shaft is moved Anti clock wise. With this there will be Falling Edge at the B terminal then at A terminal. This edge will occur once for 360/20 = 18 degrees (This is for a Encoder with 20 position, this changes from type to type, higher the count greater the accuracy). With both above conditions, we can get direction and degree of rotation. Thus we get required parameters for getting the position of a shaft.

Components Required

Arduino uno board, connecting pins, 220 resistor, LED (eight pieces), 1K resistor, 220 resistor (2pieces), 100nF capacitor (2 pieces ), bread board. Arduino nightly

Circuit Diagram and Working Explanation

The capacitors here are for neutralizing the contact bouncing effect in ENCODER. Without those capacitors there will be some serious problems in position reading. When the shaft is moved there will be time difference between two output pins output. The Arduino UNO will recognize this time difference for clockwise of Anti clock wise rotation. If the rotation is clockwise the binary count is incremented by one, and this count is shown in LED port as shown in figure. If the rotation is Anti clock wise the binary count is decremented by one and the binary count is shown at LED byte. is explained step by step in C code given below. Code int count =0; int x=0; int y=0; void setup() { DDRD = 0xFF;//LED port as output PORTD =0;//0V at PORTD pinMode(8,INPUT);// sets the pin8 as input pinMode(9,INPUT);// sets the pin9 as input } void loop() { if ((digitalRead(8)==LOW)||(digitalRead(9)==LOW))//If any Encoder pins show falling edge execute lop { delay(10); if (digitalRead(8)==LOW)//if PINB is second to go LOW { if (count<255) { count++;//increment binary count if count is less than 255 } } if (digitalRead(9)==LOW)//is PINA is second to go LOW { if (count>0) { count--;//if binary count is greater than 0 decrease count by 1 } } delay(100); while ((digitalRead(8)==LOW)&&(digitalRead(9)==LOW))// wait till shaft position reset { } } PORTD = count;//showing count at LED port. } Video microcontroller-projects/keypad-interfacing-with-arduino-uno

Keypad Interfacing with Arduino Uno

]

Components Required

ARDUINO UNO, power supply (5v), 100uF capacitor , buttons (two pieces), 1K resistor (two pieces), 4x4 Keypad Module, LED, JHD_162ALCD (16x2LCD). arduino IDE (Arduino nightly).

Circuit Diagram and Working Explanation

pin for contrast control (VEE-controls how thick the characters should be shown) and3 control pins (RS&RW&E). ] The connections which are done for LCD are given below: PIN1 or VSS to ground PIN2 or VDD or VCC to +5v power PIN3 or VEE to ground (gives maximum contrast best for a beginner) PIN4 or RS (Register Selection) to PIN8 of ARDUINO UNO PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for user) PIN6 or E (Enable) to PIN9 of ARDUINO UNO PIN11 or D4 to PIN10 of ARDUINO UNO PIN12 or D5 to PIN11 of ARDUINO UNO PIN13 or D6 to PIN12 of ARDUINO UNO PIN14 or D7 to PIN13 of ARDUINO UNO We are going to connect the keypad module between pins 0-7 of Arduino Uno, as shown in the circuit diagram. All the eight pins of keypad module are connected accordingly. Now for setting up a connection between Keypad Module and UNO, we need to get the keypad library from the ARDUINO website. After that we can directly call the header file. We will discuss each command below.
#include <Keypad.h> const byte ROWS = 4; // Four rows const byte COLS = 4; // Three columns // Define the Keymap char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'#','0','*','D'} }; // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins. byte rowPins[ROWS] = { 0, 1, 2, 3 }; // Connect keypad COL0, COL1 and COL2 to these Arduino pins. byte colPins[COLS] = { 4, 5, 6, 7 }; // Create the Keypad Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); char key = kpd.getKey();
First we will call the header file which enables user to access all keypad commands.We will write each key of keypad in matrix, for the UNO to understand the key press. Telling the Uno which pins are used to connect the keypad module. Telling the UNO to map each key on press. Getting the UNO mapped key in to a memory. The working of Arduino UnoKeypad Interface is best explained in C code givenbelow. Code #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 10, 11, 12, 13);//RS,EN,D4,D5,D6,D7 #include <Keypad.h>//header for keypad commands enabling const byte ROWS = 4; // Four rows const byte COLS = 4; // Three columns // Define the Keymap char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'#','0','*','D'} }; // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins. byte rowPins[ROWS] = { 0, 1, 2, 3 }; // Connect keypad COL0, COL1 and COL2 to these Arduino pins. byte colPins[COLS] = { 4, 5, 6, 7 }; // Create the Keypad Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup() { for(int k=8;k<14;k++) { pinMode(k,OUTPUT);//pins 8-14 are enabled as output } lcd.begin(16, 2);//initializing LCD } void loop() { char key = kpd.getKey(); //storing pressed key value in a char if (key != NO_KEY) { lcd.print(key); //showing pressed character on LCD } } Video microcontroller-projects/servo-motor-control-using-matlab

Servo Motor Control using MATLAB

, so that you can program your Arduino directly through Matlab.It is very useful when you are working on complex robotics like Robotic Hand, Humanoid etc. as you can process your complex program on your PC in Matlab and then directly program the results in Arduino. First of all you have to download Arduino support package from Matlab. You can download it by using following link: as it allows us to control servo motors. You may select other programs according to your choice. You may learn about various pde file by just opening it in Arduino IDE. on your Arduino and now we will move on to Matlab. I will try to teach you about Matlab code using picture so that it can be easy in understanding. folder as your current folder in Matlab. You can do it by clicking on ‘browse the folderᾮ which will be used to communicate between Arduino and Matlab. After that it will take few second to connect your Arduino to Matlab. You can see it in picture given below. In () you have to write about that COM port on which our Arduino is connected. And after the connection is successful, you can see what different hardware you can use. command to do it. command to do it. I have used servo motor which requires 7.4 V voltage supply. So I provide it power supply by using LiPo battery. One of the most Important thing is to short the ground of power supply to the ground of the Arduino otherwise the servo will not work properly. It is the most common mistake which happens. And also don’t give power to servo from your Arduino as it can destroy your Arduino. /> Video microcontroller-projects/arduino-magnetic-field-measurement

Magnetic Field Strength Measurement using Arduino

ᾮ ] Arduino has six ADC channels. In those any one or all of them can be used as inputs for analog voltage. The UNO ADC is of 10 bit resolution (so the integer values from (0-(2^10) 1023)). This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. So for every (5/1024= 4.9mV) per unit. line. Here one must understand that in each character there are 5x10=50 pixels so to display one character all 50 pixels must work together, but we need not have to worry about that because there a another controller (HD44780) in the display unit which does the job of controlling the pixels (you can see it in LCD unit, it is the black eye at the back).

Components Required

ARDUINO UNO, power supply (5v), JHD_162ALCD (16x2LCD), 100uF capacitor (2pieces), UGn3503U. arduino IDE (Arduino nightly)

Circuit Diagram and Explanation

pin for contrast control (VEE-controls how thick the characters should be shown) and3 control pins (RS&RW&E). In the circuit above, you can observe I have only took two control pins, the contrast bit and READ/WRITE are not often used so they can be shorted to ground. This puts LCD in highest contrast and read mode. We just need to control ENABLE and RS pins to send characters and data accordingly. The connections which are done for LCD are given below: PIN1 or VSS to ground PIN2 or VDD or VCC to +5v power PIN3 or VEE to ground (gives maximum contrast best for a beginner) PIN4 or RS (Register Selection) to PIN8 of ARDUINO UNO PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for user) PIN6 or E (Enable) to PIN9 of ARDUINO UNO PIN11 or D4 to PIN10 of ARDUINO UNO PIN12 or D5 to PIN11 of ARDUINO UNO PIN13 or D6 to PIN12 of ARDUINO UNO PIN14 or D7 to PIN13 of ARDUINO UNO The ARDUINO IDE allows the user to use LCD in 4 bit mode. This type of communication enables the user to decrease the pin usage on ARDUINO, unlike other the ARDUINO need not be programmed separately for using it in 4 it mode because by default the ARDUINO is set up to communicate in 4 bit mode. In the circuit you can see we used 4bit communication (D4-D7).So from mere observation from above table we are connecting 6 pins of LCD to controller in which 4 pins are data pins and 2 pins for control.

Working

For interfacing an LCD to the ARDUINO UNO, we need to know a few things.
analogRead(pin); analogReference(); analogReadResolution(bits);
First of all the UNO ADC channels has a default reference value of 5V. This means we can give a maximum input voltage of 5V for ADC conversion at any input channel. Since some sensors provide voltages from 0-2.5V, with a 5V reference we get lesser accuracy, so we have a instruction that enables us to change this reference value. So for changing the reference value we have (“analogReference();ᾩ As default we get the maximum board ADC resolution which is 10bits, this resolution can be changed by using instruction (“analogReadResolution(bits);ᾩ. This resolution change can come in handy for some cases. Now if the above conditions are set to default,we can read value from ADC of channel ᾰᾠby directly calling function “analogRead(pin);ᾬ here “pinᾠrepresents pin where we connected analog signal, in this case it would be “A0ᾮThe value from ADC can be taken into an integer as “int ADCVALUE = analogRead(A0); ᾬ by this instruction the value after ADC gets stored in the integer “ADCVALUEᾮ NOW let’s talk a bit about 16x2 LCD.First we need to enable the header file (ᾣinclude <LiquidCrystal.h>ᾩ, this header file has instructions written in it, which enables the user to interface an LCD to UNO in 4 bit mode without any fuzz. With this header file we need not have to send data to LCD bit by bit, this will all be taken care of and we don’t have to write a program for sending data or a command to LCD bit by bit. Second we need to tell the board which type of LCD we are using here. Since we have so many different types of LCD (like 20x4, 16x2, 16x1 etc.). In here we are going to interface a 16x2 LCD to the UNO so we get ‘lcd.begin(16, 2);ᾮ For 16x1 we get ‘lcd.begin(16, 1);ᾮ In this instruction we are going to tell the board where we connected the pins, The pins which are connected are to be represented in order as “RS, En, D4, D5, D6, D7ᾮ These pins are to be represented correctly. Since we connected RS to PIN0 and so on as show in circuit diagram, We represent the pin number to board as “LiquidCrystal lcd(0, 1, 8, 9, 10, 11);ᾮ After above there all there is left is to send data, the data which needs to be displayed in LCD should be written as ᾠcd.print("hello, world!");ᾮ With this command the LCD displays ‘hello, world!ᾮAs you can see we need not worry about any this else, we just have to initialize and the UNO will be ready to display data. We don’t have to write a program loop to send the data BYTE by BYTE here. is further explained through the below C code. Code #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 10, 11, 12, 13);/// REGISTER SELECT PIN,ENABLE PIN,D4 PIN,D5 PIN, D6 PIN, D7 PIN char ADCSHOW[5];//initializing a character of size 5 for showing the ADC result void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); } void loop() { lcd.print("FluxDensity");//showing name lcd.setCursor(0, 1);//move to second line lcd.print("(in Gauss):");// showing units String ADCVALUE = String((analogRead(A0)-515)/3.76);
/* Now since the default reference if 5V and resolution is 10bit so for every 5/1024 = 5mV, we get one increment is count, The sensor provides increment voltage of 1.3V for every 1Gauss increment if field. So we need to divide ADC value by 3.76 for getting the gauss value, now the 0 gauss output of sensor is 2.5V so we need to subtract that first. To hold a 0V read at 0Gauss field. */
// Convert the reading to a char array ADCVALUE.toCharArray(ADCSHOW, 5); lcd.print(ADCSHOW);//showing the field strength value lcd.print("G "); lcd.setCursor(0, 0);// set the cursor to column 0, line 0 } Video microcontroller-projects/rfid-with-arduino-uno-tutorial

RFID Interfacing with Arduino

In this tutorial we are going to design a system to read the ID of RFID cards. RFID stands for Radio Frequency Identification. Each card has a unique ID embedded in it. These systems have many applications, likein offices, shopping malls and in many other places where only the person with authorization card is allowed to enter inthe room.RFID is used in shopping malls to stop a theft from happening, here the product will be tagged with RFID chip and when a person leaves a building with the RFID chip an alarm is raised automatically and so the theft is stopped. The RFID tag is designed as small as grain of sand. The RFID authentication systems are easy to design and are cheap in cost. Some schools and colleges nowadays use RFID as attendance register.

Components Required

ARDUINO UNO, power supply (5v), 100uF capacitor , buttons (two pieces), 1K resistor (two pieces), EM-18(RFID reader module), LED, JHD_162ALCD (16*2LCD). arduino IDE (Arduino nightly).

Circuit Diagram and Explanation

pin for contrast control (VEE-controls how thick the characters should be shown) and3 control pins (RS&RW&E). In the circuit, you can observe thatI only took two control pins ashis give the flexibility of better understanding. The contrast bit and READ/WRITE are not often used so they can be shorted to ground. This puts LCD in highest contrast and read mode. We just need to control ENABLE and RS pins to send characters and data accordingly. The connections which are done for LCD are given below: PIN1 or VSS to ground PIN2 or VDD or VCC to +5v power PIN3 or VEE to ground (gives maximum contrast best for a beginner) PIN4 or RS (Register Selection) to PIN8 of ARDUINO UNO PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for user) PIN6 or E (Enable) to PIN9 of ARDUINO UNO PIN11 or D4 to PIN10 of ARDUINO UNO PIN12 or D5 to PIN11 of ARDUINO UNO PIN13 or D6 to PIN12 of ARDUINO UNO PIN14 or D7 to PIN13 of ARDUINO UNO Before going to further we need to understand about the serial communication. The RFID module here sends data to the controller in serial. It has other mode of communication but for easy communication we are choosing RS232. The RS232 pin of module is connected to RXD pin of UNO. The data sent by the RFID module goes as: Now for setting up a connection between RFID reader and Arduino Uno, we need to enable the serial communication in UNO. The serial communication enabling in UNO can be done by using a single command.
Serial.begin(9600); data = Serial.read();
As shown in figure above, the communication of RFID is done by a BAUD rate of 9600 bits per second. So for UNO to establish such baud rate and to start serial communication we use command "Serial.begin(9600);". Here 9600 is the baud rate and is changeable. Nowoncedata is received by the UNO, it will be available for taking. This data is picked up by command “data = Serial.read();ᾮ By this command serial data is taken to ‘dataᾠnamed integer. Once a card is brought near reader, the reader reads the serial data and sends it to UNO, the UNO will be programmed to show that value in LCD, so we will have ID of card on LCD. Code #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 10, 11, 12, 13);//RS,EN,D4,D5,D6,D7 int count = 0; //integer for storing character of ID char input[12];//memory for storing 12 characters of ID void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); Serial.begin(9600);//serial communication enabling by 9600 baud rate pinMode(0,INPUT);//receive pin set as output lcd.print("CIRCUITDIGEST");//showing name lcd.setCursor(0, 1);//move courser to second line } void loop() { while(Serial.available() && count < 12) // Read 12 characters and store them in input array { input[count] = Serial.read();//storing 12 characters one by one count++; lcd.print(input[count]);//showing 12 characters on LCD one by one if (count==12) { lcd.print(" "); count = 0;// once 12 characters are read get to start and wait for second ID lcd.setCursor(0, 1);//move courser to start. } } } Video microcontroller-projects/arduino-servo-motor-control-code-and-circuit

Servo Motor Control using Arduino

Servo Motors are used where there is a need for accurate shaft movement or position. These are not proposed for high speed applications. These are proposed for low speed, medium torque and accurate position application. These motors are used in robotic arm machines, flight controls and control systems. are available at different shapes and sizes. A servo motor will have mainly there wires, one is for positive voltage another is for ground and last one is for position setting. The RED wire is connected to power, Black wire is connected to ground and YELLOW wire is connected to signal. A servo motor is a combination of DC motor, position control system, gears.The position of the shaft of the DC motor is adjusted by the control electronics in the servo, based on the duty ratio of the PWM signal the SIGNAL pin. Simply speaking the control electronics adjust shaft position by controlling DC motor. This data regarding position of shaft is sent through the SIGNAL pin.The position data to the control should be sent in the form of PWM signal through the Signal pin of servo motor. The frequency of PWM (Pulse Width Modulated) signal can vary based on type of servo motor. The important thing here is the DUTY RATIO of the PWM signal. Based on this DUTY RATION the control electronics adjust the shaft. As shown in figure below, for the shaft to be moved to 9o clock the TURN ON RATION must be 1/18.ie. 1ms of ON time and 17ms of OFF time in a 18ms signal. For the shaft to be moved to 12o clock the ON time of signal must be 1.5ms and OFF time should be 16.5ms.This ratio is decoded by control system in servo and it adjusts the position based on it.This PWM in here is generated by using ARDUINO UNO.

Circuit Components

ARDUINO UNO, power supply (5v), 100uF capacitor , buttons (two pieces), 1K resistor (two pieces), Servo motor (which needed to be tested). arduino IDE (Arduino nightly).

ArduinoServo Motor Circuit Diagram and Explanation

In normal cases we need to go to the registers of controller for adjusting the frequency and for getting required duty ratio for accurate position control of servo, in ARDUINO we don’t have to do those things. In ARDUINO we have predefined libraries, which will set the frequencies and duty ratios accordingly once the header file is called or included. In ARDUINO we simply have to state the position of servo that needed and the PWM is automatically be adjusted by UNO. The things which we need to do for getting accurate position of servo are:
#include <Servo.h> Servo sg90servo; Sg90.attach(servo_signal_pin_attached_to); Sg90.write(needed_position_ angle);
First we need to set frequency of PWM signal and for that we should call ᾣinclude <Servo.h>ᾠheader file, on including this header file in the program, the frequency gets set automatically and we get to use some special conditions, which enables the user to enter needed position of servo directly without any fuzz. Now we need to define a name for the servo “Servo sg90sevoᾬ here ‘sg90servoᾠis the name chosen, so while writing for potion we are going to use this name, this feature comes in handy when we have many servos to control, we can control as many as eight servo by this. Now we tell the UNO where the signal pin of servo is connected or where it needs to generate the PWM signal. To do this we have “Sg90.attach(3);ᾬ here we are telling the UNO we connected the signal pin of servo at PIN3. All left is to set the position, we are going set the position of servo by using “Sg90.write(30);ᾬ by this command the servo hand moves 30 degrees, so that’s it.After that whenever we need to change the position of servo we need to call the command ”Sg90.write(needed_position_ angle);ᾮIn this circuit we will have two buttons one button increases the position of servo and the other is for decreasing the position of servo. is explained in step by step of C code given below. Code volatile int i=0;//initializing a integer for incrementing and decrementing duty ratio. #include <Servo.h>// header file for controlling servo Servo servo;//defining the name usage as servo itself void setup() { pinMode(3, OUTPUT); // sets the pin3 as output pinMode(0, INPUT);// sets the pin0 as output pinMode(1, INPUT);// sets the pin1 as output } void loop() { servo.write(i);//set servo potion ‘iᾠdegrees if (digitalRead(0)==LOW) { if (i<180) { i++;//if pin0 is pressed and degrees is less than 180 delay(30); } } if (digitalRead(1)==LOW) { if (i>0) { i--;// if pin1 is pressed and degrees is greater than 0 delay(30); } } } Video microcontroller-projects/dtmf-controlled-robot-using-arduino

DTMF Controlled Robot using Arduino

DTMF controlled Robot runs over mobile DTMF technology that exists in Dial tone. DTMF stands for Dual Tone Multiple Frequency. There are some frequencies that we useto create DTMF tone. In simple words by adding or mixing two or more frequencies generates DTMF tone. These frequencies are given below:

Required Components

Arduino UNO DC Motor Mobile Phone DTMF decoder Module Motor Driver L293D 9 Volt Battery Battery Connector Aux wire Robot Chasis with wheel Connecting wires DTMF is a Dual Tone Multiple Frequency decoder module which has a MT8870 DTMF decoder IC which decodes DTMF tone signal to digital signal that are acceptable for arduino digitally. Here an aux wire isneededfor connecting DTMF module to phone.

Block Diagram for DTMF Controlled Robot using Arduino

This section’s main component is DTMF. Here we get a tone from our cellphone by using aux wire to DTMF Decoder IC namely MT8870 which decodes the tone into digital signal of 4bit. Arduino UNO is used for controlling whole the process of robot. Arduino reads commands sent by DTMF Decoder and compare with define code or pattern. If commands are match arduino sends respective command to driver section. driver section consists motor driver and two DC motors. Motor driver is used for driving motors because arduino does not supply enough voltage and current to motor. So we add a motor driver circuit to get enough voltage and current for motor. By collecting commands from arduino motor driver drive motor according to commands.

Circuit Diagram and Working Explanation

, etc.. Here one motor driver is connected to arduino for driving robot. Motor driver’s input pin 2, 7, 10 and 15 is connected at arduino digital pin number 6, 5, 4 and 3 respectively. Here we have used two DC motors to driver robot in which one motor is connected at output pin of motor driver 3 and 6 and another motor is connected at 11 and 14. A 9 volt Battery is also used to power the motor driver for driving motors. A DTMF decoder attached with this circuit and this decoder is plugged into a mobile using an aux wire for receiving command or DTMF Tone. DTMF decoder pin D0-D3 is directly connected with Arduino’s pin number 19,18,17,16. Two 9 Volt batteries are used to power the circuit in which one is used for power the motors, connected at motor driver IC pin number 8. And another battery is connected to power the remaining circuit.

Working of DTMF Controlled Robot

run by some commands that are send via mobile phone. We are here using DTMF function of mobile phone. Here we have used the mobile phone to show working of project. One is user mobile phone that we will call ‘remote phoneᾠand second one that are connected with Robot’s circuit using aux wire. This mobile phone we will call ‘Receiver Phoneᾮ First we make a call by using remote phone to receiver phone and then attend the call by manually or automatic answer mode. Now here is how this DTMF controlled robot is controlled by cell phone: When we presses ᾲᾠby remote phone, robot start to moving forward and moving continues forward until next command comes. When we presses Ᾰᾠby remote phone, robot change his state and start moving in backward direction until other command comes. When we press ᾴᾬ Robot get turn left till next command exicuted. When we press ᾶᾬ robot turned to right. And for stopping robot we pass᾵ᾮ

Programming Explanation

In program first of all we have defined output pins for motors and Input pins for DTMF decoder output as in INPUT for Arduino. And then in setup set motor pin as OUTPUT and DTMF decoder output pins as INPUT. After that we read DTMF decoder output and then compare with defined values by using “ifᾠstatement and perform relative operation. that are giving below: We write program according to above table conditions. Code #define m11 3 #define m12 4 #define m21 5 #define m22 6 #define D0 19 #define D1 18 #define D2 17 #define D3 16 void forward() { digitalWrite(m11, HIGH); digitalWrite(m12, LOW); digitalWrite(m21, HIGH); digitalWrite(m22, LOW); } void backward() { digitalWrite(m11, LOW); digitalWrite(m12, HIGH); digitalWrite(m21, LOW); digitalWrite(m22, HIGH); } void left() { digitalWrite(m11, HIGH); digitalWrite(m12, LOW); digitalWrite(m21, LOW); digitalWrite(m22, LOW); } void right() { digitalWrite(m11, LOW); digitalWrite(m12, LOW); digitalWrite(m21, HIGH); digitalWrite(m22, LOW); } void Stop() { digitalWrite(m11, LOW); digitalWrite(m12, LOW); digitalWrite(m21, LOW); digitalWrite(m22, LOW); } void setup() { pinMode(D0, INPUT); pinMode(D1, INPUT); pinMode(D2, INPUT); pinMode(D3, INPUT); pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); pinMode(m21, OUTPUT); pinMode(m22, OUTPUT); } void loop() { int temp1=digitalRead(D0); int temp2=digitalRead(D1); int temp3=digitalRead(D2); int temp4=digitalRead(D3); if(temp1==0 && temp2==1 && temp3==0 && temp4==0) forward(); else if(temp1==0 && temp2==0 && temp3==1 && temp4==0) left(); else if(temp1==0 && temp2==1 && temp3==1 && temp4==0) right(); else if(temp1==0 && temp2==0 && temp3==0 && temp4==1) backward(); else if(temp1==1 && temp2==0 && temp3==1 && temp4==0) Stop(); } Video microcontroller-projects/arduino-pwm-with-led-dimmer

Arduino Based LED Dimmer using PWM

isan Arduino Unobased PWM (Pulse Width Modulation) circuit developed to get variable voltage over constant voltage. The method of PWM is explained below. Before we get start building a 1 Watt LED Dimmer circuit, firstconsider a simple circuit as shown in figure below. and is of 80% (8/ (8+2)), so the average output voltage will be 80% of the battery voltage. In the second case, the switch is closed for 5ms and opened for 5ms over a period of 10ms, so the average terminal voltage at the output will be 50% of the battery voltage. Say if the battery voltage is 5V and the duty cycle is 50% and so the average terminal voltage will be 2.5V. In the third case the duty cycle is 20% and the average terminal voltage is 20% of the battery voltage. It isexplained in the subsequent section of this tutorial. As shown in figure, an ArduinoUNO has 6PWM channels, so we can get PWM (variable voltage) at any of these six pins. In this chapter we are going to use PIN3 as PWM output.

Required Components

ARDUINO UNO, power supply (5v), 100uF capacitor ,LED, buttons (two pieces), 10K resistor (two pieces). arduino IDE

Circuit Diagram and Explanation

The circuit is connected on breadboard as per the circuit diagram. However one must pay attention during connecting the LED terminals. Although the buttons show bouncing effect in this case it does not cause considerable errors so we need not worry this time. The PWM from UNO is quite easy. While setting up a ATMEGA controller for PWM signal is not easy, we have to define many registers and settings for a accurate signal, however in ARDUINO we don’t have to deal with all those things. By default all the header files and registers are predefined by ARDUINO IDE, we simplyneed to call them and that’s it we will have a PWM output at appropriate pin. Now for getting a PWM output at a appropriate pin, we need to work on two things,
pinMode(ledPin, OUTPUT) analogWrite(pin, value)
First we need to choose the PWM output pin from six pins, after that we need to set that pin as output. Next we need to enable the PWM feature of UNO by calling the function “analogWrite(pin, value)ᾠ. Here ‘pinᾠrepresent the pin number where we need PWM output we are putting it as ᾳᾮ So at PIN3 we are getting PWM output.Value is the turn ON duty cycle, between 0 (always off) and 255 (always on). We are going to increment and decrement this number by button press. Using PWM pins in Arduino Unois explained in the C code given below. Code volatile int i=0;//initializing a integer for incrementing and decrementing duty ratio. void setup() { pinMode(3, OUTPUT); // sets the pin3 as output pinMode(0, INPUT);// sets the pin0 as output pinMode(1, INPUT);// sets the pin1 as output } void loop() { analogWrite(3, i); // analogWrite values from 0 to 255 if (digitalRead(0)==LOW) { if (i<255) { i++;//if pin0 is pressed and the duty ratio value is less than 255 delay(30); } } if (digitalRead(1)==LOW) { if (i>0) { i--;// if pin1 is pressed and the duty ratio value is greater than 0 delay(30); } } } Video microcontroller-projects/arduino-uno-shift-register-tutorial

How to Use Shift Register 74HC595 with Arduino Uno

In ARDUINO we have 20 I/O pins, so we can program 20 pins of UNO to be used as either input or output. Although there are more pins on ATMEGA328P controller than on UNO, this is because while designing the board some pins are defaulted. Now for some applications we need more than 30 pins, say if we wantto design a 5x5x5 LED CUBE, so for this we need 5x5+5=30pins. For such cases we use serial to parallel converter chips or shift register.A shift register chip takes data from UNO board serially and gives output in 8 bit parallel configuration.

Components Required

Arduino uno board, connecting pins, 220 resistor, LED (eight pieces), 74HC595 IC, bread board. Arduino nightly

Circuit Diagram and Working Explanation

Here we are going to send data in eight bit size through a single channel to shift register. The shift register takes the data serially and stores that data in its memory. Once the data is sent by the controller, we are going to send a command to shift register to show the data at the output, with this command the shift register puts out data parallel. This output is shown by eight LED connected at output. we need to do two things:
pinMode(); shiftOut(dataPin, clockPin, data);
ᾮ The data here can be in binary or decimal or hexadecimal. The eight bit information which needs to be sent is written in place of “dataᾮ The data sent is done as: , this tells chip to not to show output for now. For eight times we will send data with clock serially, so clock high low-data-clock low- and so on. , this tells chip to show eight bit data. is explained step by step in C code given below: Code // The setup function runs once when you press reset or power the board volatile int i=0; void setup() { pinMode(2, OUTPUT); // sets the pin2 as output pinMode(1, OUTPUT); // sets the pin1 as output pinMode(0, OUTPUT); // sets the pin0 as output } void loop() { for (int i=0;i<255;i++) //if binary count is less than 255 { digitalWrite(2,HIGH); shiftOut(0,1,2,i); //send eight bit data serially for each time there is a increment digitalWrite(2,LOW); delay(500); //wait for half a second } } Video microcontroller-projects/automatic-temperature-controlled-fan-project

Arduino Temperature Control - Adjust Fan Speed based on Temperature

, you can also check that out if you are intrested.

Components Required

Most of the components should be easily available in your local hardware shop Arduino UNO DHT11 sensor DC Fan 2n2222 transistor 9 volt battery 16x2 LCD 1K resistor Connecting wires

ArduinoFan Speed Control using Temperature Sesnor

And last part of system shows humidity and temperature on LCD and Fan driver. ᾮ Here we have only used this DHT sensor for sensing temperature,and then programmed our arduino according to the requirements. Working on this project is very simple. We have createdPWM at pwm pin of arduino and appliedit at base terminal of the transistor. Then transistor creates a voltage according to the PWM input. Fan speed and PWM values and duty cycles values are showing in given table
Less 260%0Off
2620 %5120%
2740%10240%
2860%15360%
2980%20480%
Greater 29100%255100%
) The main game of PWM is digital pulse with some duty cycle and this duty cycle is responsible for controlling thespeed or voltage. Suppose we have a pule with duty cycle 50% that means it will givehalf of voltage that we apply. Formula for duty cycle given below: Duty Cycle= Ton/T Where T= total time or Ton+Toff And Ton= On time of pulse (means 1 ) And Toff= Off time of pulse (means 0)

ArduinoTemperature Controlled Fan Circuit Diagram

is also connected to digital pin 12 of Arduino. Digital pin 9 is used for controlling fan speed through the transistor. projects, both of them are very easy to built and does not need a microcontroller.

Arduino Code for temperature-controlled fan

First, we include thelibrary for LCD and DHT sensor and then define pin for lcd, dht sensor and for fan. Then initialize all the things in setup loop. And in loop by using dht function reads DHT sensor and then using some dht functions we extract temperature and display these on LCD. After this we compare the temperature with pre define temperature digit and then generate PWM according to the temperature value. For generating PWM we have used “analogWrite(pin, PWM value)ᾠfuction in 8 bit.Mean if PWM value is equivalent of analog value. So if we need to generate 20% of duty cycle then we pass 255/5 value as PWM in “analogWriteᾠFunction. Code #include<dht.h> // Including library for dht #include<LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); #define dht_dpin 12 dht DHT; #define pwm 9 byte degree[8] = { 0b00011, 0b00011, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000 }; void setup() { lcd.begin(16, 2); lcd.createChar(1, degree); lcd.clear(); lcd.print(" Fan Speed "); lcd.setCursor(0,1); lcd.print(" Controlling "); delay(2000); analogWrite(pwm, 255); lcd.clear(); lcd.print("Circuit Digest "); delay(2000); } void loop() { DHT.read11(dht_dpin); int temp=DHT.temperature; lcd.setCursor(0,0); lcd.print("Temperature:"); lcd.print(temp); // Printing temperature on LCD lcd.write(1); lcd.print("C"); lcd.setCursor(0,1); if(temp <26 ) { analogWrite(9,0); lcd.print("Fan OFF "); delay(100); } else if(temp==26) { analogWrite(pwm, 51); lcd.print("Fan Speed: 20% "); delay(100); } else if(temp==27) { analogWrite(pwm, 102); lcd.print("Fan Speed: 40% "); delay(100); } else if(temp==28) { analogWrite(pwm, 153); lcd.print("Fan Speed: 60% "); delay(100); } else if(temp==29) { analogWrite(pwm, 204); lcd.print("Fan Speed: 80% "); delay(100); } else if(temp>29) { analogWrite(pwm, 255); lcd.print("Fan Speed: 100% "); delay(100); } delay(3000); } Video microcontroller-projects/accelerometer-based-hand-gesture-controlled-robot-using-arduino

Accelerometer Based Hand Gesture Controlled Robot using Arduino

by using arduino uno.In this project we have used hand motion to drive the robot. For this purpose we have used accelerometer which works on acceleration.

Required Components

Arduino UNO DC Motors Accelerometer HT12D HT12E RF Pair Motor Driver L293D 9 Volt Battery Battery Connector USB cable Robot Chasis is controlled by using hand in place of any other method like buttons or joystick. Here one only needs to move hand to control the robot. A transmitting device is used in your hand which contains RF Transmitter and accelero-meter. This will transmit command to robot so that it can do the required task like moving forward, reverse, turning left, turning right and stop. All these tasks will be performed by using hand gesture. Here themost important component is accelerometer. Accelerometer is a 3 axis acceleration measurement device with +-3g range. This device is made by using polysilicon surface sensor and signal conditioning circuit to measure acceleration. The output of this device is Analog in nature and proportional to the acceleration. This device measures the static acceleration of gravity when we tilt it. And gives an result in form of motion or vibration. polysilicon surface-micromachined structure placed on top of silicon wafer. Polysilicon springs suspend the structure over the surface of the wafer and provide a resistance against acceleration forces. Deflection of the structure is measured using a differential capacitor which incorporate independent fixed plates and plates attached to the moving mass. The fixed plates are driven by 180° out-of-phase square waves. Acceleration deflects the moving mass and unbalances the differential capacitor resulting in a sensor output whose amplitude is proportional to acceleration. Phase-sensitive demodulation techniques are then used to determine the magnitude and direction of the acceleration. Vcc 5 volt supply should connect at this pin. X-OUT This pin gives an Analog output in x direction Y-OUT This pin give an Analog Output in y direction Z-OUT This pin gives an Analog Output in z direction GND Ground ST This pin used for set sensitivity of sensor

Circuit Diagram and Explanation

Gesture Controlled Robot is divided into two sections: Transmitter part Receiver part In transmitter part an accelerometer and a RF transmitter unit is used. As we have already discussed that accelerometer gives an analog output so here we need to convert this analog data in to digital. For this purpose we have used 4 channel comparator circuit in place of any ADC. By setting reference voltage we gets a digital signal and then applythis signal to HT12E encoder to encode data or converting it into serial form and then send this data by using RF transmitter into the environment. At the receiver end we have used RF receiver to receive data and then applied to HT12D decoder. This decoder IC converts received serial data to parallel and then read by using arduino.According to receiveddata we drive robot by using two DC motor in forward, reverse, left, right and stop direction.

Working

Gesture controlled robot moves according to hand movement as we place transmitter in our hand.When we tilt hand in front side, robot start to moving forward and continues moving forward until next command is given. When we tilt hand in backward side, robot change itsstate and start moving in backwards direction until other command is given. When we tilt it in left side Robot get turn left till next command. When we tilt hand in right side robot turned to right. And for stopping robot we keeps hand in stable. Circuit for this hand gesture controlled robot is quite simple. As shown in above schematic diagrams, aRF pair is used for communication and connectedwith arduino. Motor driver is connected to arduino to run the robot. Motor driver’s input pin 2, 7, 10 and 15 is connected to arduino digital pin number 6, 5, 4 and 3 respectively. Here we have used two DC motors to driverobot in which one motor is connected at output pin of motor driver 3 and 6 and another motor is connected at 11 and 14. A 9 volt Battery is also used to power the motor driver for driving motors.

Program Explanation

In program first of all we have defined output pins for motors. And then in setup we have given the directions to pin. After this we readinput by using ‘if statementᾠand perform relative operation. There are total five conditions for this Gesture controlled Robot which are giving below:
Movement of hand Input for Arduino from gesture
Stable0000Stop
Tilt right0001Turn Right
Tilt left0010Turn Left
Tilt back1000Backward
Tilt front0100Forward
We have writen the complete program according to the above table conditions. Below is the complete code. Code #define FD 16 #define BD 17 #define LD 18 #define RD 19 #define m11 3 #define m12 4 #define m21 5 #define m22 6 void forward() { digitalWrite(m11, HIGH); digitalWrite(m12, LOW); digitalWrite(m21, HIGH); digitalWrite(m22, LOW); } void backward() { digitalWrite(m11, LOW); digitalWrite(m12, HIGH); digitalWrite(m21, LOW); digitalWrite(m22, HIGH); } void left() { digitalWrite(m11, HIGH); digitalWrite(m12, LOW); digitalWrite(m21, LOW); digitalWrite(m22, LOW); } void right() { digitalWrite(m11, LOW); digitalWrite(m12, LOW); digitalWrite(m21, HIGH); digitalWrite(m22, LOW); } void Stop() { digitalWrite(m11, LOW); digitalWrite(m12, LOW); digitalWrite(m21, LOW); digitalWrite(m22, LOW); } void setup() { pinMode(FD, INPUT); pinMode(BD, INPUT); pinMode(LD, INPUT); pinMode(RD, INPUT); pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); pinMode(m21, OUTPUT); pinMode(m22, OUTPUT); } void loop() { int temp1=digitalRead(FD); int temp2=digitalRead(BD); int temp3=digitalRead(LD); int temp4=digitalRead(RD); if(temp1==1 && temp2==0 && temp3==0 && temp4==0) backward(); else if(temp1==0 && temp2==1 && temp3==0 && temp4==0) forward(); else if(temp1==0 && temp2==0 && temp3==1 && temp4==0) left(); else if(temp1==0 && temp2==0 && temp3==0 && temp4==1) right(); else Stop(); } Video microcontroller-projects/arduino-humidity-measurement

Humidity and Temperature Measurement using Arduino

using temperature sensor LM35. The second section reads the DHTsensor module’s output and extracts temperature and humidity values into a suitable number in percentage and Celsius scale. And the third part of the system displays humidity and temperature on LCD. Working of this project is based on single wire serial communication. First arduino send a start signal to DHT module and then DHT gives a response signal containing temperature and humidity data. Arduino collect and extract in two parts one is humidity and second is temperature and then send them to 16x2 LCD. This module features a humidity and temperature complex with a calibrated digital signal output means DHT11 sensor module is a combined module for sensing humidity and temperature which gives a calibrated digital output signal. DHT11 gives us very precise value of humidity and temperature and ensures high reliability and long term stability. This sensor has a resistive type humidity measurement component and NTC type temperature measurement component with an 8-bit microcontroller inbuilt which has a fast response and cost effective and available in 4-pin single row package. DHT11 module works on serial communication i.e. single wire communication. This module sends data in form of pulse train of specific time period. Before sending data to arduino it needs some initialize command with a time delay. And the whole process time is about 4ms. A complete data transmission is of 40-bit and data format of this process is given below: 8-bit integral RH data + 8-bit decimal RH data + 8-bit integral T data + 8-bit decimal T data + 8-bit check sum.
Complete Process
First of all arduino sends a high to low start signal to DHT11 with 18μsdelay to ensure DHT’s detection. And then arduino pull-up the data line and wait for 20-40μs for DHT’s response. Once DHT detects starts signal, it will send a low voltage level response signal to arduino of time delay about 80μs. And then DHT controller pull up the data line and keeps it for 80μs for DHT’s arranging of sending data. When data bus is at low voltage level it means that DHT11 is sending response signal. Once it is done,DHT again makes data line pull-up for 80μs for preparing data transmission. Data format that is sending by DHT to arduino for every bit begins with 50μs low voltage level and length of high voltage level signal determines whether data bit is ᾰᾠor ᾱᾮ One importantthing is to make sure pull up resistor value because if we are placing DHT sensor at <20 meter distance, 5kpull up resistor is recommended. If placing DHT at longer the 20 meter then useappropriate value pull up resistor.

Circuit Diagram and Explanation

A liquid crystal display is used for displaying temperature and humidity which is directly connected to arduino in 4-bit mode. Pins of LCD namely RS, EN, D4, D5, D6 and D7 are connected to arduino digital pin number 2, 3, 4, 5, 6 and 7. And a DHT11 sensor module is also connected to digital pin 12 of arduino with a 5kpull-up resistor.

Programming Description

In programming, we are going to use pre-builtlibraries for DHT11 sensor andLCD display module. Then we haved definedpins for LCD and DHT sensor and initialized all the things in setup. Then in a loop by using dht function reads DHT sensor and then using some dht functions we extract humidity and temperature and display them on LCD. Here degree symbol is created by using custom character method. Code #include<dht.h> // Including library for dht #include<LiquidCrystal.h> LiquidCrystal lcd(2, 3, 4, 5, 6, 7); #define dht_dpin 12 dht DHT; byte degree[8] = { 0b00011, 0b00011, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000 }; void setup() { lcd.begin(16, 2); lcd.createChar(1, degree); lcd.clear(); lcd.print(" Humidity "); lcd.setCursor(0,1); lcd.print(" Measurement "); delay(2000); lcd.clear(); lcd.print("Circuit Digest "); delay(2000); } void loop() { DHT.read11(dht_dpin); lcd.setCursor(0,0); lcd.print("Humidity: "); lcd.print(DHT.humidity); // printing Humidity on LCD lcd.print(" %"); lcd.setCursor(0,1); lcd.print("Temperature:"); lcd.print(DHT.temperature); // Printing temperature on LCD lcd.write(1); lcd.print("C"); delay(500); } Video microcontroller-projects/arduino-uno-led-blinking

LED Blinking with Arduino Uno

ARDUINO UNOis an ATMEGA controller based board designed for electronic engineers and hobbyists. Arduino based program development environment is an easy way to write the program when compared to other environment development programs.

Components Required

Arduino uno board, connecting pins, 220 resistor, LED, breadboard. )

Circuit Diagram and Working Explanation

Here we are going to write a program to blink an LED for every 500ms.In arduino uno, a LED will be already designed at the pin13, but we are not going to use it. Here we are going to connect an indicating LED to PIN0 through a current limiting resistor. The controller in arduino is already programmed to work on external crystal. So we need not to worry about fuse bits or anything. The arduino works on 16Mhz crystal clock, which is already embedded in the board. Code // The setup function runs when you press reset or power the board void setup() { // initialize digital pin 0 as an output. pinMode(0, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level) delay(500); // wait for a second digitalWrite(0, LOW); // turn the LED off by making the voltage LOW delay(500); // wait for a second } Video microcontroller-projects/computer-controlled-robot-using-arduino

Computer Controlled Robot using Arduino

Components Required

Arduino UNO DC Motor Laptop Motor Driver L293D 9 Volt Battery Battery Connector USB cable Robot Chasis

Concepts and Details

We can divide this PC controlled robot circuit into different segments and they are - sensor section, control section and driver section. Let us see them separately. This section has a serial communication device like PC, laptop etc. Here in this project we have used a laptop for demonstration. We sends command to arduino by typing a character on hyper terminal or any other serial terminal like hyper terminal, Hercules, putty, arduino’s serial terminal etc. Arduino UNO is used for controlling whole the process of robot. Arduino reads commands sent by laptop and compare with defined characters or commands. If commands are matched, arduino sends appropriate command to driver section. driver section consists a L293Dmotor driver IC and two DC motors. Motor driver is used for driving motors because arduino does not supply enough voltage and current to motor. So we add a motor driver circuit to get enough voltage and current for motor. By collecting commands from arduino, motor driver drives motors according to commands.

Working

We have programmed the PC controlled robot to run by some commands that are send via serial communication to arduino from PC. (see programming section below) When we press‘fᾠor ‘Fᾬ robot start to moveforward and moving continuesuntil next command is given. When we press‘bᾠor ‘Bᾬ robot change his state and start moving in backwarddirection until any other command is given. When we press ‘lᾠor ‘Lᾬ Robot gets turn left until thenext command. When we press ‘rᾠor ‘Rᾠrobot turnsto right. And for stopping robot we give ‘sᾠor ‘Sᾠcommand to arduino.

Circuit Diagram and Explanation

Circuit diagram for Arduino basedPC controlled robot is shown in the above diagram.Only a motor driver IC is connected to arduino for running robot. For sending command to robot we used inbuilt serial data converter by using USB cable with laptop. Motor driver’s input pin 2, 7, 10 and 15 is connected at arduino digital pin number 6, 5, 4 and 3 respectively. Here we have used two DC motors to driver robot in which one motor is connected at output pin of motor driver 3 and 6 and another motor is connected at 11 and 14. A 9 volt Battery is used to power the motor driver for driving motors.

Program Explanation

In the programmingfirst of all we have defined output pins for motors. And then in setup we have given directions to pin and begin serial communication. After that we read serial buffer by reading “serial.read()ᾠfunction and get its value in to a temporary variable. And then match it with defined commands by using “ifᾠstatement to operatethe robot. There are four conditions to move this PC controlled Robot that are given in below table.
Input Commands Output Movement of Robot
Left Motor Right Motor
S.Stop
Turn Right
Turn Left
Backward
Forward
We have written the program according to above table conditions. Complete code is given below. Code #define m11 3 #define m12 4 #define m21 5 #define m22 6 void setup() { pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); pinMode(m21, OUTPUT); pinMode(m22, OUTPUT); Serial.begin(9600); } void loop() { while(Serial.available()) { char In=Serial.read(); if(In=='f' || In=='F') // Forward { digitalWrite(m11, HIGH); digitalWrite(m12, LOW); digitalWrite(m21, HIGH); digitalWrite(m22, LOW); } else if(In=='b' || In=='B') //backward { digitalWrite(m11, LOW); digitalWrite(m12, HIGH); digitalWrite(m21, LOW); digitalWrite(m22, HIGH); } else if(In=='l' || In=='L') // Left { digitalWrite(m11, HIGH); digitalWrite(m12, LOW); digitalWrite(m21, LOW); digitalWrite(m22, LOW); } else if(In=='r' || In=='R') // Right { digitalWrite(m11, LOW); digitalWrite(m12, LOW); digitalWrite(m21, HIGH); digitalWrite(m22, LOW); } else if(In=='s' || In=='S') // stop { digitalWrite(m11, LOW); digitalWrite(m12, LOW); digitalWrite(m21, LOW); digitalWrite(m22, LOW); } else { } } } Video microcontroller-projects/automatic-door-opener-project-using-arduino

Automatic Door Opener using Arduino

in shopping malls and other commercial buildings. They open the door when someone comes near the entrance and close it after sometime. A numberof technologies are available to make such kinds of systems like PIR sensors, Radar sensors,Laser sensors, Infrared sensors, etc.In this arduino based project, we have tried to replicate the same system by using a PIR sensor. It uses a motion-detecting sensor (PIR sensor)to open or close the door whichdetectsthe infrared energy omitted from human's body. When someone comes in front of the door, the infrared energy detected by the sensor changes and it triggers the sensor to open the door whenever someone approaches the door. The signal is further sent to arduino unothat controls the door.

Circuit Components

Arduino UNO 16x2 LCD PIR Sensor Connecting wires Bread board 1 k resistor Power supply Motor driver CD case (DVD Troly)

PIR Sensor

detects any change in heat, and whenever it detects any change, its output PIN becomes HIGH. They are also referred as Pyroelectric or IR motion sensors. can detect small amount of variation in infrared. Whenever an object passes through the sensor range, it produces infrared because of the friction between air and object, and get caught by PIR. shown in figure (rectangular crystal behind the plastic cap). Along with BISS0001 ("Micro Power PIR Motion Detector IC"), some resistors, capacitors and other components used to build PIR sensor. BISS0001 IC take the input from sensor and does processing to make the output pin HIGH or LOW accordingly. Pyroelectric sensor divide in two halves, when there is no motion, both halves remain in same state, means both senses the same level of infrared. As soon as somebody enters in first half, the infrared level of one half becomes greater than other, and this causes PIRs to react and makes the output pin high. Pyroelectric sensor is covered by a plastic cap, which has array of many Fresnel Lens inside. These lenses are curved in such a manner so that sensor can cover a wide range.

Circuit Diagram and Explanation

Connections forarduino based door opener circuit are shown in the above diagram. Here a PIR sensor is used for sensing human motion which has three terminals Vcc, GND and Dout. Dout is directly connected to pin number 14 (A0) of arduino uno. A 16x2 LCD isused for displaying the status. RS, EN pins of LCD connected to 13 and 12 of arduino and data pins D0-D7 are connected to arduino digital pin numbers 11, 10, 9, 8. RW is directly connected to ground. L293D motor driver is connected to arduino pin 0 and 1 for opening and closing the gate. Here in circuit we haveused a motor for gate.

Programming Explanation

The concept used here for programming is very simple.In programwe haveonly used digital input output. DigitalRead is used for reading output of PIR sensor. After that,if PIR sensor senses any motion then program sends an command to open gate, stop gate, closing gate and stop gate. See below the complete code for arduino based automatic door opener. Code #include <LiquidCrystal.h> LiquidCrystal lcd(13, 12, 11, 10, 9, 8); #define PIR_sensor 14 #define m11 0 #define m12 1 void setup() { lcd.begin(16, 2); pinMode(m11, OUTPUT); pinMode(m12, OUTPUT); pinMode(PIR_sensor, INPUT); lcd.print(" Automatic "); lcd.setCursor(0,1); lcd.print(" Door Opener "); delay(3000); lcd.clear(); lcd.print("CIRCUIT DEGEST "); delay(2000); } void loop() { if(digitalRead(PIR_sensor)) { lcd.setCursor(0,0); lcd.print("Movement Detected"); lcd.setCursor(0, 1); lcd.print(" Gate Opened "); digitalWrite(m11, HIGH); // gate opening digitalWrite(m12, LOW); delay(1000); digitalWrite(m11, LOW); // gate stop for a while digitalWrite(m12, LOW); delay(1000); lcd.clear(); lcd.print(" Gate Closed "); digitalWrite(m11, LOW); // gate closing digitalWrite(m12, HIGH); delay(1000); digitalWrite(m11, LOW); // gate closed digitalWrite(m12, LOW); delay(1000); } else { lcd.setCursor(0,0); lcd.print(" No Movement "); lcd.setCursor(0,1); lcd.print(" Gate Closed "); digitalWrite(m11, LOW); digitalWrite(m12, LOW); } } Video microcontroller-projects/digital-dice-using-arduino

Digital Dice using Arduino

In place of throwing the dice, here we need to press a button to get a random number between 0 to 6.

Required Components

Arduino UNO Seven segment display (Common Anode) Push buttons Connecting wires Bread board 1 k resistor Power supply

Circuit Diagram and Explanation

As shown in the above digital dice circuit, arduino is used for controlling whole the process. Two push buttons are used in the circuit -one to start the dice and other for resetting the dice. Arduino reads these two buttons and perform the operation. A seven segment display is used to display the dice result. Arduino is continuously executing rand() function and stored its value in to a temporary variable. When dice button is get pressed stored value calculated and display on seven segment by using appropriate method (see programming part of article). is used for displaying dice numbers, which is directly connected to arduino digital pin numbers 6, 5, 4, 3, 2, 1, 0. And common anode pin of seven segment is connected with +5 volt 220 Ohm resistor. Two push button are also connected namely dice button and reset button which are connected to digital pin 14 (A0) and 15 (A1) with respect to ground.

Code Explanation

Programming part of this project plays a very important role to display random digital dice number on seven segment display.Arduino does not contain any library for seven segment display. so we created whole code without using any library. First of all we selects digital pin for seven segment display. int pin[7]={6,5,4,3,2,1,0}; After it we create an array of 6 digits of dice namely 1, 2, 3, 4, 5 and 6. char digit[6]={0x02, 0x79, 0x24, 0x30, 0x19, 0x12}; Now we gave direction to use arduino pin as output. void setup() { for(int i=0;i<7;i++) pinMode(pin[i], OUTPUT); pinMode(dice, INPUT); pinMode(resett, INPUT); digitalWrite(dice, HIGH); digitalWrite(resett, HIGH); We senda code for displaying zero on seven segment display by default. int temp=0x40; for(int i=0;i<7;i++) { int temp1=temp&0x01; digitalWrite(pin[i], temp1); temp=temp>>1; } Now we run rand() function to get a random number. int temp=rand(); And when we press the dice button program first map this random number and then send number to seven segment display by using bit wise operator. if(digitalRead(dice)==0) { int k=temp%6; temp=digit[k]; wait(); for(int i=0;i<7;i++) { int temp1=temp&0x01; digitalWrite(pin[i], temp1); temp=temp>>1; } delay(200); } And same for reset button. In this program we sends single bit at a time. Here we applying a for loop which run 7 time to send data to each segment one by one. Code #define resett 15 #define dice 14 char digit[6]={0x02, 0x79, 0x24, 0x30, 0x19, 0x12}; int pin[7]={6,5,4,3,2,1,0}; void setup() { for(int i=0;i<7;i++) pinMode(pin[i], OUTPUT); pinMode(dice, INPUT); pinMode(resett, INPUT); digitalWrite(dice, HIGH); digitalWrite(resett, HIGH); int temp=0x40; for(int i=0;i<7;i++) { int temp1=temp&0x01; digitalWrite(pin[i], temp1); temp=temp>>1; } delay(1000); } void loop() { int temp=rand(); if(digitalRead(dice)==0) { int k=temp%6; temp=digit[k]; wait(); for(int i=0;i<7;i++) { int temp1=temp&0x01; digitalWrite(pin[i], temp1); temp=temp>>1; } delay(200); } if(digitalRead(resett)==0) { temp=0x40; for(int i=0;i<7;i++) { int temp1=temp&0x01; digitalWrite(pin[i], temp1); temp=temp>>1; } } } void wait() { for(int m=0;m<10;m++) { for(int k=0;k<6;k++) { int ch=digit[k]; for(int l=0;l<7;l++) { char tem2=ch&0x01; digitalWrite(pin[l], tem2); ch=ch>>1; } delay(50); } } } Video microcontroller-projects/arduino-ultrasonic-sensor-based-distance-measurement

Distance Measurement using Ultrasonic Sensor and Arduino

project, so let'sget started.

Components Used

Arduino Uno or Pro Mini Ultrasonic sensor Module 16x2 LCD Scale Bread board 9 volt battery Connecting wires

Ultrasonic Sensor Module

to measure distance in range of 2cm-400cm with an accuracy of 3mm. The sensor module consists of an ultrasonic transmitter, receiver and control circuit. The working principleof ultrasonic sensor is as follows: High level signal is sent for 10us using Trigger. The module sends eight 40 KHz signals automatically, and then detects whether pulse is received or not. If the signal is received, then it is through high level. The time of high duration is the time gap between sending and receiving the signal. The module works on the natural phenomenon of ECHO of sound. A pulse is sent for about 10us to trigger the module. After which the module automatically sends 8 cycles of 40 KHz ultrasound signal and checks its echo. The signal after striking with an obstacle returns back and is captured by the receiver. Thus the distance of the obstacle from the sensor is simply calculated by the formula given as Distance= (time x speed)/2. Here we have divided the product of speed and time by 2 because the time is the total time it took to reach the obstacle and return back. Thus the time to reach obstacle is just half the total time taken.

Ultrasonic Sensor Arduino Circuit Diagram and Explanation

is shown above to measure the distance. In circuit connections Ultrasonic sensor module’s “triggerᾠand “echoᾠpins are directly connected to pin 18(A4) and 19(A5) of arduino. A 16x2 LCD is connected with arduino in 4-bit mode. Control pin RS, RW and En are directly connected to arduino pin 2, GND and 3. And data pin D4-D7 is connected to 4, 5, 6 and 7 of arduino. First of all we needto trigger the ultrasonic sensor module to transmit signal by using arduino and then wait for receive ECHO. Arduino reads the time between triggering and Received ECHO. We know that speed of sound is around 340m/s. so we can calculate distance by using given formula: Distance= (travel time/2) * speed of sound Where speed of sound around 340m per second. A 16x2 LCD is used for displaying distance.

ArduinoUltrasonic Sensor Code for Distance Measurement

The complete code for this ultrasonic distance measurementproject is given at the bottom of this page.In the code we read time by using pulseIn(pin). And then perform calculations and displayed result on 16x2 LCD by using appropriate functions. Code #include <LiquidCrystal.h> #define trigger 18 #define echo 19 LiquidCrystal lcd(2,3,4,5,6,7); float time=0,distance=0; void setup() { lcd.begin(16,2); pinMode(trigger,OUTPUT); pinMode(echo,INPUT); lcd.print(" Ultra sonic"); lcd.setCursor(0,1); lcd.print("Distance Meter"); delay(2000); lcd.clear(); lcd.print(" Circuit Digest"); delay(2000); } void loop() { lcd.clear(); digitalWrite(trigger,LOW); delayMicroseconds(2); digitalWrite(trigger,HIGH); delayMicroseconds(10); digitalWrite(trigger,LOW); delayMicroseconds(2); time=pulseIn(echo,HIGH); distance=time*340/20000; lcd.clear(); lcd.print("Distance:"); lcd.print(distance); lcd.print("cm"); lcd.setCursor(0,1); lcd.print("Distance:"); lcd.print(distance/100); lcd.print("m"); delay(1000); } Video microcontroller-projects/arduino-based-lpg-gas-leakage-detector-alarm

LPG Gas Leakage Detector using Arduino

While LPG is an essential need of every household, its leakage could lead to a disaster. To alert on LPG leakage and prevent any mishappening there are various products to detect the leakage. Here we have developed an Arduino based LPG gas detector alarm.If gas leakage occurs, this system detects it and makes an alert by buzing the buzzer attached with the circuit. This system is easy to build and anyone who have some knowledge of electronics and programing, can build it.. to detect LPG Gas. When LPG gas leakage occurs,it gives a HIGH pulse on its DO pin and arduino continuously reads its DO pin. When Arduino gets a HIGH pulse from LPG Gas module it shows “LPG Gas Leakage Alertᾠmessage on 16x2 LCD and activates buzzer which beeps again and again until the gas detector module doesn't sense the gas in environment.When LPG gas detectormodule gives LOW pulseto arduino, then LCD shows “No LPG Gas Leakageᾠmessage.

Components Used

Arduino Pro Mini LPG Gas sensor Module Buzzer BC 547 Transistor 16x2 LCD 1K resistor Bread board 9 volt battery Connecting wires

LPG Gas Sensor Module

This module contains a MQ3 sensor which actually detects LPG gas, a comparator (LM393) for comparing MQ3 output voltage with reference voltage. It gives a HIGH output when LPG gas is sensed. A potentiometer is also used for controlling sensitivity of gas sensing. This module is very easy to interface with microcontrollers and arduino and easily available in market by name “LPG Gas Sensor Moduleᾮ We can also buildit by using LM358 or LM393 and MQ3.

Circuit Diagram and Description

As shown in the schematic diagram above, itcontains Arduino board, LPG GAS Sensor Module, buzzer and 16x2 LCD module. Arduino controls the whole process of this system like reading LPG Gas sensor module output, sending message to LCD and activating buzzer. We can set sensitivity of this sensor module by inbuilt potentiometer placed on it. is connected with arduino in 4-bit mode. Control pin RS, RW and En are directly connected to arduino pin 2, GND and 3. And data pin D0-D7 are connected to 4, 5, 6, 7 of arduino. A buzzer is connected with arduino pin number 13 through a NPN BC547 transistor having a 1 k resistor at its base.

Program Description

In programming we have used digital read function to read output of LPG gas sensor module and then performed operation according to input. For testing this project we have used a cigarette lighter which contains LPG gas. Code #include <LiquidCrystal.h> LiquidCrystal lcd(3, 2, 4, 5, 6, 7); #define lpg_sensor 18 #define buzzer 13 void setup() { pinMode(lpg_sensor, INPUT); pinMode(buzzer, OUTPUT); lcd.begin(16, 2); lcd.print("LPG Gas Detector"); lcd.setCursor(0,1); lcd.print("Circuit Digest"); delay(2000); } void loop() { if(digitalRead(lpg_sensor)) { digitalWrite(buzzer, HIGH); lcd.clear(); lcd.print("LPG Gas Leakage"); lcd.setCursor(0, 1); lcd.print(" Alert "); delay(400); digitalWrite(buzzer, LOW); delay(500); } else { digitalWrite(buzzer, LOW); lcd.clear(); lcd.print(" No LPG Gas "); lcd.setCursor(0,1); lcd.print(" Leakage "); delay(1000); } } Video microcontroller-projects/line-follower-robot-using-arduino

Line Follower Robot using Arduino

Line follower Robot is a very simple robot that follows a line, eithera black line or a white line. These type of robots are very simple to build and is often the first choice for beginners who are getting started with robotics.Basically, there are two types of line follower robots: one is a black line follower which follows the black line and the second is a white line follower which follows the white line. Line follower actually senses the line and follows it. Though the idea sounds simple, with a little more development, robots similar to this are practically used in many applications like factory floor managementrobotsor warehouse robots.

Concepts of Line Follower

we have used IR Transmitters and IR receivers also called photodiodes. They are used for sending and receiving light. IR transmits infrared lights. When infrared rays falls on the white surface, it’s reflected back and caught by photodiodes which generate some voltage changes. When IR light falls on a black surface, light is absorbed by the black surface and norays are reflected back, thus photo diode does not receiveany light or rays. Here in this Arduino line follower robot when the sensor senses white surface then Arduino gets 1 as input and when senses black line Arduino gets 0 as input. Since the Line follower robot is an interesting beginners project, we have also built it using different development boards other than Arduino, you can also check them out using the below link if interested Line Follower Robot using 8051 Microcontroller Line Follower Robot using Raspberry Pi Texas MSP430 Launchpad based Line Follower Simple Line Follower using PIC Microcontroller Line Follower using ATmega16 AVR Microcontroller

Circuit Explanation

can be divided into 3 sections:sensor section, a control section, and driver section. we have usedtwo comparators for two sensors. LM 358 is used as a comparator. LM358 has inbuilt two low noise Op-amps. Arduino Pro Mini is used for controlling the whole the process of the line follower robot. The outputs of comparators are connected to digital pin numbers 2 and 3 of Arduino. Arduino read these signals and send commands to driver circuit to driveline follower. The driver section consists of motor driver and two DC motors. The motor driver is used for driving motors because Arduino does not supply enough voltage and current to the motor. So we add a motor driver circuit to get enough voltage and current for the motor. Arduino sends commands to this motor driver and then it drives motors.

Working of Line Follower Robot using Arduino

is interesting. The line follower robot senses a black line by using a sensor and then sends the signal to Arduino. Then Arduino drives the motor according to sensors'output. Here in this project, we are using two IR sensor modules namely the left sensor and the right sensor. When both left and right sensor senses white then the robot moves forward. If the left sensor comes on a black line then the robot turn the left side. If the right sensor sense black line then robot turn right side until both sensors comes at the white surface. When the white surface comes robot starts moving onforward again. If both sensors come on the black line, the robot stops.

Circuit Diagram

is shown in the above image. As you can see the output of comparators is directly connected to Arduino digital pin number 2 and 3. And motor driver’s input pin 2, 7, 10 and 15 is connected to Arduino's digital pin number 4, 5, 6 and 7 respectively. And one motor is connected at the output pin of motor drivers 3 and 6 and another motor is connected at pin 11 and 14.

Program Explanation

can be found at the bottom of this page. There are four conditions in this line followingrobot that we read by using Arduino. We have used two sensors namely the left sensor and the right sensor.
LSRSLM1LM2RM1RM2
000000Stop
011000Turn Right
100010Turn Left
111010Forward
according to the conditions shown in table above.

Required Components

In our Project, we have used a microcontroller to control whole the process of system that is ARDUINO. Arduino is an open-source hardware and very useful for project developments. There are many types of arduino like Arduino UNO, arduino mega, arduino pro mini, Lilypad etc. available in the market. Here we have used arduino pro mini in this project as arduino pro mini is small and so breadboard compatible. Toburn the line follower robot arduino code we have used anFTDI burner. L293D is a motor driver IC which has two channels for driving two motors. L293D has two inbuilt Transistor Darlington pair for current amplification and aseparate power supply pin for giving external supply to motors. IR Module is sensor circuit that consists IR LED/photodiode pair, potentiometer, LM358, resistors and LED. IR sensor transmits Infrared light and photodiode receives the infrared light. I have added a voltage regulator to get 5 volts for Arduino, comparator and motor driver. And a 9-volt battery is used to power the circuit. Code /*------ ArduinoLine Follower Code----- */ /*-------defining Inputs------*/ #define LS 2 // left sensor #define RS 3 // right sensor /*-------defining Outputs------*/ #define LM1 4 // left motor #define LM2 5 // left motor #define RM1 6 // right motor #define RM2 7 // right motor void setup() { pinMode(LS, INPUT); pinMode(RS, INPUT); pinMode(LM1, OUTPUT); pinMode(LM2, OUTPUT); pinMode(RM1, OUTPUT); pinMode(RM2, OUTPUT); } void loop() { if(digitalRead(LS) && digitalRead(RS)) // Move Forward { digitalWrite(LM1, HIGH); digitalWrite(LM2, LOW); digitalWrite(RM1, HIGH); digitalWrite(RM2, LOW); } if(!(digitalRead(LS)) && digitalRead(RS)) // Turn right { digitalWrite(LM1, LOW); digitalWrite(LM2, LOW); digitalWrite(RM1, HIGH); digitalWrite(RM2, LOW); } if(digitalRead(LS) && !(digitalRead(RS))) // turn left { digitalWrite(LM1, HIGH); digitalWrite(LM2, LOW); digitalWrite(RM1, LOW); digitalWrite(RM2, LOW); } if(!(digitalRead(LS)) && !(digitalRead(RS))) // stop { digitalWrite(LM1, LOW); digitalWrite(LM2, LOW); digitalWrite(RM1, LOW); digitalWrite(RM2, LOW); } } Video microcontroller-projects/digital-thermometer-using-arduino

Digital Thermometer using Arduino and LM35 Temperature Sensor

The same is demonstrated in below block diagram. , Arduino Uno is used to control thewhole process. An LM35 temperature sensor is used for sensing environment temperature which gives 1 degree temperature on every 10mV change at its output pin. You can easily check it withvoltmeter by connecting Vcc at pin 1 and Ground at pin 3 and output voltage at pin 2 of LM35 sensor. For an example if the output voltage of LM35 sensor is 250m volt, that means the temperature is around 25 degree Celsius. using DHT11, DS18B20 and other temperature sensors.

Circuit Components

1Supply voltage; 5V (+35V to -2V)Vcc
2Output voltage (+6V to -1V)Output
3Ground (0V)Ground
unit is widely using in embedded system projects because it is cheap, easily availablet, small in size and easy to interface. 16x2 have two rows and 16 columns, which means it consist 16 blocks of 5x8 dots. 16 pin for connections in which 8 data bits D0-D7 and 3 control bits namely RS, RW and EN. Rest of pins are used for supply, brightness control and for backlight. Arduino Board already have an inbuilt power supply section. Herewe only need to connect a 9 volt or 12 volt adaptors with the board.

Circuit Diagram and Explanation

, is shown in the above figure. Make the connections carefully as shown in the schematic. Here16x2 LCD unitis directly connected to arduino in 4-bit mode. Data pins of LCD namely RS, EN, D4, D5, D6, D7 are connected to arduino digital pin number 7, 6, 5, 4, 3, 2. A temperature sensor LM35 isconnected to Analog pin A0 of arduino, which generates 1 degree Celsius temperature on every 10mV output change at its output pin. in our previous tutorial.

ArduinoLM35 Code & Explanation

is simple and given at the end of this tutorial. Firstwe includelibrary for LCD unit and then we defines data and control pins for LCD and temperature sensor. After getting analog value at analog pin we reads that value using Analog read function and stores that value in a variable. And then convert the value into temperatureby applying the below given formula. float analog_value=analogRead(analog_pin); float Temperature=analog_value*factor*100 where factor=5/1023 analog_value= output of temperature sensor Here degree symbol is created using custom character method Complete code with a demo video is given below. Code /*-----------ArduinoLM35 Code-------------*/ /*-----------Digital Thermometer Using Arduino-------------*/ #include<LiquidCrystal.h> LiquidCrystal lcd(7,6,5,4,3,2); #define sensor A0 byte degree[8] = { 0b00011, 0b00011, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000 }; void setup() { lcd.begin(16,2); lcd.createChar(1, degree); lcd.setCursor(0,0); lcd.print(" Digital "); lcd.setCursor(0,1); lcd.print(" Thermometer "); delay(4000); lcd.clear(); lcd.print(" Circuit Digest "); delay(4000); lcd.clear(); } void loop() { /*---------Temperature-------*/ float reading=analogRead(sensor); float temperature=reading*(5.0/1023.0)*100; delay(10); /*------Display Result------*/ lcd.clear(); lcd.setCursor(2,0); lcd.print("Temperature"); lcd.setCursor(4,1); lcd.print(temperature); lcd.write(1); lcd.print("C"); delay(1000); } Video microcontroller-projects/dc-motor-control-with-arduino-uno-pwm

DC Motor Control using Arduino

(Pulse Width Modulation) concept. This feature is enabled in UNO to get variable voltage over constant voltage. The method of PWM is explained here; consider a simple circuit as shown in figure. If the button is pressed if the figure, then the motor will start rotating and it will be in motion until the button is pressed. This pressing is continuous and is represented in the first wave of figure. If, for a case, consider button is pressed for 8ms and opened for 2ms over a cycle of 10ms, during this case the motor will not experience the complete 9V battery voltage as the button is pressed only for 8ms, so the RMS terminal voltage across the motor will be around 7V. Due to this reduced RMS voltage the motor will rotate but at a reduced speed. Now the average turn on over a period of 10ms = Turn ON time/ (Turn ON time + Turn OFF time), this is called duty cycle and is of 80% (8/ (8+2)). In second and third cases the button is pressed even lesser time compared to first case. Because of this, the RMS terminal voltage at the motor terminals gets even decreased further. Due to this reduced voltage the motor speed even decreases further. This decrease in speed with duty cycle continuous to happen until a point, where the motor terminal voltage will not be sufficient to turn the motor. So by this we can conclude the PWM can be used to vary the motor speed. Figure 1 Figure 2 part of figure3. This direction of current flow is opposite to the first one and so we see an opposite potential at motor terminal to the first one, so the motor rotates anti clock wise. This is how an H-BRIDGE works. However low power motors can be driven by a H-BRIDGE IC L293D. L293D is an H-BRIDGE IC designed for driving low power DC motors and is shown in figure.This IC consists two h-bridges and so it can drive two DC motors. So this IC can be used to drive robot's motors from the signals of microcontroller. Now as discussed before this IC has ability to change the direction of rotation of DC motor. This is achieved by controlling the voltage levels at INPUT1 and INPUT2.
HighLowHighTurn Right
HighHighLowTurn Left
HighLowLowStop
HighHighHighStop
So as shown in above figure, for clockwise rotation 2A should be high and 1A should be low. Similarly for anti clockwise 1A should be high and 2A should be low. As shown in the figure, ArduinoUNO has 6PWM channels, so we can get PWM (variable voltage) at any of these six pins. In this tutorial we are going to use PIN3 as PWM output. ARDUINO UNO, power supply (5v), 100uF capacitor ,LED, buttons (two pieces), 10K resistor (two pieces). arduino IDE (Arduino nightly).

Circuit Diagram

The circuit is connected in breadboard as per the circuit diagram shown above. However one must pay attention during connecting the LED terminals. Although the buttons show bouncing effect in this case it does not cause considerable errors so we need not worry this time. The PWM from UNO is easy, on normal occasions setting up a ATMEGA controller for PWM signal is not easy, we have to define many registers and settings for a accurate signal, however in ARDUINO we don’t have to deal with all those things. By default all the header files and registers are predefined by ARDUINO IDE, we simply needto call them and that’s it we will have a PWM output at appropriate pin. Now for getting a PWM output at a appropriate pin, we need to work on three things,
pinMode(ledPin, OUTPUT) analogWrite(pin, value) analogWriteResolution(neededresolutionnumber)
First we need to choose the PWM output pin from six pins, after that we need to set that pin as output. Next we need to enable the PWM feature of UNO by calling the function “analogWrite(pin, value)ᾠ. In here ‘pinᾠrepresent the pin number where we need PWM output we are putting it as ᾳᾮ So at PIN3 we are getting PWM output. Value is the turn ON duty cycle, between 0 (always off) and 255 (always on). We are going to increment and decrement this number by button press. The UNO has a maximum resolution of Ᾰᾬ one cannot go further hence the values from 0-255. However one can decrease the resolution of PWM by using command “analogWriteResolution()ᾬ by entering a value from 4-8 in the brackets, we can change its value from four bit PWM to eight bit PWM. The switch is to change the direction of rotation for DC motor. Code volatile int i=0;//initializing a integer for incrementing and decrementing duty ratio. void setup() { pinMode(3, OUTPUT); // sets the pin3 as output pinMode(0, INPUT);// sets the pin0 as output pinMode(1, INPUT);// sets the pin1 as output } void loop() { analogWrite(3, i); // analogWrite values from 0 to 255 if (digitalRead(0)==LOW) { if (i<255) { i++;//if pin0 is pressed and the duty ratio value is less than 255 delay(30); } } if (digitalRead(1)==LOW) { if (i>0) { i--;// if pin1 is pressed and the duty ratio value is greater than 0 delay(30); } } } Video microcontroller-projects/7-segment-display-interfacing-with-arduino

7 Segment Display Interfacing with Arduino

to ARDUINO UNO. The display counts from 0-9 and resets itself to zero. Before going further, let us first discussabout seven segment displays. A seven segment display got its name from the very fact that it got seven illuminating segments. Each of these segments has a LED (Light Emitting Diode), hence the lighting. The LEDs are so fabricated that lighting of each LED is contained to its own segment. The important thing to notice here thatthe LEDs in any seven segment display are arranged in common anode mode (common positive) or common cathode mode (common negative). The circuit connection of LEDs in common cathode and common anode is shown in above figure.Here one can observe that, in CC the negative terminals of every LED is connected together and brought out as GND. In CA the positive of every LED is connected together and brought out as VCC. These CC and CA come in very handy while multiplexing several cells together.

Components Required

ARDUINO UNO , power supply (5v), HDSP5503 seven segment display (two pieces) (any common cathode will do ), 47uF capacitor (connected across power supply). arduino IDE (Arduino nightly)

Circuit Diagram and Working Explanation

The connections which are done for 7 segment display are given below: PIN1 or E to PIN 6 of ARDUINO UNO PIN2 or D to PIN 5 PIN4 or C to PIN 4 PIN5 or H or DP to PIN 9 ///not needed as we are not using decimal point PIN6 or B to PIN 3 PIN7 or A to PIN 2 PIN9 or F to PIN 7 PIN10 or G to PIN 8 PIN3 or PIN8 or CC to ground through 100 resistor. Now to understandthe working, consider a seven segment display is connected to a port, so say we have connected “A segment of display to PIN0ᾬ “B segment of display to PIN1ᾬ “A segment of display to PIN3ᾬ “A segment of display to PIN4ᾬ “A segment of display to PIN5ᾬ “A segment of display to PIN6ᾮ And is common ground type as shown in figure. Here the common ground has to be connected to ground for the display to work. One can check each segment of display by using multimeter in diode mode. Each segment should not be power with a voltage greater than 4v, if did the display will be damaged permanently. For avoiding this a common resistor can be provider at common terminal, as shown in circuit diagram. Now, if we want to display a ᾰᾠin this display as shown in below figure. We need to turn the LEDs of segments “A, B, C, D, E Fᾬ so we need to power PIN0, PIN1, PIN2, PIN3, PIN4 and PIN5. So every time we need a ᾰᾬ we need to power all the pins mentioned. Now, if we want ᾱᾠon display We need to power segments “B, Cᾬ for segment B, C to turn ON we need to power PIN1, PIN2. With both the pins high we get ᾱᾠon display.So as seen above we are going to power pins corresponding to the digit that to be shown on display. is best explained step by step in C code given below: Code #define segA 2//connecting segment A to PIN2 #define segB 3// connecting segment B to PIN3 #define segC 4// connecting segment C to PIN4 #define segD 5// connecting segment D to PIN5 #define segE 6// connecting segment E to PIN6 #define segF 7// connecting segment F to PIN7 #define segG 8// connecting segment G to PIN8 int COUNT=0;//count integer for 0-9 increment void setup() { for (int i=2;i<9;i++) { pinMode(i, OUTPUT);// taking all pins from 2-8 as output } } void loop() { switch (COUNT) { case 0://when count value is zero showᾰᾠon disp digitalWrite(segA, HIGH); digitalWrite(segB, HIGH); digitalWrite(segC, HIGH); digitalWrite(segD, HIGH); digitalWrite(segE, HIGH); digitalWrite(segF, HIGH); digitalWrite(segG, LOW); break; case 1:// when count value is 1 showᾱᾠon disp digitalWrite(segA, LOW); digitalWrite(segB, HIGH); digitalWrite(segC, HIGH); digitalWrite(segD, LOW); digitalWrite(segE, LOW); digitalWrite(segF, LOW); digitalWrite(segG, LOW); break; case 2:// when count value is 2 showᾲᾠon disp digitalWrite(segA, HIGH); digitalWrite(segB, HIGH); digitalWrite(segC, LOW); digitalWrite(segD, HIGH); digitalWrite(segE, HIGH); digitalWrite(segF, LOW); digitalWrite(segG, HIGH); break; case 3:// when count value is 3 showᾳᾠon disp digitalWrite(segA, HIGH); digitalWrite(segB, HIGH); digitalWrite(segC, HIGH); digitalWrite(segD, HIGH); digitalWrite(segE, LOW); digitalWrite(segF, LOW); digitalWrite(segG, HIGH); break; case 4:// when count value is 4 showᾴᾠon disp digitalWrite(segA, LOW); digitalWrite(segB, HIGH); digitalWrite(segC, HIGH); digitalWrite(segD, LOW); digitalWrite(segE, LOW); digitalWrite(segF, HIGH); digitalWrite(segG, HIGH); break; case 5:// when count value is 5 show᾵ᾠon disp digitalWrite(segA, HIGH); digitalWrite(segB, LOW); digitalWrite(segC, HIGH); digitalWrite(segD, HIGH); digitalWrite(segE, LOW); digitalWrite(segF, HIGH); digitalWrite(segG, HIGH); break; case 6:// when count value is 6 showᾶᾠon disp digitalWrite(segA, HIGH); digitalWrite(segB, LOW); digitalWrite(segC, HIGH); digitalWrite(segD, HIGH); digitalWrite(segE, HIGH); digitalWrite(segF, HIGH); digitalWrite(segG, HIGH); break; case 7:// when count value is 7 showᾷᾠon disp digitalWrite(segA, HIGH); digitalWrite(segB, HIGH); digitalWrite(segC, HIGH); digitalWrite(segD, LOW); digitalWrite(segE, LOW); digitalWrite(segF, LOW); digitalWrite(segG, LOW); break; case 8:// when count value is 8 showᾸᾠon disp digitalWrite(segA, HIGH); digitalWrite(segB, HIGH); digitalWrite(segC, HIGH); digitalWrite(segD, HIGH); digitalWrite(segE, HIGH); digitalWrite(segF, HIGH); digitalWrite(segG, HIGH); break; case 9:// when count value is 9 showᾹᾠon disp digitalWrite(segA, HIGH); digitalWrite(segB, HIGH); digitalWrite(segC, HIGH); digitalWrite(segD, HIGH); digitalWrite(segE, LOW); digitalWrite(segF, HIGH); digitalWrite(segG, HIGH); break; break; } if (COUNT<10) { COUNT++; delay(1000);///increment count integer for every second } if (COUNT==10) { COUNT=0;// if count integer value is equal to 10, reset it to zero. delay(1000); } } Video microcontroller-projects/arduino-uno-adc-tutorial

How to Use ADC in Arduino Uno?

is of 10 bit resolution (so the integer values from (0-(2^10) 1023)). This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. So for every (5/1024= 4.9mV) per unit. line. Here one must understand that in each character there are 5x10=50 pixels so to display one character all 50 pixels must work together, but we need not have to worry about that because there a another controller (HD44780) in the display unit which does the job of controlling the pixels (you can see it in LCD unit, it is the black eye at the back).

Components Required

ARDUINO UNO, power supply (5v), JHD_162ALCD (16x2LCD), 100uF capacitor, 100K pot or potentiometer, 100nF capacitor. arduino IDE (Arduino nightly) pin for contrast control (VEE-controls how thick the characters should be shown), and 3 control pins (RS&RW&E). In the circuit, you can observe I have only took two control pins,the contrast bit and READ/WRITE are not often used so they can be shorted to ground. This puts LCD in highest contrast and read mode. We just need to control ENABLE and RS pins to send characters and data accordingly. PIN1 or VSS to ground PIN2 or VDD or VCC to +5v power PIN3 or VEE to ground (gives maximum contrast best for a beginner) PIN4 or RS (Register Selection) to PIN8 of ARDUINO UNO PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for user) PIN6 or E (Enable) to PIN9 of ARDUINO UNO PIN11 or D4 to PIN10 of ARDUINO UNO PIN12 or D5 to PIN11 of ARDUINO UNO PIN13 or D6 to PIN12 of ARDUINO UNO PIN14 or D7 to PIN13 of ARDUINO UNO This type of communication enables the user to decrease the pin usage on ARDUINO, unlike other the ARDUINO need not be programmed separately for using it in 4 it mode because by default the ARDUINO is set up to communicate in 4 bit mode. In the circuit you can see we used 4bit communication (D4-D7). So from mere observation from above table we are connecting 6 pins of LCD to controller in which 4 pins are data pins and 2 pins for control.

Working

For interfacing an LCD to the ARDUINO UNO, we need to know a few things.
analogRead(pin); analogReference(); analogReadResolution(bits);
First of all the UNO ADC channels has a default reference value of 5V. This means we can give a maximum input voltage of 5V for ADC conversion at any input channel. Since some sensors provide voltages from 0-2.5V, with a 5V reference we get lesser accuracy, so we have a instruction that enables us to change this reference value. So for changing the reference value we have (“analogReference();ᾩ As default we get the maximum board ADC resolution which is 10bits, this resolution can be changed by using instruction (“analogReadResolution(bits);ᾩ. This resolution change can come in handy for some cases. Now if the above conditions are set to default, we can read value from ADC of channel ᾰᾠby directly calling function “analogRead(pin);ᾬ here “pinᾠrepresents pin where we connected analog signal, in this case it would be “A0ᾮThe value from ADC can be taken into an integer as “int ADCVALUE = analogRead(A0); ᾬ by this instruction the value after ADC gets stored in the integer “ADCVALUEᾮ NOW let’s talk a bit about 16x2 LCD.First we need to enable the header file (ᾣinclude <LiquidCrystal.h>ᾩ, this header file has instructions written in it, which enables the user to interface an LCD to UNO in 4 bit mode without any fuzz. With this header file we need not have to send data to LCD bit by bit, this will all be taken care of and we don’t have to write a program for sending data or a command to LCD bit by bit. Second we need to tell the board which type of LCD we are using here. Since we have so many different types of LCD (like 20x4, 16x2, 16x1 etc.). In here we are going to interface a 16x2 LCD to the UNO so we get ‘lcd.begin(16, 2);ᾮ For 16x1 we get ‘lcd.begin(16, 1);ᾮ In this instruction we are going to tell the board where we connected the pins, The pins which are connected are to be represented in order as “RS, En, D4, D5, D6, D7ᾮ These pins are to be represented correctly. Since we connected RS to PIN0 and so on as show in circuit diagram, We represent the pin number to board as “LiquidCrystal lcd(0, 1, 8, 9, 10, 11);ᾮ After above there all there is left is to send data, the data which needs to be displayed in LCD should be written as ᾠcd.print("hello, world!");ᾮ With this command the LCD displays ‘hello, world!ᾮ As you can see we need not worry about any this else, we just have to initialize and the UNO will be ready to display data. We don’t have to write a program loop to send the data BYTE by BYTE here. is explained step by step in C program given below. Code #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 10, 11, 12, 13); // REGISTER SELECT PIN,ENABLE PIN,D4 PIN,D5 PIN, D6 PIN, D7 PIN char ADCSHOW[5]; //initializing a character of size 5 for showing the ADC result void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); } void loop() { // set the cursor to column 0, line 1 lcd.print(" CIRCUIT DIGEST"); //print name lcd.setCursor(0, 1); // set the cursor to column 0, line lcd.print("ADC RESULT:"); //print name String ADCVALUE = String(analogRead(A0)); //intailizing a string and storing ADC value in it ADCVALUE.toCharArray(ADCSHOW, 5); // convert the reading to a char array lcd.print(ADCSHOW); //showing character of ADCSHOW lcd.print(" "); lcd.setCursor(0, 0); // set the cursor to column 0, line1 } Video microcontroller-projects/arduino-lcd-interfacing-tutorial

Interfacing 16x2 LCD with Arduino

line. Here one must understand that in each character there are 5x10=50 pixels so to display one character all 50 pixels must work together. But we need not to worry about that because there isanother controller (HD44780) in the display unit which does the job of controlling the pixels. (you can see it in LCD unit, it is the black eye at the back ). Unlike normal developmentboards interfacing a LCD to a ARDUINO is quite easy. Here we don’t have to worry about data sending and receiving. We just have to define the pin numbers and it will be ready to display data on LCD.

Components Required

ARDUINO UNO, power supply (5v), JHD_162ALCD(16x2LCD), 100uF capacitor. Arduino IDE (Arduino nightly).

Circuit Diagram and Explanation

pin for contrast control (VEE-controls how thick the characters should be shown), and 3 control pins (RS&RW&E). In the circuit, you can observe I have only took two control pins, this gives the flexibility. The contrast bit and READ/WRITE are not often used so they can be shorted to ground. This puts LCD in highest contrast and read mode. We just need to control ENABLE and RS pins to send characters and data accordingly. The connections which are done for LCD are given below: PIN1 or VSS to ground PIN2 or VDD or VCC to +5v power PIN3 or VEE to ground (gives maximum contrast best for a beginner) PIN4 or RS (Register Selection) to PIN0 of ARDUINO UNO PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for user) PIN6 or E (Enable) to PIN1 of ARDUINO UNO PIN11 or D4 to PIN8 of ARDUINO UNO PIN12 or D5 to PIN9 of ARDUINO UNO PIN13 or D6 to PIN10 of ARDUINO UNO PIN14 or D7 to PIN11 of ARDUINO UNO , unlike other the ARDUINO need not to be programmed separately for using it in 4 it mode because by default the ARDUINO is set up to communicate in 4 bit mode. In the circuit you can see we have used 4bit communication (D4-D7). So from mere observation from above table we are connecting 6 pins of LCD to controller in which 4 pins are data pins and 2 pins for control.

Working

To interface aLCD to the ARDUINO UNO, we need to know a few things.
#include <LiquidCrystal.h> lcd.begin(16, 2); LiquidCrystal lcd(0, 1, 8, 9, 10, 11); lcd.print("hello, world!");
As by the above table we only need to look at these four lines for establishing a communication between an ARDUINO and LCD. First we need to enable the header file (ᾣinclude <LiquidCrystal.h>ᾩ, this header file has instructions written in it, which enables the user to interface an LCD to UNO in 4 bit mode without any fuzz. With this header file we need not have to send data to LCD bit by bit, this will all be taken care of and we don’t have to write a program for sending data or a command to LCD bit by bit. Second we need to tell the board which type of LCD we are using here. Since we have so many different types of LCD (like 20x4, 16x2, 16x1 etc.). Here we are going to interface a 16x2 LCD to the UNO so we get ‘lcd.begin(16, 2);ᾮ For 16x1 we get ‘lcd.begin(16, 1);ᾮ In this instruction we are going to tell the board where we connected the pins.The pins which are connected need to be represented in order as “RS, En, D4, D5, D6, D7ᾮ These pins are to be represented correctly. Since we have connected RS to PIN0 and so on as show in the circuit diagram, we represent the pin number to board as “LiquidCrystal lcd(0, 1, 8, 9, 10, 11);ᾮThe data which needs to be displayed in LCD should be written as ᾠcd.print("hello, world!");ᾮ With this command the LCD displays ‘hello, world!ᾮ As you can see we need not to worry about any thing else, we just have to initialize and the UNO will be ready to display data. We don’t have to write a program loop to send the data BYTE by BYTE here. The way of communication between LCD and UNO is explained step by step in C code given below: Code #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(0, 1, 8, 9, 10, 11); /// REGISTER SELECT PIN,ENABLE PIN,D4 PIN,D5 PIN, D6 PIN, D7 PIN void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); } void loop() { // set the cursor to column 0, line 1 lcd.print(" CIRCUIT DIGEST");//print name lcd.setCursor(0, 1); // set the cursor to column 0, line 2 ");//print name delay(750);//delay of 0.75sec lcd.scrollDisplayLeft();//shifting data on LCD lcd.setCursor(0, 0);// set the cursor to column 0, line1 } Video microcontroller-projects/ir-controlled-dc-motor-using-arduino

IR Controlled DC Motor using Arduino

from basic interfacing projects to advanced robotic projects and IoT projects, you can check all of them in our website. Here IR sensor will detect any object in front of it and Arduino will read the IR Sensor’s output and make the Relay High. Relay is further connected to DC Motor, so DC Motor will be ON whenever IR Sensor Detects any objects in front it.

Required Components:

Arduino UNO 5V-relay module DC motor IR sensor module Breadboard Connecting wires

Circuit Diagram and Explanation:

Circuit of this IR Sensor controlled DC Motor with Arduino is simple as shown below: In circuit, IR sensor Module output pin is simple connected to the Pin 2 no of Arduino and Relay Module’s input is connected to Pin 7 no of Arduino. Further a DC Motor is connected to the Relay. To learn more about IR Sensor, Relay and DC Motor, you can go through following projects: IR Sensor Module Circuit Arduino Relay Control Tutorial DC Motor Control using Arduino

Code Explanation:

is given at the end. Here we have connected IR sensor output pin to Pin 2 of Arduino. So whenever IR sensor detects any objects Pin 2 of Arduino will be high and based on that Relay will be turned on which is connected to Pin 7 of Arduino. void setup() { pinMode(2,INPUT); pinMode(7,OUTPUT); Serial.begin(9600); } void loop() { if (digitalRead(2) == 1) { Serial.println(digitalRead(2)); digitalWrite(7,HIGH); }

Working of IR controlled DC Motor with Arduino:

Working of this project is straight forward. Whenever there is some object in front of IR sensor, it will detect that and make the output pin high. IR sensor’s output pin is connected to Arduino, so Arduino will read it and activate the Relay module by making pin 7 high. As soon as relay is activated, it will turn on the DC motor. When there is no object near IR sensor, the output of IR sensor will remain low and DC motor will also remain in Off state. The sensitivity of IR Sensor can be adjusted using the potentiometer on the module itself. Sensitivity simply means the distance from which it can detect the object. for the project are given below. Code void setup() { pinMode(2,INPUT); pinMode(7,OUTPUT); Serial.begin(9600); } void loop() { if (digitalRead(2) == 1) { Serial.println(digitalRead(2)); digitalWrite(7,HIGH); } else{ digitalWrite(7,LOW); } } Video microcontroller-projects/dc-motor-speed-control-using-arduino-and-potentiometer

DC Motor Speed Control using Arduino and Potentiometer

, the speed can be controlled by rotating the knob of potentiometer.

Pulse Width Modulation:

% Duty cycle = (TON/(TON + TOFF)) *100 Where, TON = HIGH time of the square wave TOFF = LOW time of square wave and is of 80% (8/ (8+2)), so the average output voltage will be 80% of the battery voltage. Now human eye cannot see that motor is on for 8ms and off for 2ms, so will look like DC Motor is rotating with 80% speed. In the second case, the switch is closed for 5ms and opened for 5ms over a period of 10ms, so the average terminal voltage at the output will be 50% of the battery voltage. Say if the battery voltage is 5V and the duty cycle is 50% and so the average terminal voltage will be 2.5V. In the third case the duty cycle is 20% and the average terminal voltage is 20% of the battery voltage. in many of our Projects: Arduino Based LED Dimmer using PWM Temperature Controlled Fan using Arduino DC Motor Control using Arduino AC Fan Speed Control using Arduino and TRIAC

Material Required

Arduino UNO DC motor Transistor 2N2222 Potentiometer 100k ohm Capacitor 0.1uF Breadboard Jumping Wires

Circuit Diagram

is geven below:

Code and Explanation

using potentiometer is given at the end. Pin for ‘pwmᾮ int pwmPin = 12; int pot = A0; int c1 = 0; int c2 = 0; (which is PWM pin) as output. void setup() { pinMode(pwmPin, OUTPUT); // declares pin 12 as output pinMode(pot, INPUT); // declares pin A0 as input } of Arduino HIGH and then after a delay of value c1 make that pin LOW. Again, after a delay of value c2 the loop continues. void loop() { c2= analogRead(pot); c1= 1024-c2; digitalWrite(pwmPin, HIGH); // sets pin 12 HIGH delayMicroseconds(c1); // waits for c1 uS (high time) digitalWrite(pwmPin, LOW); // sets pin 12 LOW delayMicroseconds(c2); // waits for c2 uS (low time) }

Speed Control of DC Motor using Arduino

pin of the Arduino (which is the PWM pin). The working of Arduino program is very simple, as it reads the voltage from the analog pin A0. The voltage at analog pin is varied by using the potentiometer. After doing some necessary calculation the duty cycle is adjusted according to it. Code int pwmPin = 12; // assigns pin 12 to variable pwm int pot = A0; // assigns analog input A0 to variable pot int c1 = 0; // declares variable c1 int c2 = 0; // declares variable c2 void setup() // setup loop { pinMode(pwmPin, OUTPUT); pinMode(pot, INPUT); } void loop() { c2= analogRead(pot); c1= 1024-c2; // subtracts c2 from 1000 ans saves the result in c1 digitalWrite(pwmPin, HIGH); delayMicroseconds(c1); digitalWrite(pwmPin, LOW); delayMicroseconds(c2); } Video microcontroller-projects/single-rgb-led-interfacing-with-arduino

Single RGB LED interfacing with Arduino Uno

A typicalRGBLED isshown in below figure: TheRGBLED will have four pins as shown in figure. PIN1: Color 1 negative terminal in common anode or color1 positive terminal in common cathode PIN2: Common positive for all three colors in Common anode type or common negative for all three colors in common cathode type RGB LED. PIN3: Color 2 negative terminal or color2 positive terminal PIN4: Color 3 negative terminal or color3 positive terminal RGBLEDs, one is common cathode type (common negative) and other is common anode type (common positive) type.In CC (Common Cathode or Common Negative), there will be three positive terminals each terminal representing a color and one negative terminal representing all three colors. The internal circuit of a CCRGBLED can be represented as below. , If we want RED to be On in above, we need to power the RED LED pin and ground the common negative. The same goes for all theLEDs.In CA (Common Anode or Common Positive), there will be three negative terminals each terminal representing a color and one positive terminal representing all three colors. can be represented as shown in figure. , if we want RED to be on in above, we need to ground the RED LED pin and power the common positive. The same goes for all theLEDs.

Required Components:

Arduino Uno RGB LED (Common Anode) Resistor ᾠ1k

Circuit and Working Explanation

is shown in below figure. Here we have connected Common Anode terminal of RGB LED with the 5v supply of Arduino along with a 1k Resistor. means if we make ground terminal of LED high, it will turn off. So here we are making ground terminal of RGB LED high to keep the respective LED in off state. And if we make ground terminal of RGB LED low it will glow. So as we have already seen in above pin diagram of RGB LED that pin 2 is common anode, and pin 1, 3 and 4 are the ground terminals of Red, blue and green color respectively. In below code, you can check that we are alternatively blinking all three colors in RGB led by making the Ground terminals of RGB high and low. Remember that LED will be off when ground terminal of respective color is high and LED will glow when ground Terminal of Respective color is Low. below. Code void setup() { pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); } void loop() { digitalWrite(2, LOW); delay(500); digitalWrite(2, HIGH); delay(500); digitalWrite(3, LOW); delay(500); digitalWrite(3, HIGH); delay(500); digitalWrite(4, LOW); delay(500); digitalWrite(4, HIGH); delay(500); } Video microcontroller-projects/getting-started-with-arduino-uno-blinking-led

Getting Started with Arduino Uno: Controlling LED with Push Button

The name Arduino is typically buzz word among most of the electronics students or hobbyists alike. Its ability to build things faster and cheaper with a massive online community support has made it an ideal choice for many people who are just getting started with electronics or programming. Because of its simplified hardware design and programming environment, it is possible even for people without any electronics or computer science background to learn it with ease. So what actually is this Arduino? How can you get started with it? What can you make with it to improve your lifestyle? All these questions will be tried to be answered in this tutorial, as we step through. We will set up the Arduino IDE on your PC/Laptop and upload a sample blink program to the Arduino. Then we will also build a small hardware using a bread board with a simple circuit consisting of a switch and LED and program our Arduino according to it. Sounds interesting enough?!!

What actually is Arduino?

So what is it? There are many hardware board other than Arduino UNO like the Arduino Mega, nano, mini etc.. But for the purpose of this tutorial we will stick with only Arduino UNO. The Arduino IDE is the software using which we will program the Arduino UNO board.

Setting up the Arduino IDE

can use the respective links. Also make sure you have the admin rights of the computer for easy installation. Download the Arduino IDE form the official Arduino website, by simply clicking on the link below This will download an exe file, which will be the latest Arduino IDE of your time. By the time I am documenting this, the latest version is Arduino-1.8.5 and the size of the file is 90.4MB. There is a very good chance that it got updated by the time you are trying this out. Once the download is complete launch the exe file. You might be asked for admin rights, if prompted click on yes. Click on “I Agreeᾠto agree to the License Agreement of Arduino. Next Under Installation options, make sure all the checkboxes are ticked as shown below and then click on next. Now, we have to select the location at which the IDE has to be installed. By default, it will be installed under Program files directory of C drive. It is high recommended to leave it as such and click on Install You should see the IDE getting installed on your computer. Wait till the progress bar is completed. The screen will be something like this shown below. Once completed it will show “completedᾠthen click on the close button. After closing the installer. Go to your desktop and find the Arduino exe file and launch it. It will show a boot up label and then open the IDE with a bare minimum code on it as shown below

Connecting your Arduino board with Computer:

Once the Arduino IDE is installed on our computer, the next step will be to connect the Arduino UNO board with our computer. To do these simply use the programming cable (blue colour) to connect your Arduino board with the USB port of your computer. in total which are listed below 1. It provides the required power for the Arduino UNO to operate, so you can run your projects just by directly powering them though the USB cable 2. It programs the ATmega328 microcontroller on the Arduino UNO board. The program you write on the IDE is sent into the microcontroller through this cable 3. It acts as a serial communication cable; it can talk to the computer through serial communication acting as a good debugging tool. You will understand more about this as we dig deep. Once the board is powered you will notice a small LED staying high. This is to indicate that the board is supplied with power. You should also notice another LED blinking due to the default blink program which was already uploaded by the vendor on your Arduino UNO ᾠon your computer. click on it and check if the board is listed under that option as shown below The Port name for my Arduino board has appeared as Arduino Uno, the name of your Arduino might differ based on the board vendor. It can be CCH450 or something like that so do not worry about the name of the port. it means your board is not discovered. In that case it is a driver problem, so you have to manually install the correct drivers for your board. In some cases you will find more than one COM port listed under the ports section and you will not know which one is for the Arduino board since the naming will also be different. In that case just disconnect the board and connect again. Check which COM port is disappearing and appearing again, this COM port is your Arduino UNO. Once you have found the correct COM port note down the COM port number of your board. Here for my board the COM port number is 13. This number will change each time you change the USB port to which the board is connected to.

Uploading the blink program

as shown below as shown below If everything is correct you should notice Arduino UNO on COM 13 as the bottom of the screen. After verifying that click on the upload icon (highlighted in Blue) to upload the code to the Board as shown below ᾠas shown below That is it we have uploaded the first program to the Arduino board with success. But, what is it? What have we done? What is the output of the program? To know the answer of all these questions let’s build a small hardware using which we can glow an LED when a button is pressed and write the program all by our self from scratch

Materials Required:

The materials required for this project are Arduino UNO Programming Cable Push Button LED (any color) 1k resistor Bread Board Connecting wires

Hardware Connection:

The complete connection diagram of the set-up is shown below. You just have to follow the figure to make the connections as such. is input which is connected to the second pin of the Arduino. If you take a close look you can notice that one side of the button is connected to the Ground and the other side is connected to pin number 2. This means that whenever we press the button the pin number 2 will be connected with ground as it limits the amount of current flowing through the LED. If this current is not limited excess current will flow through the LED damaging it permanently.

Programming your Arduino:

of this page, further below we are just going through them line by line. void setup() { // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly: } function. In our hardware we have to declare that pin 2 is an input pin and the pin 3 is an output pin. This can be done by the following lines pinMode(2,INPUT); pinMode (3,OUTPUT); and you cannot see it. To use this resistor we just have to write a line on out Arduino IDE. as shown below pinMode(2,INPUT_PULLUP); function. Here we have to check if the pin 2 is grounded (LOW) and if it is grounded we have to make the LED glow by making it pin3 HIGH. If not grounded (else) we have to keep the LED turned off by making the pin 3 as LOW. Let us put these words in program like if (digitalRead(2) == LOW) { digitalWrite(3,HIGH); } else { digitalWrite(3,LOW); } is used to read the status of an INPUT pin. If the pin is connected to ground it will return LOW and if the pin is connected to +5V it will return HIGH. is used to set the status of an OUTPUT pin. If we set the pin as HIGH it will provide +5V as output and if we set the pin as LOW it will provide 0V as output. So for our program, when we press the button pin 2 will be grounded (LOW), so we make pin 3 to output +5V (HIGH). This +5V will be enough to turn on the LED. If this condition is not met then pin 3 will be made 0V (LOW) which will eventually turn off the LED. That is it our program is complete, let us upload the code to our Arduino board, just like how we uploaded the blink code above.

Verifying our output:

Then when we release it the LED should turn off. If you have any problem in getting this work, you can brief you problem in the comment section for help. Or you can also use the forums for technical help. Hope you understood the tutorial and made your first baby step with Arduino, once you get comfortable with this basic you can dive deep to explore Arduino much more. etc. Code void setup() { pinMode(2,INPUT_PULLUP); pinMode (3,OUTPUT); } void loop() { // put your main code here, to run repeatedly: if (digitalRead(2) == LOW) { digitalWrite(3,HIGH); } else { digitalWrite(3,LOW); } } tutorial/unoardusim-a-simulator-to-learn-arduino-programming-and-debugging-without-arduino-board

UnoArduSim : A Simulator to Learn Arduino Programming and Debugging Codes without Arduino Board

and Mega board and have an option to select a up to of 24 I/O devices.

What is UnoArduSim?

UnoArduSim was developed by Professor Simmons of Queen’s University, Ontario, Canada. He used the platform to teach secondyear students of Department of Electrical and Computer Engineering. The graphical simulator was developed to allow students to test their robotic codes without requiring any additional hardware. except the ‘gotoᾠinstruction. Furthermore, some C/C++ language elements it does not support includes Bit-saving, union, and the oddball “comma operator is also unsupported.

Interface

containing all the menu options and a toolbar containing icon for quick actions. The image below shows the interface of UnoArduSim. From the name itself, we can understand that the code pane contains the code or the program. Code pane can be used to track the execution when the program is running, it also highlights any error in the code with red color highlight. constants) to be included in to your code from the list provided. It also gives an option to auto add semicolon or highlight the functions. It is situated under the code pane in bottom left side of the screen. It contains the current values for every user. The window also displays values of variables during execution. The microcontroller on the Lab Bench Pane behaves exactly like a real board. All the I/O devices and both the microcontrollers, i.e. 'Uno' and 'Mega' are very accurate. The electrical model of the components is good for analyzing the behavior of your program accurately, even the electrical pins will be flagged. For example: When you reset the board, the indicator LED blinks. The Lab Bench Pane is shown in the image below: The board also features an option to observe the waveform at each I/O pin. It can be done when you are executing the program, you have to click on the specific pins to see the digital waveform. You can select up to 4 waveforms to be displayed on the screen. The Menu bar contains all the option to operate and control the simulation, it gives us options such as File, Find, Execute, Options, Configure, VarRefresh, Windows and Help. Brief introduction about all the functions is given below: Allows the user to choose a program file having the selected extension. The program is immediately given a Parse. It opens the editor window. Save the edited code to the existing file. Save the edited code in to a new file. file in the Code Pane Used for displaying the previous file in the Code Pane Used for exiting the simulator. Used to proceed instruction by a single instruction . Runs the program only till the desired line. It executes and runs the code. It stops the execution of the code. It is used to reset the program to the start state. It is used to slow time by a factor of 10. I/O Devices are divided into two categories, smaller ‘I/Oᾠdevices and Big ‘I/Oᾠdevices. The segregation is based on the size of the device in real world, The smaller ‘I/Oᾠdevices contains, push button, Switched Resistor, Piezo Speaker, Coloured LED, 4-LED Row, 7-Segment LED, Pin Jumper and Analog Slider whereas the Big ‘I/Oᾠdevices have Servo Motor, DC Motor, etc. and it also have other peripherals such as MUX, Displays, etc. All the input and output peripherals are shown in the image below: A user can select a total of 16 smaller ‘I/Oᾠdevice and 8 Big ‘I/Oᾠdevices.

UnoArduSim Limitations !!

The simulator comes with few limitations. The biggest limitation is that libraries such as <Servo.h>, <Wire.h>, <OneWire.h>, <SPI.h>, <EEPROM.h> can only be emulated. Their functionality is directly built into the simulator and hence the actual files are not searched. And therefore, the other libraries won’t work as the will contain unsupported directives and unrecognized files. The execution time of Arduino program instructions are not accurate as they are not modeled accurately, therefore for every loop a ‘delay()ᾠinstruction is required to run your program that is synchronized to the real-time pin level changes.

Arduino SimulatorsAlternatives

There are a lot of alternate Arduino simulators available in the market, some of the most common simulators are: Tinkercad Circuits Virtual Breadboard & Avatar Hardware PICSimLab Wokwi IO Simulator Proteus Fritzing

How to use the UnoArduSim?

and unzip the file. In the folder, find the UnoArduSim.exe file and double click to run the simulator. The first step is to select your microcontroller. To do that, click on the Configure in the menu bar and open preference from the drop-downmenu which appears. A new pop-up window will appear, here you can select the Board, TWI Bytes and it has features like auto indent, auto insert closing, etc. Choose the board and click on load. from the drop-downmenu which appears. A new pop-up window will appear, here you can choose all the required peripherals from the given menu.

Programming

If you already have an Arduino code in a ᾮinoᾠor ᾮpdeᾠformat, you could directly upload it by clicking on the File>Load INO or PDE. To write the code, double-click on the Code Pane to open the editor. Alternatively, you can click on the File and click on Edit/View. You can also press Ctrl + E simultaneously to open the Editor. After writing your program, click on the compile button. After your compilation is complete, select the required I/O and according to the pins assigned in your program, Assign the pins on the I/O peripherals by typing on the space provided in evert peripheral block. option, it will start executing the program. Now, to see how your setup and code will perform by changing the input, change the values of the input peripheral by clicking on the buttons or change the values on the peripheral symbols to see how your system should perform.6

Conclusion

The UnoArduSim is an easy-to-use simulator. The simulator has lot of features which you will easily be able to use by playing a bit with the software. It makes debugging easier by highlighting the error. So, even if you are new into the world of microcontrollers and trying to learn Arduino programming or someone who wants to debug your code or know how your code will perform without investing time and resources in assembling the components in a fast and efficient manner then this software is extremely useful for you. I hope you found this article helpful. If you have any question or doubt related to this software, then post your queries in the comment section below. tutorial/how-to-debug-an-arduino-project-arduino-ide-debugging-tools

How to Debug an Arduino Project ᾠA better way to Write your Arduino Codes

Debugging is a vital element of the creative process when it comes to developing code. Arduino debugging, on the other hand, can be a little more difficult. One reason for this is that Arduino does not include a specialized debugging tool. However, the new Arduino IDE pro has a debugging tool with it. So, let’s see what kind of debugging tools are available for the Arduino Uno programming. The procedure of programming the Arduino is so simple but when it comes to debugging and writing a good code you need to know how many ways are available to debug the Arduino. For the debugging, we have two options available in the Arduino IDE. These are Internal Debugging tools and External Debugging Tools.

Internal Debugging Tools on the Arduino IDE

We have some internal features on Arduino IDE to debug a code. We can use the compiler, Serial Monitor, Serial Plotter, or even on the Arduino IDE Pro, we have a Serial Debugger. Now, let’s discuss one by one about the Internal Debugging Tools. We have a compiler on the Arduino IDE but it can be used to check any warning or errors when we have completed our code. If you receive a compilation error when attempting to compile or upload code to your board, check for syntax, typos, and other problems. Using the proper syntax is critical to ensuring that your code compiles. When compilation fails, the IDE will display the problems at the bottom of the screen. The error messages provided by the Arduino IDE, on the other hand, are restricted in their description and hence not always particularly helpful. If you understand what the error message implies, consider resolving the issue it suggests and recompiling. This is a quick way to debug an Arduino. As previously said, if your code fails when you try to run your sketch, you must begin troubleshooting it. First, decide which parameters to output and utilize the serial monitor to keep track of them on-screen (You can learn the basics of serial print here). The goal is to print a summary of the program's present status. As an example: Variables Inputs ᾠsensor readings Prints that indicate the programs flow, like inside an ‘ifᾠstatement to see whether the condition was met Outputs ᾠe.g. PWM values before writing them to the pin Anything else you find important to print to screen

Arduino IDE Pro Including the Debugging Tools

has a debugging tool that can be used to enhance debugging skills. It has the following features which make it very useful to the developers. New features including: Code indentation Block folding Auto-closing brackets Regular expression search and replace Comment toggling Other additional features are live debugging, autocompletion, responsive interface, and faster compilation time.

External Debugging Tools for the Arduino IDE

If you manually examine your code and still can't discover the issue, it's time to utilize a sophisticated debugging tool. Unlike many IDEs, Arduino does not have its own inbuilt debugging tool. There are, however, a variety of other tools you may use to ensure that your code is executing properly. If you want extensive debugging and simulation capabilities, the following are some of the finest tools to consider: Visual micro is a Microsoft Visual Studio plugin that allows you to develop cross-platform Arduino applications. Any code written in Visual Micro that complies with Arduino specifications will be approved. Because it allows for shared code and library modification, Visual Micro is ideal for collaborative Arduino debugging teams. Code from multiple platforms can be produced and integrated with programme code during the compilation process. Visual Micro also provides GDB debugging, as well as serial, Bluetooth, and WiFi debugging. DebugWire is an Atmel protocol that allows you to debug multiple ATTiny (e.g., ATTiny 13, 85) and ATmegas (e.g., ATmega48/88/168/328) without using JTAG and just using the Reset pin. Atmel does not document the DebugWire protocol, however, some folks reverse engineered large sections of it and were able to construct some basic debuggers. DebugWIRE provides full read and write access to the entire memory as well as complete control over the execution flow. It supports the following instructions: single-step, run-to-cursor, step-out, and software break. Atmel Studio IDE is a free Programme that provides competitive debugging capabilities to assist in the resolution of code problems. A project may be designed, compiled, and uploaded to the appropriate microprocessor using Atmel Studio. Atmel Studio's IDE, like the Arduino IDE, uses the same code, so you don't need to learn a new programming language to use it. For the open-source community, Atmel is highly adaptable and supports.ino drawings as well as C++ source codes. Atmel Studio also has excellent debugging capabilities through DebugWire or JTAG. So, these are the basics steps that you can follow to debug while writing an Arduino Code. You can try out those features of the debugging tools while making your Arduino Projects. article/why-iot-devices-require-chip-to-cloud-security

Why IoT Devices Require Chip-to-cloud Security?

are targeting IoT devices massively on a daily basis and hence, any company utilising or making an IoT device has to focus and prioritize on top-notch security. .ᾍ

The Latest and Current Layers of Security for IoT Devices

The point to be noted is that there is already an existing solution, but an embedded solution cannot be implemented on top of that and hence, Hardware Security Module (HSM) always makes sense and it will provide an equal amount of security. Then, the software security can be implemented on top of a secured MCU embedded like an Azure-based device. The basic level is network security, which is the implementation of AI and machine learning at the network core. This implementation tracks and creates the data aberration. Cloud security is also an integral part of hardware security as well. The pillar of hardware security enables the “hardware root of trustᾠthat utilises asymmetric encryption. A hardware root of trust is the platform on which all secure operations of a computer system rely. It contains the keys used for cryptographic functions and enables a secure boot process and on the other hand, a secure tunnel is also crafted for the secure flow of data from chip to the cloud, ensuring data security at rest and in transit. There is a tamper-resistant secure platform, known as Secure Element (SE) that has the potential of hosting various applications in a very secured way and also their cryptographic and classified data following the security necessities and rules established by the verified authorities. Another uniqueness of SE is that it can be utilized in numerous form factors (UICC(SIM), embedded secure element, and micro-SD) and multi-application environments. and that artifacts consist of encryption keys, passwords, or certificates. The uniqueness is that TPM is independent when compared to all other platform components such as OS, processor, and memory. It uses a root key protected in silicon to enhance native operating system file and folder encryptions and lays the foundation for authentication of TPM-enabled devices. TPM is one of the oldest developed securities. We have seen the deployment of TPM in PCs, laptops, even Google implemented it on their smartphones as well. “One of the key changes to the TPM was the titan chip when it was implemented by Google India in their servers. It changed the perspective of the market that security is not just limited to the devices, it’s also in centers and servers that need to be secured from the hardware perspective,ᾠadded Sinha.

Why Chip-to-Cloud is Important to Secure IoT Devices

According to various media reports, a year back during the COVID-19 pandemic, Alibaba declared to counter the augmenting demand for software business with an investment of over $28 billion in cloud architecture. Be it off-site or onsite, connected or IoT devices have turned out to be important to transforming enterprises swiftly. For the enhancement of connectivity technologies, the implementation of enterprise computing based on cloud plays an imperative part. There is a saying that ‘you cannot have profit before you have security.ᾠHence, cutting-edge connectivity between the devices is the urgent need of the hour that can be revoked by cyber-threats. devices utilising microchips that are energy-efficient because it will further help stay connected to the cloud every time. , but deployment of this technology on a rapid scale needs to be done. Microsoft Azure is one of the keys for secure chip to cloud. The Azure sphere in the cloud thus embeds with a private key that enables asymmetric encryption and authenticates devices with paired public keys at the time of manufacturing. For instance, in North America, international coffee chain Starbucks has deployed Microsoft Azure in all its chains. Each of the outlets have more than twelve pieces of equipment that works for more than seventeen hours a day and are required to be connected to the cloud for data related to beverages, any speculative maintenance to fight shy of disruptions, and asset monitoring. It embeds public secure keys within a secure MCU/MPU backed by its Pluton security subsystems.

How to Secure IoT Devices in Post-Quantum World

The development of quantum computing would jeopardize the most popular public-key encryption systems even though it is still in the early stages of development. These encryption systems are now essential to secure the internet because they are equipped with the potential to tackle and offer top-notch security in various communications platforms that are not security proof. With the increasing demand, it is now extremely challenging to offer state-of-the-art security to the IoT enabled devices because most of them are dependent on batteries and have limited resources in terms of memory and computational power. It signifies that specific lightweight and energy-efficient algorithms are required to be implemented for the devices. Researchers all around the world are now developing solutions to tackle the challenges of IoT devices due to quantum computing. Back in October 2019, the search engine giant Google proclaimed to have achieved quantum computing because its 54 qubit SoC had the ability to perform a calculation in just 200 seconds that would have surpassed a powerful supercomputer. The coming years, once this type of chips are commercialized, cybercriminals could easily crack any security encryptions. Now, the point is what could be the possible security solutions. The Quantum Random Number Generator (QRNG) refers to quantum driven secure chip design, which can be integrated into current Silicon design and manufacturing processes. Another option is to choose a configuration with as much memory as possible. It is forecasted that implementing at least 256kb of RAM for cryptography within the Root of Trust will be secure enough for the post-quantum world. Now, unlike asymmetric encryption, symmetric encryption does not require keys to be sent in the open, where quantum algorithms could potentially break it. Instead, it requires that the sender and recipient of a message exchange an encryption key in person. Implementation of Symmetric crypto accelerators will play a key role for post-quantum crypto algorithms. interview/shamal-vp-from-tata-elxsi-on-how-advancements-in-battery-and-charging-technology-helps-in-adoption-of-electric-vehicles

Shamal VP from Tata Elxsi on How Advancement in Battery and Charging Technology helps in Adaption of Electric Vehicles

that how the implementation of new technologies plays an important role in boosting the EV domain, and why charging should not be a major concern for urban mobility. are likely to grow faster than pure battery-electric vehicles in the heavy commercial vehicle segment over the next five years. play a critical role. The crucial point to remember is that technology that works well in one region may not work well in another. The overall geopolitical environment, supply chain management, infrastructure availability, terrain, driving conditions, and driving patterns/behaviors all contribute to selecting the appropriate technology for that region whether for the battery, traction, charging, or the entire vehicle design. can be performed. Additionally, it can assist the user inadequately planning their travel to ensure a stress-free drive. In terms of cost, the key is to optimize the battery size. Therefore, utilizing efficient energy and thermal management techniques and selecting the appropriate battery chemistry is critical. Complex control strategies are being developed to increase the electric vehicle’s overall energy efficiency. , manufacturers, and technology firms realize their EV dreams. Tata Elxsi has been at the forefront of delivering end-to-end electrification services to our customers, including activities through software, hardware, mechanical, and cloud implementation, thanks to comprehensive research and development at state-of-the-art laboratories and testing facilities, creative solution accelerators, and global partnerships. One aspect that we are looking at is more efficient, magnet-free motors. Concerning the battery - newer, safer, and more energy-dense chemistries utilizing solid electrolytes are being developed. In addition, we are developing solutions based on digital twin concepts to address several critical issues, including battery life prediction, range, and range optimization. are comparable. While charging stations, particularly fast chargers, are critical on highways, they should not be a major concern for urban mobility. article/how-technology-helps-reducing-operational-inefficiencies-in-global-ewaste-management

How Technology Helps Reducing Operational Inefficiencies in Global E-waste Management

With the advancement of technology and science over the past few decades, electrical and electronic equipment (EEE) has turned out to be an imperative part of our daily life. Nonetheless, the consumption, disposal, and production of e-waste have become unsustainable. The total consumption of EEE has escalated to 2.5 million tonnes. Devices such as laptops, radios, phones, and toys with batteries and power add to the volume of e-waste after use. Although the volume is augmenting, the adoption of recycling and collection is very low and hence, the generation of harmful greenhouse gases, and the release of toxic substances during informal recycling are on the rise. It’s not only the developing or the lower economic countries affected by this problem, but the developed countries are also facing the challenges of proper management of these wastes. For many entrepreneurs and individuals, it is now a method of income by recovering important materials from the dumped items. Most of the time, the separation and recycling is carried out informally or rather unscientifically devoid of any safety and health standards. Various associations are considering this matter strongly and urged for an impeccable legal policy and also investment in technology and modern equipment for seamless recycling.

Global Challenges and Scenario

As of now, the recycling rate of e-waste globally is 20-30 percent and the collection rate is 50-60 percent. Globally, 53.6 million metric tons of total e-wastes were produced at the end of 2019. In the same year, China gained the status of the globe’s biggest producer of e-waste, which is around 10 million metric tons. It is then followed by the US, which is around seven million metric tons, claims a report of Statista. In the solid waste management sector, waste electrical and electronic equipment management (WEEE) is now a critical matter coupled with worldwide interconnections between developing, developed, lower economic countries. In the background of sustainable development, the current impediment of e-waste management is to relocate the pattern to a feasible resource from a toxic pollution site. The notion of waste hierarchy centers on 3R policy (reduce, reuse, recycle), prevention of waste, and lower awareness to landfills. Backed by an impeccable legislation, e-waste is now regarded as a special waste stream. The concept of circular economy is now largely promoted by the European Union (EU) policy by which wastes are regarded as resources and commenced regulations for a recycling society. According to the WEEE Directive, 2012/19/EU member countries such as Romania cannot meet the waste collection rate of 45 percent due to the longer lifespan of electronic items and lower purchasing power, chiefly in the rural regions. Due to the intricate environmental laws and regulations, the high price of labours, and insufficient modern facilities, the developed countries mostly do not recycle the wastes and the huge piles of waste streams are either exported to the developing countries or dumped in the landfills. Export of dangerous and toxic wastes to the underdeveloped countries is strictly prohibited as per the Basel Convention on the Control of Transboundary Movements of Hazardous Wastes and their Disposal. In order to promote recovery and recycling options, the developed country's national waste regulations restrict the landfill. The recyclers majorly available in the west and in Europe are more to do with eye-tired products. For the consumer durables, there are hardly any recyclers available. The type of recycling processes people use in the west is different because the labour is very expensive and they try to automate the process, which means during recycling you lose out a lot of materials and metals. The resource recovery and yield are also much lesser than India. The Extended Producer Responsibility (EPR) is promoted by the EU that shifts the responsibility of e-waste management and recycling to EEE producers and importers from local authorities. The import of e-waste is strictly restricted by many developing countries like Nigeria, Cambodia, China, Vietnam, Malaysia, Pakistan, while nations countries such as Benin, Cote D’Ivoire, Kenya, Liberia, Senegal, Uganda, South Africa, India are yet to consider this matter. Tarun Pathak - Research Director - Counterpoint Research told exclusively to CircuitDigest, "Researchers think there are dozens of hurdles, but the imperative one is insufficient regulations that can be enforced efficiently. The entire ecosystem needs to be in sync in tackling e-waste. Other challenges being lack of awareness and low use of technology to navigate the challenges. For example in the smartphone segment, smartphone makers that have embraced recovery, refurbishment, and recycling of second-hand devices, not only are making a positive contribution to building their user base, they are also helping the environment by substantially reducing the embedded energy cost per year, per smartphone.ᾍ “There is a requirement of state-of-the-art recycling options backed by cutting-edge technology and modern machines and setting up more centers. As of now, there is less awareness of e-waste collection where again technology can be used. Melting the printed circuit boards and recovering metals through efficient technology will help a long way. Leveraging AI technology in sorting out the e-waste and use of more biological technologies will help further,ᾠadded Pathak.

E-Wastes Scenario in India

In India, the collection and recycling of e-waste is mostly an activity of an informal sector. Last year, researchers stated that the country ranks third in terms of producing e-wastes followed by China and the USA. Towards the end of 2019, these three countries contributed 38 percent out of the total 53.6 million tonnes of e-waste. One of the biggest challenges is that disposal, recycling, segregation, and dismantling of e-waste is carried out by unskilled laborers manually in the informal sector. Lack of awareness is another major issue due to which the wastes are dumped with garbage, which in turn is picked by dump collectors to sell it to the scrap dealers. The latter then sells it to the recycling firms who utilize outdated machines and technologies to recycle. India generates around 3.2 million metric tonnes of e-waste each year and the collection rate is only around 10-20 percent. There are 412 recyclers available in the country. In 2011, the first laws regarding e-wastes were introduced in the country and in 2016 the extended producer responsibility (EPR) laws were introduced. Then, the producers were given a specific target for the collection of end-of-life products based on certain formulas. Over 1500 producers have registered and have taken EPR Licenses. Now, the objective is to collect the e-waste from end consumers. So, these materials are being sourced through Producers Responsibility Organisations (PROs) or through authorized recyclers. A L N Rao - CEO - Exigo Recycling told exclusively to CircuitDigest, "The collection of waste is key because there are two types of products; volumetric and non-volumetric. The latter can easily be shifted across the country, but it is a nightmare for logistics to shift volumetric products in the country. The reason being the recycling plants mostly are family-driven and they are located only in select pockets in the country. Hence, shipping of volumetric products becomes an expensive affair. There is a viability gap funding (VGF) that is being done by the producers to ensure fulfillment of their EPR targets." “Currently, there is no inventorization of e-waste inventories available in the country and therefore, the exact numbers of inventories are not available. Government offices in India are the major purchasers of electronics, which is around 40-50 percent. The GOI through their offices sells the wastes to the highest bidder, which is a non-economical proposition for recyclers. The bulk consumers like the banks, software companies, and corporates also sell their wastes to the highest bidders. So, there is a leakage of material that is happening to the refurbishing market or to the informal sector in a big way, added Rao.

Deployment of Technology in the Global E-Waste Sector

As the production of e-waste is increasing by millions of tons every year, it is very important to recycle them in a proper scientific manner. Recycling implies that the chemical element, molecules, and materials are separated after which the extracted materials are sold as raw materials for making new items. This is where advanced technology plays an important role because proper extraction from these wastes is not an easy task. Of late, the Singapore CEA Alliance for Research in Circular Economy (SCARCE) worked on the latest method that will augment the recycling rates with the help of chemical extraction processes in solution and mechanical procedure of automation of sorting and disassembly. A single device microfluidics, which is integrated and miniaturized, has been developed in order to decrease price and time while developing the new extraction process. With the assistance from microfluidics, it becomes trouble-free to puzzle out the intricacies of transfers of chemical elements at the interface between water and oil. In fact, the exchange surface between the oil and water is controlled properly due to the presence of porous membranes. With the help of microfluidics, the flow of materials can be calculated accurately. Now, in order to deal with the problem of e-waste by linking numerous stakeholders among the informal and formal sectors, the IIT Madras has launched a unique platform, dubbed e-Source. This has the ability to balance the logistic supply and chain and help recycle 53.6 million tonnes of e-waste every year. This exchange dias will act as an online market for WEEE and offer a seamless and formal supply chain between sellers and buyers. According to Counterpoint Research, the legislative frameworks for household e-wastes are not properly maintained in Malaysia and in various Asian countries and they don’t even follow the EPR laws and schemes. Experts in Malaysia think that to enhance the sustainability of smart city notions, the e-wastes appearing from households require effectual management. To tackle the challenge, a smart household e-waste collection box was exclusively designed and placed with e-waste level measurement sensors to record the disposal data. Now, a backend server has also placed that schedules and notifies e-waste collectors automatically to collect and dispatch the waste when the collection box is filled 80 percent. In fact, a mobile application was also launched. This is an impeccable instance of how each country can control and recycle its e-waste with the help of cutting-edge technology.

How AI and IoT Could be a Game-Changer in E-waste Management and Recycling

Artificial intelligence is another step that can tackle the problem of increasing e-waste garbage through smart waste management and recycling and is speculated to unleash an enhanced disposal method to recycle sustainably. For instance, ZenRobotics, a Finland-based firm back in 2011 started using AI for smart recycling by controlling e-wastes utilizing a robotic waste sorter. Amalgamating AI, machine learning, and computer vision, synchronized trials are carried out by the bots to collect recycled materials from the moving conveyor belts. Since then, implementing the latest technology for recycling of wastes has gained popularity. The tag in the garbage is read by AI to identify the category of garbage and then for analysis it is sent to the actual server. Then, the numerous categories of garbage are compared by the actual or the main server and ultimately it selects the suitable recycling or disposal method. Then, it executes the clean recycling or safe disposal of the garbage wastes. Smart or intelligent traschcan furnished with IoT sensors and AI programs is another unique way to manage e-wastes. The IoT sensors on the cans have the potential to measure the waste levels of the garbage thrown inside. With assistance from intermediate servers, it sends this data for processing to the actual disposing system. The entire system has the capability to identify the volume of each waste and the respective waste disposal method. article/how-does-environmental-emi-dust-moisture-rain-and-other-conditions-affect-the-performance-of-pcb

How does Environmental EMI, Temperature, Dust, Moisture, Rain, and other conditions affect the performance of your PCB?

If you have worked with electronics, you would probably agree that there is never an "ideal condition" for your circuit, the working ofa circuit can easily be influencedby the environment in which it is being operated. Even a circuit that is well designed and tested could behave very differently in an industrial environment. In this article, we will explore different factorsand find out solutions to reduce environmental effects in PCB or circuit boards. , the major factors of environmental effects are: Temperature Dart and dust Moisture, water, or rain EMI and EMF interference Exposure to various chemicals and gases

Effects of Temperature on PCBs

Temperature affects the life of the components. Each component comes with a proper temperature grade described in their datasheet in the operating condition section. Temperature affects the PCB mechanically. In harsh temperature conditions, expansion and contraction of the PCB takes place that damages the solder joint of the components. Other than the PCB, temperature degrades capacitor life and increases the chances of thermal trigger in the high-power components which are responsible for the failure of electronic circuits. In the below image, two capacitors with the same value and same rating having two different operating temperature ranges. This is an 85-degree rated 0.1uF 50VDC Electrolytic capacitor from Wurth Elektronik having the part number - 860010672001 This is a 105-degree rated 0.1uF 50VDC Electrolytic capacitor from Wurth Elektronik having the part numberᾠ860020672001. Mainly, a fully enclosed product not having proper vents for the airflow changes its thermal characteristics when the ambient temperature starts to rise. If we look carefully and compare those two characteristics in the above images, both capacitors havethe same specification except the ripple current. The 105-degree rated capacitor hasa lower ripple current at the given temperature. Usage of the 85-degree capacitor in the 105-degree environment will reduce the capacitor life and affect the circuitry operations.

Tips to Design PCB for High Temperature Applications

It is important to know the environment where the electronic product will be used before designing the circuit. Following things need to be kept in mind while designingthe circuit. There should be adequate heatsink if no airflow will happen inside the enclosure box. It should have proper air vents if the heatsink space cannot be afforded in the design. Choosingthe right components depending on the temperature grade. Carefully designing the PCB where the most heated components are spread all over the PCB board to reduce the heat dissipation on one particular point. Selecting proper temperature grade PCB to avoid degradations.

Impact of Dust on PCBs

This affects the high-frequency circuits, especially the RF antennas that are PCB-based. In very high-frequency circuits in Ghz rating, the dust particle could potentially degrade the RF performance in long-term operations. This is due to the changed conduct spacing that affectsthe impedance of the PCB. The below image illustrates this effect in the PCB. to know more about the importance of PCB impedance.

How to Avoid the Dust on your PCBs?

Well, it’s just not possible to have your board 100% dust free all time, but you should make check the following things to avoid any major PCBfault due to duct. Havingclean PCB after soldering. Assembly needs to be done in clean places where dust is not a huge factor. A dustproof enclosure with proper grade needs to be added for high-frequency equipment that is used in very dusty and rough conditions. Using IP65 rated enclosure with gasket sealing can be used.

Effects of Moisture, Water or Rain on PCB Boards

Another major and disruptive environmental factor is moisture or rain. It leads to rust, oxidation, corrosion, sometimes short circuits as well. Long-term exposure to PCB in an environment where there is moisturecould significantly degrade the epoxy glass, resin, or glass interfaces and could crack aboard. It also slowsdown circuit speeds and increased delay times with the functions of the corresponding device in high-frequency operations. Improper sealing could lead to water clog in thecircuits and short circuitmay take place due to rain or water. The below image showsmoisture effect in PCB. In the above image, moisture affected the whole PCB and created corrosion on the components.

How to Prevent PCB from Moisture, Water, and Rain?

Use an IP65 or IP67 rated enclosure if the application environment has too much moisture or has been accidently exposed to rain or water. Usage of proper bags or moisture-free elements when assembly and moving circuit boards. Reduce the chances of glass or epoxy-based PCB getting colder than the air to stop the production of moisture.

Effects of EMI and EMF Interference on PCBs

EMI or EMF is a very crucial issue when a high-frequency circuit or whenSwitching Power Supply works on a harsh field where magnetic field radiation is an important factor such as in a power plant, near large transformers or motors, etc. In such a case, the magnetic field could produce a significantly high number of noises and cross-talk in electronics circuits where frequency drifting may occur. Also, high-frequency circuits that are exposed to a large area of the open field could affect the RF transmission close to the ground and the transmission of the signal would not have long-distance capabilities. Adequate protection or shielding is required to be added to the main circuit board. One perfect and widely used solution is the faraday cage. Proper conductive shielding across the high-frequency components also significantly improves the EMI and EMF immunity. in high-frequency devices having RF components. The image describing With and Without the shielded cage. The shielding is connected with the Ground connection of the module.

How to Protect your PCBs from EMI and EMF Interference?

As discussed, Faraday caging can be a solution for larger electronic circuits Conductive shielding improves the immunity of noise interference. Having a good selection of components along with proper PCB design reduces EMI radiation and improves immunity. Usage of EMI shielding vias in the circuit.

Exposure to various Chemicals and Gases can Damage your PCBs

This is not the major cause but could significantly damage the circuit board as well as the electronic product when exposed to a larger chemical compound in the environment. Since each component consists of silicon or different types of specialized fluids (especially in capacitors), chemical exposure increases the chances of failure. Not only does thePCB gets affected by the chemicals, it also produces hazardous and toxic chemicals which gets returned to the environment without proper management of the E-Waste. Major chemical exposure is the chloride that provides corrosion on solder joints or in copper traces and significantly reduces the performance. Few gaseous materials such as Sulphide, sulfur dioxide, chlorine, and nitrogen dioxide are hazardous for the solder joints and copper traces. In the above image, contamination of chemical (Sulphur Dioxide) damaged the PCB board as well as the capacitor and resistor.

How to Protect your PCBs from Chemicals and Gases in Harsh Environments?

Having conformal coating on the PCB. Selecting components that could work on hazardous gas contaminated zones. Usage of sealant in the enclosure. Thus, environmental strain can significantly shorten electronic lifespans and affect or degrade the performance of the equipment. Having fair knowledge of the application environment and choosing the right component is the key to success and leads to reduction in additional time and money investments. interview/amitansu-satpathy-founder-of-best-power-equipment-talks-about-challenges-faced-in-electronics-manufacturing-service

Amitansu Satpathy, Founder of Best Power Equipments Talks about Challenges Faced in Electronics Manufacturing Service (EMS) and Ways to Tackle them

about the various challenges of this sectors, the solutions that must be taken care of, and how deployment of top-notch technology can be a game-changer in making India globally competitive in the electronics manufacturing. As per Kearney (a global management consulting firm), India represents only 2 percent of the world’s manufacturing output. The growth in electronic manufacturing is critical to India’s economic development. One of its strengths is its large talent pool consisting of engineers, young labour force, and significant domestic consumption of manufactured goods. One of the fundamental steps one should take is to improve productivity which can be achieved by adopting smart automation practices. Secondly, in spite-of huge working population, finding skilled manpower is difficult. Thus, Indian companies should train the engineers on technical skills, retraining, and upgrading the skills of new and existing employees. The manufacturing industry should support vocational training institutes for developing skilled labour pools as well as establish standards for curriculum and certification testing. This will ensure all entry-level workers to have the skills needed to perform their jobs. Thirdly, supply chain inefficiencies with most opting to carry excess inventory to compensate for the inefficiencies and demand volatility. Most of the companies should focus on supply chain agility. Agile companies carry less inventory, manage flow better, and have fewer stock-outs. Globally, companies are facing high entry barriers and competitive challenges. The companies are adopting advanced technologies to optimize its manufacturing power, investing in smart robotics, cloud data and automated factory technologies as groundwork for industrial upgrade. India stands out as a cost-effective alternative and labor represents one of the main costs of manufacturing. But, India is unmatched in the size of its labor force. One area where India suffers is in “know-howᾍ Electronics Manufacturing has been embracing technologies to a larger extent. The technologies include Internet of Things, predictive maintenance, ERP Systems, Big Data, Robotics, VR & AR, 3D Printing and innovative technology across the logistics field. These technologies are being deployed globally as well. These technologies have proven to help manufacturing companies achieve product precision, which improves quality and reduces costs and error. Thus, it is necessary for companies to focus on innovation and work closely with other technology sectors. Today, there is a need to build reliable product that can give you reasonable profit. This will reduce the services expenses and drastically increase the profit. We need to adopt & implement efficient energetic processes. This can be achieved by providing software and hardware customized solutions. We have been able to provide Product reliability, imparting knowledge & education to the dealers and associates, and target the solutions as per the needs of the customers. These strategies have made us grow. We are offering various products like Rack mount UPS, Modular UPS, Modular Data Center solutions, ESS (Energy Storage Solutions) and various special projects. Apart from this, are integrating our UPS with Lithium Battery solutions, also working on ESS (Energy Storage Solutions) with lithium batteries. We are using PWM, DSP & IGBT technology in all our products that helps in better battery management and reliability. We have a manufacturing unit in Noida and Greater Noida and increased its capacity last year. Recently,BPE also acquired a new manufacturing facility of 15,000 Sq.Ft area in Noida, with its automated production lines & high end processes equipped with advanced production facilities with the product range of 300 kVA three phase large UPS. We invest a minimum 3 percent annually on R&D and hire engineers every year who have rich experience in UPS and other industrial electronic products. Thetask of these Engineers is to bring out innovation in UPS. We also have a testing lab for product evaluation. Our aim is to be the leading manufacturer in the industry, which will be known for innovation and adapting to new age technologies like the inclusion of IoT & 5G. We plan to maximize the market segment reach by 2025. We are working towards aligning to 4.0 technology and bringing faster, flexible and more efficient processes to produce higher-quality goods at reduced costs. article/most-popular-eda-and-circuit-simulation-software

Comparison Between the Popular Electronics Simulation and EDA Software ᾠWhich one should you choose?

ElectronicDesign Automation software or EDA software are tools used for designing circuits such as Integrated Circuits and PCBs. But before even designing the PCBs, engineers utilize software to check whether their electronics designs will perform as expected or not, and to do so they utilize the electronics circuit simulation software. Circuit simulation softwareis a tool developed for modeling and analyzing electronics circuitry. The mathematical models of different parameters of electronics components are used to replicate the performance and behavior of the circuit under different conditions. It is a fast and cost-effective method of designing and validating circuits, especially ICs before fabricating and testing them in the real world. Electronics simulator packages usually comprise Schematic editor, PCB editor, Spice software which helps an engineer to perform complete design and analyze the performance of the circuit before physically building it, thus greatly improving efficiency while reducing the cost and time. There are different types of software available for simulating analog, digital and mixed mode simulator capable of simulating circuits with varying accuracy, capabilities and have different instruments to do so. In this article we will compare CircuitMaker, LTspice, Multisim, KiCAD, EasyEDA, and PSIM, we will go through the costs, capabilities, and features of these products so that you can decide the best software for your usage.

Proteus

features. The software came out around 3 decades ago and is considered one of the best by professional engineers. It has more than 15 million parts in the component library and offers features like differential pair routing, group length matching, remote front panel design for Arduino and Raspberry Pi microcontrollers, etc. This is one of the professional software with the availability of microcontrollers. The proteus is capable of performing all the simulation and design aspects of a project and with such a long time in the industry, it has refined almost all the features. But the one thing where it actually shines is the simulation part. The software is offered in 3 packages, Enterprise, Platinum, and Custom with price tags of $ 6592, $ 8003, and $ 248 respectively. The custom package by proteus gives a user an opportunity to completely customize their product and select only the essential features they need, the additional features can be added for an additional cost. More than 15 million components in the library Availability of microcontrollers such as PIC, Raspberry Pi, and Arduino, etc. Extremely prompt customer support The large variety of tools for analysis The user interface is easy to learn and use Cost, the packages are extremely expensive No free version of the software is available

Autodesk Eagle

and other open-source websites release Eagle files for boards designed in-house for the maker community. The layout is user-friendly and because of a large community, tutorials and resources are readily available. The Autodesk eagle is most suitable for small to mid-level complex projects. The large community makes it a great software for beginners as the availability of learning resources is high. The Autodesk Eagle is offered in 3 variants, the Standard and Premium packages cost $100 and $500 annually or $15 and $60 monthly. There is a free version of the software which has limited capabilities in terms of sheet size, layers, and PCB board area. Free version with limited capability is available. Easy to use. Lot of resources and tutorials available due to a large community. 3-D modeling capability It doesn’t have signal and power integrity solution. Creating custom component is difficult Navigating library is complex and lacks components

CircuitMaker

shows the layout of the schematic editor. Altium CircuitMaker is best suited for designing multilayer PCBs and a good component library makes it suitable for different electronics projects and its auto-routing feature makes it a good choice for even large projects. The CircuitMaker is a freeware with no cost whatsoever. It also doesn't have any non-commercial clause, i.e. you can use all the features of this software to make the commercial products without needing to pay any license fees making it a perfect solution for designers The software is freeware. No non-commercial clause. The user interface is easy to use. It has a good component library. Powerful autorouting feature Good component wizard Supports importing projects from OrCAD, EAGLE, P-CAD, etc There is no simulation tool available in the software. You can only have 5 private projects and data is saved over cloud Bugs and lags are more evident than many paid EDA tools. Only available for Windows operating system and not for Mac or any other OS.

NI MultiSim

National Instrument’s Electronics Design Automation tool NI Multisim is one of the most widely used tools for simulating electronics circuit. It has digital, analog and power electronics circuit design and simulation capabilities and it uses the original SPICE-based simulation software. Multisim has one of the highest tools and instruments available among its competitors and the simulations results are highly accurate and comparable to real-world testing. It also offers Digilent FPGA boards such as Basys and Nexys, these platforms can be programmed by exporting the digital logic diagrams created in Multisim in a rawVHDL format. It offers a PCB designing feature that is easy to use with a wide component availability in the library. It also features a very effective auto-routing feature. The user interface although have a mixed response due to its archaic looks and symbols which makes it difficult and time-consuming for new designers trying to enter the ecosystem. There is also a web-based platform called Multisim Live which lets you create and share circuits for free. Multisim is highly popular in Educational Institutes. A screenshot of Multisim live is shown in the image below. It is mostly used in Educational institutes for teaching and doing research, it's mostly used for analyzing analog, digital, and power electronics circuitry. : The NI multisim has 4 packages namely Education, Base, Full, and Power Pro priced at $628, $1869, $3267, and $4838 respectively. The base and the full package provide a partial component database with 47,000 and 49,000 components while the power pro package provides a full component database with over 55,000 components and an RF part selection limit of 17, 76 components for the cheaper options respectively while no such limit for the power pro package. Simulation results are very accurate Number of testing instruments available are high Over 55,000+ components available 35+ virtual instruments An online simulation software is available The user interface looks outdated and is difficult to navigate for some users Many microcontrollers and ICs missing in the library. Expensive Unavailability of complete components for the base package Only 4 out 35 virtual instruments available for the cheaper option.

LTspice

LTspiceis one of the most used simulation software in the industry. It derives its name from Linear Technologies, the previous name of Analog Technologies which developed this software. This software offers schematic capture and waveform viewer platform apart from the SPICE simulation it is known for. It also allows you to observe transient behavior on a cyclic basis and analyze the step-load response. Similar to CircuitMaker, it is a freeware with no restriction to features, the number of components, subcircuit, or limits in node but unlike the former which has no no-clause commercial usage clause, LTspice comes with some restrictions such as users are not allowed to compete with Analog devices products. The software uses an advanced algorithm which performs simulations faster than a lot of its paid counterparts with high accuracy. LTspice is a freeware, all the features in the software are available to the users without any hidden cost. The software is useful for analyzing electronics circuits, power electronics circuits audio circuits, etc. The fast simulation and accurate results make it a good option for commercial product development without any expense. The software is completely free with no limitations to its usage. Accurate results Fast simulation Doesn’t have PCB editor

PSIM

PSIM is a specialized simulation software developed for simulating power electronics and motor drive simulation but also has the capability to simulate most other electronics circuitry. PSIM is developed by Powersim and uses trapezoidal rule integration and Nodal analysis as its main simulation algorithm. When compared to other software-based on SPICE, PSIM provides a much faster speed andmodels which are rarely available in most other software such as Multi-level converters, and models for renewable energy systems. It also provides an automatic embedded code generator and has an option for thermal simulation which computes switching and conduction losses of switching devices. This software is most suitable for power electronics simulation, it is also capable of simulating motor controllers, motor drivers, inverters, etc. This is a great software for people in the Renewable energy industry or engineers working on storage systems, grids, or even powertrain of vehicles. The company offers 3 packages, Student, Annual Academic License, and Education pro package retailing at $99, $300, and $1500 respectively. The Education pro package is similar to an annual academic license with a lifetime license validity. The student license having the max circuit size capped at 60 elements while the other 2 having no such restriction. The student license also lacks thermal modeling and many core features such as code generation or links with other software. Fast and accurate simulation Thermal simulation capability Wide choice of models for power electronics Various models specifically for renewable energy systems and energy storage systems. Affordable software It is a paid software, for basic electronics circuitsmany freeware are more suitable. Less testing equipment compared to other competitor software like multisim.

EasyEDA

EasyEDA is a fully functioning web-based EDA tool and simulation software. This software doesn’t have a non-commercial license, making it a great tool for students and normal users. It is a great tool for basic to intermediate users which provides an easy to adapt user-interface and ability to generate BOM or convert your schematics to a PCB as it also has a PCB editor tool. You can then download the gerber files to get your PCB fabricated. It was essentially made for the maker community as a freeware thus provides all the essential features in its free web-based tool. In terms of pricing, this is one of the cheapest software available in the market apart from the freeware software. The EasyEDA has 3 plans, a free package which is a freeware, a professional pack that costs $4.9 a month, and the Enterprise pack which costs $9.9/ month. The only difference among the three packages is that you don’t get advertisements in the paid versions and with the Enterprise package you also get improved team management features. The online software is best suited for new and intermediate users, its easy and clean interface makes learning the software very easy but the lack of features and capabilities make it incompatible for the power users. Inexpensive Easy to navigate user-interface No non-commercial licensing Unlimited private project No need to install any software The main drawback of EasyEDA is its limited features Internet connection is required to work on it Limited components

KiCAD

KiCAD is another free EDA software that even lets users modify the software to their liking by modifying the source code. It has a very simple user interface and getting started with KiCAD is fairly simple. The schematic editor is called the Eeschema. When it comes to the component library, KiCAD has a lot of components available but navigating library is a bit confusing as it doesn’t have an atomic library, but one library for symbols and another for component making it a bit confusing for the beginner. The KiCAD has a very powerful 3D viewer which lets you visualize the PCB in a 3D mode, but you don’t get an auto-router feature installed in the software, instead, you need to download the layout editor to use this feature. The KiCAD is capable of running simulation using a free SPICE tool called ngspice, but it is complicated for a new user. The software is a freeware with no limitation to its usage. The KiCAD is good for making a PCB layout as it doesn’t have any limitation on the board size, number of layers, and number of pins. The availability of a SPICE tool makes it a very lucrative package. Free software with no limitation Easy to understand user interface Powerful 3D viewer No limitation to the size of the board or layers No auto-routing features and requires add-ons for that Complex component library menu There is a lot of simulation and EDA software available in the market. Every software has some pros and cons, some are extremely accurate and have a lot of features but require time to get used to them and are costly while there aresome freeware which are giving close competition to the paid software. Some softwarelike the PSIM are really good for power electronics simulation while NI’s Multisimhasa lot of virtual testing equipment for testing even the RF circuits, etc. Thus, a one-fit solution is not possible for all the cases, and depending on the project’s requirement and complexity a software has to be chosen. interview/chief-architect-of-invento-mitra-robots-arvind-nagaraj-envisions-robots-to-be-a-sight-in-malls-airports-and-hospitality-sector-in-next-five-years

Chief Architect of Invento Mitra Robots, Arvind Nagaraj envisions Robots to be a sight in Malls, Airports, and Hospitality Sector in Next Five Years

about how to overcome the challenges of the robotics sector, how to make these products more flexible and less prone to damage, and most importantly, the latest technologies deployed in manufacturing these products. ts that could carry items from one point to another along a pre-programmed route in a controlled environment. Only in the past decade, we have seen the rise of deep learning technologies that have allowed machines to handle some of the uncertainty and irregularities present in real-world environments that cannot be solved purely by traditional software programming. This gave rise to a plethora of new devices like smart speakers, convnet powered cameras, etc. , we have been able to equip our robot’s hardware with more sophisticated algorithms. Our robots make use of cutting-edge AI technologies to recognize/generate speech, detect objects, navigate in obstacle-filled environments by themselves. is the holy grail for AI research and we will have to augment robot’s capabilities with human intelligence until then. We expect humans to make complex decisions for machines when they get stuck. , one of the pioneers in robotics and AI technologies made a series of predictions three years ago where he called out when specific aspects of robotics will reach a certain level of maturity. He predicts that the conversational capabilities of robots and other AI systems will mature much sooner than generally available dexterous hands and complex indoor navigation systems. We agree with this take and have bet heavily on conversational robots - we expect this technology to rapidly improve and allow our robots to have more natural sounding and smarter conversations. Manufacturing hardware in India is a huge challenge. It is very expensive to import components, the infrastructure support and education are very low as compared to manufacturing powerhouses like Germany and China. These major factors make it very difficult to start a manufacturing project regardless of how well established the brand is (whether it’s Tesla or any small player - the complications remain the same). We are taking on these challenges one by one and have been successful in overcoming them to a great extent. We have managed to hire the right talent, source locally, and innovate by 3D printing our own components to bring down the costs to a great extent. is another challenge. People have high expectations (all thanks to the movies) and it's highly challenging to present realistic use cases. We have done more than 400 events and have managed to be able to present bots as a friendly robotic avatar through crowd engagement activities. Bringing down the customer expectation is one of the most crucial steps towards enabling mass adoption of robots in India. The popularity of robots is rising massively in India. People generally welcome the presence of a robotics avatar in day-to-day places like Malls and hospitals. We have managed to deploy our robots with 40+ corporate clients in India alone and receive 100+ inquiries every week from event managers, businesses, and curious individuals from all walks of life enquiring about robots. Our safe estimate is that robotic avatars will become a common sight in malls, airports, and the hospitality sector in the next five years. to collect body temperature and issue visitor passes. We were able to quickly deploy the robots across India and other countries because we were able to build on top of Mitra’s conversational visitor management platform. In the future, we see our robots work with humans as partners and help them be more productive and resourceful by taking up the repetitive and risky parts of their work. We see human and machine intelligence working together to accomplish tasks that either of them individually would find very hard. In order to get to that point, we have been primarily investing in a fleet management system for our robots that can allow humans to monitor, teleoperated, and guide them. Imagine walking into a hardware store of a major retailer. A friendly robot meets and greets you at the entrance. The robot can recognize your face if you had visited previously and use its knowledge of your past visit to completely personalize your experience. You convey your home improvement project idea by answering a few quick questions. If the project is simple, the robot would be able to directly offer you suggestions using its intelligence ᾠsuch as guiding you to the drilling machine in aisle 5, nails in aisle 8, and photo frames in aisle 10. If the project is more complicated, it connects you to a human expert (working offshore) who guides you appropriately and adds the items you desire to the robot’s list. The robot then walks you through the store and helps you with the pricing. data to the analytics backend system to slice and dice the data, allowing the executives to glean insights. We are talking about creating customer delight based on data, expert connect, and human-robot interaction ᾠthat works not just in a hardware store, but also in malls, pharmacies, hotels, hospitals, and more. We design and manufacture the hardware - we write the software in-house and we manage our robotic fleets. Having end-to-end ownership of the technology and processes allows us a level of control that would not be possible if we only did a subset. Our company also improved its own local supply chain for manufacturing as the pandemic brought sudden changes to our industry. In terms of social events, we have the experience of working with scores of brands across industries through which we were able to acquire valuable insights on human-robot interactions. Our treasure trove of information and insights guided our software development teams to create unique plug-n-play features and integrations that make us quite unique. We also see a huge benefit in operating our fleet management teams in Bengaluru - we can offer human-robot operator services at a fraction of the cost compared to western countries. We will continue to deploy robots in business environments for the foreseeable future. The amount of data collection and rate of data processing in the physical world(retail) is a tiny fraction of what is happening in the online e-commerce industry. We wish to fill that gap as much as possible through our robots. Our robots help supercharge your retail shopping experience. - these are unique challenges in an aging world where India as a country blessed with a large, young population can take charge and lead. As the technologies in AI, wireless connectivity, hardware, and computation improve, we see robots not just in business settings but also in people’s homes enriching lives. article/where-does-india-stands-in-pcba-production

Where Does India Stand in PCBA Production?

manufacturing is extremely imperative for anyone associated in the electronics industry. In general PCBs can be defined as a laminated sandwich structure that consists of both conductive and nonconductive materials that enables engineers to place component on a rigid structure and make the necessary connections between them. Now, with the heavy escalation of growth and demand of electronic items in India, the demand of sophisticated range of PCBs are also on the rise. Although, the country has progressed massively in manufacturing in the past few years, it still faces numerous impediments due to which most of the electronic components and PCBs are imported from outside.

Market Challenges and Indian Scenario

must be created. Due to Coronavirus infection, the global electronics and semiconductor industry has largely suffered the financial loss, but if the predicted third wave of the infection does not pose a threat and disruption again, then industry could regain the momentum and the average industry growth could be reality by the end of this year. told exclusively to CircuitDigest, "Currently, the industry is facing a challenge of balancing supply and demand environment. We see growing impact of a slow supply chain and expect challenges by missing components for the industry. The majority of the industry is now shifting towards ‘no impactᾠ& ‘minimal impactᾠin various components category and no disruption in the supply chain is the urgent need of the hour.ᾍ Simha also opined that they are expecting the demand to remain strong for PCBs. Currently, the PCBs that are made in India are designed for use majorly in high-end automotive, and industrial applications along with medical. The industry, however, tends to experience demand supply imbalances in the copper-based materials such as copper clad laminates, pre pregs and copper foils in addition to huge material escalation costs coupled with high supplier lead times. ). In order to boost and perk-up the country’s manufacturing cluster, it is imperative to attract numerous manufacturing operations of which manufacturing of PCBA is the key. India is speculated to largely perk-up its electronics manufacturing cluster in the coming five years. If the momentum in manufacturing escalates, it could initiate the manufacturing and design of numerous multi-layer PCBs, and also the commencement of making of semiconductor chips (ATMP) could turn out to be a possibility. In the beginning of PCBA operations, value addition could be around 3-6 percent and in the coming three years, it could augment to 15-20 percent. are massively investing and escalating this industry. The major problem is still hidden because most of the renowned companies have their manufacturing units in China and other South Asian countries. But, after the onset of COVID-19 and US-China trade war, the shifting of manufacturing hubs is slowly taking its course. The global companies have now realized that supply chains must be de-risked. It is now imperative for India to magnetize leading contract manufacturers to begin their operations in the country, but ultimately it would accelerate the export of PCBs. is a first step towards miniaturization. The high Frequency boards with 24 and 77 Ghz finds application in sensoricᾠradar, Lidar, camera and V to X communication. Semi Flex and Rigid Flex PCBs and more, with thickness ranging between minimum 0.6 mm to maximum 2.4 mm. Apart from these India even produce 4-layer laser PCB’s up to 3-n-3 multi-layer PCBs for usage in electronic application including automotive navigation, infotainment and advanced driver assistance systems. The manufacturing capability up to 18-layer boards findits deployment in industrial applications and 12-layer boards in the automotive sector.

India and Global Perspective

is still imported. Now, the market of PCBs in India is a bit different from other parts of the world. Internationally, flexible circuits market is speculated to grow much faster compared to that of rigid PCBs because the former can wipe out connectors and has the ability to smoothen the form factor reduction. According to industry association ELCINA, PCB makers in India are majorly focused on making multi-layered, single-sided, and double-sided PCBs equipped with a layer of four to six and most of these are made in low to medium volumes. There are about 200 PCBA makers in the country, out of which 60 percent are very minor and jumbled.

Why SMTis Required for Producing more PCBs

The assembly of PCB is an essential manufacturing technology that needs high volume of precision and specialization. Several automated machines and Surface Mount Technology (SMT) are actually needed to craft PCBs on a large scale. There are several advantages of SMT technology in producing PCBs such as improved electrical performance, miniaturization, cutting-edge assembly, and automation. Hence, to produce more PCBs, manufacturers and the industry should also look for creating a top-notch SMT cluster. The Surface Mount Device (SMD) components are basically either square or rectangular in shape and are placed flat on the PCB. With the assistance from SMT machines, SMD components can be mounted from 1.0 x 0.5 mm to chips of 90x90 mm and it has the potential to place a total of 86,000 components in just within an hour and a PCBA for smartphone can be crafted in just five seconds. Now, the unique Thru-hole technology works extensively well on components with wires and leads that needs to be placed on the PCB board by plugging them via the holes on the PCB. This technology is mostly applicable on those PCB assemblies that are furnished with bigger components like coils, capacitors, and resistors. According to the experts, this technology is becoming a waning concept as the component’s density on the PCB is becoming larger and miniaturization is the standard.

Important Factors to Consider during PCB Assembly

Regardless of its complete intricacy, if an electronic product contains a PCB with errors, problems will crop. Hence, to manufacture a cutting-edge PCB, a strong supply chain is required. At the same it is extremely imperative to create an accurate balance between specification, ongoing availability, and unit cost. Engineering teams on the other hand, grab sample components from the manufacturer directly during the prototype and design process, but after sometime, the average lead-time for the parts and orders associated with production volumes can increase. If sourcing of correct components is not done then not only the assembly of PCBs becomes difficult, it also creates a heavy impact on the manufacturing series/cycle of the product on which it would be mounted. Such delays even ruin the reputation of OEMs, which ultimately results in the financial losses. Sometimes, the PCB’s design might look very catchy, but while manufacturing the item it could be a completely different story. For an instance, the tracks on the board might not have ample tolerances and during the manufacturing process it could end up in short circuit. In order to have a state-of-the-art solder joint on each of the components, the circuit board needs proficient engineering assistance that will also save it from heat damage. Now, there are few aspects to consider while manufacturing a double-sided PCB. It helps mount more components in a limited space and reduce costs. Manufacturers must ensure that all the big components are mounted on one side of the board and must pass via the oven or else there could be a danger that the components might fall off from the board. interview/why-is-india-still-failing-to-become-globally-competitive-in-electronics-manufacturing

Why is India still Failing to become Globally Competitive in Electronics Manufacturing

about the various challenges of Indian electronics manufacturing service (EMS) cluster, the current technologies implemented, and why the growth of manufacturing is also related to acquiring state-of-the-art technology and latest equipment. The association was formed in 1967 by seven component manufacturers in Mumbai when the electronics industry was struggling to deal with several complicated policy issues, which required to be rectified. From the beginning, our main vision was to expand the electronics manufacturing cluster in the country and our focus was always on strong growth of electronics components and on value added manufacturing. Now, we shifted our focus to help build strong technology and equipment to boost the sector. In the last fifteen years, our focus has been shifted more on EMS sector, raw materials, and equipment manufacturing. Our basic intention is to promote the industry which during the late 60s was a fledgling industry. There is now a growth in the demand for components and electronics equipment. t is extremely competitive. They are now growing because a very high share in the manufacturing and production is now catered through the EMS companies, which work on low margins around 5-7 percent. One big challenge is that they have to import all their inputs and all their components. To prevent that we have to strengthen our own component sector and we need to ensure that the supply of component for EMS companies should be regular. Right now, there is a huge issue with the semiconductor devices, which is not available. We have to take tough decisions, invest, and take risks. The country still lacks global-sized EMS companies. for technology development. In fact, the revised National Policy on Electronics (NPE) 2019 focused more on developing latest technology for which investments are already happening. The Ministry of Electronics and Information Technology (MeitY) is closely working with various organizations to develop e-waste management technology, recycle and reduce. But we have to produce more semiconductors in the country. is now far ahead because it started manufacturing very early. With extreme aggression China expanded its industry, which helped it become the world’s largest exporter of electronics. It has developed its own ecosystem and has got very large specialized industrial parks. In facts, its semiconductor industry is also becoming globally competitive like Japan, Korea, and USA. Although electronics manufacturing in India started long back, the nation failed to develop its high-added value ecosystem. It is not that India does not understand technology, our scientists and technologists are very sharp and they are doing a great job. The problem is India did not develop a healthy ecosystem and in the entire 90s we failed to keep pace with global industry in terms of technology. These machines are not made in India and they are all driven by computers, and extremely precise because they can mount thousands of small components on PCB. We need to manufacture all these machines in India if we have to strengthen our own industry. Even there are specialized equipment required for PCB manufacturing. You need specialized equipment for specializing the film which is used in a capacitor for making ceramics resistor. It is a bit of a chicken and egg situation because once the industry grows, the demand for this equipment will grow. The global manufacturers now are not keen to come to India and develop them and we have to convince them that India is a potential market. We need to invest more in these areas. interview/jeetender-sharma-md-of-okinawa-scooters-discuss-the-challenges-faced-by-ev-industry-in-india

Jeetender Sharma, MD of Okinawa Scooters Discuss the Challenges Faced by EV Industry in India and Recent Technological Advancements

about why it is taking so long for EVs to popularize in India and other parts of the world, current initiatives to solve the challenges, and most importantly, current technologies integrated in these vehicles. batteries. Ultimately the vehicles started having solid state batteries. A couple of years back, the vehicles are not connected. Currently, with the help of technology you can control your vehicle through your app or maybe through mobile phone. For an instance, at Okinawa, we already have a product in which you can connect the complete vehicle and you can control the vehicle with your smartphone. Youngsters now understand that technology is changing with the time and if the good technology innovation is there, they will go for it and they will adopt it. There are now three major challenges out there in the industry and the most important one is about the awareness. People are actually not aware about the benefits and usage of electric vehicles as such. The second one is supply chain perspective. We should always think of making a sturdy product where we have a good supply chain network in India and then we can have a quality control on the product side and on the component side as well. Automobile companies should think of growth and popularity of these vehicles because people always compare EVs with the Internal Combustion (IC) engine backed vehicles. So, we should get the right product at the right cost with a good quality. The third problem is to make people understand how this product because they are not familiar with its technology. But I think slowly these things will move away as lots of awareness campaigns are coming up, the government backed programs like inter-state campaigns would help further. in EVs since the past two and half years. I personally think it is an excellent move for this sector and other automobile firms because it will make the products more cutting-edge and popular among people. Consumers always go for a product which they understand and like and in this case, if their vehicle is artificial Intelligence enabled or IOT enabled they can get all information on their palms with the help of their smart phone. Our strong business model relies on our network, which is mostly our dealership network. It has got three important models like sales, service, and spare parts. We always like to give the complete ecosystem to the consumer because when they buy the product they don’t need to worry about after sales service. In EV, the technology is new, which is a challenge for the consumers also. When the COVID-19 appeared, many usual things were changed in business. From offline sales service, we introduced our online sales where consumers can purchase their products and also book for customer care or after sales service. In my opinion, more charging stations are required where it will serve two purposes. First, they will bring the awareness about the electric vehicles and second thing it is good for four-wheeler and the three wheelers too. If you see the geography of India the size is so big if you want to setup numerous charging station, I think it will take years. So, the second thing is if you give ease to the consumer, you don't require the charging station because this is a myth in the back of the customer’s mind. At Okinawa, we gave ease to our customers that they can charge their scooter anywhere and at any place with a normal three pin plug, like you're charging a mobile phone. We have introduced detachable battery which you can easily take out and can charge at anywhere you wish. Okinawa’s product is about the look, feel and size of our electric scooters. It is as sturdy and fast like IC engine and families can travel with much comfort and safety. We have various other kind of products as well, which are in six categories. We have other scooters especially made for females and there is also b2b scooter available for delivery purposes. So, we always try to offer a complete solution for a family and they can select it as per their key requirement. We are now currently focusing on expansion of our business and product category. In the coming years, we have decided to unleash a range of new scooters and motorcycles in high-speed category. Then, we are now coming up with a new facility where we will increase our capacity in the phase manner in vehicles. To boost the ecosystem, we are putting more awareness on our website and we are also planning to develop the supply chain ecosystem with other partners as well. This is an impeccable way to craft the ecosystem more robust. article/a-detailed-comparision-of-popular-li-ion-battery-chemistries-used-in-evs

A Detailed Comparison of Popular Li-ion Battery Chemistries used in Electric Vehicles

Cells have been used for storing energy from time immemorial, from a Baghdad battery, which dates back to 250BC to newer technology such as a hydrogen fuel cell, that just gives water as a byproduct, batteries have come a long way. A group of cells when connected together is called a battery. Batteries are touted as the future of energy storage for Electric Vehicles. Even the first cars, made in the year 1842 were powered by batteries, which is almost 2 decades before the invention of Internal combustion engine vehicles but the lack of range and slow charge rate caused the decline of Electric Vehicles in the 20th century. The growing environmental concern due to climate change has forced us to move towards renewable energy and adopt battery energy storage systems and the research and development of battery technologieskick-started. , their advantages and disadvantages and compare them with few other rechargeable batteries.

Primary Cell and Secondary Cell

, the ones we use in our TV remotes, wall clocks, etc. These are considerably cheaper while having high energy density, which means that they are smaller, weigh less and are more cost-effective. This makes them ideal choice for applications that require lower amount of energy as it helps cut down the cost as well as the weight of the final product. Secondary cells are energy storage devices that can be reused multiple times. They can perform reversible cell reactions that allow them to recharge, by just reversing the direction of the current. Albeit being more expensive than the primary cells, they can be used multiple times, thus making them a better choice for energy storage applications that require a constant replenishment of energy, such as mobile phones, smart-watches, Electric vehicles, or large Battery Energy Storage systems for homes ordiscoms, etc. There are a lot of different types of secondary cells available in the market, there are multiple variants of Lithium-ion cells, Nickel cells, Lead-acid batteries, hydrogen fuel cell, etc., all these batteries have their pros and cons. In this article, we will focus only on different chemistries of Li-ion Batteries.

Li-ion Cell

Lithium-ion cells are rechargeable cells, they use lithium as one of the key components in the construction of the cell. The development of Li-ion cells started in the early 70s, and their advancement and potential to catapult the energy storage systems making the adoption ofEV’sa reality caused its inventors to win a Nobel Prize in Chemistry in 2019. These are rechargeable cells commonly used in portable electronics to something as large asDiscomsfor storing energy produced from renewable energy. There is a tremendous amount of research going on in the Li-ion batteries which cause the capacity of battery to increase drastically in the coming future. In the past 3 decades, the cost of battery has decreased by 97% and since the last decade, it has fallen by 88%.

Components of Li-ion Cell

The image below shows the different components of a Li-ion cell. The material used in the cathode determines the capacity and voltage of Li-ion battery. This material is called the active material. The active material plays a crucial role in the chemical reaction in the battery which causes the flow of current. The capacity of a cell depends on the size of the active material at the cathode, i.e. for higher capacity of the cell, we need to have bigger cathodes. Meanwhile, the voltage of the cathode depends on the element used as a cathode. The nomenclature of the battery usually depends on the cathode, like a Lithium-ion battery has a cathode made up of Lithium. But because lithium is highly reactive and unstable making it difficult to contain and use directly, therefore a combination of lithium and oxygen is used as a cathode. Similar to the cathode, an anode is the other electrode, which is also coated with an active material. It is the negative electrode and its property decides the rate of charge and discharge of the battery. We try to maximize the surface area of the anode which affects the rate of flow of electric current through the external circuit, resulting in a higher rate of absorption or emission of lithium ions released from the cathode. Anode stores the lithium ions during the charge cycle of the battery. The image below shows the discharging and charging states of the battery showing the flow of electrons and ions during the process. The most commonly used anodes in Li-ion cells are graphite and the oxide spinel Li4Ti5O12.Grapheneis being investigated and is considered a better alternative that can increase the power density as well as the charge and discharge rate of the cell. is an electrically neutral solution, both the electrodes are submerged in the electrolyte solution. Although the solution is neutral but when an electric potential is applied, the ions start flowing towards the electrode. During the charge cycle, the lithium ions move from cathode to anode, while in the discharge cycle the reverse happens. Electrolyte plays a major role in the movement of ions thus making the flow of current possible. The movement of anions and cations in opposite directions in the electrolyte causes the flow of current. For a Li-ion cell, the electrolyte needs to be a lithium salt, hence the most commonly used electrolyte in a Li-Ion battery is LiPF6 dissolved in an organic solvent. The separator plays an important role in the functioning of the battery. The electrolyte acts as a medium between the electrodes while the separator is placed between the electrodes to isolate them from each other so that no electron flows through them while allowing the ions to flow between them. The separator forms a catalyst when covered with the electrolyte thus facilitating the movement of ions between anode and cathode while stopping the electrons. When excessive heat is applied, the pores of separator get clogged by the melting process, this property can be employed as a safety feature, making the separator act as a fuse, stopping the flow of current in case of overheating thus safeguarding the battery fromfire. Most batteries for mobile phones and tablets which need to be kept lightweight and do not have a very rugged use have a single polyethylene separator while larger industrial batteries deploytri-layered separator that acts like a fuse, protecting fires during extreme temperatures and on multi-cell configurations.

Types of Li-ion Battery

Li-ion batteries can be classified based on the combination of anode and cathodes used. There are six categories of lithium-ion battery readily available in the market, these are Lithium Cobalt Oxide (LCO), Lithium Manganese Oxide (LMO), Lithium Nickel Manganese Cobalt Oxide (NMO), Lithium Iron Phosphate (LFP), Lithium Nickel Cobalt Aluminum Oxide (NCA), and Lithium Titanate (LTO). Apart from theLTObattery, all other Li-ion battery has graphite as an anode. All the above Li-ion chemistries have different properties and we need to know their properties, their operating conditions and other parameters in order to select the best battery for our application. The properties of all the chemistriesare given below. Lithium cobalt oxide battery have cobalt as the main active material in its cathode. It was invented in 1991 and has been extensively used because of its high energy density of 150-200 Wh/kg. Although this battery chemistry is energy dense, but other options are being investigated as the experts are claiming that the world could face a cobalt supply shortage soon. This is due to the surge in sales of electric vehicles where this battery chemistry is extensively used, leading to increase in cost over time. Cobalt is a highly volatile metal, which limits the current handling capabilities ofLCObattery due the risk of overheating. Furthermore,LCObatteries have lower thermal stability, that makes them sensitive to higher operating temperatures and overcharging. LCObatteries are extensively used in portable electronics such as phones, cameras, laptops and have a high demand in electric vehicles. Lithium manganese oxide batteries are also known as lithium-ion manganese batteries. It has LiMn2O4 as a cathode. Theearliestcommercially developed battery with this chemistry was produced in 1996. These batteries have low internal resistance and high temperature stability which makes them safer than other lithium-ion battery types.LMObatteries are capable of delivering current up to 20-30 Amps due to their low internal resistance, thus making fast charging and discharging possible. The main disadvantage of this chemistry is its relatively low cycle life of 300-700 cycles. These batteries also have lower capacity. Because of these drawbacks limited research and advancement of this battery type are expected in the future. LMObatteries are extensively used in applications where high C-rates are required such as power tools. It also has applications inEVsand in medical applications. Lithium iron phosphate batteries use phosphate as active material in the cathode. These batteries are one of the most used chemistries in electric motorcycles,e-rikshawas well as other applications that need a long lifecycle and significant safety. These batteries have a moderately high energy density of 90-160 Wh/kg. Similar toLMO,LFPchemistry have low internal resistance resulting in higher thermal stability. Unlike theLCObattery, these batteries are durable and have a long lifecycle with low self-discharge rates.LFPbatteries have one of the best life cycles making them a very cost-effective option considering their long operations life. However, the nominal voltage of 3.2V of theli-phosphatebattery means that it has less energy than other types of lithium batteries. LFPbatteries are used in industrial equipment and heavy machinery due to their high thermal stability and great life cycles. They are widely used inEVs, especially in e-bikes,e-rikshaw, and many cars because of their ability to withstand a lot of mechanical and thermal abuse. Lithium Nickel Manganese Cobalt Oxide (NMC) Batteries uses a combination of nickel, manganese and cobalt as the active material for its cathode. The most commonly used ratio is 60 percent nickel mixed with 20 percent each of manganese and cobalt to form the alloy. Changing the ratio of these metals can alter the property and we can either attain a high specific energy density or a high specific power. These batteries are cheaper than other Li-ion batteries and have a very low self-heating rate and a nominal voltage of 3.7V.NMCbatteries have energy density of 150-220 Wh/kg, which is higher than most other chemistries. This battery is commonly used to power medical equipment, power tools and is considered as one of the preferred battery chemistries forEVs. LithiumNickle Cobalt batteries, also known asNCAbatteries have a combination of nickel, cobalt and aluminum as active material in its cathode. These batteries have a high life cycle and are one of the most energy-dense Li-ion chemistry with energy density as high as 260Wh/kg and a nominal voltage of 3.6V. But the main disadvantage of this battery is its lower thermal stability and high cost making them an unviable option for consumer electronics. They are a good option forEVsdue to their energy density, theNCAbatteries must be used in cars with extra safety measures to monitor their performance and other data to keep the drivers secure. TheNCAbatteriesare becoming increasingly important in electricpowertrainssuch as in Tesla and find applicationin grid storage due to their lifespan and energy density. Lithium titanate, also known asli-titanateare one of the newly developed Li-ion chemistries. They have advanced nanotechnology and replacethe graphite used in the anode with lithium titanate as the active material. The large surface area of Li-titanate allows a larger quantity of electrons to enter and exit the anode faster, making a very high rate of charging and discharging possible without compromising on safety. The main drawback of this battery is that it suffers from is the low nominal voltage and low energy density of 2.4V and 50-80Wh/kg respectively. What makes this battery special is its ability to provide discharge rate exceeding 30 C for a short period of time. The use of advance nanotechnology makes it one of the safest chemistries available in today’s time. Currently, a lot of big manufacturers of electric vehicles and bikes such as Mitsubishi, Honda, etc., useli-titanatebatteries, and there is potential for this type of battery to be used in electric buses for public transportation. LTObatteries have potential scope in aerospace, military and are used in battery energy storage systems for storing wind energy and solar energy and for creating smart grids. Their ability to sustainhigh discharge rates make them a preferred option for frequency control devices for grid applications.

BatteryComparison

The battery can be compared on many different parameters such as nominal voltage, the weight of the battery, specific energy, etc. The chart given below compares data of different chemistry of Li-ion cell. For reference, we have also addedNiMh, Ni-cd battery in the table below.
NiCd-20601.220800Heavy
NiMH-20701.230500Middle
Low Self Discharge NiMH-20701.212000Middle
Li-ion (LCO)-40703.6101000Light
Li-ion (LFP)-40803.2512000Light
LiPo (LCO)-40803.7101000Lightest
Li-Ti (LTO)-40552.4520000Light
LMO-853.7-700Heavy
For better representation of the above the data, the graphs have been drawn. The first graph represents the operating temperatures of different battery chemistry while the second graph shows the self-discharge rate of different battery chemistry. From the above graph, it is clear that all the Li-ion chemistries have a broader operating range than the Nickel based batteries. From the above graph showing the self-discharge rate, it is clear that most of the Li-ion cells have a very low self-discharge rate. The property of Lithium-ion cell depends completely on the cell chemistry. All the chemistries have their own pros and cons which needto be considered while selecting a battery for a specific usage. The table listed below compares different Li-Ion chemistries.

Lithium Nickel Manganese Cobalt Oxide (LiNiMnCoO2) ᾠNMC
2.40V3.70V3.30V3.70V3.70V
Typical operating range1.8Vᾲ.85V3.0Vᾴ.2V2.5Vᾳ.65V3.0 Vᾴ.2V3.0 Vᾴ.2V
50Ᾰ0Wh/kg150ᾲ20Wh/kg90ᾱ20Wh/kg200-260Wh/kg150ᾲ00Wh/kg.
1C typical; 5C maximum, charges to 2.85V0.7ᾱC, charges to 4.20V1C typical, charges to 3.65V0.7C, charges to 4.20V, fast charging possible with some cells0.7ᾱC, charges to 4.20V
10C possible, 30C 5s pulse1C, 2C possible on some cells1C, 25C on some cells1C1C
3,000ᾷ,0001000ᾲ0005000-7000; up to 12000 possible in some cells500500ᾱ000
200°C +210°C (410°F)270°C (518°F)150°C (302°F)150°C (302°F)
~$1,005~$420 per~$580~$350-
Electric vehicles, UPS, etcE-bikes, E-Rikshaw, industrial equipment, etcE-bikes, E-Rikshaw, Battery Energy storage system for discoms, offices and homesMedical devices, industrial equipment, electric vehiclesSmart watches, mobile phones, tablets, laptops, cameras
The graph shown below compares the nominal voltages of different Li-ion Chemistry. From the above graph, we can say that the nominal voltage ofNMC,LCOandLMOis higher than other chemistries while that ofLTOis lowest. If we compare the data for energy density from the table, we find that the chemistry follows the same trend withLTOhaving the lowest energy density. In terms of cycle life,LFPandLTOhave the best cycle life while theNCAandLTOhave a very low cycle life making them unfit forEVs. LFP,NMCandLTOhave the best thermal runaway making them most suitable for operations in extreme temperature. When considering the costs,LTOperforms well in most parameters, but the cost is not justifiable for consumer products and everyday portable equipment, whereas,NMCandLFPprovides best of both worlds, they are competitively priced, while providing a decent performance and althoughNCAis cheaper than the other options but its poor thermal performance makes it dangerous forEVsand other operations where high temperature and mechanical stress is common, thus extra cost has to be considered for employing additional safety features to make it safe to use. To sum up, it can be said thatLi-ion batteries are the future of energy storage, the specification of cell depends on the internal composition, i.e. the material used for the electrodes, separator and the electrolyte. By changing the cathode, properties such as specific energy, charging rates, cycle life, nominal voltage, etc. can be controlled but every chemistry hastheir own pros and cons which needs to be considered while selecting theli-ioncell for a product. In terms of cycle life,LFPandLTOhave the best cycle life while theNCAandLTOhave a very low cycle life making them unfit forEVs.LFP,NMCandLTOhave the best thermal runaway making them most suitable for operations in extreme temperature. When considering the costs,LTOperforms well in most parameters, but the cost is not justifiable for consumer products and everyday portable equipment, whereas,NMCandLFPprovides best of both worlds, they are competitively priced, while providing a decent performance and althoughNCAis cheaper than the other options but its poor thermal performance makes it dangerous forEVsand other operations where high temperature and mechanical stress is common, thus extra cost has to be considered for employing additional safety features to make it safe to use. A lot of research is going on in the field of battery and according to industry experts, the energy density of battery will increase with the cost expected to decline in the coming future.

interview/vidushi-gupta-co-founder-of-psiborg-on-how-their-iot-solutions-are-bridging-the-gap-between-hardware-and-software-systems

Vidushi Gupta, Co-founder of Psiborg on How Their IoT Solutions are Bridging the Gap between Hardware and Software Systems

deployment is huge, and its applications are limitless. solutions help in bridging the gap between hardware and software systems by providing a one-stop solution for all the development needs. Gupta, and asked her a few questions. companies. We took this as an opportunity and started making solutions to provide a one-stop solution to our clients. I would say innovation, experimentation, and opportunity are the key ingredients that helped us take this company off the ground. , weall knowis not a product but a technology, rather a combination ofexisting technologies, which includes designing hardware, programming hardware, connecting it to the API, and back-end development of the application, and designing of application as well, which requires UI and UX. , we are a team of young, energetic electronic design engineers, and software developers smartly collaborating to create next-to-perfect products in all aspects. From hardware designing to firmware development to integration to cloud-based platforms, or building a mobile application, we cover all, even with customized form factor design. To be precise, we transform client’s ideas into a product in a single place. product life cycle goes like this - After gathering requirements, the next step is to brainstorm with the client on functionality, considering power and size estimates. components are assembled and everything is according to the final project but the shape and placement are not as perfect as the final product. , user buttons are finalized. Refinements are done according to the feedback of both the teams and a mature product takes into account the refinements that have to be made and production control monitoring is done and that is given to the client for validation testing. security devices will be evolving the most with different use cases and there is no end. and the product and it helps us to do rapid prototyping. We have designed notes and gateways for various low power wide area network protocols such as Sub1 Gigahertz. These can be customized according to the cloud services and analytical tools as per the application requirement. protocol. It is a lightweight protocol and has many other advantages over HTTP. However, the choices are again dependent on the type of application we are building an implementation of that. , 4G, etc. because all these devices are sending data to the gateway through some particular frequency and these gateways send the data and return to the cloud and from cloud the data returns on our applications for visualization. So, choosing a particular protocol depends on various factors, and they and they differ in other factors as well like frequency, latency, data packets, etc. . with higher processing power consume more energy. So, first, we do a thorough analysis and choose the components having ultra-low power consumption in which you spend most of the time in the lowest power mode or sleep mode, it's like they perform their specific task and quickly enter into the lowest power mode. We are very careful in managing the sleep cycles of all the controllers and modules chosen for the design and making architecture in a way in which the system can be used to the maximum capacity with the least power consumption. Writing optimized code is also very important so that no extra thread runs in the background. A combination of ultra-low-power components and optimization of code helps in getting the job done. , usually companies opt to move towards designing their own boards. Most entry-level projects are built on these developing boards as they are easy to code. Also, these hobby boards are much cheaper as compared to various development boards available in the market. For example, if we talk about the Snapdragon processor kit and Raspberry Pi, the price range is quite different. So, building using commercially available boards is very time-consuming, because they are complicated and have a lot of new features which people are not even aware of. Also, you would have to write the code from scratch. You don’t get the readymade code on the web. I don't understand why people are so often using these developing boards in their design, what is the point of using development that can be programmed by anyone by reading just a couple of articles on the website. We don't support using these developing boards other than using them to check the feasibility in lesser time, but not in the product. for embedded development, we notice that 90 out of every 100 resumes have the only experience in these boards. This is a very big problem in the industry because we require a particular skill set in the industry like we opt for writing custom libraries for most of the peripherals. There is a very huge gap, which is among the hobbyists and the industrialists and this gap needs to be bridged somehow. so that the placement can be done according to them. If the PCB is in some specific size/shape, then obviously 3D printed enclosures are the best. Besides, in the Indian market, there are many enclosures available online and your PCB can be made according to those enclosures saving time as well as cost. So, we prefer both according to the projects. Indian market is very different; it is very cost-sensitive and quite influenced by Chinese manufacturers. Sometimes, people want the product to be in the same price bracket as of the Chinese competitors. So, that is one of the main problems with the Indian market. Also, they have short to-go-to-market days; people want their products to be deployed at the earliest. Moreover, people want to work on a per-piece basis. They want us to develop a product, do R&D, and deploy the software. They are ready to pay more than BOM costs saying you can keep your margin, but we will be getting devices on a per-piece basis. I don't know why they totally neglect the developmental costs and resources. I'm not sure about other geographical regions if we only talk about India, but yes, in Delhi NCR that is one of the major problems. devices. devices in a different areas. So, currently, the market is good in India and it will be better in the coming years. We have just 20% from India and 80% from other countries. Initially, it was very tough to get Indian projects, actually in the initial days, the number of projects is less so, development costs cannot be arranged to buy other projects. The people in India are not ready to pay quality-assured development costs. That was one of the major problems earlier. We never got an opportunity to work with Indian clients because of the cost issues mainly. But yes, we’ve got various other projects, which were very good and we learned a lot from those projects. We work on client-specific projects; we have built almost every possibility in smart agriculture, from satellite imagery to detection of nutrients, macro and micronutrients like nitrogen, phosphorus, etc. from the soil, and accordingly, AI/ML can be done and the database can be created, so that the farmer can get a database of what crops to be grown with this nutrient level. Also, we have worked on workplace automation; we have done workplace automation in our office as well. We have made many security devices, which are now at a level where AI and ML have to be integrated. Those are one of the projects which are which have very good potential. And some use cases are different and as we are under NDA, I cannot disclose those projects, because they have different use cases. We have not seen any such implementation till now. We are having really promising projects now and which have a very good potential market. in India, at least in another year. This is our mission right now. article/how-electric-vehicles-are-leveraging-artificial-intelligence-to-improve-battery-performance-and-charging-efficiency

How Electric Vehicles are Leveraging Artificial Intelligence to Improve Battery Performance and Charging Efficiency

between 2020 and 2026. AI is extensively used in manufacturing, assembly lines, and many EV players are testing self-driving EVs to gather data, analyze and repair Electric Vehicles. With AI and machine learning, Electric Vehicle manufacturers have the ability to process massive amounts of sensor data faster than ever before, giving companies an unprecedented chance to improve upon existing maintenance operations and even add something new ᾠpredictive maintenance. “The EV industry willadvance considerably due to the induction of Artificial Intelligence as it will make the life of riders easy and convenient. Auto manufacturers are rapidly upgrading their existing production systems by incorporating AI platforms. These companies are increasingly focusing on developing autonomous vehicles to improve passenger mobility.ᾍ It can be useful in many applications such as repairing the EV, figuring out the problem area, finding the nearest workshop & recharge centers, and can also be helpful in the safety of the electric vehicle as it can switch off the e-bike or e-cars from the mobiles,ᾠadded Nischal. - Nishchal Chaudharyᾠto know more about the several disruptions in the Indian Electric Vehicle sector.

How AI is Accelerating the Power of EV Batteries

has made aspirations like recharging an electric vehicle in the time it takes to stop at a gas station a reality, and it might help enhance other elements of battery technology as well. The scope of the global battery market is rapidly increasing. EV models like Tesla S 100D offers 355 miles, Hyundai Kona offers 198 miles, or MG ZS EV could offer 214 miles on average and none can be fully charged in a matter of minutes. For instance, at Tesla supercharging station, EVs will take 75 minutes to reach full charge,andIndian players in the EV industry would require more than 3 hrs for a full charge. mentioned that “AI is contributing significantly in the overall battery management in electronics. It has been there for some time now in smartphones where AI helps to increase the charge of a battery, reduce time to charge and also improves the life of the battery. For instance, AI keeps a check on the temperature of the battery and responds with safety measures in case of overheating, etc.Similarly, it’s helping optimize the energy efficiency in EVs as well.ᾍ

Future of Artificial Intelligence in EV Industry

With various applications such as Autonomous driving, user behaviour monitoring, and Smart navigation systems, AI is playing a key role in the EV Industry. It can be used for safety applications like predictive maintenance of equipment, driver behaviour monitoring, and vehicle security. Different companies are using Artificial Intelligence in their vehicles, some use this technology to change current transportation systems with self-driving services, while some use it for strengthening the battery power of their EVs. and said that “In EV verse, there will always be an attempt by the industry to achieve efficiency on several things. These include maximising the charge, increasing the charging time, increasing the life of the battery, optimizing the use of battery in all electronics including lights, increasing the maximum speed, increasing acceleration, safety and security, among others. AI can add that requisite intelligence to EVsto makeefficient use of resources.Not only in EVs but in entire automobile sector, AI has a greater role to play. It would not be wrong to say that after Smartphones, cars might be the biggest users of AI in years to come.ᾍ review/quick-review-on-the-spv1050-energy-harvester-and-battery-charger-ic-for-standalone-battery-powered-applications

Quick Review on the SPV1050 Ultra low power Energy Harvester and Battery charger IC for Standalone Battery Powered Applications

that is capable of utilizing the energy harvested by solar panel or Thermo Electric Generator TEG to charge a battery. In this article, I will be explaining its features, functionality and power output along with some potential application. Also, I will be testing this board with different inputs in various lighting conditions to charge different energy storage devices to show it in action. Later in the article, we will be analyzing the derived data to see if this board can be used with any existing setup or not.

What is Energy Harvesting?

Energy harvesting is a method of harnessing power from external sources such as wind, solar, motion, or even from Wi-Fi signals,to be used for small and portable applications such as wireless sensors, automation, or projects such as wearable electronics, IoT or smart home applications that require wireless sensor network. It can be used for powering a device or be used for storing energy in a battery or capacitor for future use. A simple diagram showing how energy harvesting is done is shown below.

SPV1050 Energy Harvesting and Battery Charging IC

What makes this board shine out is its ability to utilize miniscule amount of current and voltage produced by solar panels. The image of the board is shown below. This board is capable of charging a cell even when the input has few microamps of current. The ability to charge a battery over a wide range of input voltage and current makes it a very useful device. The schematic of the board is shown below. In the above schematics, the U1 denotes the SPV1050, here J1, J2, J3 Jumpers are used for enabling or disabling the MPPT. The CN2, 8-way screw connector is used for connecting the battery for getting the battery status signals. The 2, 5 pin male switches are used for controlling the LDO while the 4-way screw connector adjacent to it denotes the connector for LDOs load connection. and has optimized system configuration to make SPV1050 work at higher efficiencies.

How to use this board with higher powered solar panels or TEG?

according to the required input and output. This canbe done by changing few passive components in the board. By making the necessary changes, the operating range can be extended from 150mV to 18V,upto 100mA, down to 2.2V andupto 5.3V. First startup at Vin = 2.6 V Input voltage working range: 150 mV > Vin > 18 V End of charge battery voltage: VEOC = 4.25 V Battery undervoltage protection: VUVP = 3.7 V

SPV1050: The energy harvesting IC

can boost the energy harvested by 60%. The SPV1050 is available in a 5 x 5 mm, 20-lead QFN package and in die form. The image below shows the internal block diagram of the SPV1050 IC. The MPPT functionality present in the SPV 1050 is programmable by a resistor input divider and allows maximizing the source power under any temperature and irradiance condition. The MPPT algorithm can be disabled by shorting the MPP-SET pin to the STORE pin, and by providing an external voltage to the MPP-REF pin.

Battery Charger

The IC has a battery charger circuit that improves the lifetime and safety of the battery, it controls an integrated pass transistor between the STORE and BATT pins and implements both the undervoltage (UVP) and the end-of-charge (EOC) protection thresholds. Transformerless thermoelectric generators and PV modules energy harvester High efficiency for any harvesting source Up to 70 mA maximum battery charging current Fully integrated buck-boost DC-DC converter Programmable MPPT by external resistors 2.6 V to 5.3 V trimmable battery charge voltage level (± 1% accuracy) 2.2 V to 3.6 V trimmable battery discharge voltage level (± 1% accuracy) Two fully independent LDOs (1.8 V and 3.3 V output) Enable/disable LDO control pins Battery disconnect function for battery protection Battery connected and ongoing charge logic open drain indication pins

Solar Panels used as Inputs

For showing the working of the energy harvester, I have used a solar panel from powerfilm, SP3-37 and another solar panel is a combination of 2 panels purchased from an ecommenrce website. 2 different inputs have been used to show the working of the module in both buck and boost configuration and to show how it works in different lighting conditions.

SP3-37

It belongs to the classic application series that are extremely flexible and meant for indoor usage for wireless electronics, wearables and remote applications. This specific solar panel doesn’t have an UV-stabilized surface, hence you should avoid long term outdoor usage. The image given below shows a SP3-37 alongside a Victorinox Champ multi utility knife. From the image, it can be clearly seen how thin and small this solar panel is. From the name itself, we can say that the solar panel gives an output of 3 Volts and the number 37 tells that it has a width of 37mm. It is a 1.1g solar panel that can be used in most low-powered application. The specifications of the solar panel is given below: Max Output Power (Pmax) = 70mW Max Output Current(Imax) = 22mA Max Output Voltage (Vmax) = 3V Short Circuit Current (Isc) = 28mA Open Circuit Voltage (Voc) = 4.6V The VI curve of this thin film solar panel is given below:

Connecting Wire to a SP3-37

To solder your SP3-37 flexible solar panel, heat your soldering iron tip and run over the silver part. Scrape off the upper plastic film with your hot soldering iron tip and you will observe that the plastic burns off creating a niche in your solar panel. Melt and deposit some soldering wire at the niche you just created by scraping off any remaining plastic. Finally, tin a wire and connect it to the solar panel into the location.

Dual Solar Panel Setup

The other solar panelused for testing is a combination of 2 panels with rating of 5.5V and 250mA. I ordered these solar panels from an e-commerce website. The description stated that it is a 1.2Watt monocrystalline solar panel. I’ve connected both the 1.2W panels in parallel to make a larger panel. Theoretically, the combined panel can give an output of over 2.6watts. On testing the solar panel setup in the sun, the following data was achieved: Open circuit voltage Voc = 5.5V Short Circuit Current Isc = 280mA ) together, it gives a rough estimate of the power, We also take the fill factor of Solar panel into consideration while calculating the PMAX. We cannot measure the fill factor without a load but it istypically around 0.7. PMAX is given by: PMAX=Voc×Isc×FF So the maximum power of this solar panel by our experiment is PMAX=5.5×280mA×0.7 = 1.078 Watt

Testing the Energy Harvester

) together, it gives a rough estimate of the power, We also take the fill factor of Solar panel into consideration while calculating the PMAX. We cannot measure the fill factor without a load but it istypically around 0.7. PMAX. It is denoted by: PMAX=VOC×ISC×FF

Testing the SP3-37

The SP3-37 being flexible has inherited advantages as it makes it more appealing for wearable applications where appearance and aesthetics are paramount but on the downside, the efficiency is lower than the regular solar panel of similar dimensions. The Open circuit voltage was 1.7V and the short circuit current was 30uA (51microwatts or 5.1*10^-6 W). In this condition, I have used a 1Farad, 5.5V supercapacitor with this setup. After 2 hours, the supercapacitor got charged by 0.137V that is 0.009385 Joules or 9.385mW. That is basically 1.6uW of energy every second. When this setup was kept outside in the patio but not directly facing the sun, the same setup was able to charge the supercapacitor to 2.78V from 0 in 3 hours, (around 3.9Joules of energy). It charged 1.85V in 2 hours (475.36uW or 39.5uW per second). I tried charging the battery with the SP3-37 for several hours, but due to the low output from the solar panel, the battery could not get any substantial amount of charge, then Idecided to stop testing this setup as it made no sense to continue testing with this setup. Charging the supercapacitor with the solar panel inside a moderately lit area and it charged the supercapacitor to 2.8V that is 19.6 J that is around 2.18 milliwatt per second. The higher energy is justifiable as the output power of this setup is much higher than the SP3-37. As shown in the figure, the output from the module was between 4.1-4.2V. I charged the battery with the solar panel in a moderately lit area and it charged the battery from 3.52V to 3.538 V in 90 minutes that corresponds to 21.6Joules (4milli watt per second) testing the setup again, it got charged by 60.48 Joules in 3 hours(from 3.538V to 3.552V in 3 hours) i.e.5.6 milliwatt per seconds. Keeping the dual solar panel setup in the patio, during the day time, but not directly facing the sun, it got charged by 970 Joules in 2 hours, i.e.about 135.5 milliwatt energy per second Considering the battery to be 4.4Watt hour, this setup will be able to charge the battery from 0 to 100% in approximately 33 hours. It might not seem like a very efficient method but considering that it is a small portable setup, which is supposed to be clubbed with low powered standalone system, it makes sense. Below is the table of the analyzed data:
Super CapacitorBattery
PlacementInsideOutsideInsideOutside
Sp3-371.3uW/sec237uW/Sec--
Dual Solar panel2.1mW/sec-5.6mW/sec135.5mW/Sec

Where and how it can be used?

board is capable of utilizing as low as 20uA current during its deep sleep mode. The node MCU can remain in the deep sleep mode for 72 minutes. But the power consumption can only be calculated based on the types of sensors used and frequency of data transmission required, thereafter, a suitable solar panel and battery system combination needs to be selected. An image of Node MCU is shown below. utilizes 20uA in deep sleep modeand during transmission, requires an energy of 120-170mA. If we connect it with a LM35 temperature sensor which requires a 60uA of current, even our thin film SP3-37 setup with the supercapacitor, placed in a lowly lit area would be able to run the setup. This system can easily be used to power this setup sending data every few hours. The skeleton deep sleep sketch would look like: The ESP8266 connects to Wi-Fi The ESP8266 performs a task , here read the LM-35 data and publishes an MQTT message. Goes in the Deep Sleep Mode for a predefined period of time. After predefined time, the ESP8266 wakes up and the whole process is repeated over and over again.

Application

The ability to charge even with small amount of energy makes this board capable of being used in a plethora of applications. It can be used in all the standalone systems, requiring low power. The most appropriate application for this board is for wearable electronics, IoT devices, wireless sensing, smart home, weather monitoring station, etc.

Conclusion

Doesn’t matter whether you keep your harvesting module in a well-lit room or inside your calm and serene room, no matter how miniscule the amount of energy generated by your solar panel or TEG is, this module is capable of makingthe energy usable by storing it in the battery or in the super capacitor to be used later. It employs various techniques to condition the charge to keep your battery’s health great and its ability to charge different battery chemistry us just a cherry on the cake. So, this energy harvester module coupled with a solar panel will be able to generate enough energy for your low powered application. Although you might have to decide the sizing of the storage system and your harnessing solar panel, but rest assured it will be able to charge your system. interview/akash-sinha-founder-and-ceo-of-omnipresent-robot-tech-talks-about-wide-scale-use-of-drones-technology-in-india

Aakash Sinha, Founder and CEO of Omnipresent Robot Tech Talks about Wide Scale Use of Drones Technology in India

The increasing demand for drones for inspection, surveying, monitoring, and surveillance applications in the fieldof agriculture, infrastructure, telecommunications, mining, etc. is propelling the growth of the drone analytics market. Omnipresent Robot Tech is a company working towards developing robots and industrial UAV/drones using very popular solutions like machine learning, virtual reality, computer vision, etc. to provide video analytics, industrial inspections, and defense. The company has also got the approval for e-commerce drone delivery. In an exclusive interview with Circuit Digest, the founder and CEO of Omnipresent Robot Tech, Mr. Aakash Sinha, shared details about the company, the services they're providing, and much more. Few years back, I was working at iRobot Corp, which is one of the biggest robotics companies in the world. While I was there, I proposed them as to why we don't expand the iRobots business in India and I did a little stint with them to expand their business in India. At that time, I realized that in India, there are a lot of new technologies like robots, drones, AI but there aren't enough people providing it. Around that time, I felt maybe it's a good time to take a chance of starting my own business over here.We started working with DRDO Labs, and ISRO. We were part of Chandrayaan I and subsequently Chandrayaan II. We incorporated a company over herein Indiaand started developing robotic solutions. Companies like Wipro make software for banks, hospitals, government. Similarly, we have been building a variety of robots for a variety of industries and segments. Our strength mostly lies in the software that powers the robots which is the AI. It's this AI part that we build for robots, and it can be used for a variety of robots. On the surface, it might look like we are doing a lot of different things but in actuality; we are essentially building the brain of a robot that could be used on Chandrayaan or drones, etc. You can think of robots as a device or a machine that is gathering a lot of data. For example, in video analytics, the video can be taken from a camera, robot, or drone. Once the video comes, you have to make sense out of it. That's where the AI will be used. We've been deployed in a lot of factories, oil refineries, power plants, and at these places, we've built something a Nerve Center. The nerve center takes in data from various platforms, whether it's a camera, drone, or robot. Then it processes those to generate the AI behavior whichcould be something like detecting whether somebody is wearing a mask or are people following social distancing, or in the factory, are people wearing safety gear. Similarly, there can be a variety of behaviors like detecting crowd behavior, fire, or anything that you think will require some kind of a noteworthy event that can be trained in the nerve center. It can then generate a notification that can go to the security head on his mobile phone. The processing can be done, whether the data is coming from a drone, a CCTV camera, robot, or even a mobile phone. Sometimes the video taken from the mobile phone can also be uploaded to our nerve center. Basically, the nerve center brings about data from all these sources, and then depending on the user's requirement, we add a certain type of behavior for them. We can divide it into two parts. Sometimes clients want only the drone AI, sometimes they want the camera, and sometimes they want both. If they want to deploy drone-based AI, then we usually send a team of pilots and a drone. Right now, there are not enough drone manufacturers in India. So, we've been building our drones. Although, we think that we will see a lot of growth in software as opposed to hardware. We have focused quite a bit on the software part but we deploy a drone pilot at the site. We give a drone nerve center dashboard interface to the client. The client can request on the dashboard as to when they want to have a drone flight, in what region, and what are the kinds of things they want to see and then our pilot gets that message and they schedule a flight. Once the drone collects the data, that data is then processed, usually on the cloud but sometimes, the client might have certain reservations, and they may not want the data to go outside the system. In that case, we can deploy a local server as well. So, the data gets processed on the local server and a report is generated and that report can again be viewed online by the client. As we start getting more and more data, we also keep on training our engine. On day one, we have a pre-trained engine over there. But after a period of one or two months, once you've got enough data, we can also add more customized behaviors, which is something the clients might like. For example, in an oil refinery, it's very difficult to tell if there is a problem on a vertical structure like an oil flare. To inspect that, they may have to send somebody climbing up there, and they may even have to turn off the flare which causes a lot of losses to the client because they need to keep on running continuously. We do these kinds of inspections, and minute things like cracks, corrosion, structural damage, etc. can be detected by the AI and put on the report. One of the good places where the robots have a lot of good justifiable demands is dull, dirty, and dangerous tasks. For example, if you want to inspect a cell phone tower or a power line tower, or coal mines. This is where the machine should ideally go. That's when a machine is fully justified. In Chandrayaan II, there was Pragyaan Rover but unfortunately, that rover didn't quite come out. But that rover will again be sent on Chandrayaan III. Once that rover lands on the Moon, it will take almost 10 minutes to upload one image on Moon or download one image from Moon, it's not going to be a 100 Gbps home connection. You have to do everything autonomously there. The simulator software that we built for the Chandrayaan rover is the same software that the rover was supposed to use. Once the rover lands on the Moon, we see a simulated image of the rover. We can see a rover going on the Moon surface and we can also plan the path. We could click on any point and tell if the rover can cross a particular path or big rock. Also, we can know the distance, angle, height, etc. As the rover moves, we get the feedback and we can drive the rover sitting here. The rover sends us just two images and we make a single 3D image out of it. This is the software that the Chandrayaan rover is going to use, and once it lands on Moon, then our software is going to help it navigate and guide across the Moon. We don't have a LIDAR on Chandrayaan. It is very similar to how humans see 3D. The rover has two cameras like two eyes from which it sends the images. Initially, we wait for 10 minutes before the rover starts, then we download the two images sent by the rover. Once, we have converted the images in 3D, we get a clear picture. We can control the rover from Earth and know what it is doing on the Moon. One of the reasons why we are doing both hardware and software is because there is no standardization in this industry. As far as robots and drones are concerned, it's not like I can just buy one Intel-based computer and just load windows and then run my apps or whatever. As there's that lack of standardization, we probably end up doing more than what we need to do. One of the problems is to make sure that our hardware and software are compatible, and also generic enough. That presents a challenge. There is also a challenge in terms of hiring, we want to hire but we can't get the right kind of people. Maybe, jobs are slowing down in the software industry but in terms of robotics and AI, I think jobs are growing exponentially. We often end up training all our people, so that after a few months they start delivering. We have done a drone delivery trial for one of our e-commerce partners, Shop X. We've also been working with a few other major e-commerce players. We did the drone delivery trial for a box of shoes being delivered from one warehouse to another warehouse in Bangalore. These two warehouses were about a few kilometers away. The government has selected a few companies and has granted permission for carrying drone delivery trials. As part of these trials, we will be attempting deliveries as large as 100 kilometers carrying a 15 kg payload. There are a lot of repercussions because the government has allowed drones up to 500kgs to be flown and they can be used in green zones. The green zones will practically cover more than 80% of the country and even in other zones, with special permissions; you will be able to fly. So with that kind of payload capacity, the drones will give much better costing and performance when compared to let's say, a small truck or a small vehicle carrying that kind of payload. These new regulations will cause a lot of disruption in the drone industry and a lot of new companies will grow and I think it's a very good time to get into this segment. The biggest hurdles are regulations, which the government has just come out with. The new regulations seem very promising. It is still in draft, it will be ratified in about 30 - 45 days. Once that happens, we'll see a lot of investor interest in this segment; investors will love to get into this field, companies like Flipkart, Swiggy, Amazon, etc. will all love to get in here. Once these big names also start getting in them, you will automatically see this sort of snowballing effect, and we will see it becoming a reality very soon. Having said that, it will probably still not be like, a drone knocking on your window because there will still be a few security concerns, and the drones might have a designated landing from where a local boy/guard could deliver. Already there are big companies like Tata, Adani, and Reliance that have got into drones. Big names are getting in here because they can sense the market and drone delivery is a huge market. After all, there's enough market to set up. A couple of more big delivery companies like DHL, a company FedEx can be set up just for drone deliveries. Defense is going to be also extremely big market because most of our future comebacks and things will start happening via robots and drones. The next big market is consumer drones. Currently, most consumer drones are coming from China and now with the government putting harder restrictions on Chinese drones, there's a big gap created here as to who is going to build all these drones for consumers in India. Drone-based agriculture will be another big sector because half of our landmass is agri-land and drones have been shown to boost agri yield by up to 20 - 25%. Imagine the kind of impact it can have on our GDP. We have around six lakh villages, and the drone can be operated locally. That means it can also generate employment, technicians, and pilots, and then they could serve the village using it for agriculture and also using it for other things like safety, security, and so forth. Just agriculture itself is going to be a huge segment. The next big segment will be asset management for industries and construction. It's also useful for insurance companies. To assess how the structure was made, what is the progress, and then you know, maintenance of things like cell phone tower, electrical tower, pipelines, railway tracks, railroads. The National Highway Authority has just issued a circular saying that all our highway projects have to be now mandatorily be inspected and monitored via drones. There are a lot of segments that are going to get big; you will see 2-3 unicorns in drone space in India in the coming three to four years. I think it's a really good time to get in here. article/everything-you-need-to-know-about-the-flysky-fs-i6-transmitter-and-receiver-for-drone-control

Everything you need to know about the FLYSKY FS-i6 Transmitter and Receiver for Effortless Drone Control

If you have worked with RC planes, Drones or any other hobby grade DIYaerial vehicles, then you would probably know that controlling these vehiclesfrom land needs skill and practice. The operator (person who controlsthe drone) should have rightly calibrated his drone with his trainmaster before the flight and should also know how to control the vital signals to his drone during flight to have a successful flight. One of the most popular and commonly used transmitter to control these drones and most other aerial vehicles these days is the FS-i6 Transmitter manufactured bya company called FLYSKY. comes with a lot of bells and whistles allowing you to fully customize your flight setting and use it from basic drones, airplanes, helicoptersto complicated multi copters and racing drones. But, if you are a beginner you might probably be overwhelmed with all the buttons, toggle switches, joysticks and customization options on this transmitter module. That is why exactly we have written this article. This article will explain the basic functionalities and specification of the FLYSKY FS-i6 transmitter and help you understand when, where and how you can use them to have a seamless flight with your drone. We have a lot of things to discuss but lets start with a basic introduction to the FLYSKY FS-i6 transmitter.

Specifications of FS-i6 transmitter & FS-iA6B Receiver

Transmitter FS-i6has the following specifications.
Channels6
RF range2.4055 ᾼU+393C> 2.475 GHz
Bandwidth500KHz
Band140
RF PowerLess than 20dBm
2.4G systemAFHDS 2A and AFHDS
Sensitivity1024
Low voltage warningLess than 4.2V
DSC PortPS2
OutputPPM
Charger PointNo
ANT length26mm*2 (dual antenna)
Weight392gm
Power6V 1.5AA*4
Display modeTransflective STN positive type 128*64 dot matrix
Size174*89*190 mm
On-line updateYes
CertificateCE0678, FCC
Receiver FS-iA6Bhas the following specifications.
Channels6
RF range2.4055 ᾠ2.475 Hz
Band140
RF PowerLess than 20dBm
2.4G systemAFHDS 2A
ANT length26mm*2(dual antenna)
weight16.4g
Power4.0-6.5V
Size42.6*26.1*15.1mm
RX Sensitivity-105dBm
CertificateCE0678, FCC
i-Bus portYes
Data acquisition portYes

Overview of FS-i6 Transmitter

The range of transmitters depends on magnetic interference. If the magnetic interference is more at someplace, then the transmitter will have less range and if the magnetic interference is less, then the transmitter will operate at a higher range. Now, we can say the average range of this transmitter is 1500 meters. The LCD screen is a user interface of this transmitter. We set up the transmitter by using the button by seeing at the LCD display. We can see the battery indicator, mode indicator, etc. on the LCD display. The battery indicator is used to indicate the power and status of the transmitter and receiver. A receiver's battery status will not be displayed if it is not bound to the transmitter. (Yaw); these are the default channel settings for mode 2. We have further explained the mode. In the image given below, we can see that there are 2 gimbals in the image. One is on the right side and the other is on the left side. We use trims for stabilizing the drone. We adjust these trims when the drone destabilizes during flight. These four trims are given for four channels. By holding the trim in the desired direction, we may perform faster trim adjustments. The transmitter starts beeping in a higher tone when the trim position reaches the middle. These two knobs are given at the top of the transmitter. These are auxiliary channels that can be used to attach switches to extra channels to control parts of the model like landing gear and headlight. In the image given below, we can see that it has two knobs. The knob on the left is VRA and the knob on the right is VRB. ). A, B, D are two mode switchesand C is a three mode switch.We can put the function of channel 5 and 6 in any one of the two-mode switches. We use switch C when we use GPS in drones. We use bind-key when we bind the transmitter to the receiver. In the image given below, we can see the black-colored bind-key. This button is at the bottom of the left side of the transmitter. In the video guven below, we have explained all the input buttons, keys, knobs, switchespresent on this transmitter. This receiver has 2 antennas and 6 channels. For the best qualitysignal,the receiver should be mounted away from the motors or metal parts. The connectors are used to connect the parts of the model and the receiver. CH1 to CH6: These channels are used to connect the ESCs (Electronic speed controller), Vcc, or other parts. B/VCC: It is used to connect the binding cable for the binding receiverand transmitter. We connect motors with the receiver through ESCs (electronic speed controllers). The connection of the receiver is shown in the figure given below. In this video, we have given a brief introduction of the receiver. The sticks are used for controlling the aircraft, each stick has 2 functions. The right stick controls pitch and roll, the left stick controls throttle and yaw. For mode 2, channels are controlled by left and right sticks according to the below diagram. It is also called elevator operation. For mode 2, we can control the pitch in Channel 2 at the right side stick. It is also called aileron operation. For mode 2, we can control roll in Channel 1 at the right side stick. It is also called rudder operation. For mode 2, we can control yaw in Channel 4 at the left side stick. For mode 2, we can control throttle in channel 3 at the left side stick. This function is used for reversing the channel function. For example, by turning the channel 1 stick right side, the drone rolls on the right side but we want the drone to roll left side when we turn the right side stick. Here we are trying to do exactly the reverse. We can do this easily by using the reverse function. The end-points function alters a channel's range of motion. This can be used to avoid model damage when a servo travels too far, potentially damaging pushrods and other components. The low-end point is in the left box, while the high-end point is in the right box, as seen below, with low being red and high being blue. Using this function, we can check the operation of the stick in the display in real-time. Auxiliary channels can be used to attach switches to extra channels to control parts of the model like landing gear and headlight. For example, we can control the function of channel 5 using switchesVRA, VRB, SWA, SWB, SWC, and SWD. It is used to change the center point of the channel. For example, if a drone’s Rudder is slightly out of alignment, this function couldbe used to fix this. This function can be applicable on only channels 1, 2, 4. It is used to change the difference between the highest and the lowest possible value. If we applied a throw of 20cm to the rudderandwe move thestick to , we would get 10cm rudder movement. If wemove the stick of the way, the rudder will move 5cm, so at 100%, there is a direct, linear relationship of stick movement and surface movement. We can set different dual rates for different channels. For example, for channel -1, we can set 100%, and for channel -2 we can set50%. This function is used to control the movement of the motor from the throttle orwe can say by using this function; we adjust the ratio of the movement of the stick and motor by using non-linear and linear curves. For example, if we want a lower throttle change in 0-40% and a larger throttle change in 40% to 100%. We can adjust throttle change using this function. For example, in the figure given below, we can see throttle is lower in 0-30% and in 40-100% throttle is higher. In the video below, we have briefly explained all the functions mentioned above. Here we can select a model which we want to connect with our transmitter. We can connect a maximum of 20 models with this transmitter, for example; we can store up to 20 receivers. Here we can rename the currently selected model. This function changes the type of the currently selected model, including airplanes and helicopters with different types of swash plates. For drones, we will select airplane and glider options. This function is used to copy one model to another model slot. For example, if we want the same setting of model 2 in model 3, then using this function, we can easily copy the settings of model 2 in model 3. This function resets the current model to the default setting. There are four stick modes available. For example, when we use stick mode 2, then we operate all channels according to this figure. When we use stick mode 1, then we operate all channels according to this figure. This function is used for firmware updates. We connect the transmitter with the PC by using a USB TO PS/2 cable. Setup: , and then download the latest firmware update available on this website. 2- Connect the transmitter to the PC by using USB to PS/2 cable and press “OKᾠin this function. 3- Wait for a minute, PC takes time to recognize the transmitter system. 4- Now, open the update on the PC and select “Start Upgradeᾮ 5- When the update has been completed, then cycle the system power. This function resets all the settings made in the transmitter. In this menu, we change the communication protocol for the transmitter. For example, for AFHDS Protocol, we use R9B, GR3F, GR3E, R6C, and R6B receivers. For AFHDS 2A, we use iA6B, iA10, iA10B, iA6, iA4B, X6, A6, A3 receivers. Here in this tutorial, weare using an iA6B receiver, so we will select AFGHD 2A protocol. We use it for transferring all channels through one physical output. If PPM output is ON then it will transfer all channels through one physical output. If PPM output is off, then it will transfer via channels 1-6. By using this function, we can change the battery monitoring setting. There are 4 options in this function. 1- Internal sensor ᾠThis system has a voltage sensor inside this. If we want to use an external voltage sensor, then we can change it from an internal sensor to an external sensor as well. 2- Low- Here, we set the low voltage value for the battery. When the battery voltage reaches this low voltage value, then the monitor displays battery level is low. 3- Alarm ᾠHere, we set voltage value for alarming, when the battery voltage reaches less than the set voltage level, then the transmitter starts beeping. 4- High- Here, we set the highest voltage value of the battery. 4- Failsafe-This system is used to protect our drone when the receiver loses the signal and the drone becomes uncontrolled. Here, we set all 6 channels values in terms of percentages. If the receiver loses the signal, then it uses these preset 6 channel values. For example, if the drone has a signal loss, then it comes back to the ground, then for this, we have to set the throttle to the minimum value of -100%. 5- Sensors List-This function is used to displayinformation from the sensor. For example, currently, we have only a voltage sensor inside this so it displays only the current-voltage of the battery. This function is used for which sensor value will be displayed on the LCD display. We use this function when we have to display the value of only one sensor in the LCD screen out of many sensor values. 7 -Speed-distance -This function is used to detect speed and distance traveledby drone. We use this function when we connect speed and distance sensors. 8 - Servo frequency -The frequency that the receiver sends to the servos is determined by this function. In the video below, we have explained the system setting of this transmitter. Interference can result in control loss; keep the FS-i6 system away from high-voltage power lines and communication broadcasting antennas. When operating a model, never hold the transmitter antenna. It lowers the RF signal's quality and intensity, and it may result in a loss of control. Before turning off the transmitter, make sure the receiver battery is disconnected. After we switch on the transmitter, the 2.4GHz system may cause interference with nearby planes or automobiles. article/could-indias-first-5g-cellular-chipset-koala-be-a-game-changer

Could India’s first 5G cellular chipset 'Koala' be a game-changer?

have unveiled sophisticated 5G chipsets that would take the future of technology to the next level. in India, you can check that out if you are interested.

Unique Technologies Furnished in Koala

, “NB-IoT is a 5G massive Machine-Type-Communication (MTC) technology that enables low-bit rate IoT applications and extends device battery life up to 10 years. We developed the Koala chipset by combining wireless technologies on one chip (NB-IoT and GNSS) with embedded switching power management functions to enhance the overall power efficiency of the system. Further, the SoC has been developed with a shared modem hardware to optimize its cost.ᾍ , and a plethora of sensor connectivity, asset tracking, and digital healthcare devices.

How this Chipset is Going to be the Game-changer

applications, it is imperative to closely monitor the battery drain during sleep mode to not just augment the overall performance but to ensure the longevity of the battery. With the advancement of semiconductor technology, the chip density, and operating frequency have grown proportionately, making power consumption in battery-powered portable devices a major hurdle.

5G Chipset Prototype

“To address this, we had to make specific design optimizations at several levels, such as power gating of analog, power gating of digital, and use of specific low-leakage digital libraries where possible, to name a few. Incorporating a dynamic power management scheme into the system is a tough task that requiresa number of design iteration cycles as well as rigorous debugging and verification,ᾠadded Smith. To enable a connected ecosystem and provide solutions for new, India-specific use cases, the designing developer haveused software-programmable Digital Signal Processors (DSP) for the modem. This gives the chipset much needed flexibility to adapt and optimize the performance of the chip to be used in instances that are particular to the Indian market.

Roadmap for the Project “Koalaᾼ/strong>

in India in partnership with global technology leaders with an aim to contribute to the transformation of the telecom industry globally. Project Koala is still at a very nascent stage as we continue to further develop our solutions,ᾠconcluded Smith. article/electronics-component-manufacturing-in-india-where-we-are-and-what-can-we-expect

Electronics Component Manufacturing Ecosystem in India: Where we are and What can we expect?

The electronics manufacturing service industry is one of the fastest growing industries in the world. India, which is now rapidly developing its electronics manufacturing cluster, has a 3 percent share of the worldwide production of electronics. The country is now slowly turning into a global manufacturing hub for electronics and electrical components. According to experts, the government and associations should look for more electronic components manufacturing companies in the nation because there will be more chances for international OEM tycoons to set up their units in India. Electronic components are considered to be the building blocks for this sector. A proper and impeccable structure of manufacturing electronic components requires a supportive ecosystem and a high capital investment. This is where electronic associations and the government of India are working hard to smoothen the system. (like integrated circuits, diodes, etc.) and the associated components (like optical disc, magnets, RF Tuners, etc.) have also witnessed its growth. from global giants to set up a fab in India. The country’s electronics manufacturing is growing every year with the assistance of various policies and schemes such as the revised National Policy on Electronics (2019) and Production Linked Incentive(PLI) scheme, but India still outsources a huge portion of components from China. Due to this situation, the country is failing to have a proper electronics manufacturing cluster. Counting the total demand of electronics in India, 70-80% of components and 50-60% of products are still being imported. The volume of imports escalated 31% between April and October 2017 to $29.8 billion, claims an exclusive report of Mint. In order to encourage domestic production, heavy import duty was augmented on various electronic products such as microwave, LED bulbs, and various IT hardware products from 10% to either 15% or 20%. This initiative will boost domestic manufacturing of electronic components manufacturing in India on a large scale, feels many association leaders. China leads globally in ESDM sector output and with its highly competitive pricing, often supported by government subsidies, India has no choice but to buy from there. While other countries too are dependent on imports from China, India’s situation is particularly acute due to its own inability to grow our value added components manufacturing sector. Let’s find out what some of the experts told exclusively to CircuitDigest about the possible reasons behind outsourcing raw materials from China and other countries: Although India's electronics manufacturing ecosystem is developing rapidly every year, there are various loopholes that are depriving the country of having a proper manufacturing ecosystem. Some of the big challenges are that India doesn't have a company or an anchor which would get into components at a big scale. The country does not have an equivalent of companies like Toshiba, etc, which has a diverse components portfolio above all R&D at that level. Secondly, India’s investments are leveraging manpower as it is continuing to set up EMS or contract manufacturing shops in India. In fact, the domestic value addition is also very limited. “The challenge is also related to the global scenario. For example, a lot of minerals and raw materials used are abundantly available in countries like China, but then there are countries in Africa also where we can get them. Also, the manufacturing of components is successful when we have scales. India has just started thinking beyond local consumption after the introduction of the PLI scheme. We need to have optimal volumes to make the business case for such investments,ᾠadded Kawoosa. Currently, India is making some of the components that are required for the manufacture of Electronics products in India, mainly passives and some discrete active components. But, when it comes to Semiconductor chips of higher complexity and capabilities, India has limited capabilities to manufacture them except for the strategic requirements. India now imports about 50% of its components demand, claims IESA.The manufacturing capability of whatever components India manufactures is hampered to some extent due to the COVID-19 pandemic. under WTO in December 1996 to which India is a signatory and which came into effect in April 2005. Under this agreement, participants decided to remove tariffs on IT products. Since then, investments in this segment have shrunk and domestic equipment and EMS companies have been meeting more than 80% of their component requirements through imports,ᾠstated Goel. As per a study by ELCINA, component manufacturers in India face a 10% disability cost due to which they are unable to compete with imports. Some of the accompanying challenges like the high cost of Finance become a big disadvantage and increases as value addition increases due to greater requirement of capital, manufacturing processes, and technology. Components constitute the high-value addition segment of the electronics supply chain and suffer higher disability costs. This cost disadvantage, combined with zero import duty, has been the biggest roadblock in the growth of our component industry, which further intensifies the challenge due to a lack of economies of scale. This is a chicken and egg situation. The existing ecosystem of component manufacturing in the country lacks global scale and capabilities, suffers higher costs, and thus has not attracted adequate investments. It needs a big stimulus to attract both domestic and foreign investors and injection of technology for rapid growth and achieving economies of scale. This reduces the demand for locally manufactured components, which has restricted the domestic industry to US$10 Bn, with substantial dependence on imported raw materials. Post COVID, the electronics industry is facing an unprecedented shortage of electronic components especially semiconductors, chip components, and even multilayer PCBs. Commodity prices have soared due to theslowdown in output, disrupted supply chains, and logistics issues. Geopolitical issues have caused friction and many large buyers are shifting their sourcing to more trustworthy sources. Raw materials such as ferrite powder, PCB laminates, and many others are witnessing a rapid increase in prices adversely impacting a large section of the Indian Component sector viz. PCBs, Transformers, and Inductors where we have a reasonably significant manufacturing presence. While India is aspiring to become a leader in electronics manufacturing, our industry is facing a shortage due to extremely high import dependence. Undoubtedly, COVID is the main culprit which has not spared any country, but we being weak in electronic components manufacturing are at the mercy of foreign suppliers and have no negotiating capacity. We have to accept the increased prices and long lead times with its given consequence of higher production costs and lower output, opined ELCINA. article/how-to-select-your-drone-flight-controller-a-comparative-selection-guide

How to Select your Drone Flight Controller ᾠA Comparative Selection Guide

on the basis of what we want to do with the drone. For example, if we are going to design a drone that will drop some items at a given location,we have to use a flight controller that can reach the exact GPS location. Here, we are going to compare some mid price range flight controllers.

What is Flight Controller?

in the drone. It is an electronics board in which sensors, processors, communication protocols, transmitter pins are installed. Every part of the drone is controlled by a flight controller. It moves the drone by changing the RPM of the motors. It is a control system that takes input from the sensors and makes the drone fly accordingly. Flight controller purpose is to stabilize the quad copter during flight and to do this, it receives the signal from sensors and send these signals to processor and then it passes control signal to ESCs and the combination of these signals instructs the ESCs to make fine adjustments to the motors rotational speeds which in-turn stabilizes the craft. Once processed, this information is sent to the ESCs which in turn adjust the rotational speed of each motor to control flight orientation (yaw, right, left, up, down, backward, forward).

Comparison of Flight Controllers

Here, we have compared for flight controllers from $20 to $140.
Input Voltage (DC)4.8V ᾠ6.0V4.8V-15.0VMC- 4.8V-5.5V VU-7.2V-26.0V12V ᾠ16V7VMC:4.8V~5.5V VU Input: 7.4V ~ 26.0 V
ProcessorAtmel 644PA 8 bit AVRSTM 32bit with 28 kb flash & 20kb RAM-----------------ATMEGA2560, ATMEGA32U-232bit STM32F427 Cortex M4-------------------
Sensors6050 MCU (acc & gyro )Acc & gyro sensorAcc, gyro, Barometer, MagnetometerAcc, gyro, Barometer,Acc, gyro, Barometer, magnetometerAcc, gyro, Barometer, Magnetometer
ProgrammerNot Required (Tune by buttons on it)RequiredRequiredRequired (Arduino Compatible)Requires (supports Linux/Unix)Required
Type of Copter2,3,4,5,6,7,84,64,64,64,64,6,8
Telemetry (Ext)NoNoYesYesYesYes
GimbalYes (except octa copter)Yes (for quad & hex only)Yes (for quad & hex only)YesYesYes
PC RequiredNoYesYesYesYesYes
Weight (gm)2625MC: 25, VU: 208240MC:27g PMU:28g
FirmwarePre-installedOpen PilotDJI NAZAArdu copterMission PlannerDJI NAZA
GPS (Ext)NoYesYesYesYesYes
Now, we are going to compare some mid price range flight controllers.

KK2.1.5 Flight Controller

KK2.1.5 has ATMEL mega 664PA IC inbuilt inside it. It is 8-bit AVR RISC-based microcontroller with 64k of memory. It has inbuilt accelerometer and gyroscope, 6050 MPU, and auto-level function. It has eight motor outputs on right side of the board; we connect ESC here. It has 5 control inputs; these inputs are connected through the receiver. It also has one LCD display in the middle, it will work as a user interface for the drone. Its operating voltage is 1.8V to 5.5V and its input voltage is 4.8-6.0 V. Its price range is from $20 to $22. This is the flight controller for beginners because it is easy to understand. For this, we do not need to have any programming knowledge. We don’t need any PC for this. We can tune and setup this flight controller through the button on it. In a very short time, we can make it ready for flight. Its connection with the receiver and ESC is very simple. We cannot use KK2.1.5 for single copter. Its flight stability is not good enough for beginners. We can use gimbals for KK2.1.5 drone and gimbalfeature is not available in any other flight controller in this price range. We can use gimbal from twin copter to hexa copter only. Without a gimbal, we can fly drone from twin to octa copter. It is mostly used by beginners. Its flight stability is very low. In this, we can also do surveillance using the camera, but we cannot connect the camera to the flight controller. In this, we can mechanically fit the camera. It is very cheap flight controller We don’t require PC We don’t require any programming knowledge We cannot add any GPS module, sensors, and telemetry to this flight controller It does not provide stable flight

CC3D Flight Controller

This flight controller is also for beginners. It is very compact in size, so we can design small drone using this. We can easily program it by connecting it to the computer. PC must require for this. It provides stable flight as compared to KK2.1.5. The Open pilot CC3D flight controller is integrated with a powerful STM32 bit microprocessor that runs at 90 MIPS with 128Kb flash and 20Kb RAM. This flight controller features a high-performance 3-axis accelerometer and MEM gyro meter. The camera stabilization system supportsupto3-axiscameramountswith stabilizationandmanual controlfromanyofconfiguredreceivers. Its price range is from $14 to $17. It is very small in size and looks like a normal flight controller, but it is a very good flight controller and gives a very stable flight. We can also use a GPS in this flight controller, but we have to install the GPS module separately. To use it, we have to take a computer and write a program in it using the software. We need a computer to use it. We have to program this flight controller from computer. We get more stability in CC3D than in KK2.1.5. It is used by beginners but it supports GPS, due to which we can use it in GPS based applications. SRD 250 V 3 drone has designed by using CC3D. It is very cheap flight controller We can add GPS module to this flight controller It gives stable flight as compare to KK2.1.5 It supports wide selection of open source firmware We cannot add extra sensors and telemetry to this board It does not give stable flight while using gimbals

DGI-NAZA M LITE Flight Controller

DGI-NAZA ᾠM LITE inherits the high reliability and stability of NAZA-M. The innovative all-in-one design simplifies installation and saves space and weight. It contains inner damping, controllers, 3-axis gyroscope, 3-axis accelerometer, and barometer in its light and small Main Controller. It can measure flying altitude, attitude and therefore, can be used for autopilot/automatic control. The advanced attitude stabilization algorithm not only inherits the outstanding flight stability of DJI products but also provides excellent maneuverability. It is more flexible and stableand gives the hobbyists a wonderful flight experience. It offers three types of control modes: GPS Atti. Mode (with GPS module), Atti. Mode, Manual Mode. The pilot can switch between the three modes to achieve different flight characteristics. It also can adjust automatically within the flight environment and intelligently switch between GPS Atti. Mode and Atti. Mode to make sure the flight is safe and secure. The plug and play GPS module will greatly enhance the performance for Aerial Photography with accurate Position Hold, Return-To-Home, and Intelligent Orientation Control functionalities. With the GPS Module, the multi-rotor will have position and altitude locked accurately even in windy conditions. Hovering accuracy is approximately 2.5m horizontal and 0.8m vertical. This is a good flight controller for stable flight. Its price range is from 5500 to 6000 INR. We can use it for only quad copter and hexa copter. Its best feature is that it does not crash if its battery is exhausted. It has an RTL mode which makes the drone land back from where it takes off. This flight controller also supports gimbals. To use it, we have to take computer and write a program in it using software (DJ assistant). It also has a barometer sensor. There is a problem in NAZA that if its application is installed in windows 7, then it gets installed easily but if we installit in window 10, then we face some problems in installing the software here. It containsinner damping, controllers, 3-axis gyroscope, 3-axis accelerometer, and barometer in its light and small Main Controller. It can measure flying altitude, attitude and therefore can be used for autopilot/automatic control. It is mainly used for Autopilot work and sport flying like drone racing, etc. It is plug and play type of flight controller We don’t need to be worry regarding firmware It is supported by largest drone company I the world Flight controllers software are closed source.

APM 2.8 Flight Controller

Ithas built-in compass for FPV RC drone, module has the option to use the built-in compass and external compass via a jumper. It allows the user to turn any fixed, rotary-wing. In addition, it turns multi rotor vehicle (even cars and boats) into a fully autonomous vehicle. Meanwhile, it is capable of performing programmed GPS missions with waypoints. One of the main features of APM2.8 is that it is Arduino compatible. We can program it using Arduino IDE software. Its price range is from $38 to $40. It is an open-source autopilot system. The only feature it has more than cc3d and kk2.1.5 is the barometer sensor so that the drone can maintain the height and fly the drone easily at a height. The process from downloading the software to programming the flight controller is complex at DGI. Here we need to download mission planner software. The APM 2.5 board requires no assembly and is ready for firmware. We can add external sensors in this flight controller like SONAR, Buzzer, LEDs It supports Arduino IDE It is no longer being supported by the ArduPilot project.

Pixhawk 2.4.8 Flight Controller

Pixhaek 2.4.8 supports 8 RC channel and 4 serial ports. Main feature of pixhawk 2.4.8 is that it supports various user interface for programming and apps for smart phone. It can configure and detect its peripheral automatically. It also supports Unix/Linux like programming tools. It has advanced 32-bit ARM CortexM4 high-performance processors; can run NuttX RTOS real-time operating system. Ithas32-bit STM32F427CortexM4 core with FPUthe 32-bit STM32F103 failsafe co-processor. It support UART, I2C , SPI, CAN bus interfaces and hasST Micro L3GD20H 16 bit gyroscope, ST Micro X4HBA 303H 14-bit accelerometer/magnetometer, invensense MPU 6000 3-axis accelerometer/gyroscope and MEAS MS5607 barometer sensor. It is the best open source flight controllers, so it has become very popular amongst DIY drone builders. It can be used with the main open-source drone projects, ArduPilot and PX4, and it is completely open source hardware. It means any manufacturercan build and sell the boards but architecture should be the same. There are many of IO ports on the pixhawk so we can easily communicate it with on board computer like Raspberry Pi boards. It is supported by big open source software project We can easily interface it with Raspberry Pi It is one of the older board. Many times, it shows arming error but it can be solve easily

DJI- NAZA M V 2 Flight Controller

The Naza-M V2 is a powerful flight controller for enthusiasts, commercial and industrial flyers. It is easy to install, simple to configure and above all, extremely stable. Nine types of traditional motor mixes are supported, making it ideal for every setup. 16 point Ground Station is available free for both iPad and PC, without serial number verification. 2.4G Bluetooth Datalink required. The Naza-M V2 boasts the extraordinary stability you would expect of all DJI flight control systems and combines it with unparalleled maneuverability with and without GPS. Built into it are automatic GPS course correction plus GPS and compass interference monitoring, which combine to offer more stable flight and minimal magnetic interference. Forward on a multirotor is normally the direction the nose is facing, which can get confusing when turning, but with IOC switched on, direction is hugely simplified. If a hexrotor or octorotor equipped with a Naza-M V2 suffers a motor failure in flight in attitude or GPS mode, it will maintain its altitude and rotate around the stopped motor. This allows it to fly safely back home and land. If the connection between the multirotor and the remote control are disconnected during flight, a failsafe system will activate. Provided there was enough GPS signal at the time of the disconnection, the multirotor will fly back to its point of takeoff and land automatically. This feature can also be triggered manually using the One-Key Go-Home function activated using Assistant. Using a BTU with power efficient Bluetooth, parameters can be adjusted at any time through a smartphone without excessive power use. Connection records are automatically stored by the Bluetooth module and protected by password. Parameters can be automatically synchronized to the cloud restored immediately when mobile devices are changed. Storm SRD 6 uses DJI NAZA V 2 as a flight controller. It is plug and play type of flight controller We don’t need to be worry regarding firmware It is supported by largest drone company in the world Flight controller’s software are closed source article/an-overview-of-layer-stack-management-in-pcb-design

An Overview of Layer Stack Management in PCB Design

that are used for high-density PCB designs. like: Basic of PCB Via Stitching in PCB Design Understanding Blind, Buried, and Through-hole vias in PCB How can Teardrops help in Improving Quality and Stability of your PCB Design You can check those out if you are interested to learn about PCB design and manufacturing. That being said, let's look into the tips to reduce PCB manufacturing costs.

What isLayers Stacking PCB Design?

Below image shows a signal layer where multiple signals are routed as well as components are placed. A plane layer is different. It does not consist of any signal other than the Ground or Power Planes. This is useful for multiple reasons, mainly having a good Ground and Power Path all over the circuitry.A solid copper is placed all over the board and by just cutting the copper plane, separate segments are created to provide different plane signals. Below is an excellent example of the same where the Plane layer is shown. The next type of layer is a mixed layer that uses both signal and copper fill as a plane. This is the most commonly used layer type in two layers and six layers boards. Sometimes it is also used in four-layer boards as well. There are multiple instances that this type of layer is seen in general PCB boards that do not have significantly high-speed traces. The image given below showsan example of a mixed layer type.

How many layers do we need?

The first question arrives before deciding the layer stacking is that how many layers are required for the design. A standard rule of thumb is to use the number of pins on a printed board per unit area. The below chart can be used as a starting point.
Pin Density RatioPCBs layer(s)
more than 1.01
0.6-1.01 or 2
0.4-0.64
0.3-0.44 or 6
0.2-0.38 or 10
Less than 0.210 or 12 or 14
However, this is not limited to all cases. PCB density depends on components' fixed position, signal integrity, etc. Now, after deciding how many layers should be there, it is time to select the layers for what type of signals to be routed on which layers. Few things are needs to be evaluated before making some decisions. It is important to route high current layers on the top and bottom layers. As the internal layers do not dissipate heat through air. Thus, if the internal layers are used for high current operations, it will induce temperature rise of the PCB. High-frequency signals emit high EMI, thus internal layers with a stacking of Ground planes on above and bottom layers help to reduce radiated EMI.

Dielectric and Copper Density and Layer Management

This is because changing the copper density and the dielectric changes the board size and it could alter the impedance parameters of the overall board. The copper density and PCB size are also dependent on the overall cost of the board. Increasing the Board thickness possibly increases the board costing as well. Generally, the copper thickness of 35um and 70um is widely used in PCB layer stack management. Increasing the copper possibly increases the current carrying capacity of the traces and reduces the heat dissipations. A major thing is to select a layer order where the layers are evenly balanced. Below are the most used layers in different layer configurations from 4 layers to 8 layers PCB Board. For optimal performance, the layer assignments need to be exactly as described below. The top and bottom layers can be used for signal layers, and the two internal layers can be used for power and ground this way, we can debug for errors in the PCB. Layer assignments - Signals (that needs to be tested most often) / GND Plane / Different Power Signals / Signals For 6 layer PCBs, the process gets a little bit complex but the overall concept stays the same. The signal planes always stay at the top, for any modifications in the POC stage. The ground and power planes live below that and the mixed-signal planes. The power and ground planes are routed vertically and the signal planes are routed horizontally that we reduce EMI and noise for high-speed PCB design. Always remember to make the plane before you start designing the PCB. Thus, if you select the second layer as the Ground plane, always choose the 5 the layer as the ground plane. This is very important. Also, in 6 layer design, route the signals vertically in one layer, and horizontally on another layer. In this case, the magnetic field generated from the traces will cancel each other and reduce the cross talk. Layer assignments -Signal / Solid GND Plane/ High Speed Signal / High Speed Signal / Solid GND Plane/ Signal The concept of 8 layers PCB is also the same, as an 8-layer PCB, it is used for very high-speed designs like computer motherboards, FPGA, and all so to isolate EMI and noise, we put the ground plane below the top and bottom signal plane underneath that, there are mixed signals plane and other ground and power planes. The entire structure is given below. Layer assignments -Signal / Solid GND Plane/ High Speed Signal / GND or Power / GND or Power / High Speed Signal / Solid GND Plane/ Signal. interview/fabless-semiconductors-will-strengthen-indias-esdm-strategy

“Fabless semiconductors will strengthen India’s ESDM strategyᾠᾠSandeep Aurora and Krishna Moorthy from India Electronicsᾠand Semiconductor Association

highlighted key challenges of electronics and semiconductor manufacturing, what India needs to do to boost its FAB units and several key criteria of this sector. I would say not an anti-China strategy is what India should start looking at this time, but it must focus on the real India-centric ESDM strategy. India has a huge demand for electronics, we are already doing $150 billion import today, which would be double to $400-500 billion by the end of 2025-26. If we apply this strategy correctly this year, then in the next 9-10 years, we will be able to add as much as 25% of India’s GDP from ESDM. If we are talking of a 5 trillion-dollar economy by 2025-26, we can easily target trillion from ESDM alone. In fact, the PLI scheme is great, but that strategy is not enough. Global companies like Samsung shifting its manufacturing of OLED panels to India is also a huge move. The big part of the strategy of India becoming an ESDM powerhouse is how do we develop the products, how do we own the design, how do we own the IPs, and that has to happen quickly. It must be noted that we cannot create an IP unless we know how to design it, how to fabricate it, how to assemble it and test it to prove that IP is good to be put in the product. So, fabless semiconductors will be one of the strongest pillars in India’s ESDM strategy in this decade. For example, take the initiative of theSAFAL program of the government of Karnataka. Today, eight fabless companies already working in SAFAL premises. The best country to learn about fabless semiconductors is Israel, which has many fabless semiconductor companies and they are so successful. The whole issue is production had to be stopped due to the Pandemic. But the system level demand has not really dropped. So, people are still buying gadgets and automobiles. In 2020, the worldwide sales of semiconductors increased 6.5 percent approx. So, now if production stops even for a month and even if sales increases, there will be a thrust in manufacturing. So, how this could have been avoided. One is the semiconductor industry must diligently work to ramp up production to renew demands, but the supply-demand imbalance cannot be easily solved by turning on a switch. It is still going to take some time. Even there is a report from the US defense department saying that they are affected immensely in spite of being the most prioritized sector. Big companies like Samsung, TSMC, Intel manufacturing FABs are also extremely concerned, they are trying to increase the capacity as quickly as possible. They are setting up new production lines. Global shortage of chipsets is going to stay for at least oneyear. To perk-up the scenario in India, IESA already had multiple meetings with government authorities so that they influence the manufacturers and Indian industry is not badly impacted. India will definitely have semiconductor manufacturing companies, but we have to break it down into small pieces because it is not only wafer manufacturing but there are other components of semiconductor manufacturing like assembly, testing, marking, packaging, or what we call ATMP or OSAP. Production of these elements is easy to set up in a period of 1.5 years. Only if we have these things done in the next 1.5 years, then setting up a proper wafer fab will take place in another three years. For example, Cochin and Chennai have started producing system-level products like battery chargers. It has to be done step by step because when the other small components are already available, then only we can have proper wafer fab in the coming three years. The pace of vaccination is picking up. When the second wave hit, we took a lead by working closely with the industry, and fortunately, the good thing is that the industry is able to vaccinate all its employees. The biggest challenge faced by EMS industry is the supply chain disruptions due to pandemic and it is taking a lot of time to get sorted out. Our industry is very cost-conscious, and you want to make sure you are doing everything right. When the disruptions happened, nobody had enough stockto meet the demand. The industry is now working together with large manufacturers, already announced investments into bending manufacturing. A large section of industries globally has realized that they need to hedge and there need to be multiple places of manufacturing, which imply that there must be more than one hub. A lot of global manufacturers are now looking into Indian EMS companies to create this as a second important hub. When any problem or issue arises, we as an association start looking at it proactively. We are working very closely with the government and the industry and trying to find solutions to the several challenges caused due to COVID-19. We are also working with multiple companies to see how we allocate a certain state of resources from large companies in India. But the longer-term issue is how do we build a resilient supply chain where India does not suffer like this again. Another important thing is how do we place India in the middle of the supply chain in the electronics segment. We are doing a very deep study on what all supply chains of the electronics and semiconductor industry comprisesof and what all elements of supply chains are there where India can participate. If you look at the complete ecosystem of the electronics industry you have the active semiconductors and passive components in tripping blocks. Then there are some very big components like SoC or processors, which also get added with other components to make a system. So, our clear strategy on the roadmap is capturing the data on whatever the components we have imported, what is the value of that, and which industry has been utilizing it. Another roadmap is to help companies build up a 100 percent manufacturing of electronic end products and components. article/design-guide-for-high-frequency-op-amp-comparators

Design Guide for High Frequency Op-Amp Comparators

applications, the designer should know how different Op-Amp parameters are getting varied during different Frequency Ranges.

How Op-Amp Performance Differs for DC and High-Frequency Signals?

is shown in Figure ᾠ1 given below and the Internal Structure of LM339 Comparator is shown in Figure 2. ᾠwhich defines the high-frequency operation of the given Op-Amp. Among the various high-frequency operational parameters, the Gain is the most important parameter of any op-amp for any application. For Comparator applications, the Op-Amp will use a maximum gain of the Op-Amp, and gain variation due to the frequency is the first notable parameter in Op-Amp for comparator application. The Gain variation for different frequency signals of LM324 Op-Amp can be found in Open Loop Frequency response curve which is shown in Figure 3. Based on the datasheet curve of Open Loop Frequency response, we can find that the gain of the Op-Amp reduces with the increase in frequency. For less than 10Hz, the Open Loop can provide the maximum gain and around 1MHz frequency, the gain is 0dB (1V/V). In this condition, the output voltage is equal to the difference between Inverting and Non-Inverting terminal voltage only. Also, from the large frequency response of the LM324 Op-amp shown in Figure 4, the output voltage swing is reduced with the increasing frequency. In Figure 4, for 15V Vcc, we can get the maximum output of 13.5V from LM324 Op-Amp whereas, if the signal frequency is 10kHz, the output voltage is only 10V and at 100kHz, it is around 1V. So, like DC applications the comparators can’t be directly replaced by Op-Amp by only considering voltage ratings of the device.

Example Circuit: PWM Generator using Sawtooth and DC reference Signal

control applications, where the fixed frequency sawtooth waveform is compared with the DC voltage, and based on the magnitude of DC voltage, the PWM duty cycle gets changed. The low-level voltage of the Sawtooth (V+) is 0V and the peak voltage is 0.5V. The Inverting input (V-) DC voltage waveform varies between 0V to 0.5V. If the inverting input (V-) is 0V, then the output is always high (Vcc) or 100% Duty cycle. If the Inverting input voltage is greater than or equal to 0.5V then the output voltage is Zero or Vee. In this example, the inverting input voltage is maintained at 0.2V and the response output response with LM339 Comparator is shown in Figure 7 and the respective circuit is shown in Figure 6. The PWM generator circuit with LM339 works better as expected and for 5V Vcc, the output maximum voltage is equal to Vcc and the lower voltage is equal to around 120mV. Based on datasheet specifications, the 120mV nearly matches with a typical low voltage level. The response of the same circuit with the LM324 Op-amp is shown in the figure given below. implemented with LM324 has produced a different response compared to the response with the LM339 comparator. By putting those two output responses in a single window as shown in Figure 9, we can find two major mismatches. 1) Output Voltage level 2) Rise Time and Fall time of the Op-Amp response In terms of output voltage level, the comparators always produce the output voltage equal to the Vcc and in rare case, it may be 200mV lesser than or higher than that. But for Op-Amps, the maximum output voltage swing is comparatively lesser than the Vcc. The output voltage swing of LM324 is given in the table given below. As per the datasheet specifications, the maximum output voltage of 5V - Vcc LM324 Op-Amp output is 3.5V only. So, while replacing the comparator with an Op-Amp, the designer must check whether the Op-Amp output voltage swing matches the requirements. as per datasheet for unity gain is 0.5V/us. Before using an Op-Amp for an application, particularly for High-Frequency comparator applications, the slew rate requirement should be calculated based on the below formula Slew Rate (V/s) = 2.π.f.V Here f = Frequency if the signal to be processed in Hz V ᾠPeak to Peak Voltage of Output Signal In our application, we need to process a 10kHz frequency signal and the output peak to peak voltage is 5V. So, for this requirement, the minimum slew rate required from the Op-Amp is: Slew Rate (V/s) = 2x3.14x10000x5 = 314000 V/s In Op-Amp datasheets, the Slew rates are mentioned in V/uS, and converting the above result to V/us gives => 0.314V/uS. The other important parameter to consider is that the obtained slew rate is only for Unity Gain (where the input voltage difference and output voltage are equal) and the slew rate response will reduce based on the higher gain (Op-amp as comparators will work on higher gain stage). So, while using the Op-Amp comparator applications, the slew rate should be higher than the calculated requirement to get the perfect output. which is very low for this comparator application and the LM324 Op-Amp should be replaced with a high slew rate Op-Amp. Along with the slew rate to obtain better high-frequency output, the peak output voltage should also be reduced based on the signal frequency as shown in Figure 4. The Output response for 100 kHz signal with LM339 Comparator and LM324 Op-Amp is shown in Figure 10. ᾠinstead of a Comparator. For 100kHz frequency, the required Slew Rate is also 3.14V/us and can’t be matched with LM324 Op-Amp. To match this requirement, the high slew rate and high bandwidth Op-Amp have to be replaced instead of LM324.

Conclusion

For comparator applications, it is always better to use a comparator instead of Op-Amp. If the Comparator is replaced with the Op-Amp for DC and very low frequency signals the Output voltage swing, Common Mode Voltage, Differential Mode Voltage, Output Configuration, and drive current are the important parameters that should be taken for analysis. Whereas, if the application is High frequency, along with the above-mentioned points, the Op-Amp Bandwidth, Slew rate, and propagation delay are the major decision-making parameters. The Large signal response which is related to defining peak voltage for Slew Rate calculation at different frequencies is also added and for higher slew rates, the Op-amp operating current consumption is also higher which increases the Op-Amp power requirement. Due to the increase in operating power, the Op-amp junction/die temperature may also increase, and thermal parameters are also taken into consideration before replacing the comparator with Op-Amp. article/smt-manufacturing-in-india-where-do-we-stand

SMT Manufacturing in India ᾠWhere do we stand?

Over the past couple of years, technology has been progressing on a rapid scale, its demand has also augmented among various industrial sectors and consumers. Across the vast consumer electronics cluster, which comprises smartphones, tablets, computers, liquid crystal displays (LCD), and LEDs, the utilization of Printed Circuit Boards (PCBs) has escalated tremendously. According to several electronics associations such as IESA and ELCINA, the market share of consumer electronics is much higher than that of industrial electronics. Hence, placement and soldering equipment is being largely utilized in the manufacturing of numerous electronic products, which in turn has increased the applications and demand of surface mount technology (SMT) machineries. As the adoption and market of industrial and smart electronic devices have increased, the cleaning market of SMT has also evolved because during the production process, there is a much requirement for cleaning equipment. Currently, the form factor of electronic devices has contracted due to which soldering equipment has been outstripped by SMT placement equipment in terms of market share. Over the past seven to eight years, India has witnessed unprecedented growth in the electronics segment whose manufacturing is also growing every year. Carefully examining the policy front, the government of India has escalated the rate of custom duties on the import of PCBs and other manufacturing components in order to encourage manufacturing locally. Due to this, domestic manufacturers will be forced to manufacture and assemble PCBs in India. Now, if manufacturing starts happening locally, then the momentum of growth of the country's SMT industry would also perk up rapidly. While speaking of the imperativeness of manufacturing in the country, Sandeep Aurora, Vice President ᾠBusiness Development & Govt Affairs, IESA told an online media, “We need to address the entire manufacturing and supply chain procedure in the nation so that we can become ‘atmanirbharᾮ To fulfill that dream, SMT manufacturing must be the top priority, maybe not instantly, but surely has to be carried out, and then only India would be able to enhance the strength of its entire electronics manufacturing cluster.ᾍ On the other hand, India’s industry experts opine that the government has to understand the importance of SMT manufacturing, and then only there can be momentum in India’s electronics manufacturing. The machine’s manufacturing has already commenced well, but there should be more push to the government’s ‘Vocal for localᾠpolicyᾠthat will push the growth to a larger extent. Currently, it is predicted that the SMT segment in India would witness a growth rate of 20-25 percent every year until 2025 if the plan works successfully. Speaking of the various challenges of SMT manufacturing in India, Masafumi Himeno- Div. Managing Director ᾠPSFSIN, Panasonic India said exclusively to CircuitDigest, “SMT manufacturing has a history of more than 50 years, in terms of equipment, human resources, and management. It has undergone various major evolutions. In addition, SMT manufacturing (production area) is expanding globally. India must achieve complete non-defective production. Under the Make in India policy, the future of SMT manufacturing in India is bright. India is still a young market in electronic manufacturing compared to other countries. Therefore, to achieve complete non-defective production and to build an experienced workforce will take some more time, but I believe these challenges will be overcome in near future.ᾍ Praveen Madan, GM, SMT Division- Juki Singapore told CircuitDigest, "It is always the quality and cost of the end-product. As of today, 80-90% of the parts / raw materials are imported and most of the SMT products manufacturing is for the domestic market in India. Higher import means higher cost. In India, labor cost could be cheaper compared to other countries, but capital goods, cost of operation, and inefficiency in factory utilization could be higher due to various political or regional reasons. These are the vital problems that need to be fixed before thinking of fulfilling the dream of making India a global manufacturing hub including SMT.ᾍ Market situation is now to wait and watch due to the higher cost of manufacturing. People are worried about the 3rd wave of COVID-19 and cannot predict the lockdown. Many customers have delayed their new projects and investments. If India wants to become aglobal SMT manufacturing hub,then some of the following need to be considered: 04 Electronics Manufacturing clusters in each region for complete supply chain Give incentives to manufacturers per PC export. For example, if one LED TV made in India is being exported, then they can get a fixed value from the government, say per PC export. Need to change the mindset for export orientation (this includes quality, price, delivery, and after-sales support globally) Need more PCB and component manufacturing plants. Sincethe cost of setting up a semiconductor plant is high, govt participation is important in terms of investment to start with. Global branding/promotion of Make in India products. “Due to the pandemic, SMT manufacturing industry, just like others, was temporarily affected. However, factors such as semiconductor shortage, low demand, and availability of workforce are for the interim period, and we don’t see an impact on the industry over the long term. On the positive side, the pandemic has hastened the digitization process. Faster adoption of digital will lead to an increase in demand for Automation, Automated Guided Vehicles(AGVs), software solutions, preventive maintenance, and digital reporting features, post-pandemicᾠadded Himeno. India is already on the path of becoming a global manufacturing hub, some of the additional factors that will help foster the growth are: Contract manufacturing and Electronics Manufacturing Services Long term and stable policies Ease of doing business Export incentives Creation of SEZs Optimizing supply chain efficiencies Incentivize schemes like PLI Creation of skilled workforce The SMT market in India is expected to reach a turnover of US$ 5.42 billion by 2022, growing at a CAGR of 8.9 % between 2017 and 2022, claims a report by research firm Markets and Markets. The growth of this market would be fuelled by the increased adoption of miniaturised consumer electronic products and the augmented demand for electric vehicles coupled with sophisticated features for connectivity, safety, and entertainment. India’s industry experts feel that the country still lags behind having a state-of-the-art electronics manufacturing service (EMS) industry; the speculated volume of the Indian SMT equipment industry would be about 75 ᾠ80 percent of the EMS industry. As per industry estimates, Indian SMT market is expected to grow in double digits. MeitY industry report estimates that the global SMT market is expected to grow by 5-7% CAGR during ᾲ0-ᾲ5. interview/our-vision-is-to-build-affordable-healthcare-solutions-for-differently-abled-chaankya-gone-cto-of-makers-hive

Our Vision is to Build Affordable Health-Tech Solutions for Differently Abled - Chanakya Gone, CTO of Makers Hive

is a true innovation in the field of medical science that has changed the lives of millions. It replicates the functionality of the natural arm/hand to enable amputees to perform their day-to-day tasks with ease. A lot is being done in the bionic limbs industry, however, there are certain gaps to be filled to enable people with amputations to become futuristically-abled; affordability being one of them. is a company that is working towards developing a fully functional customizable and mobile app-enabled Bionic Hand ᾠKalArm. Keeping the economic challengesin mind, the Makers Hive team has developed an affordable fully functional Bionic Hand. We spoke with Chanakya Gone, CTO of Makers Hive about the prosthetic arm developed by the company, the technological aspects involved, and their future plans. Dr. APJ Abdul Kalam Sir’s ideas motivated us to start Makers Hive in 2018 with a vision to build cutting-edge assistive technologies to solve contemporary social problems in developing nations like India. The motive of our company is to democratize the assistive-tech industry, especially prosthetics. We build health-tech devices to empower the lives of amputees and transform them from differently-abled to futuristically-abled. We are focusing on the sectors that have been deprived of innovation for the past few decades. Our company builds world-class products in the bionics sector and makes them accessible and affordable for those in need of assistive technology. KalArm is a 3D printed light-weight and affordable bionic hand that combines uncompromised functionality with style. KalArm uses EMG sensing technology to sense inputs from the user’s (amputee) forearm muscles to perform various grips to hold objects of various shapes and sizes. Myoelectric technology allows for greater control and precision in the prosthesis. This feature enables users to upgrade the firmware of KalArm to the latest version which would give it access to the latest features. Additionally, it has customized panels that allow users to customize KalArm with various colors, patterns, and embossed designs of their choice. Most of the prosthetic hands currently manufactured in India do not provide individual finger control to the user, which limits the number of activities that the user can perform in daily life. Prosthetic hands currently available in India offer only up to 5 default grip patterns. Moreover, these prosthetic hands do not have mobile application support. For any configuration changes/functionality issues related to these prosthetic hands, users need to visit the prosthetic and orthotic clinic. KalArm users can directly identify and troubleshoot most of the problems and upgrade the firmware with a tap of a finger using KalAssist mobile application. The grips and hand appearance customization features are the key differentiators for KalArm when compared to other prosthetic hands. Once we had figured out what we wanted to build and realized its potential to make an impact, we started spending time with our end users (below-elbow amputees) to understand the problems that they generally face while performing their daily chores. We then spent a considerable amount of time with the doctors from prosthetic and orthopedic domains to understand the usage of biopotential signals (EMG signals) to control prosthetic devices. These initial interactions with amputees and doctors gave us an idea about what the users are expecting. Our market research and competitor analysis helped us finalize the product requirements. We then started our design thinking process to build a prototype that can capture EMG signals from the amputee’s forearm muscles and drive the motors to open/close the fingers. Initially, we used readily available development boards, EMG sensors with wet electrodes, motors, and 3D printers for building our prototype bionic hand. After multiple iterations, designs, calculations, software analysis/simulations, etc. we achieved the intended functionality. After repeated testing with our users, we realized that the use of wet EMG electrodes was not a great option as the user had to replace the electrodes very frequently. After some research, we found out that the EMG sensors that are currently being used in the Indian market were being imported and that a pair of dry EMG sensors cost more than 1 lakh. As we had already decided to build an affordable bionic hand, the team at Makers Hive, having strong expertise in designing and manufacturing electromechanical products took it as a challenge, designed and built the EMG sensors completely in-house. One of the design considerations was to build KalArm as per human hand anthropometric data. Although the prototype version did not fit in these dimensions, the subsequent versions were well within the limits of normal human hand anthropometric dimensions. The alpha version of the product was incorporated with our dry EMG sensors, and we could achieve human hand-like finger motion with KalArm using advanced software algorithms. We incorporated 18 default grips in this version along with mobile application support via Bluetooth. A detailed usability testing was done with amputees (with various age groups, education levels, amputation types, etc.) in the presence of a Certified Clinical Prosthetist. The feedback that we got during this stage helped us improve the product in terms of safety and we slowly moved from the prototyping materials to medical-grade materials to give maximum comfort to the user. , 2020. KalArm works on Electromyography signals. Electromyography (EMG) measures muscle response or electrical activity in response to a nerve’s stimulation of the muscle. KalArm uses the existing muscles in the amputee’s residual limb to control its functions. Two sensors fabricated into the prosthetic socket receive electrical signals when the amputee intentionally engages specific muscles in their residual limb. These signals are further amplified and processed by the sensors and later converted into meaningful commands that are sent to the control system. The control system unit converts the received commands into useful grip patterns by driving the motors (present inside the palm area of KalArm) that close and open the fingers. Hold, long hold, double impulse, triple impulse, co-contraction, and long co-contraction are the possible movement commands of KalArm. Upon applying particular EMG signal commands, the bionic hand enters pre-allocated grip patterns. KalArm comes with four different Modes. The first three are the default modes consisting of 18 pre-defined grips. While the fourth mode is a custom mode; the user can add up to 6 custom grips here. The multi-functional button present on the device can be used to switch between the modes. KalArm is built as per the human hand anthropometric measurements. It comes in one standard size till the wrist part. It comes under medium human hand size dimensions which will suit most of the amputees. The forearm part is customized as per the amputee’s residual limb. Users can choose from a wide range of materials like PA 12, carbon fiber, and thermoplastics for the forearm. Customization can be done for the palm’s outer panel and forearm panels. Customization includes colors, patterns, and embossed designs. KalArm consists of a control system that continuously tracks the working condition of the key components, like motors, battery, and EMG sensors by analyzing parameters like encoder, current sense feedback, device voltage level, device temperature, battery temperature, EMG signals, etc. It sends the data to the mobile application which provides alerts/notifications to the user. All the critical components of KalArm are represented either by red or blue dot in the mobile application. Red indicates that something is wrong with the node, while the blue dot indicates that the status is good. Device health monitoring feature of the arm plays an important role in the serviceability aspect of the device, where detecting the health of various components will help in identifying the exact issue and providing the required support to the user in resolving the issue in a significantly less time compared to the existing devices. KalAssist application communicates with KalArm via Bluetooth. KalArm is an electro-mechanical product with integrated firmware. One of the key design considerations was that the overall dimensions of KalArm had to match with normal human hand dimensions. To achieve this, we needed miniature motors, sensors, and high-strength lightweight materials. One of the challenges we faced was with regards to the linear actuators that were required to open and close the fingers. We needed miniature linear actuators that could fit in the palm while also offering high torque, but we could not find any such actuators in India. We took it as a challenge and developed our linear actuators with self-locking ability that can handle up to 15Kgs load. One other challenge that we faced was related to the thumb position feedback system. We needed something accurate, small, and durable. Systems used in existing bionic hands were way too costly and not reliable. To address this issue, we developed our own contactless position feedback mechanism for the thumb swiveling system in KalArm. We have also filed a patent for the same. During the development of the prototype, we realized that the usage of wet EMG electrodes was not a good option as the user had to replace the electrodes very frequently. After research, we found that the EMG sensors that are currently used in the Indian market are being imported and a pair of dry EMG sensors cost more than INR 1 lakh. We took that as a challenge and built our EMG sensors which not only capture the EMG signals but are intelligent enough to detect if the user is wearing the bionic hand or not and sends the feedback to the control system so that the device can enter power-saving mode when not in use. We have also filed a patent for the same. Currently, there are more than 6 million amputees in India. Most of the amputees in India use mechanical and cosmetic hands that serve no purpose. In the last couple of decades, people have moved towards Myo electric hands that just open and close. Most amputees cannot afford advanced bionic hands and are eagerly waiting for an affordable bionic hand. KalArm is 10 times more affordable than western alternatives while offering plenty of Industry-leading features. Since the launch, we have got more than 500 requests from India, Sri Lanka, and Bangladesh. We are currently working on setting up the Manufacturing plant (as per ISO standards) for bulk production and after-sales service. Makers Hive will continue to innovate in the Med-Tech domain and consistently work towards making world-class assistive technology affordable. We are planning to venture into Exoskeletons for enhanced mobility and the paraplegic, Bionic eyes for the visually impaired, and other bionic products. article/everything-you-need-to-know-to-design-and-build-your-own-custom-custom-lcd-displays

Everything you need to know to Design and Build your own Custom Segment LCD Displays

and a low tooling fee too. At firstthought, designing a custom segment LCD might look like aHerculean task, but trust me that it is easier than it seems. In this article, we have summarised and compared the display types and available technologies which are required to construct a custom segment LCD. We have also provided a flowchart that can act as a step-by-step guide while you design your own custom LCD. We have also provided the process we followed, a require gathering sheet we used for communicating our needs to the manufacturer, and afew other data and the quotation we received from the manufacturer.

Common Terminology used in Segment LCD Displays

Before we dive deep in, you should know about the common design terminologies associated with segment displays and what they mean. ᾠIt is the smallest unit that can be individually controlled, it can either be in the shape of a bar, dot, or icon. ᾠElectrical connection terminal connected to multiple segments ᾠElectrical connection terminal which is connected to only one segment. : A silhouette of any shape can be placed on the glass which enhances the ability to display data. For example, a symbol of a heart can be made to denote heart rate or an icon for a low battery to show that the battery needs to be charged. Icons are counted as a single pixel or segment and can give a lot more details than similar-sized text. ᾠIt denotes the time in which the segment is energized, it is given by the on-time by total time per frame. ᾠIt denotes the number of different voltage levels used in driving the segments, static drives (explained later in this article) only have 2 voltage levels or 2 bias voltage while multiplex drives have multiple voltage levels. For example, 1/3 will have 4 bias voltages.

How Segment LCDs Work?

are special materialsthat havetheirmolecules aligned in the same direction. If the light waves passing through polarisers have the same orientation as the filter, then the molecules of lights are absorbed by the filter, hence reducing the intensity of light passing through it, making it visible. w.r.t to the polarizing filter, obstructing the light in that particular area as shown in the figure below. Hence, that area becomes darker and prominent.

Why do you needCustom LCD Display?

A custom LCD is important for maximizing the efficiency of the display area by adding custom symbols and characters. It also helps in reducing the cost and improving energy efficiency of the product. A higher number of custom symbols and specified placement of numerical and alphanumerical characters makethe display more informative and readable for the user. This makes it look better than the plain old boring displays we get in the market. Furthermore, we can specify the viewing angle, contrast, and other specifications which can increase durability or give a better value for money for our intended usage. A typical Custom Segment display is shown below, we will also show you how to design and fabricate the same further in thearticle. The LCD display doesn’t emit any light of its own, therefore it requires an external source of illumination or reflector to be readable in dark environments.

Display Types

While designing a custom segment LCD display, we have the leverage of choosing a lot of parameters that affectthe final product. From the color of the display to the illumination technique and color of illumination as well as the type of input pins. Some important considerations we need to take while designing a custom 7 segment display are - thetype of display, i.e. positive or negative, illumination method, driving technique, polarising type, and connection method. All these design criteriaare explained below: Positive and negative displays can be easily distinguished by the colour of the background and characters. Some common differences between the positive and negative displays are:
Dark image on light backgroundLight image on Dark Background
Front and rear polarizers are perpendicular to each otherFront and rear polarizers are aligned to each other
Used in areas with high ambient light, the backlight can also be used.Used in areas with low ambient light, hence the backlights are often used.
Background can be of multiple coloursPixels can be of multiple colours
Can be used in any display techniqueOnly possible with transmissive display
without using a backlight. are compared below:
BrightnessSizeInverter requiredPower consumptionDurabilityLife (in hours)
MediumSmallNoLowHigh100,000
HighMediumNoHighLow10,000
LowSmallYesLowHigh15,000
HighMediumYesMedium60,000
MediumSmallNoHighHigh100,000
For displays that needto be used for budget-friendly devices that shouldbe small and rugged, LED lights are preferred for the displays due to the highdurability and lowcost of operations. For highbrightness, CCFL and Incandescent lights can be used. that can be used in theLCD display, the properties and difference are given below:
, the display is illuminated through backlight, embedded in the display, an outside source of light is used for illumination of the display, can be illuminated through a backlight or the outside ambient lighting
Contrast is better than transreflective polarizer but not as good as reflective polarizerIt has the highest contrast ratioContrast is not as sharp as the reflective polarizer
Without a backlight it is difficult to be readBacklighting is not possible due to an opaque reflectorIt can be used with or without a backlight
Consumes highest energyConsumes lowest energyConsumes low energy when backlight is turned off.
are best to be used forfront reflectors. If the device has to be used without backlight, then we can select a reflective polarizer for the back-panel as it gives the best contrast ratio. Displays can be categorized into two types, passive displays, and active display, passive displays are simpler to construct as they have 2 connections at each segment, the conductors comprise of an Indium Tin Oxide to create an image, whereas the active displays use thin-film transistors (TFT) arranged in a grid. The name is due to its ability to control each pixel individually.
Passive DisplayActive Display
Twisted Nematic (TN)STNFSTN Film Super-twisted nematicTFT Display
CostLowmediumHighVery High
Viewing angleLowMediumHighVery High
Contrast sharpnessLowMediumHighVery High
Power ConsumptionLowMediumHighHigh
Operation temperature range-10 to 60 C0 to 50 C0 to 50 C
If we need to display a fixed set of data, then we can select a passive display as it is cost-effective and energy-efficient. It dictates how each segment is connected within the display. There are 2 drive methods, static drive, and Multiplex drive.
Static DriveMultiplex Drive
Segment pinsIndividual pins for all segmentsMultiple segments can have the same pins
Common pinOnly one common pin in the LCDMultiple common pins
Complexity of operationEasier to operateComplex to operate
Most optimum applicationOptimum for LCDs with few segmentsOptimum for LCDs with a large number of segments
Operating voltageSingle operating voltageMultiple operating voltages
Contrast RatioBetter contrast ratio than multiplex driveLower contrast ratio than the static drive
should be preferred as it has multiple common pins, hence reducing the total number of pins required to drive the display. LCD interconnections are used for connecting the devices with the LCD screen. They are mainly of 3 types that are:
Elastomer connection or Zebra stripSilicon Strips of alternate conductor and insulator. Fast assembly and disassembly. Preferable to use in an environment with high vibrations, but are not suitable for harsh environments. Yields higher conduction than pins Requires a specialized compression bezel Minimum contact patch 0.5mm
PinsAttached directly to the display. Easiest to work with during product. prototyping or production of smaller batches. Provides excellent protection from a harsh environment with vibrations and shock. Have the lowest number of interconnects per inch. Minimum contact patch 1.5mm
Flat Flex CablePCB and LCD are connected by flex cable using heat and pressure. Suitable for harsh environmentsand offer better protection to breakage due to external stress. A high density of contact points. Not suitable for smaller costs as initial setup cost is high. Minimum contact patch 0.28mm
will work best for you can be defined as the angle w.r.t. to the bias angle at which the contrast of segments is legible. To improve the viewing angle in an LCD, a Bias is incorporated in the design which shifts the nominal viewing angle with an offset. Another technique is to increase the Voltage, it affects the bias angle, making the display crisper when viewed from a direction. For example, the viewing angle of a TN type TFT LCD is 45-65 degrees. Extra-wide polarising film (EWP) can increase the viewing angle by 10 degrees, using an O film polariser can make the viewing angles 75 degrees but these come at a cost of reduced contrast. Anti-glare filters are bonded with the top polarising filters using adhesive. It improves the viewability by re-directing light waves so they don’t reflect back towards the viewer thus reducing glare. Newer materials are capable of reducing the front glare by up to less than 0.3%. which are described below:
Chip on board or surface mounted devicePCB is mounted behind the glass. It can contain extra circuits of the product in addition to the LCD circuitry. Connections have to be designed on the display. Higher designing cost and higher cost due to extra components. Complex assembly process.
Chip on glassUtilises the LCD glass to have the driver circuit, thus reducing the size. The COG LCD is connected to other circuits with above-mentioned LCD connection methods. All connections such as a driver and ICs are present on the display. Lower designing cost and lower cost of parts. Simple assembly process.
COG can be used as it is cheaper and makes the assembly process simpler, but if the dimensions are a constraint, then the COB is also a viable option.

Case study for designing a custom LCD

Our product needs to display the following data: 2.5-micron and 10-micron particulate matter (PM) suspended in the air; the units should be in parts per million (PPM). CO2 in the air in PPM along with total volatile organic compounds present in the air in parts per billion (PPB). To make the product more usable, we included time in 24-hour format, Temperature in oC, Battery status, loudspeaker status, Bluetooth status, and Wi-Fi status. And for some personal touch, we also added how good the air quality in the room is by using 3 different smileys. We realized that it was impossible to provide all these data in a generic LCD available in the market, thus decided to build a custom LCD for our project. A step-by-step flowchart is shown below to walk you through each and every step of selecting components and getting your custom segment LCD manufactured. We started by listing down our requirements and drew a mock-up of the display on paper. After finalizing the placement of all the segments and icons on the prototype sketch of the display, we then decided which all icons and segments have to be kept on for the whole time and which needs to be driven. Realizing that there are too many segments, characters and icons, hence we selected a multiplex drive with 8 common pins which helped us bring down the total pins from an estimated 180 pins to less than 40 pins. Since the device was meant to be used inside houses and offices, which are more often than not well lit and protected from environmental conditions, we opted for a positive mode display. For superior contrast ratio and better viewing angle, we chose a Film Super Twisted Nematic Display (FSTN) with a drive condition of 1/8 Duty and bias of 1/4. Usually, the displays are mounted at a height of 4.5 feet from the ground, thus the viewing direction was selected to be 12'O clock with an operating frequency of 64Hz. We selected a Transmissive polarizer for the front glass and a reflective polarizer for the rear glass so that the natural light can pass through the front panel and the display can achieve the maximum contrast without the need for backlighting and we opted for the pin type connectors as they are easy for prototyping and are suitable for harsh environment with a lot of vibrations and shocks which best suited our purpose. In the above image of a custom display design, we sent to the manufacturer, the red lines over multiple characters indicatethat all these are considered as a single segment. For the sake of simplicity, we added test like T, S, U, B to denote Text, Symbols, Units, and Battery respectively. These characters were followed by numbers to simplify communication between us and the manufacturer. For example, if we needed any particular text or symbol to remain on, we can easily specify that to the manufacturer by using the corresponding text for that segment. is shown above which a customer needs to fill to specify all the details to the manufacturer. we got from one of the manufacturers. As you can see, the cost is based on the quantity. Higher the quantity, lower the cost. Apart from the cost per quantity, there is one more component called tooling fees. Tooling fee is a one-time fee charged by the manufacturer. It is for the technical design, support, and customization of the product. Customization of PCB or tooling of LCD can drive the tooling price higher or lower. The tooling time and cost depend on how detailed and accurate designs you sent to the manufacturer. They then send the exact dimensions and technical details of the product they will be manufacturing. Once you confirm the design, they manufacture and ship the product which might take 4-8 weeks to arrive depending on the size of the order and mode of transportation selected. A custom segment LCD can help you personalize your product while also saving the overall cost of your product. The whole process will take you around 2-3 months, which will include the designing phase, prototyping phase, and getting your custom segment LCDs delivered to your doorstep. Higher ordering quantity will reduce the cost per piece of each unit, thus driving down the cost of your final product. article/an-engineers-introduction-to-shakti-platform-and-how-you-can-get-started

An Engineer’s Introduction to Shakti Platform and How you can get Started

, we pay around 45k INR more than any US-based customer. itself, by an Indian company with parts and technology fully developed in India from scratch, maybe with some help from already existing open-source designs as a base?That would not only cut down the costs significantlybut also have many other benefits like specially customized products for their own country like Xiaomi does for the Chinese market. For those of you who are aware of the complexities of designing optimized and reliable hardware, this might seem to be far-fetched, and believe me, it probably is. However, it does not mean that we should continue relying on others for accomplishing something that we can do on our own, just because it is currently not feasible. Changing circumstances and diplomatic ties affect the import-export of products and last year it was made pretty evident to the world that they were extremely dependent on China for their manufacturing needs. If something affects this import-export, it has huge implications in India as well as the world as a whole and hence the government finally decided to develop its own microprocessor technology and the “Shaktiᾠproject is one of the few attempts in this direction. ISA and are designed specifically for different categories of applications, like the E-class, which is for basic microcontroller applications. , a startup that is going to come out of IIT-M with the core members of the Shakti project involved as founders. They have the aim of running on a business model similar to that of Qualcomm i.e., they mainly wish to focus on designing and IP creation rather than manufacturing, which interested companies can outsource or handle on their own. , who licenses manufactured chips to other companies, like mobile manufacturers but does not own their own foundry or chip manufacturing unit. Shakti might very well fit as the Qualcomm of India. However, the main difference here is that Shakti developers don’t look for royalties as the designs are inherently open source. This makes the architecture cheap and affordable to everyone, while still keeping some reasonable doors open for revenue generation, as the sale of self-branded chips. Companies and consumers willing to support the initiative are more likely to go for them instead of some other option, even if it is based on the same open-source architecture. If things go well, we can expect products running the Shakti processors within a few years. The Pinaka runs on the Artix7-35T and is meant for lightweight embedded applications. The latter two run on the Artix7-100T board and are meant for heavier applications. The Vajra can even run a very lightweight version of the Linux OS. Hence, you either need to have theArtix7-35T board or Artix7-100T for running the MCS for the above boards. are supported. However, since Arduino does not support 64 bit boards, the Vajra board is not supported on Arduino IDE. Here are the specs for the three architectures: development. So, here are some useful links: User manual for the shakti system Register mapping document, though it is missing some things: Youtube video can help you upload the MCS and program files into the Arty board Blog that explains how to setup an ubuntu environment for bare metal C or ASM coding for shakti Guide for using PlatformIO IDE with Shakti Guide for using Arduino IDE with Sakthi Before starting with anything, do not forget to upload the MCS and program files onto the board for your preferred architecture. Refer to the above video for that. in detail stay tuned. The Shakti project might not be fully ready, but it is absolutely worth trying out if you would like to understand how chips are architectures are made, how FPGAs work, etc. More than anything, the next time you feel frustrated about the perils of using imported electronics, knowing this will change in the coming years will probably make you feel better. article/how-to-replace-a-comparator-ic-using-op-amp-parameters-to-be-considered-for-efficient-design

How to Replace a Comparator IC using Op-Amp? Parameters to be Considered for an Efficient Design

is the first choice for any designer to comply with the design requirements and in most cases, the Operation amplifiers will satisfy the requirements as expected. But, why do we use Operational Amplifiers as Comparator? are preferred over the dedicated comparator because of any one of the following reasons. In most of the circuits, the Op-Amps are the mandatory component to process the analog signals. So, commonly the multichannel Channel Op-Amps are selected for a particular circuit and some of the channels are used for true Op-Amp requirements and the remaining channels can be used for the Comparator requirements. With this, the single component satisfies both Op-Amp, comparator requirements which prove beneficial in terms of reduction in the size of the PCB, reduction in the cost of extra component and reduction in the inventory of extra component and also can save a decoupling capacitor which is placed between Vcc to Gnd of any Op-Amp or comparator IC. In some of the applications like simple LED indications, turn-on/turn-off simple transistors based on threshold limits, DC, and low-frequency signal comparison circuits, the simple Op-Amps are quite sufficient to satisfy these uncomplicated requirements. If some of the unused Op-Amp channels are available in the circuit, then the Circuit designers generally use that unused op-amp and finish the requirements. There are different types of circuit specifications available depending upon the design. So, the required comparator specifications also varied based on design requirements. But, comparator availability to satisfy every design requirement is lesser whereas the Op-Amp segment has plenty of options with respect to technology, cost, and packaging, etc. So, in most cases, designers need to go with the Op-Amp to satisfy the comparator requirements. is not an easy task. It requires more insights on important Op-amp parameters to match the Comparator Performances with Op-Amps. This article will provide the details of the impact of Op-Amp, which is used as a comparator with different practical circuit requirements.

Comparator Circuit for Simple DC Voltage Applications

Consider a Home UPS system that operateswith a Single Lead Acid Battery, this system requires a Low Voltage indicator to warn the Customer about the present low voltage condition of the battery. The Voltage level of the Lead-acid battery is 11.7V to 13.5V under open-circuit conditions. So, with margin, the low current buzzer and warning LED should be turned on when the battery voltage level goes below 12V. The selected LED and Buzzer voltage is assumed to be 3V and the operating current is assumed to be 3mA. The Low Voltage Indicator circuit can be implemented using a Comparator, as shown in Figure 1. The constant 3.3V reference is applied to the non-inverting comparator pin using Zener Diode. The R_Zener is selected based on the Zener Current value. Based on 1N4728A Datasheet, the Zener Current in this circuit is equal to its test current of 76mA. The 110.5 value is not a standard resistor value. So, 100 is selected for R_Zener. The voltage divider connected to the inverting pin of the comparator provides the Battery Voltage detail and whenever the voltage at inverting pin goes below 3.3V, the LED and Buzzer will be activated by the transistor inside the Comparator. for any application, the important parameter to be considered is the Output Configuration of the comparator. The comparators come with two types of output configurations as shown in Figure 3 and the output load of the comparator has to be carefully configured based on the type of comparator output configuration. For Open Collector Output based configuration, the pull-up resistor should be placed between the Output Pin of the comparator and Source, which energies the output load. It can either be a Comparator Vcc power supply or another power supply. In Push-Pull Configuration, the maximum comparator output voltage will be nearly equal to the Comparator Vcc and the output load is directly connected to the output pin of the comparator. The below figures show the different output configurations for comparators obtained from the manufacturer datasheets. As per the datasheet, the LM339 has the Open Collector Configuration. So, for the output load, a push-pull resistor and power supply are required. The Low Voltage Indicator Circuit using LM339 Open Collector Output Configuration is shown in Figure 5. Here, the LED and Buzzer are connected with a Pull-up resistor and connected to the comparator output (Open collector) terminal. The Pull-Up resistor which is used to control the current through Buzzer and LED is selected based on the below calculation. The LED and Buzzer voltage is assumed to be 3V and the operating current is 3mA. LED and Buzzer is connected in series with R_CONTROL resistor and the current in a series circuit is the same which is equal to 3mA. Meanwhile, the Output configuration of the LMV7239 Comparator shown in Figure 6 has the Push-Pull type output configuration. With LM7239, the output load is directly connected to the output pin of the LM7239. The LM324 Op-Amp internal schematic is shown in Figure 7 and it has the Push-Pull output configuration and all Op-Amps have the Push-Pull Output Configuration only. While connecting directly to the output of the Push-Pull configuration comparator/Op-Amp, the two important points should be taken into consideration. The Load Voltage requirement should be less than or equal to the Comparator Output Voltage. The Load Current Requirement should be less than the Comparator output current specification. While using Push-Pull Configuration-based comparator and Op-amp, the Output voltage swing is the important parameter that defines how the output load can be connected with the output terminal of the Comparator or Op-Amp. = Vcc = 5V). So, for 5V Vcc, the high rail output voltage varies between 4.75V and 4.85V. The low rail output voltage varies between 230mV to 450mV. Likewise, the Op-Amp also has the Push-Pull output configuration, and the output voltage swing of LM324 Op-Amp is shown in the Figure given below. , we are getting a maximum of 4.85V for the same 5V Vcc. Whereas, if we search for the High voltage output level in the LM339 comparator, the data will not be available because the output voltage level of LM339 will depend on the supply which is connected to the output transistor For the implementation of Low voltage indicator with LM7239 Comparator and LM324 Op-Amp, the LED and Buzzer requires 3V individually. So, the series connection of LED and Buzzer will require a total of 6V output and can’t be delivered by both LM7239 and LM324. So, the LED and Buzzer are connected in series and the R_Control resistor value can be calculated as below. The loads are connected in parallel so the total current requirement is 6mA. The 308.3 and 83.3 are not the standard resistor values. So, 300 and 82 standard values can be selected instead. is shown in Figure 10. In this circuit, the output load voltage requirement is less than the comparator or Op-Amp output voltage level. In case the LED and Buzzer need to be connected in series, then the circuit has to be modifier as shown in Figure 11 with external MOSFET or Vcc that can be increased to a higher voltage level based on Comparator or Op-Amps maximum voltage levels.

Parameters to be considered on Input Pins

The important parameter that should be considered at the input pin is the Common Mode voltage of the inverting and non-inverting Pins. In LM324 Op-Amp the Common-Mode Voltage Range is given in the below figure. LM339 also has the same common Mode voltage level and LM7239 accepts up to Vcc+0.1V. As per the datasheet, it is Vcc-1.5 = 5-1.5 = 3.5V. So, at any condition, the input voltage at any pins should not exceed the Common Mode Voltage. As per the above implementations, the Voltage reference by Zener diode at the Non-Inverting terminal is 3.3V and it is under the Limit of 3.5V. At inverting terminal, the voltage obtained from the voltage divider is less than 3.5V when the battery voltage is less than 12.9V. But, from the specification, we can know that the battery voltage is varied between 11.7V to 13.5V and more than 12.9V, the design will exceed the common-mode voltage limit and create problems in circuit operation. To mitigate this issue in LM339 and LM324, there are two possible ways available. Vcc of the Comparator or Op-Amp can be increased to the higher voltage level Voltage reference at non-inverting pin and voltage divider can be modified based on the Common Mode voltage level. (Here instead of 3.3V reference 2.7V reference and voltage divider values can be modified accordingly). Instead of LM339 and LM324, the LMV7239 can be used which has the 5.1V Common Mode voltage range. While using Op-Amp as a comparator the basic deciding feature is a differential Voltage specification of Op-Amp. The differential voltage is the difference between the Non-Inverting and Inverting pin voltage levels. In most of the comparators, the differential voltage will be equal to the Vcc. But, in Op-Amps, it will vary based on the Op-Amp model. For some of the Op-Amps like LM324 have a differential voltage level equal to the Vcc and other Op-Amps have less than the differential voltage level of less than Vcc. In some cases, the Op-Amps have bidirectional back-to-back protection diodes at the input terminals of the Op-Amp. In this case, the maximum allowed voltage difference between the input terminals is only around 0.7V. For example, if the Input Voltage reference at Non-Inverting input is 1V, then at inverting pin, the maximum allowed voltage variation is between 0.3V to 1.7V. Lesser than or higher than the mentioned voltage limit, the Op-Amp circuit may misbehave and lead to wrong results. The Differential mode voltage range of LM324 is given in Figure 13 and the allowed voltage levels are much higher than our requirement. In Push-Pull output configuration, the entire load current is supplied via the Op-Amps or the comparators. So, the current requirement should be lesser than the Output Current Specification of the Op-Amp or Comparator. Also, with this comparator operation mode, the Op-Amps work under saturated voltage conditions. So, the increase in load current will also lead to more power dissipation in the Op-Amp and will increase the Op-Amp IC temperature and strict control is required on this part.

Conclusion

Based on the above data, the replacement of Comparator with Op-Amp is quite an easy task with the careful considerations of different input and output voltage parameters for very simple DC voltage applications. However, in High-Frequency applications, the replacement is not easy and it should consider Op-Amp frequency responses, Slew Rate, and propagation delay parameters, and replacing it without detailed analysis will lead to complete design failure. article/top-30-diy-iot-projects-from-basics-to-advanced

Top 30 DIY IoT Projects - From Basics to Advanced

“Internet of Thingsᾠis one of the most used technology buzzwords of the current times. After all, who’d have guessed that one day we'd have access to technology that will allow us to connect commonplace objects ᾠsuch as lights, kitchen appliances, door lock systems, baby monitors, and electrical appliances ᾠto a centralized and integrated network and operate them from anywhere in the world. The ‘Thingᾠin IoT can be any sensor, actuator or any kind of device with built-in-sensors that can collect and transfer data over a network without manual intervention. The Internet of Things enables devices to communicate with each other and make decisions on their own without any human interventions. In this getting started guide for the Internet of things we are going to present some interesting project ideas that you can build to get hands-on experience. This list of projects ranges from some basic projects like controlling an LED from awebserver to advance projects like complete home automation projects. So, without further ado, let’s get into it!

1. Controlling LED using NodeMCU and Google Firebase

This is a very basic project to kickstart your Internet of Things journey. As the name suggests this project guides you to set up a Google Firebase cloud and then control LED connected to NodeMCU GPIO pin wirelessly. Firebase is Google’s database platform which is used to create, manage and modify data generated from any android application, web services, sensors, etc. For more information on Firebase, please visit the official website of Google Firebase. Once you have finished setting up your device on Google Firebase, you can control it from anywhere in the world.

2. NodeMCU Webserver to Control an LED

Now to take you one step ahead towards IoT development, this project includes building a web server to host a webpage, and control any appliance remotely from anywhere in the world. This project uses ESP12E NodeMCU as webserver, although any ESP module can be used here. In simple terms, Web server is a place where we can store the web pages, process them and deliver them to the web clients. Now, what is web client? It is nothing but a web browser installed on our mobiles and PCs. A protocol is used to establish and transfer information between web client and server. This protocol is known as Hypertext Transfer Protocol (HTTP).

3. Controlling a WS2812B RGB LED Matrix with Blynk

Over the course of a few years, RGB LEDs are getting popular day by day due to it's beautiful color, brightness, and enticing lighting effects. That is why it is used in many places as a decorative item, an example can be the home or an office space. Also, we can use the RGB lights in the kitchen and also in a gaming console. They’re also great in a kid’s playroom or bedrooms in terms of mood lighting. This IoT project includes a Neo pixel Based RGB LED matrix shield, Arduino, and Blynk application to produce many fascinating animation effects and colors which we will be able to control with the Blynk app.

4. Controlling Servo Wirelessly

This is another beginner-level IoT project to control Servo Motor over Wi-Fi using a Webpage. This project includes an Arduino Uno, Servo Motor, and a Webpage with a slider. The ESP8266 will establish a connection between the servo and the web browser through the IP address and then by moving the Slider on the web page, the servo will move accordingly. Even by setting Port Forwarding on your router, you can control the Servo from anywhere in the world over the internet.

5. IoT Weather Station

This is one of the excellent IoT project for beginners. This IoT-based weather station is specifically designed to facilitate the reporting of weather parameters over the Internet. This is one of the best IoT projects where the system is embedded with temperature, humidity, and pressure sensors that can monitor the weather conditions and provide live reports of weather statistics over a webserver. The weather data is updated live on the online webserver. So, you can directly check the weather stats online without having to rely on the reports of weather forecasting agencies. This IoT project includesESP32, DHT11, and BMP180 sensor to get the weather data and then send it to the webserver.

6. Reading Data from Internet using Arduino

Projects listed above only updatedata tothe internet, but what if we want to read data from the internet. Don’t worry, this project includes a step-by-step guide to read data from the internet using an API. It uses ESP8266-01 Wi-Fi module with Arduino Uno to read the time, date, temperature, and humidity from the internet using an API. Then send these values to an Arduino board and display them on the 16*2 LCD screen. By building this project you can learn about interfacing ESP8266 with Arduino and reading different types of data from internet using APIs. Before we dive in, it is important to know how actually this thing is going to work. Basically, we have to start with the ESP8266-01 module. We will be using the Arduino IDE to program the ESP8266 and the code will be written to use an API to read a JSON file through http request. Then we will phrase this JSON file to extract only the required information from the complete JSON file. Once the information is phrased, we will print it out using the serial communication. These serial lines will then be connected to the Arduino, so that the Arduino could read the information sent from ESP8266. Once the information is read and processed, we will display it on the LCD screen.

7. Publishing Data to Google Firebase

Microcontrollers have small internal memory which is not enough to save sensors generated data for long time, either you have to use some external memory device or can save the data on some cloud using internet. To rectify this kind of problem,we always look into the ways where we want to monitor the sensor data in real-time from anywhere without any physical presence at that place. The Google Firebase Cloud can be used in this scenario where we just have to interface some controller, which can be connected to internet and can be able to exchange data with cloud server. This project helps you in sending the data to Google Firebase cloud. This project uses temperature & humidity sensor DHT11 and a NodeMCU ESP8266 Module to log the temperature and humidity in real-time on Google’s Firebase database server.

8. Patient Health Monitoring System

Health monitoring is the major problem in today’s world. Due to the lack of proper health monitoring, patients suffer from serious health issues. There are lots of IoT devices now-a-days to monitor the health of patient over internet. Health experts are also taking advantage of these smart devices to keep an eye on their patients. With tons of new healthcare technology start-ups, IoT is rapidly revolutionizing the healthcare industry. This IoT-powered Health Monitoring System records the patient heart rate and body temperature and also sends an email/SMS alert whenever those readings go beyond critical values. Pulse rate and body temperature readings are stored over ThingSpeak and Google sheets so that patient health can be monitored from anywhere in the world over internet. It also has a panic button so that patients can press it invcase of emergency to send email/SMS to their relatives.

9. Water Quality Monitoring System

This IoT-based project involves building a Water Quality monitoring system that can remotely monitor water quality. This project holds immense value for the agriculture sector to check and maintain water quality. It can monitor Soil moisture, pH of water, Temperature, etc. This project includes an Arduino Uno, NodeMCU, Gravity Analog pH sensor, DS18B20 temperature sensor, and Soil moisture sensor. NodeMCU board helps to connect the system with the Internet and facilitates data transmission. By building this project you will get to know about the working of different sensors and the serial communication between Arduino and NodeMCU.

10. LoRa Communication between ESP32 and Arduino

LoRa is a wireless Radio frequency technology introduced by a company called Semtech, intended to be used to transmit bi-directional information to a long-distance without consuming much power. This LoRa based project uses two LoRa modules as transmitter and receiver to transfer data between Arduino and ESP32. By building this project you can learn about interfacing LoRa module SX1278 with ESP32 and Arduino Uno. ESP32 LoRa setup will request the weather data from an API for any given city and send it to the Arduino LoRa setup. Then Arduino LoRa will receive the data and display it on 16x2 LCD. So ESP32 LoRa will act as a transmitter and Arduino LoRa as a receiver. An OLED is also connected at ESP32 to display the temperature and humidity on the sender's side.

11. Publishing Data to AWS Cloud

Raspberry Pi has always been the first choice for developing IoT-based applications if some level of computation is involved. With the flexibility of python and strong developer community, it is very easy to collect, log, analyze or report a set of data using the Pi. This project helps you to send data to Amazon AWS using Raspberry Pi. This project uses DHT11 sensor to read the value of Temperature and Humidity, then connect to the AWS IOT service and update the sensor values using the AWS IOT SDK. This data then can be visualized in the Amazon IOT console.

12. IoT Based Electricity Energy Meter

We all know about electricity energy metersthat are installed in everyone’s house or offices to measure the electricity consumption. At the last of every month, many of us get worried about the high electricity bill and we have to look at the energy meter once in a while. But what if we can monitor our electricity uses from anywhere in the world and get an SMS/E-mail when your energy consumption reaches to a threshold value. This IoT-based project enables you to build a Smart Electricity Energy meter using Arduino and ESP8266 Wi-Fi module which can not only send you the SMS/Email of your electricity Bill but also you can monitor the energy uses anytime and from anywhere in the world. It uses a Current Sensor ACS712 to measure the energy consumption, and IFTTT platform to send the SMS/E-mail notifications.

13. IoT Based Smart Jar

This is one of the interesting IoT project ideas to create. This smart Jar Project allows you to keep track of the stocks, and it is easily accessible from the internet. The Jar includes an ultrasonic sensor at the top of it and uses the ultra-sonic reflected waves to figure out at what extent the Jar is filled and how much space is left inside the jar. Whenever the amount of content changes in the jar, it is sensed by the NodeMCU, and the same is updated on the webserver. This can be helpful to track supplies and plan for restocking from anywhere in the world.

14. IoT-based Event Management System

Another interesting and easy-to-build IoT project. This RFID Based IoT Enabled Event Management System that not only monitors the entry log but with the help of IoT technology,it can also send the Log and Entry data directly to a dedicated server that can handle all the authentication, authorization, and management making the whole process seamless. This project uses an NodeMCU with EM18 RFID Reader module, RFID Cards, and 16*2 Alphanumeric LCD. Building this project will help you learn about interfacing RFID module with NodeMCU and sending the data to Thingspeak Cloud.

15. Smart Irrigation System

Most of the farmers use large portions of farming land and it becomes very difficult to reach and track each corner of large lands. Sometime there is a possibility of uneven water sprinkles. This result in the bad quality crops which further leads to financial losses. In this scenario, Smart Irrigation System using Latest IoT technology is helpful and leads to ease of farming. The Smart irrigation System has wide scope to automate the complete irrigation system. This project uses ESP8266 NodeMCU Module, Water Pump Module, Relay module, Soil Moisture Sensor and DHT11 Sensor. It will not only automatically irrigate the water based on the moisture level in the soil, but also send the Data to ThingSpeak Server to keep track of the land condition. The System will consist of a water pump which will be used to sprinkle water on the land, depending upon the land environmental condition such as Moisture, Temperature, and Humidity.

16. Smart Parking System

With the growing popularity of Smart Cities, there is always a demand for smart solutions for every domain. The IoT has enabled the possibility of Smart Cities with it’s over the internet control feature. A person can control the devices installed in his home or office from anywhere in the world by just using a smartphone or any internet connected devices. The Smart Parking industry has seen a number of innovations such Smart Parking Management System, Smart Gate Control, Smart Cameras which can detect types of vehicles, ANPR (Automatic Number Plate Recognition), Smart Payment System, Smart Entry System and many more. This project follows a similar approach to build a smart parking solution. This project uses an ultrasonic sensor to detect vehicle presence and trigger the gate to open or close automatically. The ESP8266 NodeMCU will be used here as the main controller to control all the peripherals attached to it.

17. Solar Power Monitoring System

In the area of renewable energy, solar energy is at the forefront, because producing energy by using the power of the sun is the easiest and commercially viable way of renewable energy. Speaking of solar panels, the output power of a solar panel output needs to be monitored in order to get optimum power output from the panels. This is why a real-time monitoring system becomes necessary. In a large solar power plant, it can also be used to monitor the power output from each panel which helps to identify the dust buildup. It also prevents any fault conditions during the time of operation. This project helps you build an IoT-based Solar Power Monitoring System by incorporating the MPPT (Maximum Power Point Tracker)-based battery charging technique, which will help to reduce charging time and improve efficiency. Also, it will measure the panel temperature, output voltage, and current to improve the safety aspect of the circuit. It also sends this data to ThingSpeak cloud services to monitor the output data from anywhere around the world.

18. Air Quality Index (AQI) Monitoring System

AQI Monitoring System is one of the best ideas to start experimentingIoT projects. Air pollution is a glaring problem in all parts of the world, and monitoring air pollution levels is a challenge that every country is facing. IoT-based air pollution monitoring systems can both monitor the level of air pollution in cities and save the data on web servers for future use. This smart air quality monitoring system uses an ESP32 with Nova PM SDS011 sensor, MQ-7 sensor, and DHT11 sensor. It measures the concentration of PM2.5, PM10, and Carbon Monoxide to calculate the Air Quality Index. The worst sub-index (or maximum of all parameters) determines the overall AQI. These AQI values are also published on Adafruit IO cloud so that it can be monitored from anywhere in the world.

19. Contactless Body Temperature Monitoring

Since the corona outbreak, it has become very difficult to identify those who are affected by the virus or not. To solve this issue, temperature devices are often used to measure body temperature. These devices have non-contact IR temperature sensors which can measure the body temperature without any physical contact. There are many temperature guns available in the market, but none of them gives any alert or email notification to higher authorities to take appropriate actions when the temperature exceeds a particular limit. This project uses a Raspberry Pi, MLX90614 IR temperature sensor, and Pi-Camera and sends email alerts with the image of the person if the temperature of any particular person exceeds the set value.

20. Surveillance Robotic Car

This project helps you build a web-controlled surveillance robotic car using Raspberry Pi and a webcam. This could be a useful and inexpensive security and spy tool, which has many configurable options and can be built in few hours. This project mainly uses Raspberry Pi, USB web camera, and two DC motor with Robot chassis to build this Robotic car. It has a web camera mounted over it, through which it gets the live video feed and the interesting part here is that it can be controlled from a web browser over the internet. As it can be controlled using webpage, means it can also be controlled using webpage in Mobile. The webpage has Left, Right, Forward, Backward links, clicking on which you can move the robot in any direction. This project uses “Motionᾠfor getting live Video feed from USB camera and used “Flaskᾠfor sending commands from webpage to Raspberry Pi using python to move the Robot, which are explained in detail in subsequent part of this tutorial.

21. IoT Based Smart Keychain

Agree it!!! It has happened to all of us. Many times, we misplace our keys and go searching for them everywhere in the house, and after a long search, we end up finding them with much distress. Now, the obvious solution here is to place your keys in their right place, but as engineers, what’s the fun in doing that. So, this project helps you build a simple IoT-based Smart Key Chain using ESP8266-01, Buzzer, and Battery. Now in case if you can’t find your keys and you remember that you have attached an IoT keychain to your keys, so you take out your phone and open Chrome, and open your Keychain Webpage. Then you click on the toggle button, and in moments, you hear a beep sound coming from your keychain and with this, you can easily track your keys.

22. Biometric Attendance System

A few years back if you were to tell someone that the Geyser and bedroom lights in your home are connected to internet, they would be baffled and might even criticize it as over-engineered products. But today, with the advent of IoT, Smart cities, etc the idea no longer sounds strange, we have devices around us that have become smarter by being able to communicate with the internet. This project aims to leverage this IoT into the boring attendance system to make it smarter and more effective. Most conventional attendance systems available today store the information over a micro-SD card and have to be connected to software via a computer to access the information. This biometric attendance system project uses an Arduino that scans for fingerprint and on successful identification of the person, it will log the information to a cloud platform like ThingsBoard by using the ESP8266 Wi-Fi module. This information can then be displayed in the dashboard of ThingsBoard making it available for the required authorities to view and analysis information over the internet without having any direct physical access to the hardware.

23. Lora Based GPS Tracker

Knowing the whereabouts of a particular object/person has always been comforting. Today, GPS is being extensively used in asset management applications like Vehicle Tracking, Fleet Tracking, Asset monitoring, Person tracking, Pet Tracker, etc. For any tracking device, the primary design consideration will be about its battery expectancy and monitoring range. Considering both, LoRa seems to be the perfect choice since it has very low power consumption and can operate on long distances. This project tutorial provides a step-by-step guide to build a GPS tracking system using LoRa, the system will consist of a Transmitter which will read the location information from the NEO-6M GPS module and transmit it wireless over Lora. The receiver part will receive the information and display it on a 16x2 LCD display. To keep things simple and cost-effective for this project we will not be using a LoRa gateway. Instead, will perform peer-to-peer communication between the transmitter and receiver.

24. IoT Based GPS Location Tracker

This DIY project tutorial, guides you to build an IoT-based GPS Location tracker using NEO-6M GPS Module. This Location Tracker Board consists of a NodeMCU, OLED Display Module, NEO-6M GPS Module, and 3.7 to 6V booster circuit. It also has a simple local webserver to display the location details. This webserver contains a link to directly check the location in Google Maps. So, if you want to check the location of a person that has this board just go to the webpage and click on the link and the exact location of the person will be displayed on Google Map. Apart from GPS module interfacing with NodeMCU this project also helps you learn PCB designing.

25. Voice Controlled Window Curtains

“Good morning. It’s 7 A.M. The weather in Malibu is 72 degrees…ᾠthese were the first words of JARVIS when being introduced in the Marvel Cinematics Universe. Most Iron Man fans should be able to recollect this scene and remember that JARVIS was able to open a window (kind-of) in the morning and give updates on time and weather. In the movie, the window Glasses were actually made of See-Through Touch Displays and hence JARVIS was able to make it turn from black to transparent and also display weather stats on it. But, in reality, we are far away from See-through touch screens, and the closer we can get is to control window blinds or constraints automatically. So, this project helps you build exactly that. The automated motorized blind would open and close automatically at pre-defined times. These Arduino controlled blinds can also take commands from Google assistant so that you can open or close your window blinds remotely through voice commands.

26. Voice Controlled Smart Rocket Igniter

This Smart Rocket Igniter project enables you to control your rocket using Alexa voice commands. Yeah, you read it right. This NodeMCU based rocket launcher has a very sturdy chassis made out of plywood, a reliable relay-based control mechanism, and a very unique mechanism for launching and reloading the rockets. So next time instead of firing rockets manually you could just command Alexa to fire them for you. The working mechanism of the circuit is very simple, the main component which is responsible for launching the rocket is the nichrome wire, and it comes in the form of a heating coil. This nichrome wire will act as the rocket igniter.

27. AC Fan Speed Control using Smart Phone

The whole concept behind creating the smart fan control system is to enable you to control the fan using Smartphone. A fan regulator circuit is a crucial component that is used to increase or decrease the speed of an AC Fan/motor according to needs. A few years back, you had a choice between a conventional resistive type fan regulator or an electronic regulator, but nowadays it's all been replaced by the electronic fan regulator circuit. This project helps you to build an IoT-based AC, Ceiling Fan Regulator circuit. Which will be able to control the speed of your ceiling fan with the help of an Android Application.

28. Smart Wi-Fi Video Doorbell

Nowadays, Security system is one of the most researched fields and with increasing security threats, companies are launching new smart security products to combat these threats. IoT is an added advantage in this field which can automatically trigger an event, like calling the police, fire brigade or your neighbor, in case of any emergency. This ESP32-CAM based and Smart Wi-Fi doorbell can easily be powered by an AC socket and whenever someone at the door presses the doorbell button, it will play a specific song on your phone and sends a text message with a link of video streaming page where you can see the person at the door from anywhere in the world.

29. ESP8266 based Smart Plug

While Smart plug products are already available in the market, like the popular Moko WiFi Smart Plug or Sonoff, they are a bit expensive and on top of that, it doesn’t give you the joy of building your own. So, this project can guide you to build your very own Smart plug using ESP8266 Wi-Fi module. The device that we built can easily be plugged into any exiting AC socket and then on the other end you can connect the actual load simply by plugging it into this socket on our device. After that, just keep the main switch of your socket always on, and you can control your Load directly from your Smartphone.

30. Voice Controlled Home Automation

One of the best ways to test your IoT skills is working on a home automation project. This project here is different, the idea here is to create a practical home automation board that can fit into our AC power units on our walls and stay concealed inside it. The board should not interrupt the normal working of our power unit switches, that is they should turn ON or OFF with manual switches as well. And without being said, it should also be able to control the same load with voice using Google Assistant and also set a timer so that any load can automatically turn ON or OFF during a preset time of the day. for upcoming new projects. If you wish to know more about IoT, here are some bonus project ideas that you can build: IoT Based Raspberry Pi Microwave Performing MQTT Communication with ESP8266/NodeMCU using Arduino IDE IoT Based IPL Scoreboard Log Data into MySQL Database using NodeMCU Google Assistant Based Voice Controlled Home Automation interview/runal-dahiwade-founder-of-peppermint-robots-talks-about-various-aspects-of-their-autonomous-floor-cleaning-robots

Runal Dahiwade, Founder and CEO of Peppermint Robots talks about various aspects of their Autonomous Floor Cleaning Robots

Whenever we hear the word floor cleaning robots, the very first name that comes to our mind isRoomba. No doubt, it has gained immense popularity, but it has some concerns too like it is noisy, it faces difficulty in transitioning. Another challenge thatRoombafaces is crossing over from hardwood floors to high-pile rugs and thick carpets. With the idea of overcoming these challenges and enhancing the technological aspects of floor cleaning robots, Mr.RunalDahiwadestarted the company, Peppermint Robots which builds autonomous robots. One of the floor cleaning robots from the company is Peppermint Pro. It is an extremely efficient autonomous floor-cleaning robot thatcomes with advanced features to fulfill the cleaning requirements. To discuss the designing and working of floor cleaning robotstheir company builds, we had a conversation with Mr.Runalwho is the founder and CEO of Peppermint Robots. Initially, I used to lead operations for an automotive aftermarket company, where we had a service vertical, which was extremely manpower intensive. As we were scaling up between 2017- 2019, I realized that the whole dependence on manpower for certain services becomes a challenge, if it is something very repetitive. We decided to do something with automation and that's how the journey to explore robotics started. We stumbled upon some great ideas and started building a car washing robot. With the guidance of mentors, we soon found that the commercial housekeeping space is a more evident, global, and available target market. We felt that any public or working space, such as airports, warehouses, industries, schools, colleges, hotels, and parks is cleaned every day, which is a repetitive and difficult physical task. Close to two and a half years back, the journey of Peppermint started. We set up the company in May 2019 to formalize our efforts. We were blessed to have a stellar team and my co-founder, Mr.Miraj. When it all came together, we found that our hypothesis and the technology make sense. We love what we are doing and what the whole industry for commercial housekeeping stands for. Also, we are very excited about our robots, which are currently on the field in western India and will soon grow and scale across India and beyond. We can categorize the floor cleaning space into two types. One is a personal space like home, house, small office, and then there is a public space like large offices, industries, warehouses, airports, railways, etc.Roombasare personal home cleaning robots with different grades and scales of machines, while we specialize and build commercial and industrial-grade robots. The first family of robots, we have built is for the floor and gradually we’ll get into vertical surfaces like walls and windows. There is a different type of floors that could be polished floor or cement floors. Our robots are good with six types of hardwood floors. Initially, we started with hard surfaces, but now we have a new dedicated line of robots built for soft floors like carpet and wood.Roombaand a similar grade of robots are household appliance-grade robots while what we build are large industrial-grade robots. Our smallest robot is a 200 kilograms, and tall table-like machine and that's how we are extremely different. Also, with such large machines, there is very less tolerance for the mistake. If theRoombaaccidentally hits your leg, it's probably acceptable, but if a 200-kilogram machine hits your leg that will not be acceptable. The approach of how its navigation happens and how its safety systems are built is very different. Three layers of safety and rigorous testing for over 18 months lead us to industrial-grade safe housekeeping robots. The current range of robots, we have is of floor cleaning robots. There are different types of floors. First is a large and contiguous open area like convention centers, airports, and parking lot needs to be clean in a more structured fashion taking the least time possible. For this, we use our virtual machine and create our pathfindingand navigation system stack from the ground up. Second is long, narrow stretches of floors like industrial gangways, lobbies. Such areas demand a smarter way of addressing as these areas will be used by everybody as well and there could be any other equipment or material moving around. We will either do long, narrow stretches at a time, so that neither we become an obstacle nor does any other moving object become an obstacle for us. We follow different philosophies when it comes to navigation stacks. The algorithm we have is based on structured cleaning in the minimum time possible. The third one is Mix use case in which we mix and match our stack, and deploy them on the field. Robots don't have eyes, we have to put eyes to it for which we use different sensors for varying sensitivities and merge that data for our integrated view. We use primary localizing sensors, 2-D or 3-D depth cameras for sensing more sensitive information in the environment. Apart from this, we have ultrasonic sensors and in the future probably radars. These three sets of sensors are used to deal with the different sensitivities of the environment because as a large robot, we have to not only look at the environment; we have to be mindful of people and machines around, and other features like pillar furniture, we also have to be very accurate about things like glass. Glass is transparent, sometimes it's very clean, and then the camera may or may not catch it very well. We have sensors to deal with that too. We use these different sets of sensors and bridge them together to make a more consolidated understanding of the environment. The higher focus is on the front end of the robot, but there is also a secondary set of sensors towards the rear. There are seven different layers in a scrubber dryer robot. TheLIDARis the primary sensor for localizing. We also use cameras and depth sensors for obstacle detection. Cameras allow us to capture feed that can be used to detect a lot of things, various kinds of people, furniture, machines, forklifts, baggage trolleys, etc. It’s important to note that such large machines have substantial battery packs and it's important to have an automotive-grade BMS. We have partnered with a company to get those done as per automotive safety standards. Apart from this, there are ultrasonic sensors, and the whole system also has physical buttons which are called emergency stop buttons. The onboard computers are so smart that we can detect a lot of external stimuli. For example, if there's a staircase, the robot should be able to detect it and stop. All of this is also connected back to our systems for enhanced learning from all the data. We have an option if certain customers wish to have real-time updates for the robots then we can do that. It's a seven-layer system with seven distinct components that work together to provide a great, safe technique of operating. Pune has an automotive manufacturing ecosystem, many large companies, good automotive grade fabrication experts, and vendors, and many other things. We leverage that ecosystem when we design the Peppermint pro and newer machines like scrubber dryers, carpet cleaners. It’s an autonomous moving machine, which cleans floors and it carries water. Initially, some of the challenges were to be very sure of our sub-assemblies. There are six sub-assemblies in our robots and every subassembly does its individual function, but they all have to work together. It's one thing to make prototypes, but very different to batch manufacture, and eventually mass manufacture. As a team, we had to deep dive into it, and as there was just no other way to do it. We make five or eight robots in a batch, depending on the cycle and currently, we have batch manufacturing of two of our robots in the pipeline. We have some really good supportive vendor partners who are specialists in certain areas. Getting it all together is a really big challenge both physically and functionally as mechanics should work together, fit together, and look proper. All these systems talk to each other and eventually, floor cleaning happens beautifully. Peppermint is best in class as we have a patented cleaning technology tech stack, which cleans the floor in a better way. We were lucky to have the right team members very early who have worked on different use cases, but similar subsystems, having deep experience in manufacturing. Moreover, the rich automation ecosystem of Pune helps a lot. As we have six sub-assemblies, we have the supply chain procurement of each of those sub-assemblies independent of each other. Scouting for the right part or material takes time, but once we are good, we try to narrow it down to one or two vendor partners and then start fabricating stuff. Some challenges which occur are usually in importing parts that are not yet made in India and theCOVIDsituation over the last almost one year now hampered the whole supply chain globally like shortage of old semiconductor or conductor which is impacting our work. We had to go to a plan B on one particular circuit to work. A colleague of mine -Vaibhav, who leads our entire packaging and product excellence, has been instrumental in getting these pieces together. We gather data for real-time analysis and then we dump it. Being autonomous robots, no one is looking at the robots when they're cleaning the area. There has to be some accountability to what's going on to the customers or the facility management companies who are overseeing housekeeping. We decided very early in our journey, that there has to be some visibility of how effectively the robot is working. So, based on this principle, we have real-time data which we gather from our robots and then differentiate it into categories. One is operational data which is about how much floor is cleaned in the shift or how much water is there and either the battery is properly charged or not. On the other hand, there is another bucket of data, which is maintenance data. As a large machine with lots of moving parts, this data helps to know what the health of motors is, are the laser and sensors getting data accurately, and if there is any red flag, you'd rather have a preventive approach to it rather than fixing it after it is broken. We use that second maintenance data to take rich decisions on servicing of the robots. There are two types of services; one is very tactical where we double-check all the data related to sensors while the other one is more strategic where we know about the parts of their life cycle. To manage replacement or rectification of that competence we use operational and maintenance data. The operational data helps in giving visibility of operations, while the maintenance data helps in planning the machine's uptime and maintenance quite well. It simplifies our life as everyone has visibility to what's going on. Our data stack peppermint dashboard has just started this financial year. The intention is to do with the permission of our customers. We don't store any data at our end for any other use and we would be analyzing the data for many things, for example, the robot is in a mall or an industry and there is spillage of oil on the floor, which is a safety hazard, as anyone would slip over it or it will attract insects and spoil the whole floor, while the robot will clean such a data we will know how that spillage happened and try to look at the source of an external event. Similarly, there are many such incidents, which we can recognize by doing post-processing of data and draw very intelligent outcomes. We recently started work on one customer's request which is the actual cleaning index of the floor and the air around it. Since these robots are cleaning certain sensitive areas in warehouses where sensitive material is kept, we are trying to catch things like odor or any particular matter in the air, which can trigger a safety alarm or healthy database being sent back to the servers. We're starting with safety as step one, so like to start spillages on the floor, air quality odor, or any toxic elements in the air, that sort of data which is meaningful to certain types of customers. We're very sensitive about it likepharmaindustry, paint industry. These are the early stages of our peppermint dashboard, but it's lovely to see it is all happening in real-time. We have two large types of customers. One is large facility management companies who are experts in housekeeping operations and we supply machines to them, and they, in turn, take it to the customers. So, that's one bucket through which we get access to large industries likeGHWsteel. We have certain customers with direct engagement because they have automation or robotics as a clear mandate. We have different types of customers like Associated Capsules,MaproFoods, Caravan Logistics, etc. Apart from this, we have customers lined up outside India as well, starting with Dubai as our first territory outside India. Most of our customers have more than one robot so it gives us confidence and encouragement. It's a three-step process. Firstly, we have to go and map the place. This is a robot-assisted by an engineering process, it's a one-time process we undertake and we prefer to do this because it builds very clear data about the environment. This may take one to three days and depend on the size of the deploymentsite. The second step is to get the robot to start cleaning and we do a supervised run for a day or two just to be double sure if the robot is cleaning everything properly or not. And then, finalizing its positions of where it will be charged and where the water will be changed, because the everybody may have a different way of giving us access to water, plumbing connections, or electrical connections. The trend is to finalize the workflow and hand over the robot to the local operations team, which could take somewhere between two to four days, depending on the size of the area. We have a very dedicated engineering deployment team for this to lead the whole exercise for peppermint. The whole process wrapped up within a week and we hand over the robot and move on to the next site. Globally, in developed countries, there are many floor cleaning robots on the floor, therefore; it's easy to say that the awareness, use case, and benefits are established. It's a different curve to entering those markets. And as now, betterment is available in certain countries in the Middle East and we are getting exposed to such markets. In India, we are in the early stages of the adoption of robots, which is great news, because in such a dense market like India we have a very large number of high population density cities that give us access to a large density of robots in a cluster. We are in the early stages and believe that the potential is truly endless, with more new infrastructure getting built in India, getting bigger airports, bigger malls, bigger industries, public parks, and convention centers. We are slowly getting to a place where our public infrastructure is truly getting upgraded in the last decade. It's only a matter of time that we start getting organized methods of cleaning, housekeeping, and facility management and robots play a very crucial and transparent role in that. The application simplifies the process, speeds it up, and makes it more cost-effective. We are super excited about India, as well as our overseas deployments, as this is just the beginning of this journey. Some of the more mature markets have been there for the last three to five years and we allow different ways of educating and entering with our robots in those markets. We are in the middle of the launch of our second family of robots. The objective for us always has been to completely address horizontal cleaning solutions first, which is all types of floors, whether indoor or outdoor, for different frequencies of cleaning. We started with a midsize 45-liter scrubber dryer and have recently launched a 100-liter version which is slightly larger. Now, there is a new family of robots altogether, which are mid-size robots for carpet cleaning, floor vacuuming, smoking indoors. And in the latter half of this year, we would have launched our outdoor sweeping robots as well, and probably to our knowledge that will be the first-ever in class. We are very proud of what we as a team have been building towards and I think by the end of this year, you will see us as a five robot offering doing things different indoors and outdoors. article/how-to-secure-esp32-firmware-and-flash-memory-using-esp-idf-framework