January 17, 2015

0 Comments

Sending SMS with IOT-644 Board, ThingSpeak and Chikka API

This article will show you how to add SMS capabilities to your IOT based projects. This article is based on gizDuino IOT-644 arduino compatible board based on ATmega644 and Wiznet W5500 Ethernet chip, ThingSpeak and chikka API.

gizDuino IOT ThingspeakChikka

 

Arduino do not have native support for HTTPS protocol so we will use Thingspeak to trigger the Chikka API. The Chikka API entitles you to send 25 SMS for the free account.

Lets Get Started!

1. Sign up for a free trial at https://api.chikka.com/. After signing up, verify your number. Chikka allows you to send SMS only to the verified number using your free account. Take note of your chikka short code.

2. Signup for an account at Thingspeak. Register at https://thingspeak.com/users/sign_up.

Now that you have your accounts, we configure Thingspeak

1. Go to thingspeak.com sign in using your account then click on apps.

2. Click on ThingHTTP followerd by New Thing HTTP. This will take you to the setup page.

Thingspeak

 

3. Name it ChikkaSendSMS,

4. URL is https://post.chikka.com/smsapi/request

5. HTTP AuthUsername is your chikka Client ID, and the AuthPassword is your Chikka Secret Key

6. Set the Method to POST

7. Leave the Content Type as Blank.

8. Click on remove header and leave the host blank

9. Put the following in the body, change the shortcode, clientid and secret key as per your chikka account.

message_type=SEND&mobile_number=%%number%%&shortcode=YOUR_SHORT_CODE&
message_id=RANDOM_USER_GENERATED_32_Characters&message=%%message%%&
client_id=YOUR_CLIENT_ID&secret_key=YOUR_SECRET_KEY

10. The message_id is a unique ID needed to be generated as per the instruction from CHIKKA.

11. Save the ThingHTTP.

Gizduino Side

1. Make sure that your Arduino IDE is patched with the latest E-Gizmo Patch for the gizDuino IOT644 board

2. Upload the following Code to your IOT Board. Don’t forget to change your apiKey and sendNumber
#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
char server[] = “api.thingspeak.com”;
IPAddress ip(192,168,1,200); // Change this to your ip range
// if no DHCP is present

EthernetClient client;
const String apiKey = “Your ThingHTTP Api Key”;
const String sendNumber = “DESTINATION_NUMBER”; //start with
//country code
void setup()
{
Serial.begin(9600);

Serial.println(“Gizduino Initialization”);
if (Ethernet.begin(mac) == 0) {
Serial.println(F(“Failed to configure Ethernet using DHCP”));
Ethernet.begin(mac, ip);
}
Serial.print(“DHCP Assigned IP:”);
Serial.println(Ethernet.localIP());
delay(1000);

Serial.println(“Sending SMS”);

//this function will send the sms
sendSMS(sendNumber, URLEncode(“IOT Pa More”));

}

void loop()
{

}

void sendSMS(String number,String message)
{

if (client.connect(server, 80))
{
//make TCP connection to ThingSpeak

client.print(“GET /apps/thinghttp/send_request?api_key=”);
client.print(apiKey);
client.print(“&number=”);
client.print(number);
client.print(“&message=”);
client.print(message);
client.println(” HTTP/1.1″);
client.print(“Host: “);
client.println(server);
client.println(“Connection: close”);
client.println();
}
else
{
Serial.println(F(“Connection failed”));
}

while (client.connected())
{
if ( client.available() )
{
char c = client.read();
Serial.print(c);
}
}
Serial.println();
client.stop();
}
//Encode spaces to HTML tags
String URLEncode(const char* msg)
{
const char *hex = “0123456789abcdef”;
String encodedMsg = “”;

while (*msg!=”){
if( (‘a’ <= *msg && *msg <= ‘z’)
|| (‘A’ <= *msg && *msg <= ‘Z’)
|| (‘0′ <= *msg && *msg <= ‘9’) ) { encodedMsg += *msg; } else { encodedMsg += ‘%'; encodedMsg += hex[*msg >> 4];
encodedMsg += hex[*msg & 15];
}
msg++;
}
return encodedMsg;
}

3. One Uploaded, you will get a response similar to the image below from your serial terminal

Chikka Response

Continue reading...

October 12, 2014

0 Comments

Reading RFID tags with C# and RDM630

 

Low Cost RFID

The RDM630 Proximity Reader Module is a low cost 125 kHz RFID  Proximity reader. It uses uEM 4100 or compatible card with  64 bit Manchester encoding and outputs the data to its serial port at 9600 baud. With this, RFID tags can be easily read by C# using the serialport module and can be integrated to larger systems such as inventory or attendance systems .

The output format of the reader is given as :

 

format

To create the simple interface, create a new project and add two labels, change text to COM Port and ID TAG respectively, add a combo box to contain installed serial ports, a rich text box to contain the data coming from the tags, a button which will serve as connect and disconnect button and add a serialport.

After adding the controls, lets make the magic happen! Add the System.IO.Ports namespace, we need it later to get all the installed serial ports on the PC and populate our combo box for the Serial Port Selection.

IO Namespace

 

Instantiate a new delegate for the received serial port event and initialize the delegate to use getRFID routine to capture the data from the reader.

delegate

At startup, we get all stored serial ports and populate the combo box for the selection of the desired COM Port

getSerial

For the Connect button to Open or Close the connection add the following
Button

To read the RFID data, we read till the ETX of the reader and display it to the richtextbox

get

Finally we test if it works

YouTube Preview Image
Continue reading...

September 23, 2014

0 Comments

PBOT Graphical Programming with miniBloq

  The PBOT is an entry level robotics platform that features 3 IR Collision Sensors, 3 Line Sensors and a 2 channel Motor driver. It is Compatible with all Gizduino Boards (An arduino derivative board) and all arduino form factor boards. It is a good starting point for beginners in the field of robotics. Line Follower, Sumo […]

Continue reading...

September 19, 2014

0 Comments

Hacking a cheapo PIR for projects

This cheap PIR sensor with LED light is an eye catcher for hacks at only 150 Philippine peso. A generic PIR based on the LP0001 PIR controller chip and can readily be used for projects. The circuit reveals a basic circuit based on the datasheet of the controller chip, the signal from the output pin can […]

Continue reading...

September 18, 2014

0 Comments

Getting Started with the E-Gizmo IOT644

Today, we live in the Internet era where everything can be seen or controlled online. Internet of Things are becoming more and more popular. For us makers, the E-Gizmo IOT-644 board is a great starter board to build IOT projects. It is based on Atmel Atmega 644, double the memory and RAM of the Uno and […]

Continue reading...

August 12, 2013

0 Comments

Philrobotics interviewed by Vigattin radio program

(Photo grabbed from http://vigattintourism.com/tourism/articles/Vigattin-Radio-with-Project-NOAH-and-PhilRobotics) Philrobotics has been interviewed last Saturday, August 10, 2013,  by Vigattin radio program (DZIQ 990kHz) along with Project Noah and International Rice Research Institute’s (IRRI) Bigas Hackathon organizer Ms. Bianca Ferrer. It was great looking back at how we’ve won the 1st Bigas Hackathon with lack of planning and the only […]

Continue reading...

January 20, 2013

2 Comments

Getting Started With Philrobokit Presentation Material

Congratulations to Gigz for a successful Anino Seminar held last Saturday. For those who wanted to attend but wasn’t able to go, below is the presentation material. Getting Started with PhilRoboKit Anito This 7Zip file contains the Powerpoint presentation and sample codes. <edit editedby=n0th1n6> Getting Started with PhilRoboKit Anito by </edit>

Continue reading...

January 1, 2013

6 Comments

Anito Seminar

To start of the year, Philrobotics will have a seminar this January. Here’s the details. What: Anito Seminar When: January 19, 2013 Where: e-Gizmo 2fl VSC Building, Taft Ave Malate Manila Time: 1pm Wanna know more about the Anito Dev Board? (click here)

Continue reading...

January 1, 2013

0 Comments

Happy New Year!

Happy New Year to you all from Philrobotics team. May we all have a prosperous new year. Let’s have more fun and activities, and enjoy building robots and learning new things this 2013.

Continue reading...

November 19, 2012

0 Comments

Robot Zoo in the Philippines

Over the weekend, I brought my kids to a popular mall at the end of EDSA to see the planetarium and Robot Zoo. It was a fun experience seeing these huge robot animals. There’s a giraffe, a chameleon, a rhino, a grasshopper, platipus, squid, and bat. Mostly these robots are powered by pneumatics so you […]

Continue reading...