Photon expansion

My Photon-based weather station has turned into such a project that I’m now out of pins for sensors, and there’s still a bunch more data I’d like to collect. My thought is to add a 4067 multiplexer to provide more channels, both analog and digital. Sparkfun has one of these in a convenient breakout: https://www.sparkfun.com/products/9056. Is there any reason this wouldn’t work? Is there a better alternative?

I’d also like to have more serial ports. I know there’s an extra “hidden” port on the Photon but I don’t want to start soldering on tiny lands. Anyway, I may need two extra serial lines. Can I do the same mux trick with TX/RX?

Hello,

Let me ping someone that might be able to help on this, @mohit is this something you are able to help with?

Kyle

I think that the 4067 should work if you can live with the on resistance of around 125 ohms. I’ve used them successfully for digital signals, I haven’t tried one for analog signals. I don’t see why it couldn’t work for multiplexing the TX/RX lines as long as you only need to be connected to one serial stream at a time (you would need two of the devices, one for RX and one for TX). There are other devices out there that have considerably lower on resistances. For instance, the NX3L4051 (8 SPST switches) and the MAX4734 (4 SPST switches), both of which have on resistance below 1 ohm.

1 Like

Hmm - I didn't even know about that. If you've used it OK, that's good enough for me. I suppose it might make a difference for my battery voltage sensor, where I'm using an analog pin as a voltage divider.

I think I'm going to need more than 8 pins though, which is why I was looking at the 4067.

Personally, I would add more ADC and GPIO using I2C. I have some references in my I2C tutorial:

3 Likes

Wow, that tutorial is fantastic! I was always intimidated to try I2C because it looked too complicated. I’m now motivated to get some sensors and try out your examples. Thanks!

2 Likes

Great tutorial!
I would like to ask your opinion.
I need to measure 16 voltages with as much accuracy as possible upto 4.3volts
Which I2C device would you recommend with a Photon?

On the Photon/P1/Electron/E Series (Gen 2) I would use an 8-channel I2C ADC, like the ADC128D918. By running it off a 5V supply with a 5V I2C bus you'll be able to directly measure 4.3V. You'll of course need two but you can put up to four ADC128D818 on a single I2C bus.

On the Argon/Boron/Xenon (Gen 3) I would use the same ADC, but because the Gen 3 I2C bus is not 5V tolerant you'll need an I2C level translator like the PCA9306 as well.

2 Likes

Thank you @rickkas7.
Tried a Google search for ADC12D918 but came up with nothing.

Sorry, I dropped a digit when I typed it in. I corrected the post above as well, which should have read ADC128D918.

@rickkas7 would this be ok?
https://shop.controleverything.com/products/12-bit-analog-to-digital-converter-16-channel

Yes, that should work. I have several of the ncd.io boards, though not that one, and they work well with Particle devices.