Power meter blink (usage) logger, responds with json

Hi :slight_smile:

Hoping to get some advice. Here is what I would like to do:

I would like to be able to log blinks form my power meter (it blinks an LED 1000 imps/kWh) and provide access to the logged data using json (http). I'm hoping to visualize power consumption (in my house) on my iPhone

I have made a simple "eye" using a photoresistor and connected it to my "Arduino Uno" board. I am able to see an increase in the resistance when my power meter blinks. So far so good.

But now I'm a little lost.

  1. I'm looking at the "Arduino Ethernet w/o PoE module". Would I be able to use the SD slot on this board to log data and at the same time respond to requests (json)?

I found the following while reading about the "Arduino Ethernet w/o PoE module":
(http://arduino.cc/en/Main/ArduinoEthernetShield)
Note that because the W5100 and SD card share the SPI bus, only one can be active at a time. If you are using both peripherals in your program, this should be taken care of by the corresponding libraries.

I'm a c# developer so please excuse the flowing questions (I'm new to C):
2) How would i go about registering the blinks? Is there a better way than a simple "if(resistance > value)" in my main loop?
3) How would i go about logging data and at the same time be able to respond to requests and return JSON? (is there a way to do some sort of threading?)

Fingers crossed that someone can provide inspiration/answers :slight_smile:

  1. I'm looking at the "Arduino Ethernet w/o PoE module". Would I be able to use the SD slot on this board to log data and at the same time respond to requests (json)?

Yes, the libraries take care of making the appropriate device the active device.

How would i go about registering the blinks? Is there a better way than a simple "if(resistance > value)" in my main loop?

No, there isn't a better way. What is the problem with that way?

How would i go about logging data and at the same time be able to respond to requests and return JSON?

Why are you hung up on JSON? Is there some reason not to send plain text? I mean, if someone intercepted your transmission of energy usage data, in the form of number of ticks in some time period, would that compromise you somehow?