Showing posts with label particle photon. Show all posts
Showing posts with label particle photon. Show all posts

Thursday, October 20, 2016

Webhook from Particle Photon to Thigspeak

In one of my old blog post we already had a introduction about the Particle IoT platform.As we discussed there particle events have many application and can be integrated to many other IoT services like webhooks,Thingspeak,IFTTT,Ubidots, etc.In this post i am going to share that how to create a webhook to thingspeak from particle.
It is very simple ,actually we are just using the particle event (particle.publish) here.No tactical coding is needed to send data to thingspeak from particle using webhook.for demo purpose i am just showing how to visualize varying analog voltage graphically in thingspeak.Here i am using a potentiometer to change the analog voltage.You can change it to any other sensor and visualize data graphically.even you can embed this graph into your personal site.

Wire up your particle photon as shown in the above circuit.Then open particle Web IDE and upload the below code to your photon.The code is simple it is just publish an event which is publishing the analog voltage on pin A0 in every 1 minute.

void setup(){
pinMode(A0,INPUT);
}
void loop() {
// Get some data


int value=analogRead(A0);
String val=String(value);


// Trigger the webhook
Particle.publish("value", val, PRIVATE);
// Wait 60 seconds
delay(60000);
}



Now we have published an event named "value". We can see the updates of this event in particle console.
Now we can create new  integration .For that select new integration in console and select webhook
You can see the above screen.Now we have to create a channel in thingspeak and fill the data to above form.Now open thingspeak and create a new account if you are new to thingspeak .Then create a new channel and note the channel API



Now we can fill the webhook form in particle console.Fill the boxes like below
  • Event Name=value
  • URL=https://api.thingspeak.com/update
  • Request type = POST
  • Device = Your device name
Now press advance setting tab and fill the boxes  

  • api_key: YOUR_API_KEY
  • field1: {{PARTICLE_EVENT_VALUE}}

now the webhook to thingspeak is created.Now you can see graphical representation of your sensor values in thingspeak


You can also embed the graph in your site also.

Monday, April 11, 2016

PARTICLE CORE the best hardware choice for IoT based prototyping




Future world is the world where everything is connected.Nowadays electronics engineers researches mainly on IoT-internet of things.we need internet of everything.There are many boards and modules in market which helps hobbyists to develop their prototypes and play with connected things.Arduino is already providing Ethernet shield ,WiFi shield for connect the device into internet.Raspberry Pi is also came up with their WiFi and LAN.especially their latest Raspberry Pi3 has inbuilt Bluetooth and WiFi
But in this blog post  i am going to explain my experience with a cool microcontroller board other than Arduino and Raspberry Pi.That is Particle core - a microcontroller board with inbuilt WiFi module and cloud connectivity.(https://www.particle.io/)

Particle core

Particle is core is one of the amazing and cool stuff for electronic engineers,hobbyists and prototype makers.This board can be easily connected to internet as easily as we connect our smartphones to internet.

  • It uses ARM 32-bit Cortex™-M3 CPU Core as its brain
  • The WiFi module is CC3000

Some of its features makes this board extra cool.

1.This board can be coded remotely.

    Yes you can code this board far away from your hardware.Because Particle uses a
web IDE,the code is debugging from their cloud and uploading it to Particle core via internet.All you need is set up your account in particles web IDE(https://build.particle.io/build/) you will have a  unique id for your particle.if you keep connected the particle with WiFi you can code it from anywhere in the world.

2.Arduino like language.

     No need to study a new language for programming your particle.The coding language used for Particle is very much similar to arduino C.So any arduino hobbyist can easily play with particle.

3. Particle variables

    Particle variable is another cool thing.you can send particle variable data into cloud.it can easily see using URLs which is based upon your devices unique id.It have its own API.Also if you are using
Particle Dev(a desktop application)  in your computer,you can easily watch the current value of particle variables.All you need to do  is just declare your variable as particle variable by simple command,then the data will be in the cloud.No need of any long coding (https://docs.particle.io/reference/firmware/core/)


4.Particle Functions

   These are cloud functions.You can easily trigger value from cloud and controll your device according to that function. This is also working using particles own rest API (https://docs.particle.io/reference/firmware/core/)



5.Tinker the mobile App

Tinker is a mobile app which can use in your smartphones.if you upload the corresponding code for tinker in your particle core you can control all pins of your device using your phone.you can make a pin HIGH or LOW or can write and read analog values.

6.connection with IFTTT

Particle is a verified channel in IFTTT services. You can write conditional statement actions using this.
For eg;if you want a mail notification/sms/push notification when your particle variable value is below or above(like your room temperature is x ) that is so easy with IFTTT and particle

7 .Arduino like pins and Protocols

Particles pins are similar to arduino.but its voltage output is 3.3V max.Particle supports protocols like UART,SPI,I2C,