WIZ610wi: How to Convert from Arduino Ethernet Shield Project to Arduino Wireless Project

details

Whenever I work on Arduino Ethernet Shield projects such as twitter and Sensor node, I have thought that the Wi-Fi solution is better than Ethernet Shield solution.

How about you? Which solution would be better one in your opinion?

I would like to introduce easy solution that doesn’t make your Ethernet Shield project change.

We have already been experienced in the Twitter application.

Let’s start using the Twitter for Arduino Ethernet Shield project.

Please refer to the Arduino Twitter application; http://playground.arduino.cc/Code/TwitterLibrary

dd

  • My Twitter application used the analog sound sensor (DFRobot.com)

22

  • Block Diagram

3333333

 

  • Source code
#include <SPI.h> // needed in Arduino 0019 or later
#include <Ethernet.h>
#include <Twitter.h>
// The includion of EthernetDNS is not needed in Arduino IDE 1.0 or later.
// Please uncomment below in Arduino IDE 0022 or earlier.
//#include <EthernetDNS.h>

#define SOUND_SENSOR A1
#define THRESHOLD_VALUE 50//The threshold to turn the led on 400.00*5/1024 = 1.95v

// Ethernet Shield Settings
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// If you don't specify the IP address, DHCP is used(only in Arduino 1.0 or later).
byte ip[] = { 192, 168, 1, 123 };
// Your Token to Tweet (get it from http://arduino-tweet.appspot.com/)
Twitter twitter("Please input your Twitter account");  //minsu.jeun@gmail.com
// Message to post
char msg[20];

void setup()
{
  Serial.begin(9600);
  pins_init();
  int temp=25; //First start message
  sprintf(msg, "The Sense Value %d", temp);
  Serial.println(msg);
  delay(1000);
  Ethernet.begin(mac);
  Serial.println("connecting ...");
}

void pins_init()
{
  pinMode(SOUND_SENSOR, INPUT);
}

void loop()
{
  int sensorValue = analogRead(SOUND_SENSOR);//use A0 to read the electrical signal
  sprintf(msg, "The Sense Value %d", sensorValue);
  Serial.println(msg);

  if(sensorValue > THRESHOLD_VALUE)
  {
     if (twitter.post(msg)) {
// Specify &Serial to output received response to Serial.
// If no output is required, you can just omit the argument, e.g.
// int status = twitter.wait();
      int status = twitter.wait(&Serial);

        if (status == 200) {
          Serial.println("OK.");
        } 
        else {
          Serial.print("failed : code ");
          Serial.println(status);
        }

    }

    else {
      Serial.println("connection failed.");
    }
  } //close if(sensorValue > THRESHOLD_VALUE)
  delay(500);
}// main close

 

 

  • Test Result

4444444444444444

 

 

  • How to change from Ethernet to Wi-Fi?

           –  I would like to introduce WIZ610wi, one of the Wi-Fi module from WIZnet.

           – http://www.wiznet.co.kr/sub_modules/en/product/Product_Detail.asp?cate1=5&cate2=43&cate3=0&pid=1020

5555555

– The main function of WIZ610wi is to support AP/Client/Gateway mode.

 

  • WIZ610wi Client Mode

66666

– Use a wireless adapter for wired-only Ethernet enabled device. This mode is suitable to connect smart TVs, game consoles, or computers for your wireless network.

 

  • How to set up the WIZ610wi Client Mode

7777777777777

  • Operation Mode Setting Image.

88888

You should have to confirm AP information.

Site Survey -> Having access to AP selection

9999999999

Input Access AP information

10

Check the success message in the box and click “OK”

11

  • Connect between Arduino Ethernet Shield and WIZ610wi-EVB
  • Block diagram

12

  • Test Result

1314

 

  • Conclusion

We can easily find Arduino Ethernet shield projects such as Twitter server, TCP server, and Client and so on.

However, it is not usually easy to convert from the Ethernet Shield solution to Wi-Fi solution for Arduino.

This is the reason why I suggest that you better use and add WIZ610wi then, it makes you convert from Arduino Ethernet Shield to Wi-Fi solution easily which means that you don’t have to waste your time and money to buy a new Wi-Fi module and learn about it.

In order to purchase WIZ610wi, please visit the following website; www.shopwiznet.com/wiz610wi.

Whenever I work on Arduino Ethernet Shield projects such as twitter and Sensor node, I have thought that the Wi-Fi solution is better than Ethernet Shield solution.

How about you? Which solution would be better one in your opinion?

I would like to introduce easy solution that doesn’t make your Ethernet Shield project change.

We have already been experienced in the Twitter application.

Let’s start using the Twitter for Arduino Ethernet Shield project.

Please refer to the Arduino Twitter application; http://playground.arduino.cc/Code/TwitterLibrary

dd

  • My Twitter application used the analog sound sensor (DFRobot.com)

22

  • Block Diagram

3333333

 

  • Source code
#include <SPI.h> // needed in Arduino 0019 or later
#include <Ethernet.h>
#include <Twitter.h>
// The includion of EthernetDNS is not needed in Arduino IDE 1.0 or later.
// Please uncomment below in Arduino IDE 0022 or earlier.
//#include <EthernetDNS.h>

#define SOUND_SENSOR A1
#define THRESHOLD_VALUE 50//The threshold to turn the led on 400.00*5/1024 = 1.95v

// Ethernet Shield Settings
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// If you don't specify the IP address, DHCP is used(only in Arduino 1.0 or later).
byte ip[] = { 192, 168, 1, 123 };
// Your Token to Tweet (get it from http://arduino-tweet.appspot.com/)
Twitter twitter("Please input your Twitter account");  //minsu.jeun@gmail.com
// Message to post
char msg[20];

void setup()
{
  Serial.begin(9600);
  pins_init();
  int temp=25; //First start message
  sprintf(msg, "The Sense Value %d", temp);
  Serial.println(msg);
  delay(1000);
  Ethernet.begin(mac);
  Serial.println("connecting ...");
}

void pins_init()
{
  pinMode(SOUND_SENSOR, INPUT);
}

void loop()
{
  int sensorValue = analogRead(SOUND_SENSOR);//use A0 to read the electrical signal
  sprintf(msg, "The Sense Value %d", sensorValue);
  Serial.println(msg);

  if(sensorValue > THRESHOLD_VALUE)
  {
     if (twitter.post(msg)) {
// Specify &Serial to output received response to Serial.
// If no output is required, you can just omit the argument, e.g.
// int status = twitter.wait();
      int status = twitter.wait(&Serial);

        if (status == 200) {
          Serial.println("OK.");
        } 
        else {
          Serial.print("failed : code ");
          Serial.println(status);
        }

    }

    else {
      Serial.println("connection failed.");
    }
  } //close if(sensorValue > THRESHOLD_VALUE)
  delay(500);
}// main close

 

 

  • Test Result

4444444444444444

 

 

  • How to change from Ethernet to Wi-Fi?

           –  I would like to introduce WIZ610wi, one of the Wi-Fi module from WIZnet.

           – http://www.wiznet.co.kr/sub_modules/en/product/Product_Detail.asp?cate1=5&cate2=43&cate3=0&pid=1020

5555555

– The main function of WIZ610wi is to support AP/Client/Gateway mode.

 

  • WIZ610wi Client Mode

66666

– Use a wireless adapter for wired-only Ethernet enabled device. This mode is suitable to connect smart TVs, game consoles, or computers for your wireless network.

 

  • How to set up the WIZ610wi Client Mode

7777777777777

  • Operation Mode Setting Image.

88888

You should have to confirm AP information.

Site Survey -> Having access to AP selection

9999999999

Input Access AP information

10

Check the success message in the box and click “OK”

11

  • Connect between Arduino Ethernet Shield and WIZ610wi-EVB
  • Block diagram

12

  • Test Result

1314

 

  • Conclusion

We can easily find Arduino Ethernet shield projects such as Twitter server, TCP server, and Client and so on.

However, it is not usually easy to convert from the Ethernet Shield solution to Wi-Fi solution for Arduino.

This is the reason why I suggest that you better use and add WIZ610wi then, it makes you convert from Arduino Ethernet Shield to Wi-Fi solution easily which means that you don’t have to waste your time and money to buy a new Wi-Fi module and learn about it.

In order to purchase WIZ610wi, please visit the following website; www.shopwiznet.com/wiz610wi.

COMMENTS

Please Login to comment
  Subscribe  
Notify of