Using the Tinker App/Sketch with a Photoresistor

I got my Photon at Maker Fair SF (actually bought 2, gave one away and just ordered 2 more for July shipment). Anyhow, got the Tinker thing working but doing the setup with a Photoresistor and Resistor that came with it doesn’t yield much variance on the Analog read function of a pin. Eventually I figured it must be something with that setup and did a simpler program to just read an analog value and print over serial.

This yield the results I was looking for and now I’m able to effectively use this with IFTTT and ThingSpeak.com …My questions is, why was it not showing the variance in the Tinker Program any thoughts. I know the electronics setup is right since it works with a simple analogRead program.

1 Like

@andyleer,

I’m trying to find out how the Tinker app polls the values but haven’t found the repo for the apps.

Ping @ido

Tinker iOS app will be open-sourced this week.
Anyhow, it just does an “analogRead” from the pin, nothing fancy there.

@andyleer: I’d love to understand how did you hook up your photoresistor to your Photon? did you use a pull-up/pull-down resistor? where was it connected to?

I hooked it up just as was described in the link here… with putting the A5 High in the Tinker values stay around 323 +/- 30 or 40 but never enough to detect a difference.

Connect other end of photoresistor to 3V3 (don’t output ‘1’ to A5 and use it as supply).
I just tried it with tinker, I am getting readings around 180 for darkness, around 400 for ambient office light and 1000-2000 when shining with a flashlight directly onto the sensor. Quite a nice workable range. Try that.

Hate to say it but I tried that too…I’ll give it another go in a day or two, having too much fun with ThingSpeak.com right now. I tried this on another (originally bought 2 of the photons) same thing. I even went as far as to check data sheet and recommended resistor values. Again, it’s working now with a simple analog read sketch. Once I try again, I’ll give my results, maybe post a youtube if it doesn’t work.

Thanks,

Andy

If your resister is 220 ohms, and your photoresistor is 3000, then you will not see much change.

A good rule of thumb, check the resistance of your photoresistor about mid range, and use a resistor of about that value.

What is the resistance of each of these in your setup ?

I would also stick in a cap (.01 or .1) on the A0 pin.

Using Tinker, when you set A5 high, you then have to click on A0 again to see its value (it will not update on your screen else).

Thanks, Jack

I have a feeling that the mobile app is not continuously polling the Spark.variable() and is a request if the user click it thing.

So what you are observing as not changing might be correct. It’s just how it’s designed to be.