Does Anyone Know Of A Submersible Arduino/RaspberryPI Compatible Spectrometer?

255 views
Skip to first unread message

Cory Geesaman

unread,
Sep 3, 2017, 3:59:25 AM9/3/17
to DIYbio
The subject pretty much says it - I'm trying to find a (hopefully cheap - under $200) Arduino or RaspberryPI compatible photospectrometer which can be submerged for long periods of time in water to log water quality.  I've been searching around a bit and can't find any, but if someone knows of one which could be hacked fairly easily (sticking it in a new case for instance) that would be great too.  I'm not too worried about calibration (I can calibrate the thing and write the code needed to identify different ions from a bunch of data,) just want to avoid having to designed the thing from a capillary tube up though light sources and sensor if at all possible.

Gordana Ostojic

unread,
Sep 3, 2017, 9:03:45 AM9/3/17
to DIYbio
 I would use fiber optic input and leave the spectrometer out. Ocean optics used to have small one and probably lots of other companies.  

Michael Hogan

unread,
Sep 3, 2017, 7:47:55 PM9/3/17
to DIYbio
I presume you are using UV/VIS.

I have been using Hamamatsu C12666MA and C12880MA modules for some stuff.  The modules themselves are a bit north of $200, and you need to add some simple op amps, some way to digitize the signal, and some light source.  There is a carrier board from Pure Engineering that is a little under $100 (so now you are looking at something a bit over $300).  It has a white LED that is an OK light source if you normalize it, and it has a 405nm LED for measuring fluorescence.  The board is designed to plug right into an Arduino, and there is some sample code available for it (the sample code is just "ok").  Spectral resolution is pretty mediocre ( rated at 15nm max ) 

We have code for interfacing the PureEngineering carrier to a NUCLEO-F303K8, which is an ARM-m4 board that is pin-compatible with the Arduino-mini -- the code uses the mbed programming environment.  This code is somewhat more full-featured than the Arduino code .. it's interrupt driven, and the F303 has 12 bit converters that run at 2M samples/sec (the conversion routines that we used actually average four successive conversions) .. so conversions are fast if you have enough light to permit short integration periods.

We have also been looking at the Pasco PS-2600 and Vernier Spectrovis.  This are student spectrometers that cost $400.  It has a fiber-optic accessory for $70 that plugs in to the cuvette holder -- you can probably 3d print your own fiber extender for the light source and the sensor w/o much problem. So far, I am scratching my head trying to figure out how they make such a good spectrometer so inexpensively.  They claim 3nm spectral width, max, and I was able to determine (using Wireshark) that they are probably using a TCD1304 sensor and converting at 12 bits. Their spectrometry software is actually pretty good too (and free).  As a bonus, the machine can be used over bluetooth with a tablet or phone, and it has rechargeable batteries.  No easy way to hook it up to an RPi or Arduino, though.

So .. 
  • under $200, I think you are looking at camera-based solutions, with a healthy dose of DIY and low dynamic range .. or maybe a spinning-mirror setup (lots of tweaking to get it working well) .. or maybe a DIY TCD1304 solution (tough to get the optics really dialed in and calibrated, if that matters in your app).
  • Mid $200-ish, you can probably make a Hamamatsu micro-spec based solution, again with a healthy dose of DIY
    • need to amplify the module's video signal, need to make light-sources, need to enclose everything in a water-tight container etc.
    • spectral resolution ~15nm, dynamic range depends on conversion method.  12-bit converters will probably give about 10 usable bits
  • A bit over $300-ish, you can make a Hamamatsu micro-spec based solution, with just a little DIY
    • Light-sources, signal amps etc. already designed with PureEngineering carrier module.  Need to make water-tight package and add Arduino or other micro for acquisition.
    • spectral resolution ~15nm, dynamic range depends on conversion method.  12-bit converters will probably give about 10 usable bits
  •  $400+, I think that you can add a fiber extensions for light and signal to a Pasco PS-2600 or a Vernier Spectrovis (same machine, I think)
    • Spectral resolution ~3nm,  Conversion appears to be 12-bit. Decent free software.  No standard support for Arduino or RPi.
    • Water-proofing is easy, I think, if you use fiber-optic extensions
  • $1000+ -- The options open way up, with Ocean Optics and a lot of similar modular specs.  Not sure about interfacing methods.

Jonathan Cline

unread,
Sep 4, 2017, 1:24:49 PM9/4/17
to DIYbio, jcline

On Sunday, September 3, 2017 at 12:59:25 AM UTC-7, Cory Geesaman wrote:
The subject pretty much says it - I'm trying to find a (hopefully cheap - under $200) Arduino or RaspberryPI compatible photospectrometer which can be submerged for long periods of time in water to log water quality.  I've been searching around a bit and can't find any, but if someone knows of one which could be hacked fairly easily (sticking it in a new case for instance) that would be great too.  I'm not too worried about calibration (I can calibrate the thing and write the code needed to identify different ions from a bunch of data,) just want to avoid having to designed the thing from a capillary tube up though light sources and sensor if at all possible.

You are requesting a device which can: 
1. be submerged => it must be physically small and self-contained
2. operate for long periods => it must be power efficient (i.e. likely battery powered, also sometimes incorporating solar)
3. log data obviously with timestamp, for long periods => it must have large storage memory

Both arduino and raspberry pi are completely unsuitable for #1, & #2, and arduino is unsuitable for #3.   Neither arduino nor raspberry pi are power efficient, in fact the raspberry pi is a ridiculous power hog (including the zero).   Arduino as a logger is only suitable for connected-pc operation, USB connected, not self-contained. 

Logging data with timestamp (even deltas) is storage intensive over long periods.  Usually the logging period is a compromise between storage size and required sampling rate for good data analysis.

I suggest starting with the single requirement "for long periods of time" and define exactly what that period is, calculate the storage requirement for that period, then use that to narrow the choices. Based on that period you can also calculate the total power required for sizing a battery, and then get an idea of total physical size (approximate) for a case design.  A good board design should use no more than 50 mA average, especially considering it should be sleeping in between each data sample.   Using all this info, you can filter through the available hardware to find the one that physically fits, will actually run for the given time, and be able to store the data between in-field downloads.  Then narrow down to hardware which can run micropython if you want to avoid the assembly language programming. 

There are several recent projects for water/environmental sampling such as some new oceanographic buoys off southern california, battery powered and recharge on solar.  They might be using low power FSK radios to transmit data periodically to a shore station.   Nordic semiconductor has some great boards which fit those types of applications.

--
## Jonathan Cline
## Mobile: +1-805-617-0223
########################

Abizar Lakdawalla

unread,
Sep 4, 2017, 1:41:54 PM9/4/17
to diy...@googlegroups.com
What exactly are the measurements for, do you need the whole spectrum or are you looking at specific absorbance wavelengths, or turbidity/light scattering, or fluorescence, or conductivity? What analytes are you trying to track.

--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en
Learn more at www.diybio.org
---
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+unsubscribe@googlegroups.com.
To post to this group, send email to diy...@googlegroups.com.
Visit this group at https://groups.google.com/group/diybio.
To view this discussion on the web visit https://groups.google.com/d/msgid/diybio/93faa70f-b785-4c40-b66a-aba257528637%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Griessen

unread,
Sep 4, 2017, 2:52:20 PM9/4/17
to diy...@googlegroups.com
On 09/04/2017 12:41 PM, Abizar Lakdawalla wrote:
> What exactly are the measurements for

Yes, maybe Cory could use a platform like I am working on back burner to run with
solar power, micropython for filesystem on SD cards, inexpensive flat flex cables and connectors for modules...able to support
10mA average 3V current draw indefinitely, more for bursts and more with more optional long life batteries.

Aakriti Lakshman

unread,
Sep 5, 2017, 7:39:34 PM9/5/17
to DIYbio
Hey! I'm also looking for a UV spectrometer to detect the presence of proteins. Are there any cheap alternatives??

Abizar Lakdawalla

unread,
Sep 5, 2017, 8:47:26 PM9/5/17
to diy...@googlegroups.com
Check out https://www.adafruit.com/product/1918 for a UV sensor in the 240-370nm so would work for the 280 nm protein absorbance peak. You will also need a 280 nm emitting LED, these are about US$30-40 on ebay.

--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en
Learn more at www.diybio.org
---
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+unsubscribe@googlegroups.com.
To post to this group, send email to diy...@googlegroups.com.
Visit this group at https://groups.google.com/group/diybio.

Skyler Gordon

unread,
Sep 5, 2017, 9:12:41 PM9/5/17
to diy...@googlegroups.com
Hey there!

Not sure if this has to do with oceans, but remember it has a lot of virus based biological materials in it. It could mean low amounts phosphorus.

What sort of power restrictions are you working with? Solar, wall socket, or something else?

-SG


On Tue, Sep 5, 2017 at 5:47 PM Abizar Lakdawalla <abi...@gmail.com> wrote:
Check out https://www.adafruit.com/product/1918 for a UV sensor in the 240-370nm so would work for the 280 nm protein absorbance peak. You will also need a 280 nm emitting LED, these are about US$30-40 on ebay.
On Tue, Sep 5, 2017 at 2:21 PM, Aakriti Lakshman <aakriti...@gmail.com> wrote:
Hey! I'm also looking for a UV spectrometer to detect the presence of proteins. Are there any cheap alternatives??

On Sunday, September 3, 2017 at 3:59:25 AM UTC-4, Cory Geesaman wrote:
The subject pretty much says it - I'm trying to find a (hopefully cheap - under $200) Arduino or RaspberryPI compatible photospectrometer which can be submerged for long periods of time in water to log water quality.  I've been searching around a bit and can't find any, but if someone knows of one which could be hacked fairly easily (sticking it in a new case for instance) that would be great too.  I'm not too worried about calibration (I can calibrate the thing and write the code needed to identify different ions from a bunch of data,) just want to avoid having to designed the thing from a capillary tube up though light sources and sensor if at all possible.

--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en

Learn more at www.diybio.org
---
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+un...@googlegroups.com.

To post to this group, send email to diy...@googlegroups.com.
Visit this group at https://groups.google.com/group/diybio.
To view this discussion on the web visit https://groups.google.com/d/msgid/diybio/d81d238a-1da6-462d-8077-02d1b293e68b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en

Learn more at www.diybio.org
---
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+un...@googlegroups.com.

To post to this group, send email to diy...@googlegroups.com.
Visit this group at https://groups.google.com/group/diybio.

Skyler Gordon

unread,
Sep 5, 2017, 9:14:07 PM9/5/17
to diy...@googlegroups.com
Also. Is it going to need to be cleaned?

-SG

Cory Geesaman

unread,
Sep 6, 2017, 2:28:42 AM9/6/17
to DIYbio, jcl...@ieee.org
I may have worded this poorly, I'm looking for a submersible probe (the RaspberryPI [ideal microcontroller given other sensors I'm working with] will be in a box sitting in a dry area plugged into a PoE connector.)  There is a bit of a power limitation in that the PoE card has 1.3A at 5V and with the other probes attached it's already pushing that limit, so I might actually have to drop the PoE aspect and use a different supply since 1.3A/5V seems to be as good as it gets for Raspberry PI PoE cards.

Cory Geesaman

unread,
Sep 6, 2017, 2:32:11 AM9/6/17
to DIYbio
Ideally 250nm-1200nm, I'm aiming for a broadband detector to pick out ion concentrations in water when combined with separate D.O., tubidity, ORP, pH, conductivity, and temperature sensors.  The individual ion sensors for things like nitrate, nitrite, fluoride, calcium, sodium, phosphorous, ammonium, etc tend to run about $1,500 each - I'd like to get away with a probe that can get a decent spectrum and pass it along to an actual server for processing to pick out the ion concentrations.


On Monday, September 4, 2017 at 1:41:54 PM UTC-4, Abizar Lakdawalla wrote:
What exactly are the measurements for, do you need the whole spectrum or are you looking at specific absorbance wavelengths, or turbidity/light scattering, or fluorescence, or conductivity? What analytes are you trying to track.
On Mon, Sep 4, 2017 at 10:24 AM, Jonathan Cline <jnc...@gmail.com> wrote:

On Sunday, September 3, 2017 at 12:59:25 AM UTC-7, Cory Geesaman wrote:
The subject pretty much says it - I'm trying to find a (hopefully cheap - under $200) Arduino or RaspberryPI compatible photospectrometer which can be submerged for long periods of time in water to log water quality.  I've been searching around a bit and can't find any, but if someone knows of one which could be hacked fairly easily (sticking it in a new case for instance) that would be great too.  I'm not too worried about calibration (I can calibrate the thing and write the code needed to identify different ions from a bunch of data,) just want to avoid having to designed the thing from a capillary tube up though light sources and sensor if at all possible.

You are requesting a device which can: 
1. be submerged => it must be physically small and self-contained
2. operate for long periods => it must be power efficient (i.e. likely battery powered, also sometimes incorporating solar)
3. log data obviously with timestamp, for long periods => it must have large storage memory

Both arduino and raspberry pi are completely unsuitable for #1, & #2, and arduino is unsuitable for #3.   Neither arduino nor raspberry pi are power efficient, in fact the raspberry pi is a ridiculous power hog (including the zero).   Arduino as a logger is only suitable for connected-pc operation, USB connected, not self-contained. 

Logging data with timestamp (even deltas) is storage intensive over long periods.  Usually the logging period is a compromise between storage size and required sampling rate for good data analysis.

I suggest starting with the single requirement "for long periods of time" and define exactly what that period is, calculate the storage requirement for that period, then use that to narrow the choices. Based on that period you can also calculate the total power required for sizing a battery, and then get an idea of total physical size (approximate) for a case design.  A good board design should use no more than 50 mA average, especially considering it should be sleeping in between each data sample.   Using all this info, you can filter through the available hardware to find the one that physically fits, will actually run for the given time, and be able to store the data between in-field downloads.  Then narrow down to hardware which can run micropython if you want to avoid the assembly language programming. 

There are several recent projects for water/environmental sampling such as some new oceanographic buoys off southern california, battery powered and recharge on solar.  They might be using low power FSK radios to transmit data periodically to a shore station.   Nordic semiconductor has some great boards which fit those types of applications.

--
## Jonathan Cline
## Mobile: +1-805-617-0223
########################

--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en

Learn more at www.diybio.org
---
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+un...@googlegroups.com.

Cory Geesaman

unread,
Sep 6, 2017, 2:34:30 AM9/6/17
to DIYbio
Correction, 350nm on the low end.

Cory Geesaman

unread,
Sep 6, 2017, 2:46:16 AM9/6/17
to DIYbio
Honestly, I really hate platforms - they tend to do a handful of things really well and integrate like like crap with any other platform.  Picking something like python over c sounds particularly painful to interop with other things - I'd much rather have the raw probe data that can be run through an ADC or some other simple logic and code my own driver several dozen times over than I would try to decipher a half dozen different platform developer's API, coding styles, and logical paradigms then make them play nicely together (it's also much faster to do the former in addition to being less stressful.)

Cory Geesaman

unread,
Sep 6, 2017, 3:43:31 AM9/6/17
to DIYbio
I'm adding to this since it seems I worded the original very poorly based on responses (and the concept has been refined a bit since then.)

To start, my application is not a data logger meant to sit out in a pond or swamp somewhere, it will be wired into a (hopefully PoE if I can keep the wattage low enough) connection tied directly to a server with decent storage and processing power, but am very against any form of closed hardware (not in the least of which because I use FreeBSD for servers and nobody making proprietary code likes to talk to them, but also because I've never had a pleasant experience with vendor lock-in.)

I'm aiming for a water monitoring probe which can detect a very wide range of ions, this would be coupled with tubidity, D.O., ORP, conductivity, pH, and temperature sensors taking measurements every minute or 10 minutes, depending on the size of the data.  Given the other data available and the fact ion detectors tend to be designed per-ion with a focus on membrane-based techniques and run about $1,000-$1,500 (per ion) with a shelflife numbered in months under continuous use (at best), that option isn't on the table.

This has gotten me looking into spectrophotometers, and it seems if I can measure reflection, adsorption, and fluorescence spectra independently over a wide band (and of course one at a time for fluorescence spectrophotometry) it should be feasible to pick out just about any ion concentration with a high degree of accuracy and a decent server to parse the information.  It even has the added benefit that I can add ions as needed by finding the relevant data and having the computer check for matches across the entire history of the dataset rather than just having big holes in the data before a particular sensor was added.

To this end I've thus far narrowed down the possible light source combination at the end of this post, which should yield a very large set of possible fluorescence spectrophotometry readings when they are switched on 1 wavelength at a time with individual snapshots taken (just listing these in case anyone else is working on a similar project, it took about a day to find a set of LEDs with fairly well-matched half-amplitude-wavelengths and similar amplitude at a 15-degree radius, the number at the start is the number needed to balance the amplitude to the others for a 15 degree angle, then what it is, then the price each, then the source.)

To get the adsorption spectra is pretty easy - just shine a light through something and see what doesn't make it.  To get the reflection spectra is a little trickier, in that you need to measure from the side you are shining the light from, and to get the fluorescence spectra you switch on 1 group at a time and see what other wavelengths you get out of it.  My best idea for this thus far is actually pretty painful to implement: take a fiber with two Y-shaped splices (so more like an X with an elongated center) and for one pair have an input going to a cavity with all the LEDs embedded in the walls pointed at a pigtailed cosine corrector (diffuser plate over top of a piece of glass which effectively opens a single mode fiber aperture to about 4mm across.)  On the other side of the input pair you would actually have your output, going to a diffraction grating with a camera pointed at it.  On the other pair you would have the sample cavity and a reference signal going back to a different y coordinate on the diffraction grating.  Then you would have 1 more fiber on the opposite side the cavity for adsorption detection which again goes to the diffraction grating - for a total of two fibers going to the probe.  This is probably really hard to decipher so I've added a diagram below (sorry for the quality of it in advance), and would welcome better ideas to achieve the same because at the moment it looks like I'll need to get a fusion splicer to make the X-shaped section and attach the components to it, plus have a cavity milled or hack one together with epoxy.


Cory Geesaman

unread,
Sep 6, 2017, 3:53:42 AM9/6/17
to DIYbio
My thought would be to have the sensor in the probe wrapped around a 4-8mm ID square glass tube so you could just run a cotton swab through it for cleaning.

Skyler Gordon

unread,
Sep 6, 2017, 4:40:51 AM9/6/17
to DIYbio
If you had a continuous flow it would be great for taking a lot of data samples.

Not sure what a PoE is... But remember though, if this is for an ocean setting you're going to have to account for a controller(?) as well as mobility issues. Plus it needs a rechargeable power source (solar, bio-batteries, radio waves, etc.) but the best way would be to just use less power. Doesn't seem like you have power issues, but just a thought.

To be honest, it sounds like you have more of a materials problem then anything else. Diffraction, and more accurate LED spectrums seem like they could help. I don't get your 1 wire idea, but if you're looking for an alternative to a light source you could think about using microcantilevers (or atomic force microscopy) as a way of detecting small things in the water but that's some seriously hard stuff you're talking about.

-SG



Jonathan Cline

unread,
Sep 6, 2017, 5:51:04 AM9/6/17
to diy...@googlegroups.com, jcline
If you have PoE then a minimal embedded unix board is a good choice.
Raspberry Pi is still not a great choice because it is made for
video-display applications and burns power comparable to that. If you
are sending data immediately through the PoE network then local
storage space is not needed thus Raspberry Pi's main benefit of having
a huge microSD Card + great file system support does not add benefits,
considering the tradeoff in power. Even the Pi Zero burns too much.
The Pi is not a microcontroller, it is a graphics/video
microprocessor. Talk about vendor lock-in, the Pi SOC internals are
obscure enough that they are either secret or might as well be secret.
There won't be much recourse if you run into a hardware/low level
software glitch with interfacing your sensors.

I can't imagine that any sensor board "made for Pi" would be limited
to only working with the Pi. Because, the Pi has relatively generic
peripheral bus support. Any other board will have GPIO or I2C.
Personally I wouldn't trust the Pi builds to be real time in any sense
(important for sampling and calibration), or bug free in the IO
drivers, regardless of it's linux kernel configuration. Would it skew
measurements if the logging rate is every 1 minute? Yes, possibly, so
that choice depends on if you want to live with +/- 2% error just from
random timing slip.


One great board I used (UBW32), has micro BSD open source kernel
ported to it (called retro BSD) and SD card + BSD filesystem, it is
PIC32 so very low power, and every peripheral you could reasonably
think of. You could use simple serial. Writing unix drivers for your
sensor would be straightforward. Writing user apps, obviously very
simple. micropython could be a good way to go in userland
regardless, because it supports basic hardware access while allowing
general python programming. micropython does not imply using the
thousands of broken open source python libraries out there, because
they are likely not supported anyway, and are superfluous on embedded
hardware, but it does provide serial, io, math, and basic python
coding which is probably faster to iterate than C. You could check to
see what other boards micro BSD has been ported to. These are open
boards, not proprietary lock-in (not much lock-in is possible with a
microcontroller anyway, it's just the SOC on a card). It is always
handy to have a remote terminal on the device itself and all your code
would be nice POSIX. One thing to look for in the hardware, is either
a real time clock (better if with battery, like coin cell) or at least
a dedicated timer, so that you can timestamp your samples precisely,
and also not need to constantly set or reset the system time.

I'd say you would want to cache the sampled data locally and send it
to the remote server in larger periodic chunks (as slow as every 1 hr
or more, with retry mechanism). That way you have built-in
reliability and redundancy, i.e. don't lose valuable data when your
comms has problems (for example, transmission problem, or if the
server process restarts, etc). This kind of thing is simple in unix
with a cron job, shell script, and rzsz, as old school as that seems
(or uucp if you do ppp over the serial).

I agree with the other comment on the thread regarding sensor cleaning.
> --

Cory Geesaman

unread,
Sep 6, 2017, 8:42:53 AM9/6/17
to DIYbio
PoE is "power over ethernet" - it would be physically connected to a powered switch with a wire as opposed to having a separate power and network wire.  MEMS devices would almost certainly be outside my budget - I expect the whole probe + spectrophotometer to run somewhere under 2k, but engineering a MEMS device would likely be a million in the dev effort.

Cory Geesaman

unread,
Sep 6, 2017, 8:47:06 AM9/6/17
to DIYbio, jcl...@ieee.org
Not to say you're wrong on any other points, but there's no way Python is faster than c, it's at best a match.  Python isn't even a real language, it's a wrapper for c.

Michael Hogan

unread,
Sep 6, 2017, 9:55:38 AM9/6/17
to DIYbio
Thanks for the tips on the Spark-fun sensors .. exactly what we need for one of our projects.

Jonathan Cline

unread,
Sep 6, 2017, 11:49:42 AM9/6/17
to Cory Geesaman, DIYbio, jcline
On 9/6/17, Cory Geesaman <co...@geesaman.com> wrote:
> there's no way Python is
> faster than c

I believe you misunderstood the following :

>> basic python
>> coding which is probably faster to iterate than C.

This means implementing (coding) is faster to iterate i.e. faster to
write and rewrite, i.e. can be coded rapidly and bugfixed rapidly.
Not talking about execution time which for the hardware had
surprisingly small overhead, i.e. really good code size and code
execution time.

> Python isn't even a real language,

I don't know where you're going with that statement, especially in the
context of a comparison to the Arduino language. Any real-world
design which compromises on using Arduino hardware wouldn't use the
Arduino language because of the many drawbacks, especially when power
efficiency is a design consideration. If you want to nitpick that
micropython still uses bytecode, keep in mind that data logger-type
commercial products implemented with embedded Basic have been released
-- and sold -- decades ago (i.e. quick google turns up,
http://www.hth.com/filelibrary/txtfiles/losa.txt ) which has as a
listed example, and this was implemented back in the late 1990s:

-- quote --

A BS2SX Based weather station that can monitor the following:

- Wind Speed (and peak gusts)
- Wind Direction
- Rainfall Accumulation
- Barometric Pressure
- Temperature (at up to four locations)
- Relative Humidity
- Current Time & Date

The software will also support a keypad and LCD user interface,
and a PC-Board Kit is available.

-- end quote --

If you'd like many more examples of this type of application, just
search for something like, "basic stamp weather station" since it was
a very common application and project at the high school level.

I'm not suggesting use of embedded Basic (or those boards). Just
throwing out this comparison to what was solidly accomplished in the
90s (and with 1990's hardware) vs. the inefficiencies, aka sacrifices,
in board designs and software of today (i.e. "just use adafruit and
Processing-IDE), if there's any suggestion that micropython has too
much overhead or "isn't a real language".

Another downside of Arduino hardware is that, as a proprietary
platform (which has some of the worst platform lock-in itself), it is
obsolete nowadays. Whatever hardware you choose should have a healthy
product roadmap. If compromising with design choices enough to
consider Arduino, you might as well compare Lego hardware and Lego
software (which is.. ironically enough.. very similar to a Basic stamp
design). Whatever design you choose, for an embedded device, you
should be able to easily fix or improve the code 10-15 years from now,
without having to throw everything away and reimplement from scratch
because the vendor is gone or the development system no longer runs.

Cory Geesaman

unread,
Sep 6, 2017, 12:22:24 PM9/6/17
to DIYbio, co...@geesaman.com, jcl...@ieee.org
I'd agree Arduino is a hacky solution for the reasons you listed, but coding speed tends to be determined by familiarity with a language.  I can code just as fast in c as c++ or c# or JavaScript, on the other hand Python is like someone crossed c with whitespace (because that's what it is.)  Having indentation as a syntactical requirement only appeals to people who agree with the indentation chosen while making it a serious pain to port code from other languages because the normal stuff (keyword and library differences) are all very obvious while the whitespace requirements don't stick out as well.

The UBW32 seems interesting, are there any PoE+ethernet communication boards which are pretty straightforward to add to it?

Jonathan Cline

unread,
Sep 6, 2017, 1:22:41 PM9/6/17
to Cory Geesaman, DIYbio, jcline
It's 2017, those arguments against python are over 10 years old and
python won. There's no need to rehash that stuff. "Python is like
someone crossed c with whitespace" is simply blatantly incorrect, even
grossly incorrect.

The UBW32 (aka PIC32) does, or did, have an ethernet daughtercard
available and unix networking is supported in the BSD operating system
I believe, but double check that. The UBW32 has been around for
years. I found it really neat to write unix code and run it on the
board, without all the baggage that something like the Raspberry Pi
would bring with it. PoE adapters to 12V or 5V are typical off the
shelf, I'm not sure if there's a dedicated daughtercard available.
True PoE compliance has a certain level of complexity (especially in
Q-A testing), so an external unit is probably best anyway.

If you choose suitable hardware, there's no need for PoE or ethernet.
Why run wire when you don't have to. PoE also seems like a great
solution theoretically but it just is not that simple to add onto a
board because it's intended for strict industrial grade use, it could
be far easier to just run power separately. Or since there's liquids
involved you could also look at wireless power (or inductive, aka less
efficient cordless toothbrush style) which would be great for user
simplicity and safety. Some embedded water sensor modules use
inductive power themselves anyway (with optical data comms).

The emerging platform that I see as a good way forward for these types
of sensor projects is, this might sound surprising, the microbit,
which has a long roadmap ahead of it and a huge built-in consumer
base, so it's longevity is assured. It also runs micropython (or C or
ARM9 assembly, if you want), it has suitable storage, the SoC has very
good low power modes and peripherals, and the board has a built-in
Nordic 2.4 Ghz radio which sounds like a good fit for your
requirement, of periodic data chunks (~32 byte payload etc). With
minor optimizations (i.e. turn off unnecessary peripherals and use
sleep mode with wakeup timers), the hardware could run from a few
rechargeable batteries and a small solar panel indefinitely, or
minimal wired power if you really want. I haven't used the microbit
but I have used that SoC a few times for commercial projects.

It used to be, for low power applications i.e. sensing or control or
DSP stuff, I'd instantly cross off any SoC that had hardware floating
point, because that used to indicate a certain level of power
inefficiency or lack of support for low power CPU modes (low power
designs compromised by using integer math to be optimal). The Cortex
is in that design space of modern SoC's where it finally doesn't
really matter anymore.


On 9/6/17, Cory Geesaman <co...@geesaman.com> wrote:
> I'd agree Arduino is a hacky solution for the reasons you listed, but
> coding speed tends to be determined by familiarity with a language. I can
> code just as fast in c as c++ or c# or JavaScript, on the other hand Python
>
> is like someone crossed c with whitespace (because that's what it is.)
> Having indentation as a syntactical requirement only appeals to people who
>
> agree with the indentation chosen while making it a serious pain to port
> code from other languages because the normal stuff (keyword and library
> differences) are all very obvious while the whitespace requirements don't
> stick out as well.
>
> The UBW32 seems interesting, are there any PoE+ethernet communication
> boards which are pretty straightforward to add to it?
>

Cory Geesaman

unread,
Sep 6, 2017, 1:39:54 PM9/6/17
to DIYbio, co...@geesaman.com, jcl...@ieee.org
You can argue that it's a bad idea to swim as deep into the ocean as possible until you can't hold your breath then try to make it up because you won't and that argument would have likely been made tens if not hundreds of thousands of years ago, the arguments against Python are over 10 years old because they have existed for over 10 years, that doesn't invalidate the arguments.

In terms of power I'm not really a fan of inductive technologies, the coupling just isn't good enough for an air core system if you're using anything short of Tesla coil voltages (it would negate the benefits of switching to a lower wattage chip.)  Wireless is something I like to avoid always (I was a software hacker well before a hardware hacker and have spent about a decade focused mostly on computer security, I don't think I could sleep at night if anything I cared about depended on a wireless connection.)  A wire just isn't enough of a pain in my scenario to warrant any form of wireless technology (I'm looking at sticking 20 of these things in different tanks in the same room not more than 50ft from a server room, and after that a bunch more of them outdoors not more than 5,000 ft away in the worst case scenario, I'd rather build some repeater shacks every 1,000 ft than use wireless.)  I know this isn't a common concern with the modern IoT philosophies, but this stuff will probably be sitting on an air-gapped network (or at least behind a firewall and managed switch blocking routes even as far as the firewall) because it just doesn't need to ever be accessed remotely for any reason.  With all the horror stories of foreign hackers going after IP cameras and routing equipment and governments targeting the infrastructure of eachother to have an economic impact there's a very real threat which there's just no reason to expose it to (it's only for an aquaculture research lab, but that's still enough.)

Jonathan Cline

unread,
Sep 6, 2017, 5:03:43 PM9/6/17
to Cory Geesaman, DIYbio, jcl...@ieee.org
It's important to be as objective as possible when defining
requirements and when choosing appropriate tools to handle those
requirements (including the reasons behind those early requirements),
i.e. without bias. It will make any project much more successful both
short and long term. Most of the project failures I've seen could be
traced back to arbitrary decisions in the requirements or early design
process, not in the later implementation.


On 9/6/17, Cory Geesaman <co...@geesaman.com> wrote:
>I'm looking at sticking 20 of these things
> in different tanks in the same room not more than 50ft from a server room,
> and after that a bunch more of them outdoors not more than 5,000 ft away in
> the worst case scenario, I'd rather build some repeater shacks every 1,000
> ft



Cory J. Geesaman

unread,
Sep 6, 2017, 5:13:03 PM9/6/17
to jcl...@ieee.org, DIYbio
I'm not sure which of the requirements you're considering objective.



Sent from my T-Mobile 4G LTE Device

Cory Geesaman

unread,
Sep 6, 2017, 8:58:33 PM9/6/17
to DIYbio
subjective*

Nathan McCorkle

unread,
Sep 7, 2017, 1:56:46 AM9/7/17
to diybio
On Tue, Sep 5, 2017 at 11:28 PM, Cory Geesaman <co...@geesaman.com> wrote:
> I may have worded this poorly, I'm looking for a submersible probe

http://www.ebay.com/itm/Y-type-optical-fiber-SMA905-1-7-Fiber-optic-reflection-probe-quartz-fiber-bundl-/122487851144?hash=item1c84d84888:g:vwcAAOSwhvFZEm~5

Cory Geesaman

unread,
Sep 7, 2017, 10:17:53 AM9/7/17
to DIYbio
That's one hell of a shipping charge on a $35 item, thanks though, it's worth looking at how those are made to see if it's going to be cheaper than trying to convince Thor Labs to build me the fiber components or getting a fusion splicer myself.

Gordana Ostojic

unread,
Sep 7, 2017, 10:35:36 AM9/7/17
to DIYbio
Thorlabs has fiber bundles that are easy to couple (https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=5609). Probably just need appropriate size and some kind of mount with a linear stage (TL also has all of these) if you want to be really fancy but I would say that these are pretty easy just to fix manually to the entrance of spectrometer. Spectrometers have entrance slits of about 1mm (depends on resolution you need) so choose bundle with that kind of diameter (inner).  

Gordana Ostojic

unread,
Sep 7, 2017, 10:39:44 AM9/7/17
to DIYbio

Nathan McCorkle

unread,
Sep 7, 2017, 4:19:55 PM9/7/17
to diybio
On Thu, Sep 7, 2017 at 7:17 AM, Cory Geesaman <co...@geesaman.com> wrote:
> That's one hell of a shipping charge on a $35 item

haha, I didn't notice that... but yeah the overall cost is to be
expected with a Quartz fiber (pretty much best for UV range
transmission).

Cory Geesaman

unread,
Sep 8, 2017, 1:55:04 AM9/8/17
to DIYbio
Wow, that's a great find, thank you.

Marc Dusseiller

unread,
Sep 8, 2017, 2:08:22 AM9/8/17
to DIYbio
hoi zäme,

the peeps from photosynq made something they call "CoralSpeq"

and some great discussions also happening on this forum thread:

greets,
marc

Ravasz

unread,
Sep 9, 2017, 8:59:05 AM9/9/17
to DIYbio
Hi folks,

I thought I'll chip in as well as I am struggling with a similar project. I am building a closed bioreactor to grow algae with, and that can essentially do what you need it to: monitor nutrients/spectral characteristics of a body of water. I helped design a prototype a few years ago, there are instructables for that one here: http://www.instructables.com/id/Biomonstaaar/

At the moment I am trying to come up with a new design that allows for more automation but being a biologist my electronics knowledge is limited. At the moment I am hooking up demo sensors to an arduino board and using the instrumentino package (https://github.com/yoelk/instrumentino ) on a Pi to log and graph all the data but the system does not work too well.

So if you do come up with a design that work and could keep me posted I would be utterly grateful. Also, if you feel like looking into why I can't get my own system working that would be amazing.

Let me know if you find any of this useful.

Cheers,
Mate

Cory Geesaman

unread,
Sep 10, 2017, 3:32:31 AM9/10/17
to DIYbio
I see you went with the Atlas sensors (I plan on using those too) - I'm not seeing ion detectors though - is that what you mean by being interested in it?  Thus far my best idea is the image below, I put an RFQ into Thor Labs for it which should allow for detection of just about anything in combination with the Atlas sensors, will see if they can do it.  Not so sure about the coupling on the LED cavity, but it should work reasonably well with the additional distribution of fibers dedicated to signal at various stages to account for losses.  The big questionmark in regard to whether or not Thor Labs will do it is the polarized fibers - those might be too much of a pain for them to align so many in a single cable, then pair them with an alignment in another cable (though it does kill off the need for collimators, polarizing beam splitters, prisms, and a bunch of other nonsense I was considering to couple the LEDs to the probe then get the signal back to a diffraction grating - everything else in the image seems to be stuff they already do.

Cory Geesaman

unread,
Sep 10, 2017, 3:35:11 AM9/10/17
to DIYbio
I should add that the polarization on the images are indicated by a line crossing the fiber in the direction of the polarization allowed in the cross section (maybe I'll get lucky and they just etch them on to a normal polarization-maintaining fiber for their other polarized fibers so it will be nothing, keeping my fingers crossed.)

Gordana Ostojic

unread,
Sep 10, 2017, 10:23:21 AM9/10/17
to DIYbio
I didn't look closely into what you trying to do but if it is simple absorption (not polarized absorption) you don't need to have polarizer at all.
Regarding led coupling, it depends on your detector (what is on the exit of spectrometer). If that is sensitive and you don't need much light on it, just put the led close the fiber and enough light should go in. My hunch is that the detector sensitivity will be ok in VIS (UV is a problem, also your led emission in UV is questionable) and your problem would be ambient/stray light. I would pulse the diode and detect on that frequency if you can get spectrometer detector reading signal to work that way.

Cory Geesaman

unread,
Sep 11, 2017, 3:00:48 AM9/11/17
to DIYbio
My objective is a submersible probe which can obtain:
-350-1200nm bandwidth
-reflection spectra
-absorption spectra
-fluorescence spectra
-polarization of each spectra measured
-detection of the above with the full 350-1200nm spectrum or with more fine-grained details (to pick out if say a material fluoresces at 450nm and another fluoresces at 450nm but one requires a pump of 500nm to do so and another of 600nm to do so, this would allow you to pick the two apart)  The LEDs I picked should allow individual pump bands averaging 47.2nm across.

Ultimately I want to be able to drop this in a tank of water to collect a reading every minute or 10 minutes over the course of a year and precisely map out ammonia, nitrate, nitrite, etc levels - and if I find something weird later on be able to plug the spectra into the server and have to go back and say "this started around this time, ramped up over this time, etc" without needing to know it at the start and buy a specific ion detector for it (to say nothing of the fact each submersible specific ion detector tends to be based on a membrane which dies within a few months and costs $1,500 on average, even if it weren't so limited as to need to know what you're looking for before you start looking.)

Gordana Ostojic

unread,
Sep 11, 2017, 10:51:57 PM9/11/17
to DIYbio
I doubt that you will find everything in one instrument. For starters standard UVVIS CCDs are Si and have 200-1000nm range (and edges are almost useless). For longer InGaAs CCD are used but they are more expensive, have lower response, more noise etc.  What you can do is do just monochromator with 2 exits and appropriate photodiode on each and than scan spectrum via software (it just rotates grating stepwise and records). 
For VIS it could be doable if your florescence is strong (typically you want to focus the excitation to maximize signal so different configuration from absorption that should be collimated). Simplest would be fiberoptic y probe with refection adapter at the end (look again at Thorlabs) but all depends on signal strength. If you make something similar yourself you can even put some polarizer in the sample's optical path. 
Like I said, if you want to improve signal (and ambient light will be the problem) I would assume that you can pulse your led with a simple circuit and CCS detects at that particular frequency (need phase matching which is more complicated). In optics labs it is done with lock-in amplifiers but that is expensive.
Reply all
Reply to author
Forward
0 new messages