Tag Archives: Seeed Studio

Seeeduino Cloud is an Arduino Yún-compatible Wi-Fi board


This new MCU is built around the Dragino HE IoT module and the ATmega32U4.


Adafruit has announced the arrival of the Seeeduino Cloud, an Arduino Yún-compatible MCU based on the ATmega32U4 and Dragino HE IoT module.

3034-00

The board features both built-in Ethernet and 2.4GHz Wi-Fi support, as well as USB-A port that makes it perfect for prototype designs requiring network connection and mass storage. The HE — which means “core” in Chinese — is a minimal system installed with OpenWrt.

The 802.11 b/g/n-capable MCU boasts a rich interface with Ethernet, USB, UART and plenty of GPIO pins, which offers compatibility with Grove shields. Makers can even use the Seeeduino Cloud as an IoT gateway.

Similar to the Arduino Yún, the Seeeduino Cloud eases the interface between Arduino firmware and complex web services. Makers can use the Yún Bridge library which delegates all network connections and processing of HTTP transactions to the Linux machine.

3034-01

“Historically, interfacing Arduino with complex web services has been quite a challenge due to the limited memory available. Web services tend to use verbose text based formats like XML that require quite a lot of RAM to parse,” Adafruit explains.

What’s more, the Seeeduino Cloud can be programmed with Arduino IDE via a USB cable or over the Wi-Fi connection without the need to physically access the board. Interested? Head over to Adafruit to get your hands on one today, or delve deeper into the Cloud’s specs on Seeed Studio’s Wiki page.

Transform your swimming pool into an LED dance floor


This Maker covered his swimming pool with Rainbowduino-powered LEDs to create one heck of a dance floor.  


Like something straight out of Saturday Night Fever, Loren Bufanu has managed to transform his swimming pool into an LED-laden dance floor. And from the looks of its surrounding environment filled with garnished chairs and tables, it would appear to be for a wedding or party of some sort.

IMG_20150430_000222

To accomplish this feat, the Maker covered the pool with several glass panels, each outfitted with LEDs. Inspired by the Lampduino on Instructables, the project required nearly 450 meters of RGB LED strips controlled by two Rainbowduinos (ATmega328), driven by 64 power MOSFETs, 64 transistors, 64 bipolar transistors, a few capacitors and some resistors. Producing white light from the LEDs drew 8A from the power supply.

Although he originally thought to use the Colorduino as embedded in the Lampduino, he was unable to find a way to connect two of the boards together and control them with the same interface. So instead, he turned to a pair of Rainbowduino v3.0, which are pin compatible with the Colorduinos and can communicate over I2C. For those unfamiliar with these boards from Seeed Studio, the Arduino-compatible MCU features two MY9221 chips, which are capable of handling 12 channels of Adaptive Pulse Density Modulation.

3

In terms of software, the Maker used Pixel Invaders. Unfortunately, this portion of the project didn’t come as easy as the hardware installation. Bufanu had wanted the lights to flash in sync with some tunes, but a few setbacks in program didn’t allow for this to work. In the end, he decided to employ some simple visualization software combined with the Pixel Invaders “Screen Capture” mode. Fortunately, that did the trick.

“Basically, MilkDrop-like software is displaying some colors on the screen, and Pixel Invaders capture the screen, controlling the two Raibowduino after that pattern. Both are started by a simple batch file located on the desktop of the controlling PC. It was a ‘ugly hack’ but it is doing the job great,” Bufanu explains.

Intrigued? Head over to the Maker’s original page here, or simply see it in action below.

[h/t Hackaday]

33 smart crowdfunding campaigns you may want to back this week


Every Friday, we’re taking a look at some of the smartest, most innovative projects that caught our attention on Kickstarter and Indiegogo over the last seven days two weeks. 


RePhone

rephone

This open source, modular kit lets you build your own smartphone and give inanimate objects the power of cellular communication. Seeed Studio has already well surpassed its goal of $50,000 on Kickstarter.

MixStik

f9ac631524592ce257007fa2755d4422_original

This lightsaber-like wand helps you whip up the perfect cocktail in a matter of seconds. Magnified Self has just hit their $39,000 Kickstarter goal.

JSW S+

photo-original

This remote-controlled, camera-equipped robot not only cleans your house, it looks after it as well. JISIWEI Intelligent Tech is currently seeking $20,000 on Kickstarter.

Tempescope

ztsjbhfja9hlqvauzvuj

This ambient display reproduces various weather conditions according to the forecast. Ken Kawamoto is currently seeking $398,000 on Indiegogo.

Cannybot

01e7367f46012ab82b79002aface3d9e_original-1

These DIY race cars can be assembled like LEGO and programmed from your smartphone. Cannybots has already well surpassed its $40,000 goal on Kickstarter.

Percko

photo-original-1

This embedded undershirt teaches you how to have the right posture. Percko is close to tripling its initial $33,571 Kickstarter goal.

Pebblebee Stone

71ea911ae5e9d66323954905071d2a9d

This remote can be attached to any surface or carried on the go to text friends, control music, snap selfies and more. Pebblebee has already doubled its $10,000 goal on Kickstarter.

Robo Wunderkind

3aca895f2fc0ccfe1939f77b6deec6fa_original

This robotics kit allows you to build your own robot, have fun and pick up some basic coding skills along the way. Robo Wunderkind has already well surpassed its $70,000 Kickstarter goal.

EasyDrone XL Pro

a4600d2cfe15701a48efb11a9e86037c_original-1

This modular, plug-and-fly drone can stay in the air for 45 minutes on a single charge. Easy Aerial is currently seeking $30,000 on Kickstarter.

Zoom

aa2f36eadfc381de6820d0149ac7d1c7_original

This amphibious monitor goes wherever you go to measure your heart rate 24/7 — whether that’s while you’re resting, walking, running, biking, swimming or sleeping. LifeTrak is currently seeking $100,000 on Kickstarter.

The Crafty Robot

photo-original-2

This paper toy robot is perfect for beginners — just plug it in via USB for 30 seconds, unplug it and away it goes. Ross Atkin is currently seeking $19,220 on Kickstarter.

See Sense ICON

1343c98cd05da09ddc00355ce6715aa8_original

This intelligent bike light packs anti-theft, crash alert and an array of other capabilities. See Sense has already doubled its Kickstarter goal of $36,836.

Forcite Alpine

photo-original-4

This smart helmet for snow sport enthusiasts captures video, takes calls, streams music and more. Forcite Helmet Systems is currently seeking $200,000 on Kickstarter.

TurnCycle

Turn

This system consists of a wristband that wirelessly transmits hand gestures to an LED display mounted on a bicycle or the back of a rider. Gesture Controlled Products is currently seeking $110,000 on Kickstarter.

Balight

balight001-780x439

This customizable LED wheel display will light up the night as you pedal. Balight is currently seeking $30,000 on Indiegogo.

Ravean

photo-original

This line of smart clothing delivers warmth without the bulk of multiple layers. Ravean is currently seeking $100,000 on Kickstarter.

BUZZ

af2d3b66c7a503272294b55a85bfe691_original

This fun and adorable electronics kit grows with young Makers, from an instructional tutor to a friend they can program. Soldering Sunday is currently seeking $5,000 on Kickstarter.

Koto

koto-smart-sensors-6

This family of sensors keep tabs on your indoor environment and tells you when to make simple improvements around the house. Koto Labs is currently seeking $50,000 on Indiegogo.

Orbbec Persee

ORB

This camera-ARM computer combination is ideal for building 3D apps and making 3D-printable scans. Orbbec is currently seeking $40,000 on Indiegogo.

Knobbee 32

2735ff475e80e60f17eee8b44e19178e_original

This ergonomic, high-resolution MIDI controller boasts 32 knobs and an ATmega32U4 at its core. Knobtronix is currently seeking $36,392 on Kickstarter.

Smartlet

jhabd0tfwu4icmdf1nvv-1

This smart gadget plugs into your existing wall outlet, providing you with Wi-Fi, fast USB and an LED nightlight. Smartlet has already well surpassed its goal of $10,000 on Indiegogo.

RelaxBox

photo-original-3

This box will protect your network and any connected devices from outside attacks. RelaxInternet is currently seeking $11,196 on Kickstarter.

Strone Roam

strone_roam_hub

This smart device enables you to make and receive calls/messages on your phone in another country while eliminating roaming charges. Strone Roam is currently seeking $50,000 on Indiegogo.

speeC-EZ

6bf05b501b2b81c857a14c83924b4819_original

This small unit pairs with your smartphone for hands-free, voice-controlled activities as you drive. iCreation is currently seeking $50,000 on Kickstarter.

LOONCUP

photo-original

This connected menstrual cup enables women to track and analyze their biological cycles. LOON Lab is currently seeking $50,000 on Kickstarter.

Kerv

a5890280dd6e34d4e899806f98248578_original

This smart ring lets you buy things with a single gesture anywhere in the world that accepts contactless payments. Kerv is currently seeking $118,182 on Kickstarter.

NFC Ring 2016 Range

photo-original-5

This embedded piece of jewelry can be used to unlock doors, mobile devices, transfer information and link people. John McLear is currently seeking $86,388 on Kickstarter.

AEGIS

Aeig

This pair of headphones ensures that audio output never exceeds a safe level, while also promising optimum sonic quality. 16-year-old Kingsley Cheng has reached his goal of $25,000 on Kickstarter.

SOS 20K

b063005ae4c3d9e88b49d8d84c9ebd8b_original

This rugged, portable solar battery will be there for you when you need it the most. SOS PowerBank has already well surpassed  its Kickstarter goal of $20,000.

Aquai Puck

yxilkrvkivjhy3cew79p

This simple module attaches to your appliances and measures your water consumption. Aquai is currently seeking $15,000 on Indiegogo.

SesameTouch

photo-original-1

This tiny companion makes your digital life more convenient and secure by storing all the data you need to acces your daily services. Trust Designer is currently seeking $112,544 on Kickstarter.

XKchrome

Audi

This LED lighting system illuminates your beloved motorcycle or car with millions of vivid colors and animated patterns. XK GLOW has already achieved its goal of $10,000 on Kickstarter.

StarterMate

photo-original-6

This all-in-one 3D printing starter kit comes with an easy-to-use designing platform, tutorials, materials and finishing tools. Filamate is currently seeking $22,387 on Kickstarter.

HUI

ecdd505c93ced42020e4d33ef03a40b8_original

This smart gizmo allows urban farmers and gardeners to properly measure crucial parameters for growing healthy plants in real-time. GROW & HELP is currently seeking $3,134 on Kickstarter.

REVAMPS

Un

This breakout shield is a drop-in upgrade for 3D printers using a RAMPS 1.4 controller board. Jason Pasierski is currently seeking $27,000 on Kickstarter.

If your project is powered by Atmel MCUs and you’ve been featured on our blog, be sure to download the respective badges here for use in your ongoing marketing efforts. 

We Picked Atmel Rectangle_Yellow_updated_062315

RePhone is the world’s first open source, modular smartphone


Seeed Studio’s new kit enables Makers to create their own phone and hack inanimate things with the power of cellular communication.


When it comes to electronics, the concept of modularity continues to rise in popularity — and rightfully so. Rather than have to endure the high cost of a new gadget every few years, you’ll soon be able to swap out individual parts and simply upgrade your existing device whenever necessary. Reminiscent of Google’s Project Ara, our friends over at Seeed Studio have joined the party by launching a Kickstarter campaign for a DIY smartphone made entirely from open source components.

c82caabf9f791eecfbeb1f0ef10b0946_original

Called RePhone, the modular kit enables you to create your own phone as well as hack other objects around you by giving them the power of cellular communication. Pretty cool, right? The unit itself is built around the RePhone GSM + BLE module, or the RePhone Core 3G module which provides faster data connection yet lacks Bluetooth. But that’s not all.

Seeed will offer an assortment of Xadow add-on modules, each with their own set of unique features. These include a 1.54” touchscreen, an Arduino-compatible MCU (ATmega32U4), a basic sensor board, a GPS board, an audio board, a 5×7 LED board, a GSM breakout board and an NFC board. These can be connected using an FPC cable (11 or 35 pin), soldered wires, conductive thread or a breadboard. Plus, the DIY device is powered a 520mAh battery.

fbf28c6b3bf4ed2682e488662708b638_original

Additionally, Seeed has unveiled a RePhone Create Kit, which lets you design and customize a phone enclosure out of kraft paper. This material is sewable, washable, and most importantly, easy to draw on. Makers will be able to personalize their cases in all sorts of shapes, colors and styles.

The modular gadget is indeed a fully-functional tool, which can be used like any other everyday phone to make and receive calls, send text messages, and play music. Seeed has devised Arduino, Lua and Javascript libraries, as well as a full power SDK based on Eclipse for C/C++ developers. What’s more, the RePhone can be programmed with IFTTT logic. This allows you to define and implement recipes for various actions, such as being notified if your dog wanders off or your bike gets lost.

df26e26efdcc956767369f618de912c2_original

“The modular design of RePhone brings limitless DIY possibilities. Those tiny neat blocks can be fit into a phone enclosure of any size, shape, or style you like,” Seeed Studio writes. “You can make your RePhone even cooler with different materials like leather, fabric and bamboo. Build a sturdy case with 3D printing, laser cutting, CNC and injection molding.”

To top it all off, the device is compatible with both the Arduino and Pebble. RePhone creates alternative ways to communicate with inanimate things in your physical world over GSM and 3G, whether that’s a walking cane phone for grandpa, a GPS pet collar, an interactive t-shirt or a rigged desk lamp. The possibilities are endless.

6e24e8566ce912b5e4382cf3ca774cbf_original

Ready to piece together your own RePhone? Although Seeed Studio has already completed its Kickstarter campaign, which garnered over $276,000, you can still pre-order yours today here.

Arduino and Seeed Studio announce partnership at Maker Faire Shenzhen


Seeed Studio will manufacture and distribute Arduino LLC products using the new Genuino brand in Asia.


Back in May, Massimo Banzi took the Maker Faire Bay Area stage for the highly-anticipated “State of Arduino” address. During what was surely one of the most highly-anticipated sessions of the show, the Arduino co-founder announced a New York City manufacturing partnership with Adafruit, the availability of the Arduino Zero and Wi-Fi Shield 101, as well as the launch of a sister brand dubbed Genuino (“genuine” in Italian) for boards outside of the United States.

SEEDGenuinoLow

One month later at Maker Faire Shenzhen, Banzi has returned with some other big news: He and Eric Pan, founder and CEO of Seeed Studio, have unveiled a strategic partnership between Arduino LLC and Seeed Studio. Similar to their collaboration with Adafruit here in America, Seeed Studio will manufacture and distribute Arduino LLC products using the new Genuino brand in China and other Asian markets.

“The new Genuino name certifies the authenticity of boards, in line with the open hardware and open source philosophy that has always characterized Arduino,” Banzi explains. “We are very excited to partner with Seeed Studio to manufacture our products in China. We’ve known and appreciated Seeed for years, we share the same values and I think they are one of the most forward looking companies in China.”

Uno_front1

As popular as Arduino has become throughout China, Banzi notes that the brand has been heavily used without permission. Fortunately, Genuino will allow the market to clearly identify which products are indeed authentic and contributing to the open source hardware process. The brand will still emulate the 8- and 32-bit chips that Makers have grown accustomed to over the years, such as the Uno (ATmega328) and Mega (ATmega2560), in a familiar teal and white color scheme.

Mega_front1

“Arduino is becoming a global language of making, we are proud to help provide Genuino branded localized products to carry on the conversation in China. Here we already have a huge Arduino user base and growing, it’s time to get us involved deeper with global ecosystem,” Pan added.

Genuino-branded products will be sold on Seeed’s store on Taobao and on Genuino’s official site in the near future.

Pebble pledges $1M to make smartstraps a reality


Pebble has pledged $1 million towards development of modular accessories for its latest Time and Time Steel smartwatches.


A few weeks ago, Pebble launched a Kickstarter campaign for its Pebble Time smartwatch. To date, the record-shattering gadget has already garnered nearly $20 million and has been at the center of all the wearable buzz as of late. Aside from the unveiling of its premium Steel counterpart during Mobile World Congress, another big piece of news has proven to be the announcement of modular smartstraps. This open hardware component of Pebble Time will enable Makers, developers and designers alike to create their own add-ons for the device. Better yet, Pebble is now betting big on the initiative by pledging $1 million to fund its development and commercialization.

photo-original

“If you have an idea and want to be part of the smartstrap revolution, this is your chance! Get a team together, build a prototype and put your project up on a crowdfunding platform. Our team will work to help bring your idea to life,” Pebble writes.

Smartstraps open the door to a wide-range of possibilities, including standalone cellular capabilities, NFC, GPS and even heart rate monitors. Pebble says these bands will be easily interchangeable, and can be swapped out in as little as five to 10 seconds.

In the days following its announcement, the Pebble crew received countless ideas, requests, and suggestions for smartstraps. Two of their earliest favorites came direct from notable names in the Maker community: Spark.io and SeeedStudio.

451e04920006a6fe3772e449e3f1a1c2_original

Seeed Studio has revealed that they will be producing a Pebble Time connector for their Arduino-compatible Xadow boards (ATmega32U4) later this year. Meanwhile, a recent Spark.io prototype demonstrated how an Electron could be used to untether a Pebble and connect directly to the cellular network.

“We are big fans of Seeed and their Xadow modules. They offer 20+ strap-sized modules, which include NFC readers, OLED displays, barometers and GPS modules, and we hear a Heart Rate Sensor is coming soon! The upcoming Xadow adapter for Pebble Time will make prototyping new smartstraps very simple and affordable.”

923412c2399b4561da771bdceb1e6aeb_original

Keeping in line with its crowdfunding tradition, Pebble is encouraging Makers to get together, devise prototypes and put their projects up on Kickstarter. The team adds, “We will monitor Kickstarter and other crowdfunding platforms for smartstrap related projects that support Pebble devices, and we’ll back the best of them. We truly understand the value of backing projects in their early state, having started that way ourselves.”

Want to learn more? Head over to its official page now.

Connecting an Arduino to a mobile cellular network


PubNub’s Ian Jennings demonstrates how to connect your Arduino to a mobile cellular network with a GSM/GPRS shield.


There’s a ton of tutorials out there on hooking your Arduino up to the LAN, whether it be Wi-Fi, an Ethernet, or other. But what about beyond the LAN? What if you want to connect your Arduino to the Internet in the wild?

In this tutorial from PubNub’s Developer Evangelist Ian Jennings, we’ll show you how to connect your Arduino to a mobile cellular network with a GSM/GPRS shield. This enables you to stream data bidirectionally or trigger device actions anywhere with a cellular network.

And, that’s powerful for any mobile IoT implementation (think connected car or drones) or apps without a Wi-Fi signal (think irrigation or weather sensor networks). Like like the many other DIY Arduino projects out there, it’s easy, affordable, and powerful.

So let’s get the tutorial started!

arduino mobile cellular network

What You’ll Need

  • Arduino UNO Rev3 (ATmega328)
  • Seeed Studio GPRS Shield V2.0
  • AT&T SIM Card (standalone)
  • C size batteries (x5)
  • C size battery holder (x5)
  • Smartphone
  • Laptop

Setting up the SIM Card

iphone-activation-card-600The first thing you’ll need to do is unlock the SIM card and make sure it has a data plan associated with it (hence why we included the smartphone on the list above).

Put the SIM card into your phone and read the instructions on the package. In the case of an AT&T SIM card, you may have to dial a series of numbers to activate the card, then configure the plan online, but this may vary depending on the carrier.

Note: Make sure your mobile plan supports data transfer and not just calls and texts.

Then, connect to a website on your mobile phone. If it works, you have data and the SIM card will work on your Arduino.

Setting up Arduino GPRS

Plug in your now-activated SIM card to your Arduino GPRS Shield. For how to do this, Seeed Studio has a great tutorial. Follow the tutorial, but stop and come back to this tutorial before uploading code in “Test Setup.”

Arduino Libraries

There are a fair amount of libraries needed to get setup on Arduino, but at the end, it’ll make it all a lot easier. The specific libraries for the Seeed Studio GPRS Shield v2 can be found here. In the docs, you’ll see the three libraries you’ll need to connect to a mobile network.

Import all three libraries into the Arduino setup.

Software Serial

Now that our shield and Arduino environment are ready, let’s move onto the fun part of this tutorial: playing with the cell networks. We need a way to talk to the SIM900 chip on the Arduino. Instead of using a hardware serial and talking directly to it, we’re going to use Arduino’s software serial.

Open up the SIM_900_Serial_Debug example from your Arduino examples folder.

This example is pretty simple. All we’re doing it proxying the serial data from Arduino’s serial port into SIM900’s. This enables us to use the included Arduino serial debug tool to interact with our SIM900.

void loop(){
  if(gprs.available()){
    Serial.write(gprs.read());
  }
  if(Serial.available()){     
    gprs.write(Serial.read()); 
  }
}

Call Yourself

To test everything out, we’re going to attempt to call ourselves with the Arduino GSM shield. First, load the software serial example onto the Arduino and then open up the serial debugger. Be sure to power the SIM card on the Arduino GPRS shield using the button on the side.

Power up the SIM900 by pressing the power button for around 2 seconds. The red LED will turn on. The green one beside it will begin blinking. If the shield joins the network successfully, the green LED will blink every 3 seconds. Wonderful!

Make sure you put your old SMS card back into your phone after testing the Arduino SIM. Now, type the following into your Arduino serial window.

AT

Serial output should show something like:

RDY
 
+CFUN: 1
 
+CPIN: READY
 
+PACSP: 0
 
Call Ready

If you don’t see the messages in the serial monitor, click the “send new” option that will add carriage return at the end of AT command, and then send AT command “AT+IPR=19200″ to set the baud rate of the SIM900.

Now try calling yourself. Enter the following command, replacing 1***8675309 with your own number.

ATD1***8675309;

If it succeeds, a message ATH OK will show up as the picture below. Otherwise, No CARRIER will show up instead. The reason might be nonexistent phone number or incorrect command format.

Connecting to the Mobile Cellular Network

Now that we’ve configured our Arduino to work over GSM, let’s get it connected to the mobile cellular network.

Make sure that the baud rate of SIM900 is 9600! You can use the AT Command(AT+IPR=9600) to set it through SerialDebug.

Load up the the GPRS_TCPConnection example from GPRS_Shield_Suli. This example makes a simple request tombed.org/media/uploads/mbed_official/hello.txt HTTP/1.0\r\n\r\n

However, it probably won’t run when you load it on your Arduino. This is because it’s not configured to work with your specific cellular network.

In my case I’m using AT&T, so I needed to change the following lines to configure my GPRS connection:

GPRS gprs(PIN_TX, PIN_RX, BAUDRATE,"cmnet");

This line isn’t sufficient in most cases. We’ll also need to supply an APN, username, and password. These parameters are omitted from the example but you can simply supply them on your own. You can find the relevant code here.

GPRS(int tx, int rx, uint32_t baudRate = 9600, const char* apn = NULL, const char* userName = NULL, const char *passWord = NULL);

To connect to AT&T, use the following config:

GPRS gprs(PIN_TX, PIN_RX, BAUDRATE, "wap.cingular", "WAP@CINGULARGPRS.COM", "CINGULAR1");

Now run the code. You should be able to obtain an IP and issue the request. However, the app will probably crash (SIM turns off) when the request has been issued. This might be confusing, but there’s an easy fix.

Battery Considerations

The Seeed Studio and a variety of other shields advertise to be “plug and play” with Arduino. However, this isn’t always the case. This shield in particular doesn’t have enough power from the single 5v USB supply to successfully complete TCP requests.

This is easy enough to fix though, all we need to do is give it more power! Online forums suggest adding 5 C-cell batteries to power the GSM chip, which is what we did below:

The batteries should be wired in series, with the positive end wired into the VIN input and negative wired into the GND. After you’ve added batteries, try the example again. It should connect successfully.

Great! Now we’re ready to signal with PubNub.

Signaling with the PubNub Data Stream Network

We’re going to use the PubNub Data Stream Network as our backend messaging layer for signaling our Arduino. This enables you to send and receive data bidirectionally between your Arduinos and signal to trigger device actions.

Load the following example onto your Arduino, changing the GPRS gprs() configuration as mentioned previously.

#include 
  #include 
  #include 
  #include 
 
  #define PIN_TX    7
  #define PIN_RX    8
  //make sure that the baud rate of SIM900 is 9600!
  //you can use the AT Command(AT+IPR=9600) to set it through SerialDebug
  #define BAUDRATE  9600
 
 
  GPRS gprs(PIN_TX, PIN_RX, BAUDRATE, "wap.cingular", "WAP@CINGULARGPRS.COM", "CINGULAR1");
 
  void publishData(String data) {
 
    Serial.println("attempting to publish");
 
    while (false == gprs.join()) {
      Serial.println("gprs join network error");
      delay(2000);
    }
 
    String str = "GET /publish/demo/demo/0/pubnub_gprs/0/\"" + data + "\" HTTP/1.0\r\n\r\n";
 
    // Length (with one extra character for the null terminator)
    int str_len = str.length() + 1; 
 
    // Prepare the character array (the buffer) 
    char http_cmd[str_len];
 
    // Copy it over 
    str.toCharArray(http_cmd, str_len);
 
    char buffer[512];
 
    if (false == gprs.connect(TCP, "pubsub.pubnub.com", 80)) {
      Serial.println("connect error");
    } else {
      Serial.println("publish success");
      Serial.println(data);
    }
 
    gprs.send(http_cmd, sizeof(http_cmd) - 1);
 
    gprs.close();
 
  }
 
  int counter = 0;
 
  void setup() {
 
    Serial.println("starting");
 
    Serial.begin(9600);
    // use DHCP
    gprs.init();
    // attempt DHCP
 
    while(true){
      publishData(String(counter));
      counter++;
      delay(1000);
    }
 
    gprs.disconnect();
 
  }
 
  void loop() {
 
  }

This example connects to PubNub and publishes a message every second. It works just like the previous example, but instead of retrieving data, this example streams information to the PubNub network where it’s accessible from anywhere.

Rest Client

You can see how the message is assembled by looking at the publishData() function.

See how the url is created here:

String str = "GET /publish/demo/demo/0/pubnub_gprs/0/\"" + data + "\" HTTP/1.0\r\n\r\n";

It may be confusing at first, but let’s break it down. The url is formatted according to the PubNub REST Push API.

http://pubsub.pubnub.com
/publish
/pub-key
/sub-key
/signature
/channel
/callback
/message

The domain pubsub.pubnub.com is defined later in the function. The publish key refers to is the pubnub command (you can also subscribe). The pub-key and sub-key come from your own PubNub account, but you can use thedemo keys for now. Don’t worry about signature.

The channel is really important. This is like an IRC channel for your PubNub devices to talk to each other.

Show Me the Data

Since we don’t have any other device listening for messages from the Arduino, let’s use the PubNub console to observe our channel activity.

If you’re using the default code above, you can use this link to view channel activity for your GPRS chip.

If your demo is running you should see a count like 1, 2, 3, 4 appear in the “message” pane.

We’re able to view the data coming out of the Arduino because we plugged the same publish and subscribe key into the PubNub console as we did into the Arduino. Since we’re using the demo keys the channel is shared publicly, but if you create your own account your data will be privatized.

Additional Resources and More Information

This is just one of our many Arduino-PubNub implementations. We’ve also connected Arduino Yún to the Internet, as well as showing you how to connect Arduino Uno and Seeed Studio Ethernet Shield v2. For all our Arduino related posts, here’s the full feed.


Ian Jennings is a developer evangelist at PubNub, a secure global data stream network for IoT, mobile, and web applications. He cofounded Hacker League, a site devoted to simplifying the organization of intensely collaborative tech events known as “hackathons.” Jennings recently pretty much guaranteed that he’ll always be able to keep himself stocked up on techno-gadgets with the sale of Hacker League to Intel’s Mashery subdivision for the price of more than a few PCs. But he’s not done. In fact, his latest invention, Mote.io, is a remote that connects your web browser with various music platforms like Pandora, Youtube, and Rdio, and has gotten raves on tech sites like GigaOM; he’s also in the midst of developing the Reddit app for the uber-hyped tech accessory Google Glass.