Using a grove light sensor as an up counter and sending data to the cloud

Hello Parti people!

I am completely new to this world and after getting my core setup I quickly realized that I’m in over my head… Hopefully you can help me.

My project uses a Grove light sensor to count discrepancies from the base line light reading and then sending that data to the dashboard. So each day I can look at how many times it was triggered.

Is there a pre-existing code that would work for this? I searched around online but I was unable to find what I need. Additionally, there are four connections on the sensor -do I need them all?

Thank you!

Hey there, and welcome to the community!

For your sensor it seems the NC is Not Connected, which means you’ll only have to hoop up the remaining three. GND goes to GND, VCC goes to 3.3V. Sat SIG pin goes to an analog pin of your choice.

For the code, you can have a look at this:
If you want to get this to the web, you’ve got a lot of choices. You might want to look into Particle.publish() in combination with IFTTT. You can then store the data in a google spreadsheet from which you can plot it. Alternatively, there are a bunch of online services that’ll allow you to store/plot your data.

If I were you, I’d start of easy, by making sure you can read out the sensor. Once you understand what’s going on there, then you can move on to the web side of things.

One of the easiest online platforms I have found to use is Ubidots.

There is a library already in the Particle Online IDE that you can checkout which should help you get going.

Once you have it setup you can display all your data via widgets and graphs and have emails or text messages sent out to notify you when a threshold has been reached.

It’s free so check it out.

If your just getting started avoid going the Google Spreadsheet route since its more complicated from my own personal experience. Ubidots logs your data as it comes in anyways and you can export it to CSV format at any time to use it elsewhere.

Hi @RWB, I have been using IFTTT and Google Sheets for about a year, and except for the occasional missing data due to Google API failures, it works pretty good.

One of the reasons I shied a way from Ubidots was the limit of 5 sensors. I don’t mind paying a little but $12 per month only gets you up to 15 sensors. I run many sensors with somewhere between 90-100000 data points per month.

While Ubidots looks cool, and they have awesome tutorials to help get your device connected, it’s the limits that stop me, or is there something I’m not understanding correctly about their limits? A single weather station uses more than 5 sensors, to me 15 sensors is just playing around and it appears that Ubidots charges approximately $0.75 per sensor per month as you move up. Does that sound right?

@Dylan, of course for a single sensor give Ubidots a try. As already mentioned they have awesome tutorials to help get you connected and collecting data. Since you’re counting, another approach, if you have an ios device, is Particle.publish in combination with IFTTT and Numerous (, great for keeping track of and sharing things that are counted and otherwise numeric.

@Jseiler Actually I have never needed to read more than 5 sensors so I have not yet came up on any Limits yet but right now I am actually adding up to 10-15 different data points on a currently free account.

Right now on the Free Account I have more than 5 sources running and more than 5 sources being displayed on the dashboard so I have not hit any limits so far.

So I guess if you have big time data that you have to deal with then you have to make a choice on which best fits your application. I’m adding this to some products we built so I need the easy to use custom web interface that they offer.

I tried the google spreadsheet code way back and didn’t like it at all, It was unreliable and same as you data went missing.

Thanks for your help! I’m getting data sent over to Ubidots and it’s working. I need to tweak things a bit and I’ll follow up.

You guys are the best!


@Jseiler I just got done adding 13 variables to Ubidots on the Free account.

I think you are only allowed to create 5 sources and each source can have up to 15 variables and maybe more. If you end up going over the 500,000 dots then they start billing you. Also if you use up your 5 Free text messages then they start billing you.

I also found this link on the left hand side where you can share your dashboard via a custom link and even lock the dashboard so they can’t alter it which I thought was pretty cool and I just used that for the first time.

Thanks for the added intell. Certainly can’t hurt to sign up for the free account and do some snooping around. Something to play with this weekend since my Electrons showed up in the mail yesterday :grinning: