Saturday, January 24, 2015

Wireless Virtual Switch Using LabVIEW and Arduino


Here's the example of using NI LabVIEW for controlling electrical devices wireless. I've used simple components to make this. I used  Arduino Uno, Relay module and RF Transmitter and Receiver. I've controlled only two devices, It can be extended upto  8 devices using RF Module which has 8 I/O's.



The above figure shows block diagram for the project. 

Saturday, January 17, 2015

Arduino Code for GSM Module basic program to find the network information

GSM Basic code to find the firmwire version, Network list, Network information, and baud rate. This uses the AT commands with the arduino command to communicate with the GSM module. I test these code with sim900a gsm module.

___________________________________________________________________________________

/*
Press--> a: AT Command.
f: To get Firmware Version.
l: To get List of Network.
i: To get Network Info.
v: To get VBAT voltage .
b: To get Baud rate Info.
*/

#include <SoftwareSerial.h>

SoftwareSerial mySerial(7, 8);

void setup()
{
  mySerial.begin(9600);               // the GPRS baud rate
  Serial.begin(9600);    // the GPRS baud rate
  delay(500);
}


void loop()
{
  if (Serial.available()>0)
   switch(Serial.read())
  {
    case 'a':
      AT();
      break;
    case 'i':
      Network();
      break;
    case 'f':
      FirmVersion();
      break;
    case 'l':
      NetworkList();
      break;
    case 'v':
      Battery();
      break;
    case 'b':
      Baud();
      break;
  }

 if (mySerial.available()>0)
   Serial.write(mySerial.read());
}

void AT()
{
  mySerial.println("AT");
  delay(100);
}

void Network()
{
  mySerial.println("AT+CSQ");
  delay(1000);

  mySerial.println("AT+COPS?");
  delay(1000);
}

void FirmVersion()
{
  mySerial.println("ATI");
  delay(100);
}

void NetworkList()
{
  mySerial.println("AT+COPS=?");
  delay(100);
}

void Battery()
{
  mySerial.println("AT+CBC");
  delay(100);
}

void Baud()
{
  mySerial.println("AT+IPR=0");
  delay(1000);
  mySerial.println("AT+IPR?");
  delay(100);
}

____________________________________________________________________________________



Arduino code for Send and Receive SMS using GSM module.

This is a example program to send and receive sms using gsm module and arduino. I tested these code with the SIM900A gsm module.

____________________________________________________________________________________

/*
Press--> t: To Send Text Message.
r: To Receive Text Message.
*/

#include <SoftwareSerial.h>

SoftwareSerial mySerial(7, 8);

void setup()
{
  mySerial.begin(9600);               // the GPRS baud rate   
  Serial.begin(9600);    // the GPRS baud rate 
  delay(500);
}


void loop()
{
  if (Serial.available()>0)
   switch(Serial.read())
  {
    case 't':
      SendTextMessage();
      break;
    case 'r':
      RecieveTextMessage();
      break;
  }

 if (mySerial.available()>0)
   Serial.write(mySerial.read());
}

///SendTextMessage()
///this function is to send a sms
 void SendTextMessage()
{
  mySerial.println("AT+CMGF=1");    //Because we want to send the SMS in text mode
  delay(100);
  mySerial.println("AT+CMGS=\"+91******\"\r"); // change to the phone number you using 
  delay(100);
  mySerial.println("A test message!");//the content of the message
  delay(100);
  
  mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
  delay(100);
}

///RecieveTextMessage()
///this function is to show received a sms
 void RecieveTextMessage()
{
  mySerial.println("AT+CMGF=1\r");
  delay(200);
  
  //mySerial.println("AT+CNMI=2,2,0,0,0");
  //delay(200);
   
  //mySerial.println("AT+CSCS=\"GSM\"\r");
  //delay(100);
   
  mySerial.println("AT+CMGL=\"ALL\"\r"); // to read ALL the SMS in text mode
  delay(200);
  //mySerial.println("AT+CMGR=3\r");//  to read the SMS in text mode from location x
  //delay(100);
}

______________________________________________________________________________________

Select Actuator/Motor For your Machine design Using LabVIEW and SolidWorks

Here's the detail Video explanation about How to select motor for your New Machine design using Labview , SoftMotion and SolidWorks. 

Most of the Mechatronics or Mechanical Machines involves Motor to operate, in such cases it is difficult to select appropriate motor for the new design. Mostly motor selected after the Manufacturing of the Machine. 

LabVIEW and Solidworks collaborated to find a solution for this problem and come with a solution with the toolkit SoftMotion which collects data from Solidworks and interpret in LabVIEW with the data's collected from SolidWorks Its possible find the time to complete a task and able to find the appropriate torque that is required to move in certain axis. 


Download Labview Files from Here

Solidworks Assembly file can be find in the SoftMotion example Folder.

Sunday, January 11, 2015

Temperature Control Using LabVIEW and Arduino

This is a very simple temperature control using LabVIEW and Arduino, where the user can set the minimum and maximum temperature if the temperature exceeds the maximum set level we can make the arduino to do certain work.

In this project I have set the arduino to turn On the fan when the temperature exceeds the set level. It is also possible to know the "HOT", "COLD" and MODERATE condition with the help of RGB LED and the front panel. 

Temperature log data are stored in a file where it can be later analysed the various temperature data respect to the time. 

What are the components used?
RGB LED
LM35 Temperature sensor
Arduino Uno.



Labview file can be download from here

Friday, January 2, 2015

LIGHT SHOW USING LABVIEW and ARDUINO

This example already existed in the LIFA and It was not updated for LINX for arduino, I've recreated the VI for LINX.

Note : Only wav. file format is supported, make sure you are choosing the right file format and select random color in the front panel.




Labview files can be downloaded from here