Particle Photon Shield Shield - Dude where is my Analogue Input?

Hi y’all,

I am a beginner with Particle Photon, and I am using the Particle Photon with the [Shield Shield][1] as a small experimental weather station to protect my peppers against the Texas climate. I am using the shield shield to protect the Photon against myself. I want to measure temperature (TMP36), light (resistor) and at a couple of peppers the soil moisture (resistor).

I have been struggling with the pin I/O maps, but combing references;
https://docs.particle.io/datasheets/photon-datasheet/#pin-out-diagrams
and
https://docs.particle.io/datasheets/photon-shields/#shield-shield-pin-mapping

I think I have it almost figured out now (posting this to save others time);

Shield (top print) | Shield (bottom print) | in code
A0 - A0 - A0
A1 - A1 - A1
DAC1 - DAC - A6
DAC2 - A3 - A3

so when I say in code;

int testPin = A6

I can connect my analogue sensor wire to “DAC1” on the Shield Shield to read out my light sensor.

Four AI’s is great, but more is better! I see that in the [Shield Shield pin out][2], A4,A5 and A2 are sacrificed for SPI1 functions. But in that same table, WKP shows Peripherals for both PWM and ADC. It is not clear to me if this ADC is also limited to 3.3V (has no comments **-ed to it).

So I tried to assign WKP (int testpin = A7*) and hook up the sensor to channel “3” on the Shield Shield…nothing happens. Yet, when I stick in my sensor wire directly to the pin named WKP at the Photon, I can successfully read the value with the Photon.

My questions:

  • is the Shield Shield limited to 4 Analogue Inputs?
  • if not; can WKP be used as Analogue Input, which pin on the Shield Shield should I use?

thanks all for the help!

Matt

*: said A8 in original post, its A7.
[1]: https://docs.particle.io/datasheets/photon-shields/#shield-shield
[2]: https://docs.particle.io/datasheets/photon-shields/#shield-shield-pin-mapping

WKP is A7, but in code you can still use WKP just the same (as you could use DAC in place of A6)
After all, these descriptive names are only mapped to numbers where the e.g. WKP is mapped to 17 and A7 is 17 too.

This said, I’ve not double checked the Shield shiels wiring so I’m not certain how things behave level-shifting wise, but on the Photon directly this is the case.
So if you use the headers left and right of the Photon itself you can use all A-pins as 3.3V analog in pins (unless used otherwise via the shield).

Thank you so much ScruffR!

Sorry - I misspelled that; WKP is A7 indeed (not A8). And in code they are interchangeable. I corrected my original post - my bad, I do not want to rewrite history :smile: Great point you make about the mapping from “WKP or A7” to numbers, I had not realized that yet, cool!

And you are right; if I connect the wire directly to the WKP pin on the Photon I can read the sensor. It is the same is if I connect the wire to A5 on the Photon, and address it in code as;

int testpin = A5

In that case I can read the analogue signal as well, regardless of the circuitry “downstream” no the Shield Shield. But as I am not using the Shield Shield circuitry I also do not have the Shield Shield protection (diodes, TI chips). It would be a nice work around - thanks for the advice.

Still I am wondering that if I use the Shield Shield, can I have more than 4 Analogue Inputs?

thank you very much!

Matt

I’d doubt this, since you’d need “analog level shifting” on the other A pins like (A2, A7/WKP, A4, A5) which I don’t think is implemented.
But as said - I’ve not looked at the hardware design of the shield.

If you do mistrust yourself that much :wink: you could use an external ADC board via I2C or SPI.

Thanks ScruffR!

That’s a great suggestion, and makes things much more scalable! Never even knew they existed; but with a small google I came up with;

which means I can have 4 more peppers connected to the Photon AND prevent things blowing up on me. Awesome!

thank you very much for the help!

Matt

1 Like

Hi Matt,
How was your experience using the adafruit ADS1115? I am looking to use it as a replacement to the expensive one I am currently using. Any feedback would be appreciated.

Thank you.
Tom

@GasGen
Tom, PM sent.

@Rftop, it would be good to have the response posted here so other members can also learn from it :wink:

1 Like

From what I understand he likes it, but I think my question is off the thread topic. I need to create a new thread and post my question there. I don’t want to hijack this one with my randomness. :slight_smile:

I was privately offering to share some very specific ADS1115 code with @GasGen that might apply to his project.
I assumed our discussion could get way off topic (and it did) which is generally frown’d on.
That was my only intention of the PM.

I’ll happily share my limited knowledge of the ADS1115 and experience with anyone. It just didn’t seem like this was the proper Thread for me to do so :sunglasses:

I appoligize for any confusion.

1 Like