Reading a Lateral Flow Assay (Pregnancy Test) electronically

Hi All!

I am trying to make a device that will read a lateral test assay--in English, a pregnancy test. I reverse engineered some of the electronic pregnancy tests but am still a bit lost and was hoping folks here might have some fresh ideas...

I attached a partial schematic of the electronic pregnancy test and a picture of part of the board. The schematic was created by 'ohming out' the board. The electronic pregnancy test uses 3 Red LEDs and two photodiodes (I'm sure they are not phototransistors). Also, the microcontroller on the pregnancy test does not have any analog inputs, it is using a digital input to read in the photodiodes/test result.

The lateral test assay on the one I hacked has three lines.

My next steps are using a logic analyzer to figure out what the firmware in the microcontroller is doing with the leds/photodiodes to read them and detect the presents/absents of lines on the lateral test assay. However, maybe someone has tried this or something similar and has some ideas...

Hi, the unit probably analyses the colour of the test strip, as the difference between a pos and a neg result is a colour change, then the input only needs to be digital.
The three LEDs can each emit different wavelengths of light, the photo diodes pick up the reflected energy for each LED emission and use some logic to work out the relevant colour, hence pos or neg result.
The LED wavelengths are chosen to produce definite high and low reflectance off the test strip for their different colours.

Tom.... :slight_smile:

1 Like

HI Tom...thanks so much for your input! Maybe this could give you a bit more information and maybe you will have some more light to shed on the problem (pun intended...)....

So I'm aware that it is using the photodiodes to read in the result and probably using the LEDs to illuminate the strip.* As per the schematic, they are using one I/O to read in both photodiodes; and have one I/O per LED (so they can toggle the LEDs on/off individually). It looks like they are driving the LED directly with an I/O pin. (Based on the current draw I measured from the LED this is definitely feasible and probably saves money on their BOM (Bill of Materials) + manufacturing (less components for the pick and place machine)).

The test comes with an internal fixture that mates one LED with the location of one line. This makes it such that each LED illuminates one of three possible lines that appear on the test strip. The lines are blue in color and very fine (look at the cover of any non-digital pregnancy test--sometimes the color changes, but the line should be fine). It maybe takes up 10% of the surface area of the LED.

After 'ohming out' the pregnancy test I soldered up some wires and was toggling the LEDs manually and looking at the resistance of the photodiode with a Fluke 87 DMM. The photodiode has a resistance of about 1.6Mohms with no LED on enclosed in its fixture. It might change 0.050Mohms (=50kohm) between a line and no line. This could also be a precision issue, imperfections in the semiconductor, difference in location of the LED relative to the photodiode, etc... Ultimately, this change couldn't be detected on a digital I/O so it leads me to believe I am not using the correct process to read in the circuit.

If you notice, there is 3 LEDs, 2 Photodiodes, and they need to detect the state of 3 lines...

One could extrapolate, this implies they are using the LEDs/Photodiodes in some sort of combination to detect the states of the lines (vs turning on one LED and then reading one photodiode). However, what is that combination? Does this make sense?

Since the photodiode is reverse-biased (Photoconductive mode), maybe they are using the internal capacitance of the Photodiode, charging the LED, and then measuring amount of time it takes to discharge (this would be impacted by the wavelength/energy of the light entering the photodiode). Again, this might have to be done in some sort of combination because of the 3 lines and 2 Photodiodes (detectors).

I am curious if anyone has any idea on what that process could be. If you have further questions about the circuit I could probably get you the information. I have access to a full/professional electronics lab. I am also a professional electronics expert (EE degree from Georgia Tech). However, with all that 'experience' it helps to get a fresh perspective which is where this comes in...

Really super-appreciate anyones input, thoughts, comments, etc...
Feel free to blurt out any random suggestions. Creativity leads to the best solutions!

*I assume this because LEDs can emit and detect light. Photodiodes can only detect light.

I'm impressed! I wouldn't think the typical engineer with the interest and chops to reverse-engineer an electronic pregnancy test would be gifted with the social prowess to find himself frequently in need of one. badum-tish! :stuck_out_tongue_closed_eyes:

I would definitely move on to the logic analyzer here. There may indeed be combinations or patterns involved that change the impedance of the photodiode. Also, what's the testing environment like? I.e., is it encapsulated in some kind of test shell? I assume there's some way of keeping the circuit in a light-controlled environment while it's testing.

Sorry if that's an obvious question but I'm not really too familiar with these things. I've only ever seen the non-electronic kind, and technical curiosity would've been overshadowed at the time by the dread of calling my mom and hiding from her dad.

Ok, it's pretty straightforward really.

The photodiodes are paralleled as you have determined and unlike the LEDs, they are not critically located to the reagent lines. In effect, you only have one photodiode surveying the whole strip.

There is a fair bit of engineering cleverness here. The fact that the LEDs are switched by the microprocessor means that they are only activated when you press the button (is it?) to read the result. Obviously, they are switched on in turn (not in combination, so only a single current limit resistor is needed) to read each of the three lines and only for a brief time, so there is no wastage of battery power. The device is obviously powered by a lithium coin cell.

The photodiodes are indeed a high impedance device, but then the microprocessor has very high impedance inputs, so should be able to read the current directly. We know that the Atmel processors discharge a (tiny) internal capacitor in the process of performing an analog reading - but you say these are only digital inputs. If the processor starts by switching the port to ground, then to an input and immediately begins to read the input, it will take a measurable time for the internal capacitance of the input and the photodiode itself to charge and for the port in this case, to go from low to high.

There is then no great complication in the arrangement - three lines to read (and I am not sure what the third is - there are generally two lines in such a strip test - the "test" and the "control" so I suspect there are here two "controls" on either side to confirm adequate wetting of the strip), three LEDs to illuminate them in turn with red light (since the blue of the reacted reagent is of course, "black" in red light) and two photodiodes working as one to monitor the readings. (Having two diodes actually increases the capacitance used to assess the photo-current by integration).

And I presume the interior of the casing is black or foil lined to exclude ambient light as you notice the PCB deliberately is.

I would be interested in other details of the device and display - whether it uses a button to "read" or is moisture-initiated (and times automatically from that, as I suspect it does). I am not about to go out and buy one merely to dissect, and am not so fortunate as to have someone bring one in to my office and leave it with me (it usually works the other way around - they get to take the (non-digital) test home from me if the result is favourable, or at least positive and favourable as it can spuriously turn positive in time, something else that the logic here presumably prevents), so am not in a position to do the dissection for myself. :smiley:

I know electronics is cheap and disposable, but this concept almost seems obscenely wasteful in a way.

Not to take away from the lessons of such a reverse engineering exercise, but I have to ask, why does such a thing exist in the first place? If it's merely checking the colour of the test strip, what's wrong with using EyeBall, Mark1?

JimboZA:
Not to take away from the lessons of such a reverse engineering exercise, but I have to ask, why does such a thing exist in the first place? If it's merely checking the colour of the test strip, what's wrong with using EyeBall, Mark1?

And thus my previous parting comment.

Well, there are two factors here; marketing and the ability to follow - and comprehend - instructions. You might be surprised at some of the questions we encounter (albeit not all related to the test strips). :smiley:

My thought as well. I'm hugely disappointed it's just a display format converter. Electronics for the sake of being electronic. I'm assuming these aren't frequently recycled....

SirNickity:
My thought as well. I'm hugely disappointed it's just a display format converter.

But it makes it so easy. :smiley:

SirNickity:
Electronics for the sake of being electronic.

So it must be good.

SirNickity:
I'm assuming these aren't frequently recycled....

Might be if I get my hands on them. But I don't recall anyone bringing one in to me.

Just wash your hands afterward. :wink: There are substances on used pregnancy testers known to the State of California to be icky.

SirNickity:
Just wash your hands afterward. :wink: There are substances on used pregnancy testers known to the State of California to be icky.

I sure do. Don't I know it. But not half as inspiring of cleanliness afterwards as prostate examinations. :astonished:

Before I start...thank you everyone for responding. This makes my life a world of easier. In particular, Paul__B for your wealth of information and SirNickity for your flattery and effort.

Ok, it's pretty straightforward really.
As always, everything is straight forward when you have done it. :slight_smile:

The photodiodes are paralleled as you have determined and unlike the LEDs, they are not critically located to the reagent lines. In effect, you only have one photodiode surveying the whole strip.

There is a fair bit of engineering cleverness here. The fact that the LEDs are switched by the microprocessor means that they are only activated when you press the button (is it?) to read the result.
Yes, but they are initiated when someone pee's on the test. The pee forms a switch by shorting two conductors.
The whole device is pretty clever. The cost of production for the electronics is probably in the single-digital USD--~$3 is an educated guess. The only IC they use is a 8-bit microcontroller (similar to Atmel 8-bit AVR)--probably under $1-USD. The rest of the components are LEDs, Photodiodes, and SMD resistors & caps. The only other electronics are a battery and board. The fact that the microcontroller doesn't even use an analog input is pretty crafty. Intuition would suggest they use a analog input to detect light.

Obviously, they are switched on in turn (not in combination, so only a single current limit resistor is needed) to read each of the three lines and only for a brief time, so there is no wastage of battery power.
Sounds right…I got the Saleae Logic Analyzer and am going to confirm all this.

The device is obviously powered by a lithium coin cell.
Correct

The photodiodes are indeed a high impedance device, but then the microprocessor has very high impedance inputs, so should be able to read the current directly. We know that the Atmel processors discharge a (tiny) internal capacitor in the process of performing an analog reading - but you say these are only digital inputs. If the processor starts by switching the port to ground, then to an input and immediately begins to read the input, it will take a measurable time for the internal capacitance of the input and the photodiode itself to charge and for the port in this case, to go from low to high.
Sounds about right with my train of thought. Great to here my theory confirmed. (LIKE)

There is then no great complication in the arrangement - three lines to read (and I am not sure what the third is - there are generally two lines in such a strip test - the "test" and the "control" so I suspect there are here two "controls" on either side to confirm adequate wetting of the strip), three LEDs to illuminate them in turn with red light (since the blue of the reacted reagent is of course, "black" in red light) and two photodiodes working as one to monitor the readings. (Having two diodes actually increases the capacitance used to assess the photo-current by integration).
This makes a lot of sense why they are wired on the same net.

And I presume the interior of the casing is black or foil lined to exclude ambient light as you notice the PCB deliberately is.
(There is a black plastic fixture that is used to isolate the different LEDs/test lines with respect to the proper placement of the photodiodes. On top of that, it is in a white plastic shell that precludes light from entering as well. I have been using the fixture inside a cardboard box.)

I would be interested in other details of the device and display - whether it uses a button to "read" or is moisture-initiated (and times automatically from that, as I suspect it does).
(It is moisture initiated. The moisture shorts a junction initiating a test and turning the device on.)

I am not about to go out and buy one merely to dissect, and am not so fortunate as to have someone bring one in to my office and leave it with me (it usually works the other way around - they get to take the (non-digital) test home from me if the result is favourable, or at least positive and favourable as it canspuriously turn positive in time, something else that the logic here presumably prevents), so am not in a position to do the dissection for myself.

I know electronics is cheap and disposable, but this concept almost seems obscenely wasteful in a way.

Essentially, the board could probably do hundreds of tests even with a small coin cell battery that it has. However, for the purpose of simplicity they do not let you reuse the HW by letting you buy test strips separately. This could hypothetically even allow their margins to grow because the cost of production of test strips is probably VERY low (in the 10’s of cents for the quantities they produce). They could easily have a 100% mark-up. However, the ability to change out the test strip would complicate the design and would require instructions. Mind you, you are designing for your dumbest customer (anyone can design for the smartest because they can figure it out themselves). If you design products, you should design for your worse case, not the middle of the road or even worse—best case scenario.

If this is ‘wasteful’ is more a perspective than fact. A woman who gets pregnant not under the circumstances said person wanted to be pregnant under could definitely be a stressful time. Even a smart person, might not want to read instructions on what line means what. This gives a clear ‘Not Pregnant’ or ‘Pregnant’ answer. As a male, I don’t feel in a position to say if this is wasteful or not.