Sudden Photon Death

Hello,

I’m having a reoccurring problem where my Photons permanently won’t turn on. The system was working fine for a week with the original Photon until it died. I triple and quadruple checked my wiring but everything seems fine. For the last one I tried powering it first with the usb cable; everything was fine; the information published to the cloud was as expected. Then I powered it with the power supply (4.5V through Vin); everything was fine; the information published to the cloud was as expected. Then when I shut off the power, plugged in a sensor (to the analog cable that the wires on the rightmost breadboard lead to), and turned it back on again, the photon was dead and no lights were on. A micro SD card breakout board and analog sensor are also being powered by the power supply. The documentation for both says they take 5V. With a multimeter I measure about 4.5V from Vin to ground and about 0V from 3V3 to ground. The light remains off when I have a well regulated 3.3VDC power supply connected from 3V3 to ground.

Thanks,

Xavier

Link to analog sensor pinout(BTA): http://www.vernier.com/support/sensor-pinouts/
Link to micro SD card breakout board pinout: https://www.pjrc.com/teensy/sd_adaptor.html
Picture of the wiring (color coded except for the yellow wire across the middle, the blue wire on the bottom left, and the sensor’s wires on the breadboard to the right):

If this is the sensor output that you are using:

Pin 6 = Sensor output (0-5V)

That will certainly be a problem because the analog input pins on the Photon have a maximum input voltage of 3.3V.

In order to use a 5V analog sensor you'll need to install a resistor divider or use some other technique to lower the analog input voltage as seen on the Photon input pin.

I think @rickkas7 has the answer. Certain death if it's pin 1:

At the very least, you'll need a series resistor to limit the current so that the internal clamping diodes on the Photon can shunt the voltage to a safe level. A resistor divider would be better if you're trying to measure an analog voltage.
I don't see any resistors on the breadboard (apart from the resistor on the LED on D0). Photon toast for breakfast?

@WebDust21 @rickkas7

Thanks for your responses. I should do a bit of clarification. The sensors I am using don’t use pin 1 as an output and its voltage to ground is always measured as 0v (I should actually just remove this wire). I’ve never measured more than 1.7V from pin 6 to ground and it wasn’t that high when the Photon failed. It does make sense to use a technique to lower its theoretical max to 3.3V to be safe though so I’ll be sure to do that. However, since I never observed the voltage from pin 6 to ground come anywhere near 3.3V and previously the system was running like this without issue, I’m not entirely convinced that is the (only) problem. I’d want to be a sure as possible before I insert another Photon into the circuit. Do you have any other thoughts?

One thing is often overlooked when powering via Vin.
It’s not only the voltage that counts but also how clean the DC is.
If you got 4.5V simply rectified but not properly filtered you can still blow the onboard regulator.

Also measuring voltage with a DMM is onlyhalf the truth if you have changing signals or spikes.

1 Like

And I assume some significant current draw in both cases? If yes, the Photon is fried pretty good.

If this is a sort of long-term project, I'd suggest a 5v @ 1A switching wall wart (readily available for $1 or less at thriftshops, typically identified as cellphone chargers and the like) for the power source. And at the very least, put resistors (try 10K?) in series with each I/O pin going to the sensor. Note that a series resistor may throw your A/D (ADC) readings off a little. If that's a problem, you might need to buffer the signal with, say, an LM358 at unity gain (output shorted to inverting [-] input, and to your Photon, input signal to the non-inverting [+] input.)

As @ScruffR pointed out, a DMM likely will not register high voltage spikes (transients, etc.), but they'll blow the chip out just the same. Electronics can be so unforgiving.
Please note that if you have a particularly long length of wire between the Photon and your sensor, it will be much more susceptible to magnetically induced electricity in the lines (EMP, anyone?) I don't know what the environment is, but that should be considered as a potential cause of damage.

What's the sensor's power source, anyway?

@WebDust21 I was thinking to set up a voltage divider with say 120ohm and 180ohm resistors, with Vin from the sensor’s pin6 and Vout to the Photon analog pin. That way if it ever hit the theoretical peak of 5v, the analog pin would only be greeted by a safe 3v. I might lose some accuracy in data collection though, as the input range of voltage will be smaller (Instead of 0-1.7V it’ll be 0-1V). The other sensor pins (besides power, ground, and the 0-5V signal) aren’t necessary to what I’m doing right now so to be safe I’ll disconnect them until I need them.
Could you explain why a series resistor would throw off the ADC conversion (also would I run into the same problem with a voltage divider set-up) and why an op-amp would buffer that? Please excuse my ignorance but I’d like to make sure I correctly understand to make the right choice on how to proceed.
Right now I’m powering the sensor with the same power supply as the Photon (4.5V), I’m going to add a 5V regulator as part of the solution. Once I fix this problem though, I’m going to change the power to a 4.5V battery and add a relay to de-power the sensor when it’s not collecting data.

@ScruffR @rickkas7 @WebDust21

How does this look now? I added a voltage divider with 2.2k and 3.3k ohm resistors, and an LM741 at unity gain (Imagine the photon in the hole where it was earlier). The voltage regulator is to the left.

In order to filter your DC you might want some caps too.

Does .1uF sound about right?

I’d go with that and a 4.7µF electrolytic

1 Like

That will work, assuming your sensor can drive some current! The resistors can be much higher in resistance, particularly if you're using a unity gain op-amp buffer.
And my bad for not thinking ahead quite far enough. I understand the concern about loss of resolution; you probably could get away with a series resistor and a switching diode (i.e. 1N914--or pretty much anything!) to the 3.3v rail. (And one to the ground rail, just to be safe!) Basically, you're trying to ensure that a spike of any sort either won't reach the Photon, and/or ensure that there won't be enough current to do any damage.

Sorry if it doesn't make too much sense, but I've generally found it difficult to get truly quiet ADC readings.
As a quick overview, microcontroller ADC units generally use a "sample-and-hold" system as follows:

  • ADC CONVERSION REQUEST
  • Internally "switch" the sample-and-hold capacitor (generally a few hundred pF) to the specified ADC input
  • Wait "tAD" (also known as the acquisition time), to allow the capacitor to charge. This time determines the input impedance, and is the source of the challenge!
  • Internally "disconnect" the capacitor from the ADC input
  • Start ADC conversion
  • Wait for conversion to complete (and I won't be technical about this!)
  • ADC result to code.

Basically, when the input signal has a high-impedance (read: low current, not very strong, weak signal), if the acquisition time is too short, it won't allow the capacitor to fully charge, resulting in unpredictable ADC results. A longer acquisition time will help, as will reducing the impedance (read: op-amp at unity gain, smaller bridge resistors, etc.)

I had a pretty in-depth discussion on this issue some time back (unfortunately without any outcome that I'm aware of) regarding how the ADCs are handled in at least the Core's firmware. (I'm not sure about the Photon yet; I'll have to delve into the source code sometime.) Basically, the firmware does a "pipelined ADC read" to read the ADC value 10 times, and then averages the result. In theory, that would provide a more stable ADC result. The only problem is that now you have 10 little "drains" on your input signal in very quick succession (dozens of microseconds apart), which will capitalize on capacitance ANYWHERE (wires, etc.), and result in unstable readings.

As mentioned in the linked (very technical) discussion:

(SAR = successive approximation register, referring to the methodology used to implement the ADC unit in the Core.)

You can also easily use that op-amp to amplify the signal for more range--and the op-amp won't care if you put a 100K resistor in series with your signal line. (I don't recommend it, though--10K should be more than adequate for safety :wink:.) To do that, simply replace the wire between the output and inverting (-) inputs with a resistor. The bigger the resistor, the higher the amplification. I'm really not much of an analog guy, so I'm not too much more help on that...

1 Like