Arduino Lilypad Library for Proteus

Hello friends, few day ago I have posted a tutorial on how to do Arduino Simulation in Proteus. In that post, we have used an Arduino Library for Proteus but as this library is in its initial phases that's why currently it supports only three basic Arduino boards which are Arduino UNO, Arduino Mega2560 and Arduino Mega1280. But as we know there are numerous Arduino boards which are used these days. So, I searched a little and I came across this amazing Arduino Lilypad Library for Proteus which has the support for few other arduino boards, so I thought to share it with you guys. I have tested this library myself as always and its 100% working. I have tested it on Proteus 7 and I think it will work fine on Proteus 8 as well. As we have the support for above three boards in the previous library so the two new boards here are Arduino Lilypad and Arduino Nano, both of them are quite used these days. I have explained it in detail, step by step below, if you still feel problem in any step then ask in comments.This library has the support for following boards:

  • Arduino UNO
  • Arduino UNO SMD
  • Arduino Mega
  • Arduino Nano
  • Arduino Lilypad
Note:
  • This library isn't designed by our team so all credit goes to its creator, who is blogembarcado. Hats off dude !!!
  • We are just spreading the knowledge so that more and more engineers could get benefit out of it.
  • I have also posted Ultrasonic Sensor Library for Proteus, which you can download, using this library you can simulate Ultrasonic Sensor in Proteus, moreover you can also download different examples on Ultrasonic Sensor Simulation in Proteus to get a complete grip on this sensor.

Arduino Lilypad Library for Proteus

  • First of all, download this new Arduino Lilypad Library for Proteus by clicking on the button below:
Arduino Lilypad Library for Proteus
  • Once you downloaded the rar file, extract the file named as "BLOGEMBARCADO.LIB".
  • Now place this file in the library folder of Proteus, which, in my case, is "C:\Program Files (x86)\Labcenter Electronics\Proteus 7 Professional\LIBRARY". I hope it will give you the idea where to place the file.
  • After placing the file in this folder, now open the Proteus ISIS and click on the component selection button.
  • In the search box write "Arduino" and the list of all the arduino boards will be shown immediately as shown in the below figure:
  • You can see all the five boards in the above figure and you can select any of them.There's also another components in the list which is ultrasonic sensor. Yes, this library also supports ultrasonic sensor but I haven't tested it yet that's why didn't mentioned it, I will test this sensor soon and then will also explain its working.
  • Now you can select any of these boards and can start working on them rite away. All the five boards are shown in the below figure:
  • The two new Arduino boards in this library are shown below:
  • So, now simply design your circuit and write the code in the Arduino ide. After writing the code, get the hex file from arduino software and upload it to these boards.
Note:
  • In order to upload the hex file simply double click it and the properties window will pop up. In the Properties window, there will be an option named Program File. In this Program File, browse for the hex file and upload it.
  • Now run your Proteus simulation and it will work like charm.
  • I will post few projects on these boards soon as soon as I get time to write them, so stay tuned and have fun.
  • I have posted a small project on how to use Arduino Lilypad in Proteus which you can read and download from Arduino Lilypad Simulation in Proteus.

How to Control Relay in Proteus ISIS

Hello friends, hope you all are fine and having fun. In the previous posts, we have discussed DC motor Control in Proteus ISIS and after that we have discussed the Stepper Motor Control in Proteus ISIS and finally we had a look at Servo Motor Control in Proteus ISIS. Now when you talk about motors control then first thing came in mind is Relay, because relay is the best way of controlling any motor. In today's post, we are gonna have a look at How to Control Relay in Proteus ISIS. Relay is a key components of any electronics or electrical circuit and is usually a problem for the engineers and students. Although, its not as difficult as it seems so I thought to post about it.

In today's post, we will first simulate the Relay in a simple circuit in which when you run the simulation, the relay will automatically got activated and after that we will go in a bit detail and will control relay using a logic, i.e. when you provide +5V to it then the relay will go activated and when you give GNd then it will de-energize. I will explain it below in detail how to use it with Microcontroller. Moreover, if you are planning to work on Relay then you should also check What is a Relay and How to use it? and should also have a look at Relay Interfacing with Microcontroller using ULN2003 and finally must check this one as well Relay Control using 555 timer in Proteus ISIS.If you have any questions. related to it then ask in comments and I will try my best to reply your queries. Let's get started with designing of control relay in Proteus ISIS.

Simple Control Relay Circuit in Proteus ISIS

  • First of all, we are gonna simulate a simple control relay circuit in which we will manually turn on or off the relay.
  • Open Proteus ISIS and select the below components, as shown in below figure, from the components library of Proteus, if you don't know how to do it then check our earlier posts on Proteus.
  • Now, design a circuit as shown in below figure:
  • The circuit is self explanatory, first we have used a simple 12V battery to power up the simulation, after that there's a small led attached, which will indicate that whether proper power is supplied to the system or not. Next is our relay, which is named as RL1 in the above figure.
  • After the relay, we have placed a simple 12V lamp, so now when the relay will be energized, this lamp will glow up and when the relay is de-energized, the lamp will remain off. As in the above figure, the simulation is off, that's why the lamp isn't glowing.
  • After designing the circuit, now click on the run button and if everything goes fine, then the lamp will glow as shown in below figure:
  • So, now you can see the small led is also ON, I have used green that's why its showing green color indicating that power supply is working.
  • If you compare the off state and on state simulation then you will see that the Relay is now connected with second terminal and thus completing the circuit for lamp and lamp is also now glowing.

Complex Relay simulation in Proteus ISIS

  • Now, we are gonna design a bit more complex control  relay simulation in Proteus ISIS, it's not much complicated but needs a bit more care while simulating.
  • In previous section, we have seen a simple circuit which is operated manually means in order to turn it on or off you have to turn on or off the power supply but normally, it is required that the relay must be controlled by some microcontroller automatically.
  • As the microcontrollers normally work on 5V so in order to control a 12V relay using 5V microcontroller, we need to use transistor. In that case, when you give +5V the relay got actuated and when you give GND then relay get turned off.
  • So, first of all get these components from the Arduino components library.
  • Now, design the circuit as shown in the below figure:
  • As this tutorial is about relays so I haven't used microcontroller here, instead I used this logic state, it will work same as microcontroller. So the above circuit is quite similar to the simple circuit we have seen in the above section. The only difference here is the NPN transistor.
  • Now, we are not providing the supply directly to the relay, instead we are providing it via this transistor. So, when the logid state is zero means ground, the transistor won't work and the supply cant reached to the relay and when we make the logic 1 means +5V on the base of transostor, then the relay circuit will complete and the relay will be energized.
  • Now run the simulation, the off state is shown below:
  • In the above figure, you can see that the led goes on because the power is supplied to the circuit but the lamp is still OFF and the relay is also not energized because the logic state is a low level i.e. 0.
  • Now click on the logic state to make it on high level i.e. +5V, the on state is shown in below figure:
  • Now you can see that as we make the logic state high, now relay got connected and the lamp is also ON. So by comparing both ON and OFF states, you can easily get the idea how the relay is operating.
Note:
  • If you are planning on using the relay with microcontroller, then simply remove this logic state and connect the base of transistor with the output pin of microcontroller and when you low the microcontroller pin relay will get de energized and and when you make the pin high, it will get energized.
    • That's all for today, hope you have got something out of it. In the next post I will show how to simulate a DC motor using relay. Till then take care. :))

Getting Data From Webserver using Arduino Wifi

In today’s post, as the name suggests, we will see how to get data from online webserver using Arduino Wifi in simple steps. Getting data from web server using Arduino Wifi Shield has always remained a problem for the engineers. Its not much difficult task as its usually considered to be. In today’s post, I will create a small project in which I will control two simple LEDs via online web server. It’s really a very interesting project and when I completed it, I felt like Hurrah!!!

Arduino Wifi Shield is used to connect Arduino board with Wifi. After connectivity with Wifi, one can perform many tasks using this shield. We can built a complete server on it and can also use it as a client. Server designed on an Arduino Wifi Shield are usually quite simple as it doesn’t have much processing power to support heavy server. Arduino Wifi Shield is mostly used in home automation projects where home appliances are controlled by Wifi or can also be used for security purposes. In short, it has numerous applications and is widely used.

In today’s project, we will use Arduino UNO board for programming purposes, and will interface two leds with it and then we will control these leds via an online web server. Using that online web server, we will ON and OFF these leds on command. For controlling leds from an online server, we have to design two things:

  • Online Web Server.
  • Arduino Web Client.
Note:
  • The complete project has been sent to all the subscribed members. If you want this project code, then Subscribe to our mailing list, and it will be automatically emailed to you as well.

Project Description

First of all, I will explain what we are doing and what we want to achieve. In hardware, we will use:
  • Arduino UNO
  • Arduino Wifi Shield
  • LEDs x 2
  • 10k ohm x 2

Their arrangement and pin configuration is shown in the Arduino Web Client section. We will arrange them in such a way that two leds will be mounted on the Arduino UNO shield. In web server, we will design a simple page, which will be having four buttons on it, which will be:

  • LED 1 ON
  • LED 1 OFF
  • LED 2 ON
  • LED 2 OFF

When someone will open this web page and will pres any of these buttons, respective task will be performed on the Leds. i.e. if someone pressed the LED 1 ON button then Led 1 present on the Arduino board will get ON and when someone press LED 1 OFF button, that Led will go OFF and same function will be performed for second led. There won’t be any connection between the hardware and that web server, the only connection will be the Wifi. The Arduino Shield must have a Wifi connection available and one sitting from across the world can control them. Now let’s discuss these two parts, one by one.

Online Web Server

I have designed the online web server on my own site The Engineering Projects. This is a php page which I have uploaded on my web server. In order to make this page, simply follow the below steps:

  • Create a notepad and rename it to ArduinoWifi.php and save it somewhere, from where you can easily access it.
  • The webserver code is for sale and you can buy it just for $50. We have input a lot of effort to accomplish this project that's why we have placed a very small amount on it. You can easily buy it by clicking the below button.

Buy WebServer Code

  • Save the file again and our web page is now ready to be uploaded. This web page will act as a web server for the Arduino device and will send commands to it.
  • Now we need to upload this web page on some website so that it can start working. In order to do so, you must have some web domain and hosting as I have mine on Godaddy or you can also use some free web hosting service.
  • What this code is doing, its actually using a file system. Whenever any button on this web page is pressed, it simply create a txt file with a letter. In this code, when someone pressed LE 1 ON button, character “1" is saved in the txt file. Similarly character “2" is saved in the txt file when LED 1 OFF is pressed and so on.

Note:

  • When you upload the webpage on the web server, then hit any button and check your web location where this page is uploaded, you must find a data.txt file in the same location.
  • If you can’t find the data.txt then generate it by yourself because in some web servers, generation of such files automatically is not granted.
We are done with the Web Server part, now let’s come to the Arduino Web Client part.  

Arduino Web Client

  • First of all, place the Arduino Wifi Shield over the Arduino UNO shield, as shown in the below figure:

  • Now, you need to place the two leds on two your Arduino UNO. The pin configuration for these LEDs are shown in the below figure:

   
  • Two leds are connected to pin no 3 and 4 of Arduino UNO board and are pulled down.
  • Now connect your Arduino UNO board with the computer and burn the below sketch into it.
 #include <SPI.h>

 #include <WiFi.h>

char ssid[] = “EvoWingle-12F3“; // your network SSID (name)

 char pass[] = “093B3453“; // your network password (use for WPA, or use as key for WEP)

 int keyIndex = 0; // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;

 char server[] = “www.theengineeringprojects.com“; // name address for Google (using DNS)

 String location = “/Examples/data.txt HTTP/1.0“;

 char inString[500]; // string for incoming serial data

 int stringPos = 0; // string index counter

 byte statusLed = 0;

 char c;

 int led1 = 3;

 int led2 = 4;

 WiFiClient client;

unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds

 boolean lastConnected = false; // state of the connection last time through the main loop

 const unsigned long postingInterval = 10*1000; // delay between updates, in milliseconds

void setup() {

 //Initialize serial and wait for port to open:

 Serial.begin(9600);

 pinMode(led1,OUTPUT);

 pinMode(led2,OUTPUT);

digitalWrite(led1, LOW);

 digitalWrite(led2, LOW);

// check for the presence of the shield:

 if (WiFi.status() == WL_NO_SHIELD) {

 Serial.println(“WiFi shield not present”);

 // don’t continue:

 while(true);

 }

// attempt to connect to Wifi network:

 while ( status != WL_CONNECTED) {

 Serial.print(“Attempting to connect to SSID: “);

 Serial.println(ssid);

 // Connect to WPA/WPA2 network. Change this line if using open or WEP network:

 status = WiFi.begin(ssid, pass);

// wait 10 seconds for connection:

 delay(10000);

 }

 Serial.println(“Connected to wifi”);

 printWifiStatus();

Serial.println(“nStarting connection to server…”);

 // if you get a connection, report back via serial:

 if (client.connect(server, 80)) {

 Serial.println(“connected to server”);

 // Make a HTTP request:

 client.print(“GET “);

 client.println(location);

 client.println(“Host: theengineeringprojects.com”);

 // client.println(“Connection: close”);

 client.println();

 //readPage();

 }else{

 Serial.println(“connection failed”);

 }

 }

 void loop(){

while (client.available()) {

 c = client.read();

 Serial.write(c);

 CheckingStatus();

 }

if (!client.connected() && lastConnected) {

 Serial.println();

 Serial.println(“disconnecting.”);

 client.stop();

 }

 if(!client.connected() && (millis() – lastConnectionTime > postingInterval)) {

 PingRequest();

 }

 lastConnected = client.connected();

 }

 void PingRequest(){

 if (client.connect(server, 80)) {

 // Serial.println(“connected to server”);

 // Make a HTTP request:

 client.print(“GET “);

 client.println(location);

 client.println(“Host: theengineeringprojects.com”);

 client.println(“Connection: close”);

 client.println();

 //readPage();

 lastConnectionTime = millis();

 }else{

 //Serial.println(“connection failed”);

 client.stop();

 }

 }

 void CheckingStatus(){

 inString[stringPos] = c;

 if(c == ‘*’)

 {

 statusLed = inString[stringPos - 1];

 stringPos = 0;

 // Serial.write(statusLed);

 delay(500);

 UpdatingStatus();

 // delay(500);

 // client.flush();

 // delay(10000);

 //PingServer();

 }

 stringPos ++;

}

void UpdatingStatus(){

 if(statusLed == ’1')

 {

 digitalWrite(led1, HIGH);

 // Serial.write(‘OK’);

 }

 if(statusLed == ’2')

 {

 digitalWrite(led1, LOW);

 }

 if(statusLed == ’3')

 {

 digitalWrite(led2, HIGH);

 }

 if(statusLed == ’4')

 {

 digitalWrite(led2, LOW);

 }

 }

void printWifiStatus() {

 // print the SSID of the network you’re attached to:

 Serial.print(“SSID: “);

 Serial.println(WiFi.SSID());

// print your WiFi shield’s IP address:

 IPAddress ip = WiFi.localIP();

 Serial.print(“IP Address: “);

 Serial.println(ip);

// print the received signal strength:

 long rssi = WiFi.RSSI();

 Serial.print(“signal strength (RSSI):”);

 Serial.print(rssi);

 Serial.println(” dBm”);

 }
  • Before burning this sketch into your Arduino Shield, you need to change few things which I have written in bold style in the above code, and mentioned below:Now, everything’s done, so power up your Arduino and make sure that it has got connected with the Wifi and then hit the LED 1 ON button on your web page. If everything’s gone fine then the led on your Arduino board will get ON.
    • ssid is the name of your Wifi connection.
    • pass is the password of your wifi connection.
    • server is the server name on which the web page is uploaded, which in my case is my own site.
    • location is the location of the txt file generated by the webpage, the above web page code generated a txt file in the same location and gives it a name data.txt so I simply used that. (This part is bit confusing but read it twice and you will get it.)
  • I have added comments with the Arduino code but if still, you get into some trouble, ask in comments and I will try my best to resolve them.
Note:
  • Before starting anything, first run the demo code which comes with the Arduino Library and make sure that your Arduino Shield get connected with your Wifi connection.
  • Give the link of txt file generated by the web page, not the the web page itself.

That’s all for today, Stay Blessed, take care. :))

Circuit Designing of LCD with Arduino in Proteus ISIS

Hello friends, I hope you all are doing great. Today, I am going to share Circuit Designing of LCD with Arduino in Proteus ISIS. In my previous tutorial, I have posted a tutorial on How to use Arduino Library in Proteus. Using that library, we can easily test Arduino code in Proteus to check whether its working or not. If you haven't read that post then before starting it, first read it, as without adding the arduino library we can't use Arduino in Proteus.

Coming to today's post, as we have done adding the Arduino Library in Proteus, so I thought to do some projects on it and the first one I chose is quite simple one i.e. Circuit Designing of LCD with Arduino in Proteus ISIS. So we will have a look on how to show some characters on LCD using Arduino in Proteus. If you are working on LCD then you should also have a look at my new post Scrolling Text on LCD using Arduino. Let's get started with Circuit Designing of LCD with Arduino in Proteus ISIS:

Circuit Designing of LCD with Arduino in Proteus ISIS

  • First of all, design a circuit of LCD and Arduino in Proteus ISIS, if you have already added the Arduino Library then you won't find any problem in finding the Arduino in components library of Proteus.
  • You should also download this New LCD Library for Proteus.
  • Design the circuit as shown in below figure:
  • Now, we need to design Arduino sketch for LCD, so open Arduino software and place below code into it.
  • You should have a look at How to get Hex File from Arduino.
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()
{

lcd.begin(16, 2);
lcd.print("www.TheEngineer");
lcd.setCursor(0,1);
lcd.print("ingProjects.com");
}
void loop() {}
Note:
  • For Arduino code, I have used Liquid Crystal Arduino Library, which you can download from the below link and add it in the libraries folder of Arduino software.

Download LiquidCrystal Arduio Library

  • If you haven’t bought your Arduino UNO and LCD yet, then you can buy it from this reliable source:

  • Now compile the code, and get the Arduino hex file which will be in the tmp folder, you can read Arduino Library for Proteus to know in detail how to get the hex file of Arduino sketch.
  • Now double click the Arduino in Proteus ISIS and properties window will pop up.
  • In properties panel, under the Program File section, browse to Arduino hex file as shown in below figure and upload it.
  • Now click Ok and Run your simulation, if everything goes fine then your LCD will start showing the characters as shown in below figure:
  • You should also have a look at these Arduino Projects for Beginners.
  • That's all, was it difficult ??? I dont think so :) Anyways, if you got into any trouble, do ask in comments.
  • In the coming posts, we will explore Arduino in Proteus ISIS more. Till then take care !!!

Training Error: Recognition Failed in EasyVR

Hello friends, hope you all are fine and enjoying life. Today's post is about removing a small error named as Recognition Failed in EasyVR, which I encountered while working with EasyVR shield with Arduino UNO. I have posted a complete project on EasyVR shield around a year ago in which I haven't mentioned this error because at that time I didn't encountered it. But today while working with EasyVR shield, I encountered this problem so I thought to share it with you guys.

EasyVR shield is a voice recognition module which is used for recognizing voices and operating accordingly. Using this module, one ca quite easily control anything using voice. In the previous project, I have controlled a robot using voice commands like when I say Forward then it starts moving forward, when I say REVERSE then it start moving backward and so on. So, its quite a cool feature to be added in projects but its not the perfect one as the efficiency of this module is not even 50%, if you are operating in a noise environment then it won't work as you want it to work.So ,let's get started with How to solve Training Error: Recognition Failed in EasyVR.

Training Error: Recognition Failed in EasyVR

  • First of all, I connected my EasyVR with Arduino UNO and run the EasyVR Commander.
  • I selected the Com Port of my Arduino UNO and hit Connect.
  • After that, I added a new command in EasyVR Commander and hit Train Command and it asked for Phase 1.
  • Everything was working perfect but when I train my command i.e. said the word which I wanted to save in the command, I got the error written as "Training Error: Recognition Failed", shown in below figure:
  • I tried again and again to train the command but the error keeps on continuing, which creates quite a problem for me.
  • So, below are the steps, which I have taken in order to remove this error, its kind of a troubleshooting which is quite important to learn for an engineer.

How to solve Training Error: Recognition Failed in easyvr

  • First of all, what you need to check is whether your EasyVR shield is working or not, which I did exactly. So, I remove the EasyVR shield from the Arduino UNO and upload a sketch in Arduino UNO. The sketch I uploaded in Arduino UNO is the test EasyVR sketch comes with the EasyVR library.
  • After uploading the sketch, I connected my EasyVR shield with Arduino UNO and check its output and I got a sigh of relief that my EasyVR shield is working fine, so there's no problem with EasyVR.
  • Now I again opened the EasyVR commander and this time I placed the J12 jumper no SW instead of PC, and start the training procedure and I was like surprised, it worked great.
  • I think the new versions of EasyVR shield doesn't need the jumper to be on PC for training mode.
  • In the project, I have mentioned it that place the Jumper J12 on PC while working with EasyVR Commander and place it on SW while working with Arduino UNO, which is now not applicable for the new version of EasyVR.
  • So, simply, place your jumper J12 on SW position and it will work smoothly.
Note:
  • EasyVR shield doesn't give the 100% result, it got impressed by the noise in the surroundings very quickly so whenever you are using EasyVR shield, make sure that you use it in a calm place. I even turn off my fan in order to make it work properly.
Finally, after resolving this issue, I trained five commands into it for moving a robot, which are shown below:
  • That's all for today, hope it will help you guys in some way. Thanks !!!

Send SMS with Arduino UNO and SIM900D using AT Commands

Hello friends, today's post as the name suggests is about how to send SMS with Arduino UNO and SIM900D using AT Commands. There are different types of SIM900D modules available in the market, so it doesn't matter which module you are using. All SIM900D modules work at AT commands basically so today I am going to show you how to send an SMS via AT commands without using any Arduino library. You should first read the AT commands manual which will give you an idea about AT commands. AT commands are special sets of commands which are used for communicating with SIM900 module. Using these AT commands we let our GSM work for us. Like if you want to send SMS then there's a specific AT command for sending the SMS similarly if you want to change the PIN code for your GSM module then you have a different AT command. So, there are lots of AT commands available. We can interface this GSM module with any microcontroller like PIC Microcontroller or 8051 Microcontroller but here I have interfaced it with an Arduino board. You should also check How to Send SMS with PIC Microcontroller if you wanna use PIC Microcontroller instead of Arduino board.

You must also check GSM Library for Proteus, using this library you can easily simulate your GSM module in Proteus ISIS. Moreover, also have a look at Send SMS with Sim900D in Proteus ISIS in which I have designed a simulation of SMS sending in Proteus ISIS.

Note:

Where To Buy?
No.ComponentsDistributorLink To Buy
1SIM900AmazonBuy Now
2Arduino UnoAmazonBuy Now

Components Used

I have shared the list of components used in this project. I am giving a comparison of three vendors below, you can buy from any of them:
Components List Amazon Ali Express
Give Your Suggestions !!!
Arduino UNO R3 Click Here to Buy Price: $10.99 Click Here to Buy Price: $2.79
GSM Module Sim900 Click Here to Buy Price: $28.99 Click Here to Buy Price: $10

Connect Arduino UNO with SIM900D

  • First of all, connect Arduino UNO with SIM900D module, which isn't much difficult. If you have the module in hand then the first thing you need to do is to power it up and wait for the module to get connected.
  • Usually, an LED is placed on the SIM900D module which keeps on blinking. If it's blinking fast, it means the modules haven't yet captured the signal. When the module captures the signal then the LED keeps on blinking but at lower speed.
  • Now find the TX and RX pins of your SIM900D module and connect the TX of module with RX of Arduino UNO, which is pin # 0 and similarly RX of module with TX of Arduino UNO, which is pin # 1.
  • The module, which I have used for my project is shown in the below figure, with labelled pin configurations and if you want to buy it in Pakistan then click here.
  • One other thing mentioned in above figure is pKey, connect it with ground.
  • Once your connections are ready, then upload the below sketch in your Arduino UNO and start sending messages.
    void setup()
    {
    Serial.begin(9600);
    }
    void loop()
    {
    delay(1200);
    Serial.print("AT");
    delay(1200);
    bool bOK = false;
    while (Serial.available() > 0)
    {
    char inChar = (char)Serial.read();
    bOK = true;
    }

    if(bOK)
    {
    index = 0;
    Serial.println();
    Serial.println("AT+CMGF=1"); // sets the SMS mode to text
    delay(100);
    delay(1200);
    bool bOK = false;
    while (Serial.available() > 0) {
    //Serial.write(Serial.read());
    char inChar = (char)Serial.read();
    bOK = true;
    }
    if(bOK)
    {
    Serial.println();
    Serial.print("AT+CMGS=""); // send the SMS number
    Serial.print("+923004772379");
    Serial.println(""");
    delay(1000);
    Serial.print("A new post is created by Zain."); // SMS body

    delay(500);

    Serial.write(0x1A);
    Serial.write(0x0D);
    Serial.write(0x0A);

    }
    }
    }
  • Change the mobile number with the number, on which you want to send the SMS, I have written mine.
  • You should also change the body of the SMS and can write anything you wanna send as an SMS.
  • The AT commands are required to send the SMS. I have added the comments in front of these commands but still if you get into any trouble, ask in comments.
  • That's all for today, in the coming post, we will have a look how to receive SMS with SIM900 and Arduino.

Introduction to Arduino YUN

Hello everyone, I hope you all are doing great. In today's tutorial, I am going to give you a detailed Introduction to Arduino YUN, and we will also have a look at its basic functionalities. Arduino YUN is a latest microcontroller board, manufactured by Arduino. It's the most advanced and highly stylish arduino board. The beauty of Arduino YUN lies in having two on board processors, which I haven't seen yet in any other Microcontroller board. One of them is simple Arduino processor which is similar to that of Arduino Leonardo while the second processor is Atheros AR9331. Atheros supports Linux server, which is the new thing in Arduino YUN. Because of these two processors, one now can do anything in the world of automation as well as web servers. You can say it's kind of a replica to Raspberry Pi 3.

Arduino YUN can be used as a server, you can also run python scripts quite easily on it, which we will cover in coming posts of this tutorial. You can run the Telnet session on it, can access the FTP servers, in short you can do anything with it quite easily. Let me give you an example, around 3 months ago I have designed a project on Arduino YUN in which the sensors data attached to the YUN were uploading directly on the web server via FTP and were saved in the sql database and I did all of it, just by using Arduino YUN alone. No computer was attached for FTP connection as python scripts in the Arduino YUN were doing this task. Now, I think you have gotten better idea of capability of Arduino YUN.Arduino YUN also have built in Wifi, Ethernet, USB host and SD card slot.

One another unique feature of Arduino YUN is that you can upload Arduino sketches in it wirelessly without any cable connection, if your computer and Arduino YUN are connected with the same Wifi connection. Now, let's have a look at how to manually connect the Arduino YUN with available wifi connection, which should be your first step after buying an Arduino YUN.

Manually Connect Arduino YUN with Available Wifi Connection

Now I suppose that you have got your Arduino YUN. After getting the Arduino YUN, open your box and plug the mini usb cable into your Arduino YUN and the other side of cable in your computer. I am also assuming that you are plugging it first time with your computer via usb cable.

Note:

  • You should download the Arduino software version 1.5.5 instead of 1.0.3 because Arduino sketches will be only compiled in 1.5.5 version which is specifically designed for Arduino YUN. In this tutorial, we will not use Arduino software.
  • After plugging the Arduino YUN, open your Wireless Network connections and wait for the Arduino YUN to appear as shown in below figure. It will take some time to appear so be patient.

  • In the above figure, you can see YUN connection is available, now the question is why is it available?? It is available because it is not connected to any wifi connection rite now and is acting as an access point. In other words, its just similar to a Wifi router having no wifi connection.
  • So, what we need to do is to connect with this YUN so click on YUN wifi connection and hit connect, so you will get disconnected with previous connection and will get connected with Arduino YUN as shown in below figure.
  • After connecting with Arduino YUN, yur computer has came in the same network with YUN.
  • YUN has a built-in page saved in it from where you can quite easily configure its properties.
  • So, opne your browser and write http://192.168.240.1/ and hit enter, its the current IP adress of Arduino YUN, so when you hit enter, a page similar to the below figure will open up asking for the password.

  • The default password for this page is "arduino" so insert this password and click on Log in as in above figure.
  • After log in, you will be directed to a page similar to one shown in below figure and you can see in the below figure different properties or values of Arduino YUN like current ip address, netmask etc.
  • For Wifi, it is giving connected but for Ethernet, it is showing disconnected because we haven't yet connected with Ethernet.
  • Now click on the Configure button shown in the above figure.
  • After clicking on the configure button, you will be directed to the configuration panel of YUN shown in below figure and you can see there are many fields which are ready for configuring.
  • First one is YUN NAME, which I have gven is TEP, you can give it any name which you can easily remember.
  • Second field is password, the default password as we have seen before is "arduino" so if you want to change that password then add a new password here, which I dont want, so I have left it blank.
  • Next is TIMEZONE, select our time zone from drop down list.
Note:
  • If your project involves time log or date, then its very important to select your time zone so that you get your local date and time.
  • Next are wireless parameters, where we are gonna select the wifi connection with which we want to connect our Arduino YUN.
  • Select the SSID of your network with which you wanna connect, its a drop down list which will have all the currently available networks, so you just need to connect with the one you want and also give its password and hit Configure & Restart button.
  • That's all, when you hit this button, the below screen will appear which will say Configuration Saved and the YUN is restarting.
  • It will take around 10 to 15 minutes to get completely restarted meanwhile, what you need to do is to connect with that wifi connection with which you have connected your Arduino YUN. In my case its SALAM so I connected my computer with SALAM.
  • After restart, now your Arduino YUN will be connected to the wifi connection and you won't see it in the local wireless connections as we have seen in the start.
  • So now your Arduino YUN and computer both are connected with the same network, which in my case is SALAM.
  • So, now open your Arduino 1.5.5 software and click on Tools and then Port and you can see below Aduino YUN is available and named as "TEP at 192.168.1.1" , where TEP is the name of Arduino YUN board which we have given in above steps and the ip address is the current ip address of Arduino YUN.
  • By selecting this 4th option shown in above figure, you can burn any sketch in your Arduino YUN wirelessly without any cable unless your computer and YUN are connected with the same wifi connection.
  • I don't think it was much difficult connecting YUN with the wifi connection, but quite interesting, isn't it?
  • So, give it a try and have fun. I will post more tutorials on YUN soon so stay connected and have fun. :))

PCB Designing in Proteus ARES

Hello friends, today's the last post of this Proteus tutorial. I have tried my best to explain everything but knowledge is limitless so explore this software, play with it and you will know many new things. Today's topic is about the PCB designing in Proteus. When you install Proteus, you have seen that along with ISIS there's also another package named as Proteus ARES. This Proteus ARES is used for PCB designing. You should also check the Arduino UNO PCB Design for Proteus ARES.

In order to design the PCB in Proteus ARES, first you need to make the circuit of that PCB in Proteus ISIS. You can also make PCB directly but I recommend that use Proteus ISIS first, its quite the easy approach as you don't need to do anything in it and the software intelligence helps you throughout the designing. Here's the list of Top 10 PCB Design Software. So let's get started with PCB Designing in Proteus ARES:

PCB Designing in Proteus ARES

  • As in this tutorial, I just want to give you an idea of How to design PCB that's why I haven't taken difficult circuit, just a simple PIC basic circuit.
  • First design your circuit in Proteus ISIS as shown in below figure:
Components Used:
These components are used while designing this simulation:
Working Principle:
  •  After you got sure that your circuit is perfect and ready for designing, then click on the Tools and then Netlist to ARES as shown below:
  •  After clicking, Proteus ARES will be opened.
  • Now in Proteus ARES, select the block option from left toolbar and also make sure that you selected Board Edge in the below drop down menu as shown in below figure:
  •  Now make a rectangular block in the workspace, this block is actually the boundary of your PCB.
  • You can set its proper dimensions and can also re-size it manually using the mouse.
  •  Now select the component option from the left toolbar, it will show all the components used in your circuit.
  •  Place all these components in the workspace one by one as shown below. These green lines shown in the below image is actually the software intelligence.
  • Using the circuit, it gives us the routes automatically and we don't need to panic any more just need to follow these route, if we are doing manually routing.
  •  Now there are two ways of adding routing, first method is auto routing.
  • To do auto routing, click on Tools and then Auto Router and a property box will open where you can set many different option for routing like the width of route and the PCB layers etc.
  • After selecting your properties just click on Begin Routing.
  •  And then a magic will start and you PCB will become ready as shown in below figure:
  •  Second method is manual routing, you can do manual routing by clicking the edges just like we connect wires in Proteus ISIS. For manual routing select the option shown in below figure and start routing.
That's it. I don't think its much difficult. I am gonna stop this tutorial here. I have tried my best to share my knowledge about Proteus. IF you guys having any problem in part of this tutorial, feel free to contact me. Take care.

Component Designing in Proteus ISIS

Hello friends, hope you all are having fun in your life. Today's tutorial is about the component designing in Proteus ISIS. This tutorial actually deals with the presentation of your project. Usually when students give presentation of their projects, then it is asked that add the circuit diagram of their project. Now when students open Proteus in order to design their circuit, they found out that the components they have used in their project are not available in the Proteus Directory. Now what to do ? In that case, there's a need to design your own component in Proteus and place it in the circuit. Although, this new designed component won't work as the real component but for presenting the circuit, it will be enough. ofr example, we don't have Arduino boards in Proteus software. so, I have designed some of the Arduino baords myself for Proteus which you can download from Arduino Library for Proteus. Similarly, it usually happens to me during my freelancing work to design some circuit and when I don't find the required component in the Proteus library then I simply design it on my own and then create its PCB. We will check the PCB designing of such components in the coming posts of this tutorial. So, now let's get started with component designing in Proteus ISIS.

Component Designing in Proteus ISIS

  • Now I am going to design a simple component having 4 pins.
  • First of all select the 2D Graphics Box Mode as shown in the below figure.
  • Now click on the workspace and drag the cursor to create a box, as shown in the below figure.
  • We have created the body of our component, now there's a need to add pins in it.
  • For this, click on the Device Pins Mode as shown in the below figure and click on the workspace.
  • It will add a small pin, attach this pin with the box as I did in the below figure.
Note:
  • The pin has a small green bubble on it. Make sure that this end is not connected with the box as this bubble end is for the wire.
  • I have added four pins with the box. Now there's a need to name these pins. For this purpose, double click any of the attached pin and the properties box will open up as shown in the below figure.
  • Mention the Pin Name and the Default Pin Number, it will appear on the component and then click on Next.
  • When you click Next, it will ask for the same things for the second pin and so on.
  • When you fill these info for all the four pins then click OK.
  • Now when you click the ok button, your component will now look as shown in the below figure.
  •  I have given my pins the names as Vcc, GND, Output, Signal.
  • We have completed all the info of our product, now there's a need to add this component in our library.
  • For this purpose, select the whole component and then right click and select Make Device.
  •  When you click on this option a new dialog box will open up as shown in below figure.
  • In this dialog box, you just need to give info of your new component so that you can search it easily in your Proteus library.
  • Just fill the Device Name in it and click Next. I have given the name Test Device to my component.
  •  Now click Next and go on clicking Next, unless you reach at the below page.
  • Here you need to place your component in the category. Choose the appropriate category for your product and click on OK.
  •  That's it. Now your component has been added to the library. Open your part list and search for the component like in my case I search for Test Device and the below component appeared in my list.
That's all for today. If you have any questions regarding this tutorial, ask in comments and I will reply them. Take care.

Stepper Motor Drive Circuit in Proteus ISIS

Hello friends, hope you all are healthy, wealthy and wise. Today's topic is about the control of stepper motor. In the last post we have seen How to control DC motor in Proteus, and now we are gonna see How to design a Stepper Motor Drive Circuit in Proteus ISIS. Stepper motors are usually of two types and the main difference between the two is in the number of wires used to control them. Mostly stepper motors use 6 wires to control them but few of them also have 4 wires to control them. Today we will have a look on the 6 wired stepper motor. In stepper motor, there are electromagnets which gets polarized when we supply voltage to them and depolarized when we remove the voltage. These electromagnets act as a stater and when one side get magnetize, it attracts the rotor towards it and then we need to magnetize the other side and demagnetize the previous one and in this ways if the sequence is right the motor starts moving.

Stepper Motor Drive Circuit in Proteus ISIS

  • First of all, add the below two components from the Proteus library in the workspace.
  •  Now design the circuit as shown in the below figure:
  •  This circuit is just for understanding purposes. Now I have added four states in the circuit, when I make any state one that stator got magnetize and the motor rotor will attract towards that stator and start moving.
  • In the below series of images, I have shown the clockwise movement of motor.
  • Now, as you can see from the above sequence of images, the motor is moving in the clockwise direction as I am supplying voltage in the clockwise direction.
  • Now, if I reverse the order of applied voltage the motor will also reverse its direction and will move in the counter clockwise direction.
  • The speed of the motor will depend on the speed of this sequenced voltages. If you apply these voltages with delay, the motor will move slow and if you apply them fast and continuously, the motor will rotate quite fast i.e. rpm of motor will increase.

Stepper Motor Control with Microcontroller

  • Now, in order to control this motor using stepper motor, simply connect these wires with four pins of microcontroller and apply a sequenced voltage in programming and the motor will run quite smoothy.
  • I will upload the video of the stepper motor control with microcontroller soon in this post.
That's it for today and I hope now you got the idea how to design a Stepper motor Drive Circuit in Proteus ISIS. In the next post, we will have a look at How to design a Servo Motor Drive Circuit in Proteus ISIS. So, we will meet in the next post hopefully. Take care.
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir