Author Topic: Design help for scientific instrument  (Read 5914 times)

0 Members and 1 Guest are viewing this topic.

Offline photocyteTopic starter

  • Newbie
  • Posts: 4
Design help for scientific instrument
« on: May 11, 2014, 02:55:27 pm »
Hi all,

Longtime viewer of the show. Found the channel after googling for “Kindle teardown” and have been watching ever since. I have had some classes in electronics so I’m not entirely “Dave taught”, but definitely much of my knowledge of the details of actual circuit design has come from the show.

I’m actually a graduate student in biology hoping to make an field instrument.  I thought that this would be a good place to get some insight into the design principles of the electronics! I’m the main driver on this project, so I wanted to design the instrument myself to ensure it got done and that I’d know how to modify it.

The plan is to sort oceanic plankton by analyzing their fluorescence and bioluminescence (de-novo production of biological light) characteristics as they flow (in seawater) one by one past a detector, and then actuate some valves downstream to either send them to waste or collect them.  This is analogous to a FACS instrument if anyone is familiar with those, only at a macroscopic scale and hopefully much simpler (and cheaper).

Right now it’s just at the planning / chip selection stage, so no schematic yet.

There are few different aspects to the design which I’ve listed below:

(1) Primary analog light sensor
I plan to detect the light produced by fluorescence emission of the sample by using a LED of the appropriate wavelength (green LED for green fluorescence) in photodetector mode (aka, inverted).  Same principle for the bioluminescence detection. Excitation of the fluorescence will be accomplished by a normal emitting LED/laser diode (cheap laser pointer kind) oriented at 90? to the detectors.  I hope that the detector LEDs will be sensitive enough to detect the light.  Alternatively I could use an actual photodiode with actual colored filters to get the wavelength response, but the combination of the wavelength specificity of LEDs in detector mode combined with their super low price made me want to try it.


(1a) Electrical stimulation of bioluminescence
Mechanical stimulation of the plankton as they flow through the instrument may stimulate detectable bioluminescence.  If not, I plan on using electrical stimuation to stimulate bioluminescence artificially.  So far all I’ve planned is wires exposed to the flowing seawater, with an alternating H-bridge to drive it as straight DC might cause strange electrochemical things to happen to the wires.


(2) Transimpedance amplifier
In order to detect the light current produced by the LEDs, I’ll need to amplify the current produced.  I’m planning on using a op-amp based transimpedance amplifier (http://en.wikipedia.org/wiki/Transimpedance_amplifier), specifically something like Figure 1 off Wikipedia.  According to the internet, there are two ways to operate a photodiode (1) Photoconductive and (2) Photovoltaic. In the photoconductive topology, the photodiode is reverse biased with a voltage.  This decreases the junction capacitance, thereby increasing performance at high frequency.  There is increased noise however as the bias leads to a stochastic reverse current.  Photovoltaic mode operates the LED at no bias, which decreases the noise and increases the sensitivity.  Seeing as I was planning on sampling things in the millisecond to 100 microsecond timescale which seems “low frequency” to me, I was planning on using the photovoltaic topology.

I’m having trouble choosing an op-amp as I don’t know which parameters on the op-amps would benefit my instrument the most.  Also, I have considered using a differential amplifier to try and reduce common mode noise, but again don’t know enough about it to gauge it properly.  This site has been a great resource for considering the “advanced” versions of the transimpedance circuit on wikipedia (http://www.linear.com/solutions/Transimpedance_Amplifiers). Alternatively, I may use a log-amplifier if the dynamic range of the light measured is really broad.

The op-amps would theoretically be running of 0-3.3V single supply, although if there is a benefit to using a double sided supply + op-amp I could try to design it into my circuit.


(3) ADC
Essentially my criteria so far in selecting an ADC was “Which ADC already has code I could use?”.  Based on that criteria, I looked at the MCP3204, a 8-channel 12-bit SPI interface ADC.  The IC can sample at 100 kilosamples/sec (every 10 microseconds), which might be overkill for what I need.  I’ve also been looking at I2C Delta-Sigma based ADCs, which as far as I can tell perform better but can’t sample nearly as quickly.  I also figure an I2C chip would be fairly simple to code for, as I2C is a bit simpler to understand than SPI.  The ADC would also run at 3.3V to allow it to interface directly to the Raspberry Pi I plan to use.


(4) Digital interface
I plan to interface the ADC directly to a Raspberry Pi as (1) I have one already (2) ample ram / simple file saving (3) Assumed that the 800MHz Pi would be able to do more complex things than an 16Mhz atmega (4) Can use python, which is easier than C and allows for straightforward realtime data visualization.

That being said, tests online say that the Pi polling a MCP3204 from C using the kernel hardware SPI drivers maxed out around 18 kilosamples/sec (out of 100), which makes me slightly worried that attempting to run everything from Python could run into some real timing issues.  However, the Pi does have I2C and SPI in hardware, so the low level timing stuff should be fine. I get that Linux isn’t realtime like a microcontroller, but thought that if I kept track of the high resolution system clock I would be able to correct the program when it has strange delays due to python / linux doing things in the background.


(5) Actuator drivers
The point of the instrument is really to actuate some downstream valves based on upstream measurements of the organisms.  I have some candidates for valves, but they are all pretty straightforward 12V solenoid based valves.  Given the desire to protect my Pi from the spurious high voltage things that motors/actuators can produce, I was planning on driving it by interfacing the Pi to an open collector driver chip. Also add some kickback diodes or snubber caps. Perhaps it would make sense to optocouple it to the Pi and put it on a different part of the board? 


(6) Power supply
Primary power for the instrument will be the 12V DC source from a small boat. Actuators will be supplied directly by the 12V rail.  For the Raspberry Pi I plan to first buck convert the 12V to 6-7 volts, and then linearly regulate it to 5 volts. I know that automotive/marine stuff is hardened to resist voltage spikes,so alternatively I could use a automotive inverter, then use a standard 5V power supply as this would handle all the high voltage robustness that I would otherwise have to design myself. For the analog electronics, I plan to further regulate the 5V rail to 3.3V (I’ve heard the 3.3V rail on the Pi can get quite noisy from the digital ICs), and then run the ADC and analog circuitry using the independent regulated 3.3V rail.

Beyond that, I’m planning on eventually making a PCB for it, putting decoupling capacitors everywhere, put some protective diodes places where I fear voltages, and maybe put some polyfuses / fuses on the power rails.  Maybe for the PCB layout also try to isolate the motor/digital/analog ground planes?  The actual physical fabrication of the housing/detectors is another aspect, but for that I’m planning on getting some help from people at my university.  It might end up a bit "bodged" but I just want it to work.

Does anyone have comments on the design?  Suggestions for ICs for each step are also greatly appreciated as its a bit tough to choose appropriate ICs from the catalogs when you don’t have the appropriate background knowledge/experience to evaluate it.  That being said, I’m also open to just using the best performing / most expensive chips as this isn’t a project meant for large-scale production.

Hoping to get this instrument into the field by August at the latest.
 

Offline ganzuul

  • Contributor
  • Posts: 49
  • Country: fi
Re: Design help for scientific instrument
« Reply #1 on: May 11, 2014, 09:01:36 pm »
Hello!

How fast do you need to sample? If 60Hz will do, how about a webcam and OpenCV?

Is this to be installed in a ship or at shore? There are, as you said, electrochemical considerations to be made. Done wrong you might sink a ship by turning its hull into a cathode.

Does sonar stimulate luminescence?

(Not an EE. Just a hobbyist.)
 

Offline photocyteTopic starter

  • Newbie
  • Posts: 4
Re: Design help for scientific instrument
« Reply #2 on: May 11, 2014, 10:20:23 pm »
Hi Ganzuul,

Thanks for the input! The more macroscopic measurement scheme using a camera could potentially work.  A green/yellow filter over the lens plus blue illumination would let the fluorescence I'm looking for come through. The question is detection sensitivity, and robustness to the density of plankton per unit time passing the detector. The particular plankton I'm interested in is about 2mm long, so it might be possible to detect the fluorescence with the camera.  I think it would be pretty tiny without optics though. This would have the advantage of being able to predict the velocity of the flow by tracking the plankton as they go by though.

Essentially the plan is to run the "sorter" on pre collected samples of plankton from tow nets on the ship.  Conceptually this would be: bucket with plankton flowing through a tube to the ocean by a gravity siphon, with the "sorter" in the line.  When the sorter detects something that should be kept, divert the flow temporarily to a collection bucket.  So at least in this respect, I wouldn't have to worry about hull corrosion, which I admit without my knowledge of how marine electrical systems are setup makes me feel better!

With regards to sonar stimulating luminescence.  Thats actually an interesting question.  I have read some papers which carefully quantitate how much pressure is required to trigger bioluminescence in dinoflagellates.  If anyone is familiar with the types of pressure levels sonar can produce in the water I could cross reference it.  Quite a mental image to think about a wave of bioluminescence emanating at the speed of sound!
 

Offline ganzuul

  • Contributor
  • Posts: 49
  • Country: fi
Re: Design help for scientific instrument
« Reply #3 on: May 11, 2014, 10:44:22 pm »
OpenCV might be familiar to your colleagues. If not, if you're undaunted by a moderate learning curve, this computer vision package can convert the video feed to Hue-Saturation-Lightness format which makes programmatic color recognition surprisingly simple. This could be a very powerful tool for you...


It's when the ship is docked and getting power from dry land that one can corrode its hull. For this isolation transformers are used to sum up the electrical charge to zero rather than a net current flow to ground, through water.

Quite a mental image to think about a wave of bioluminescence emanating at the speed of sound!
I had the same thought! You would assume submarines put on a respectable light show in some places. :D
« Last Edit: May 11, 2014, 10:48:48 pm by ganzuul »
 

Offline PedroDaGr8

  • Super Contributor
  • ***
  • Posts: 1283
  • Country: us
  • A sociable geek chemist
Re: Design help for scientific instrument
« Reply #4 on: May 11, 2014, 10:59:58 pm »
I'm very familiar with the FACS systems (we have Cantos, LSRII, Fortessa, half a dozen FACScaliburs at work, etc) So I know exactly what you are doing here. I apologize if this post is a bit scattery-brained because I'm typing it a bit as I go and think of it.

The hardest part of this system is going to be 1) the sorting system and 2) a system to line up the DFs in an orderly line with decent spacing between them such that you can isolate individual DFs.

Part 1) Using valves is not ideal because you will need relatively large spacing between your DFs. The more spacing the slower the scan rate. If it is just intended for enrichment, not sorting then this is much less of an issue as its no big deal if a different kind of DF sneaks through. Though if it is intended for enrichment, there are much better systems such as antibody tagged magnetic particles (commonly used to enrich subpopulations for flow cytometry). Now if its for sorting this system seems very sub-optimal. The valves are limited by their size, reaction time, etc. I think you will really need to think about this one carefully. One idea is you could use three open flow channels and use a perpendicular flow to direct it to the right channel. One quick pulse to move that single DF in the right direction. Like I said, this will be BY FAR the hardest part. Also on isolation, always optoisolate if you can but also the dampening and flyback diodes should be there too. Otherwise you are just killing optocouplers instead of uCs, cheaper but still not ideal.

Part 2) Flow cytometry uses hydrodynamic focusing in order to get the cells all into one line.



You will likely need to devise a similar system.


Now lets get into the fluorescence excitation and detection system:

For excitation, you do NOT want to excite at the absorbance maximum. The Stokes Shift is too small for a filter to work effectively filtering out the excitation wavelength. So instead you excite at a point just off of the maximum.

This image here shows what I mean:


As for the detection system, fluorescence is often quite dim. Very few systems are capable of even close to 80% light return. Most systems are in the 1-20% range, since these are biological they might be higher but you still may find the gain has to be really high to detect properly. So noise will be a factor. Often PMTs are used for detection due to their high gain and relatively low noise but making a PSU for a PMT to run off 12V sounds like a pain. So photodioes or your plan will be fine. If you want to keep the cost down you could use a single photodiode and a rotating "chopper" filter to detect the various wavelengths. Dichroic filters are commonly used and cheaply available on ebay and elsewhere. They are typically speced as XXX/yy; where XXX is the center wavelength and yy is the width of the filter. So a 490/20 would detect from 480-500. The detection step should be capable of occurring quite fast, so a rotating filter should be just fine for your uses.

About your power supply, filter the input. Ship power, like automotive power, will be very dirty. You will likely want some TVS diodes, inductors, input filter caps, etc. on the input line. Much less likely to have issues of dead PSUs this way.
The very existence of flamethrowers proves that some time, somewhere, someone said to themselves, "You know, I want to set those people over there on fire, but I'm just not close enough to get the job done." -George Carlin
 

Offline ganzuul

  • Contributor
  • Posts: 49
  • Country: fi
Re: Design help for scientific instrument
« Reply #5 on: May 11, 2014, 11:37:51 pm »
Of course, the hardest part is reassembling the cells back into plankton.  ;)
 

Offline photocyteTopic starter

  • Newbie
  • Posts: 4
Re: Design help for scientific instrument
« Reply #6 on: May 11, 2014, 11:50:25 pm »
Hi Pedro,

Appreciate the feedback!   I'll admit I was inspired by FACS instruments, but I hadn't actually taken the time to investigate the "tricks" that the instruments use.  Could be a very informative avenue!

The purpose behind the instrument is to enrich/collect enough bioluminescent plankton for a focused biochemical study of the bioluminescent system.  Really as long as I have enough bioluminescent plankton (multi-gram scale), and its relatively enriched, I think I should be able to make it work.  I just need "mass" of enzymes essentially, I can purify other things away afterwards.  Its sort of an interesting problem, these plankton have been studied before, but only hundreds of individuals at a time and they were manually sorted by hand.  But, being that you're sampling from the ocean, if there was a relatively high-throughput way to sort the organisms from the seawater, it would really enable some new types of experiments.

On the difficulty of getting particles to go "single file" through the sorter: Luckily the plankton I'm trying to sort are quite large (2mm or so), so I can size fractionate before to get rid of micron scale things and things that are larger than 2mm. Additionally I can probably dilute the ~2mm plankton in filtered seawater, which hopefully would help keep them at a low enough density that they'd go single file.  I'll definitely give the hydrodynamic focusing some more thought, I could probably jury rig something from a pulled glass capillary tube of the right diameter.

I hadn't considered the latency of the valves however, thats a good point. I can't think of another way to manipulate the volumes of fluid I'll be working with though.

Alternatively I could try to talk to some of the labs that have played with microfluidics and try to sort the organisms using the high speed cameras (likely with fluorescence filters and excitation sources) on the microfluidic microscopes they use.  I think 2mm is definitely on the larger side of "microfluidics", but it may be possible.

On the fluorescence wavelength considerations:  Luckily the molecule I'm going after to sort with has a pretty good stokes shift, most of its absorbance in the UV/Purple, and then emits in the Yellow/Green.

As for detection thresholds, I think the bioluminescence shouldn't be a problem, it can easily be seen by eye (although how much bioluminescence they have left after tumbling down a tube is a different story).  The fluorescence on the other hand, that could be problematic.  I did consider photomultipliers, they are awesome (in bioluminescence they are often used in photon counting mode to get absolute numbers of reacted molecules), but  as you know they are a bit expensive, large, and also finicky to operate.  The LEDs were sort of my reaction to realizing how complex photomultipliers are, but I definitely understand that they may be non-ideal in a lot of characteristics (sensitivity being a likely one).  I really like the idea of the chopper filter though, if the LEDs turn out to be not sensitive enough the chopper plus a proper photodiode might save the day.  Granted unless I could get a pre made chopper I'd probably have use a proper micro controller in order to get the timings right.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21688
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Design help for scientific instrument
« Reply #7 on: May 11, 2014, 11:53:05 pm »
What do you expect the frequency of cells to be -- what rate is this sorting being done at?

If it's high frequency (more than 1000/sec) ad real time, you aren't going to be able to do this on a nondeterministic platform.  Do it on an Arduino, at least the heavy lifting part.  Or even do it discrete (control the valve directly, with a counter output for events or whatever).  If it's something that needs a lot of memory (like the counting part), you might still pipe that to an rPi, over serial or something, since Arduino has little memory.

As mentioned, LEDs make terrible photodetectors.  A regular photodiode, chosen for the optimal size vs. response time tradeoff, will be best.  (As mentioned, a PMT might be even better, but yeah, kind of a pain to use.  They're available, with the high voltage converter and all that, but the gain probably isn't worth the expense and space.)  TIA is a good idea, which can be followed by a comparator -- I'm guessing either the cells are of the right type, and have been stimulated in a sufficient way, and are emitting or fluorescing, or else they're dark, without much variation inbetween, so that a simple comparison will suffice.  It will then be necessary to delay the pulses by the time it takes the stream to flow from the detector to the valve (minus the valve response time), which might not be necessary (if that subtraction can be tuned to zero), or can be provided with a digital shift register, or in software.  Some pulse stretching will be required to provide a long enough pulse to get the valve to move -- or maybe not if it's fast, so that will just depend on some component specs, but can reasonably be anticipated as a need.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Design help for scientific instrument
« Reply #8 on: May 12, 2014, 12:22:04 am »
EDIT: I kinda started writing this, then went shopping, then came back. Kinda out of date, some of it, but hopefully helpful still maybe.

(1) Primary analog light sensor
I plan to detect the light produced by fluorescence emission of the sample by using a LED of the appropriate wavelength (green LED for green fluorescence) in photodetector mode (aka, inverted).  Same principle for the bioluminescence detection. Excitation of the fluorescence will be accomplished by a normal emitting LED/laser diode (cheap laser pointer kind) oriented at 90? to the detectors.  I hope that the detector LEDs will be sensitive enough to detect the light.  Alternatively I could use an actual photodiode with actual colored filters to get the wavelength response, but the combination of the wavelength specificity of LEDs in detector mode combined with their super low price made me want to try it.

Is the fluorescence of a single organism even visible to the naked eye?  It's true that reverse-biased LEDs act as photodiodes, but I'd hazard a guess that they're very insensitive to small amounts of light. LED dies are very small (there's no point in giving them a large 'collector area' when you can just make a very bright die and chop it into tiny pieces), and in a loose sense they're just "not designed to do that job". You're also in a dangerous zone because these properties aren't specified in datasheets, so you don't know which frequencies you'll be sensitive to (don't assume that it's identical to the emission frequency curve, Si emits in infrared but forms the basis of CMOS and CCD RGB cameras), and if the LED fab makes a breakthrough in die efficiency, they'll shrink their die without telling you and you'll be wondering why your sensitivity went down.

When doing fluorescence-based studies using a microscope, there's a special sort of glass that filters exactly the frequency of interest, right? Pair that up with a dedicated, large-die phototransistor, at least for v1. Also, find some way (you probably have QImaging style quantitative cameras around) to measure the light levels you're trying to measure here, so that you can use the datasheets to know what will work and what won't.

Quote
(1a) Electrical stimulation of bioluminescence
Mechanical stimulation of the plankton as they flow through the instrument may stimulate detectable bioluminescence.  If not, I plan on using electrical stimuation to stimulate bioluminescence artificially.  So far all I’ve planned is wires exposed to the flowing seawater, with an alternating H-bridge to drive it as straight DC might cause strange electrochemical things to happen to the wires.

H-bridge is moderately complicated stuff -- if you can get away with using a capacitor to AC-couple a signal into the wires, that'd be a lot simpler (and fail-safe, failure in the H-bridge/control logic wouldn't lead to funny electrochemical things).

Quote
(2) Transimpedance amplifier
In order to detect the light current produced by the LEDs, I’ll need to amplify the current produced.  I’m planning on using a op-amp based transimpedance amplifier (http://en.wikipedia.org/wiki/Transimpedance_amplifier), specifically something like Figure 1 off Wikipedia.  According to the internet, there are two ways to operate a photodiode (1) Photoconductive and (2) Photovoltaic. In the photoconductive topology, the photodiode is reverse biased with a voltage.  This decreases the junction capacitance, thereby increasing performance at high frequency.  There is increased noise however as the bias leads to a stochastic reverse current.  Photovoltaic mode operates the LED at no bias, which decreases the noise and increases the sensitivity.  Seeing as I was planning on sampling things in the millisecond to 100 microsecond timescale which seems “low frequency” to me, I was planning on using the photovoltaic topology.

I’m having trouble choosing an op-amp as I don’t know which parameters on the op-amps would benefit my instrument the most.  Also, I have considered using a differential amplifier to try and reduce common mode noise, but again don’t know enough about it to gauge it properly.  This site has been a great resource for considering the “advanced” versions of the transimpedance circuit on wikipedia (http://www.linear.com/solutions/Transimpedance_Amplifiers). Alternatively, I may use a log-amplifier if the dynamic range of the light measured is really broad.

The op-amps would theoretically be running of 0-3.3V single supply, although if there is a benefit to using a double sided supply + op-amp I could try to design it into my circuit.

<random ramblings>Referring to the photoconductive mode, you left out the part "The leakage current of a good PIN diode is so low (<1 nA) that the Johnson–Nyquist noise of the load resistance in a typical circuit often dominates." I'm not entirely sure, but I think this implies that the increased noise in photoconductive is negligible in typical circuits. Also, I'm not sure where the claim come from that photovoltatic mode is more sensitive -- I though every photon became an electron, so it'd all be roughly the same. But maybe your source is confusing SNR with sensitivity, or maybe I'm confused.</random>

It would be a good idea to quantify the decision you're making here. I'm not sure what the right answer is, but you should be designing a circuit and calculating/assessing its bandwidth, rather than saying 100µs is "a long time" and therefore "bound to be OK". Dave has a video on op amps and bias currents, etc. Just pick a random cheap op-amp, read through the specs, and see what effect it has on your circuit:

- Input offset voltage of 5µV... is that OK? Answer: add a parasitic 5µV source to one input of your op-amp, and see if the circuit breaks.
- Input bias current of 5µA... is that OK? Answer: add a parasitic 5µA current leaking out of the op-amp, etc etc.

This way, you'll gain a good insight into what special requirements your particular circuit has, and you can knowledgeably select an opamp, rather than falling back on vague rules like "photodiode circuits tend to need a low XXX, 50 femtoWidgets looks like a tiny number, that'll be fine..." (Although I'm sure someone else will chime in with some example chips that will be a great starting point.) That 3.3V supply is going to be a big filtering factor in your choice.

Quote
(3) ADC
Essentially my criteria so far in selecting an ADC was “Which ADC already has code I could use?”.  Based on that criteria, I looked at the MCP3204, a 8-channel 12-bit SPI interface ADC.  The IC can sample at 100 kilosamples/sec (every 10 microseconds), which might be overkill for what I need.  I’ve also been looking at I2C Delta-Sigma based ADCs, which as far as I can tell perform better but can’t sample nearly as quickly.  I also figure an I2C chip would be fairly simple to code for, as I2C is a bit simpler to understand than SPI.  The ADC would also run at 3.3V to allow it to interface directly to the Raspberry Pi I plan to use.

If you get the analog side of this project sorted out well, this will be easy. Always go for overkill in v1, you might want to overclock this thing!

I'd comment that most micros have an SPI port, and ADCs are just "retrieve a couple of bytes and there's your reading", so I'm not sure what code you're referring to -- it's just the example SPI code in the uC datasheet. But I've only used a couple of ADCs (ADC122S625*) in my time, maybe other ADCs are a bit more annoying.

* This isn't a carefully thought out recommendation per se, just something that worked for me once upon a time.

Quote
(5) Actuator drivers
The point of the instrument is really to actuate some downstream valves based on upstream measurements of the organisms.  I have some candidates for valves, but they are all pretty straightforward 12V solenoid based valves.  Given the desire to protect my Pi from the spurious high voltage things that motors/actuators can produce, I was planning on driving it by interfacing the Pi to an open collector driver chip. Also add some kickback diodes or snubber caps. Perhaps it would make sense to optocouple it to the Pi and put it on a different part of the board? 

Optocouplers, isolation slots? No need to be so careful, this is a bit of inductance that a freewheeling diode can handle, not thousands of volts of deadly AC. A MOSFET driven by a TC4423 (supplied from either +5V or +12V?? not sure) driven directly by the Pi is more than sufficient.

Make these decisions based on logic and understanding, not fear.

Quote
(6) Power supply
Primary power for the instrument will be the 12V DC source from a small boat. Actuators will be supplied directly by the 12V rail.  For the Raspberry Pi I plan to first buck convert the 12V to 6-7 volts, and then linearly regulate it to 5 volts. I know that automotive/marine stuff is hardened to resist voltage spikes,so alternatively I could use a automotive inverter, then use a standard 5V power supply as this would handle all the high voltage robustness that I would otherwise have to design myself. For the analog electronics, I plan to further regulate the 5V rail to 3.3V (I’ve heard the 3.3V rail on the Pi can get quite noisy from the digital ICs), and then run the ADC and analog circuitry using the independent regulated 3.3V rail.

If it's only the solenoid that's running directly off the 12V DC, then that's not a problem. Just make sure your MOSFET is rated to handle the voltage spikes.

Consider using an LC filter from the 5V supply, so that you end up with a relatively smooth 5V, rather than shooting yourself in the foot by forcing yourself to use 3.3V in the analog section. (I'm not sure to what extent this is actually shooting yourself in the foot). <naive>Digital noise from a high-frequency device like a Pi should be easy to filter out.</naive>
« Last Edit: May 12, 2014, 12:25:47 am by rs20 »
 

Offline photocyteTopic starter

  • Newbie
  • Posts: 4
Re: Design help for scientific instrument
« Reply #9 on: May 12, 2014, 12:59:47 am »
Hi T3sl4co1l,

Thanks for your input! The rate of the plankton passing could be modified either by changing the density of plankton or changing the flow rate.  Either one could be modified in the field with some simple physical manipulations, so I don't have a good sense of what the event frequency would be. I expect the highest would be around 100s of events/plankton per second just based on the physical dimensions and potential flow rates of things involved.  A good point that a previous poster had is that I'm probably rate limited by the mechanics of the valves rather than the electronics, unless I can come up with a good solution.

In terms of the ADC sample rate, I was trying to get it down to the millisecond-microsecond regime as I figured that I needed to get a large number of samples per each individual plankton/event (this would enable an accurate signal integration digitally).  Thinking about it more, this may not be necessary at all. It would probably help my sensitivity issue by instead integrating the photodiode signal in analog, and then ADC sampling once per event.  I assume having a capacitor in place of the feedback resistor in the TIA would make it act as an integrator?  I'll read up on the basic op-amp circuits again and think about it some more.  I could easily setup two tandem absorbance detectors upstream to first initialize detection of a particle and then calculate the current velocity in the fluid, then try to do some careful timing to ensure I was integrating over the right period as it passed the downstream fluorescence detector.

Regarding the LED vs photodiode, do you have an idea how much worse an LED as a detector is?  Like 10x 100x less signal response etc.
Edit: According to this paper (http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=4123923&isnumber=4123844&tag=1)
"The calculated value for responsivity was 0.021 A/W. It is expected that the responsively would increase if the LED were reverse biased."
0.45A/W is the responsivity for the photodiode in the OPT101 integrated photodiode.  So a LED is around 20x worse than a random photodiode.

I agree that the timing should probably be done on a micro controller though.  I just tested the timing on the RPi and I found that a complied C program was delayed for 15 milliseconds worst case, which could be problematic.  Discrete is an interesting idea, but the last discrete circuit I made for my last electronics class took me about 3 days to fully debug.

@rs20

Just saw your response as well, very helpful! Thank you

Fluorescence images of the single organisms are published, including images and descriptions that go back to 1961, so I believe it is visible to the eye.  Color filters plus dedicated photodiodes are definitely doable, just more expensive.  Even on Ebay the filters are around 30 dollars each.  But, everyone seems to be saying that the actual photodiodes are significantly more sensitive than the LED idea, so I will have to track some down and make it work.

With respect to the LED frequency response, according to Figure A of this page (http://makezine.com/projects/make-36-boards/how-to-use-leds-to-detect-light), the frequency response is more or towards the color it emits, seemed workable.

I'll definitely look up Dave's video on the op-amp parameters.  I was reading on them all today from various sources and didn't have a good practical sense for it still.

Lots of flexibility in the design of the circuit still, voltages etc are flexible given the 12V primary supply.  I just wanted to keep things around 3.3V so I could interface directly to the Pi, but that might be an unnecessary restriction as I should easily shift the voltages.
« Last Edit: May 12, 2014, 02:29:59 am by photocyte »
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21688
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Design help for scientific instrument
« Reply #10 on: May 12, 2014, 03:18:14 am »
I expect the highest would be around 100s of events/plankton per second just based on the physical dimensions and potential flow rates of things involved.  A good point that a previous poster had is that I'm probably rate limited by the mechanics of the valves rather than the electronics, unless I can come up with a good solution.

Ok, so pretty slow.  Somewhere between "crawling" and "DC", as circuits go. ;)  Depending on the integration time of course.

If you're hand building the actuator, I wonder if a fine nickel foil, actuated by an electromagnet, might be handy.  (Nickel because it is ferromagnetic and reasonably corrosion resistant.)  The magnet itself can switch in microseconds, and I suspect the mechanical time constant of the foil will be limited by the water around it (viscosity should keep it well damped, while the velocity will certainly not be easy to push beyond the speed of sound in water, but probably a very small fraction at that; a minimal moving distance will of course be best).  Piezo actuators are also something to consider; if you're really frikkin' fancy, maybe something with acoustics and standing waves and mumbo jumbo (geez, that'd be a research project in itself... something for the MEs? ;) ), but even if it's just a bending aerofoil or something, it could be very fast.

Quote
In terms of the ADC sample rate, I was trying to get it down to the millisecond-microsecond regime as I figured that I needed to get a large number of samples per each individual plankton/event (this would enable an accurate signal integration digitally).  Thinking about it more, this may not be necessary at all. It would probably help my sensitivity issue by instead integrating the photodiode signal in analog, and then ADC sampling once per event.  I assume having a capacitor in place of the feedback resistor in the TIA would make it act as an integrator?

You don't want an integrator per se, but you're on the right track.  You want a slow response, which is to say, a narrow frequency band, so that you filter out high frequency noise.  Which there may be plenty of: thermal noise in the feedback resistor and op-amp, shot noise of the photodetector, and the noise of the emissive process itself.  (I don't know if this actually occurs anywhere -- but I could imagine a source which obeys Poissonian statistics, for example if the light emitting material is contained in a few organelles, and each emits a flash of light, followed by a random (diffusion driven) recovery phase, so that the total over a pile of goo averages to a constant 'hiss' of light, just as the detection of radioactive decays by a Geiger counter is a series of ticks at low rates, but becomes a loud rushing sound when the rate is high.)

If you did use an integrator, you need to remember you can only perform a definite integral at a time.  So you need to reset to "t_0", then let it integrate, then stop and count the result.  There is, of course, circuitry to do this, but why?  Suppose you could have it self-resetting, in a continuous fashion, so that values from the most recent history are weighted more strongly than values longer ago.  This is simply a low-pass filter, darned easy to make, and darned useful.

I would still sample the ADC multiple times, just because the ADC exhibits much the same behavior.  There may not be much variation between, say, four successive samples, at a sample rate several times the (analog) cutoff frequency, but in case there is, this way you'll have a higher confidence level in those samples.  The samples can be filtered digitally as well, for example using a sliding-average filter (which averages the last N samples at any given point in time, weighted equally -- in contrast to the analog filter's exponential decay of effective weight).

Quote
Regarding the LED vs photodiode, do you have an idea how much worse an LED as a detector is?  Like 10x 100x less signal response etc.

Orders of magnitude, I would think.  100x at least, and that's comparing to small photodiodes.

I don't have any real numbers.  Perhaps I should make some?  Sadly I don't have any (visible spectrum) photodiodes handy to compare to.

Photodiodes of course can be had in extraordinarily large sizes, up to whole-house sized panels (solar panels).  The tradeoff is, such large panels exhibit monstrously large capacitance, which makes detecting a rapidly changing signal all but impossible.  Small ones are quick (say, good for reading gigabits off an optical fiber), but very insensitive (LEDs being a sort of example, since their dies are also small).

Depending on your optics, a relatively small photodiode may still be suitable.  If the cells appear at the focus of a lens, and you have a spherical back-mirror (so the lens is looking directly at itself, except that cells appear in the focus, and thus any light emitted in the direction of the lens or mirror is collected -- the mirror giving a factor-of-2 improvement, much as the shiny layer behind a cat's retina -- plus any other tricks you can come up with to increase the solid angle that goes into the detector), then you can focus that back down to a point on a small photodiode, and end up with way better optical performance than a crude setup with huge detectors.

Regarding reverse bias, electron-per-electron (not per photon, as the quantum efficiency is not quite ideal, for various reasons), it's not much different, as long as the electrons freed do flow through the circuit and don't recombine -- you certainly wouldn't use it photovoltaically where photocurrent is balanced by self-forward-biased leakage current in the 0.2V+ range.  But you do get the advantage of capacitance: at 0V, the depletion region is very thin (the region where electrons and holes stand across from each other), and this forms a capacitor with narrow spacing and wide area, and therefore high capacitance.  At high voltages, the region depletes (as the name suggests!), and becomes wider, thicker.  The capacitance therefore drops, which means your system bandwidth can be better.  Usually several times better!  Particularly in high speed optics, this is an advantage which cannot possibly be left on the table.  Here, probably not as important, but even just a few volts will do some good, and you'll have at least as much available on a supply voltage somewhere.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Design help for scientific instrument
« Reply #11 on: May 12, 2014, 06:33:33 am »
A few points that come to mind:

Beware of overprocessing in the analog domain. For example, if you use a low-pass filter combined with a comparator, any bioluminescent algae (random example) that gets sucked up by the device will just saturate the device and turn it on. Yes, you can make circuitry to compensate for this (auto-compensating for DC bias like those touch sensor chips do internally), but every time you do a test and find it fails, you have to tweak one of the five pots on your board and all previous testing is invalidated.

IMHO, much better to have a board that is as high-bandwidth, high-sampling rate and general-purpose as easily practical, and do all tweaking in software land. That way, every real-world experiment you do becomes a input for a unit-test, and whenever you do a tweak, you can trivially and reliably re-run every experiment you've ever done. Of course, with any ADC, you should be low-passing the input signal to well below the sampling frequency/2, that prevents aliasing and missed signals, and addresses your concern about "catching the signal", but keep any further low-passing to the digital domain. Bonus: low-passing in the digital domain destroys quantisation noise and eliminates the issue of noise getting in to your analog chain after the lowpass filter.

A 32-bit micro should very comfortably be able to handle this task (link random thing I used once, having never done 32-bit before I was vaguely worried and was confused for one day, and then it turns out it was no more difficult, just a bit different). I'm not sure that huge memory capacity is a requirement here, if it is indeed possible to do it using an exponential filter, you need no memory at all. It may very well be possible to do using Arduino. Either way, you should be piping ADC data unmodified out to the RPi for collection (I wonder if you could set up the RPi to just listen in on the ADC -- MCU SPI bus?), so that you can inspect it for unusual things, perhaps do heavier processing that's too late to actually operate the equipment but can raise error messages.

With all of the precise data you collect this way, you can then easily figure out if a low-pass filter + comparator approach is practical using hard data. That's an easy, valuable research publication right there.

One other thing, optics are great, but they achieve one thing: they capture light that's spreading out from a point, and collect it back to a more-or-less-point where a sensor can catch it. Optics cost money and can be a pain to align. Where practical, consider alternative strategies (see attached PizzaCAD image). Clearly, my suggestion here isn't always the best (for one, it may not always be physically possible due to the dimensions of the components/dimensions of tube), but do consider it as an option. At least you're only worried about a narrow band of wavelengths, so chromatic abberation is not an issue for you (<mostly joking>maybe something you can exploit?).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf