Archive for August 2018

DDC112 Board Design/Bring Up

The DDC112 is a integrating current input ADC. You can use it for acquiring small currents (of the range of femto to picoamps (or larger if you want). Often a trans-impedance amplifier (current to voltage converter) would be used for this purpose. However the DDC112 doesn’t work like this…

The DDC112 collects current on a capacitor. It then periodically switches the capacitor over to a ADC, and starts collecting charge on a second capacitor while acquisition takes place. So, rather than having “gain” the switched current integrator has two parameters you can vary. The size of the capacitor and the time you integrate over.

The DDC112 has a number of build in capacitors, and you can also add your own externally. The DDC112 is really designed for photodiode applications. The series contains parts with 100s of channels, and built in ADCs. You’d use these for photodiode array systems, things like X-ray machines, CT Scanners etc.

However, I’m more interested in alternative applications. Things like scanning tunneling microscopes, or nanopore systems. Both these applications require the acquisition of picoamp current traces at a few kilohertz. Googling around, I found an interesting paper where they evaluated the DDC112 for use in an STM. They show a 50 femtoamp sine wave (sampled at 2Hz) which I thought was pretty cool:

Various other sources indicated that you should be able to get about 2 picoamps of noise at 1KSPS. Unfortunately I’ve not seen any board designs or code generally available. So I’ve started putting my own design together and doing some basic testing. Here’s the completed board:

Everything is probably overkill here… The DDC112 requires a 10MHz clock, so I used a 10MHz TXCO… totally unnecessary. But I was curious to play with a TXCO. I may well end up swapping it out later.

The DDC112 has continuous and non-continuous modes of operation. I wanted to run in continuous mode, constantly taking samples. To do this, you need to toggle the CONV pin, at a fixed frequency. This controls the switching (switching between collecting charge on one capacitor or another).

This frequency should be somewhat synchronized with the main clock. If I was using a fast (>100MHz) processor, I could probably just synthesize the 10MHz clock and the CONV trace. But i wanted to retain flexibility (and have currently been driving the board with an Arduino Mega). For this reason I decided to add a clock divider/generator.

For this I used an ATTINY85. I modified a digispark to use the same oscillator as the DDC112 as documented here. Currently I’m using it to generate a 1Khz CONV signal.

With these two signals in place, the DDC12 will acquire data, and pull DVALID low when an acquisition is ready. You can use DVALID to trigger and interrupt, and transfer the data to a microprocessor over SPI.

I’ve included board designs, and a dump of the code I used for testing in the notes below. A number of hacks were required on the board (re-routing DVALID to an interrupt capable pin, adding the digipark frequency generator). But they’re here for reference.

I’ve completed some very basic tests. The board seem capable of acquiring picoamp level signals. My shielding isn’t great:

But the first traces don’t look too bad, here’s a 5Hz 1nA square wave, sampled at ~1.2KSPS:

And here’s a 200pA square wave at the same:

The 200pA trace isn’t as clean as I’d like it to be, but I think if I clean up my test setup I should be able to improve things. In particular, I’m using a 100MOhm resistor to generate in input current. Likely using a larger resistor (and larger/cleaner voltage over it) would help a little. Obviously the shielding and board layout also needs work.

If you have a potential application for this board, please contact me. It would be interesting to collaborate.

Notes

Board designs (unchecked): DDC112_boards.tar

Arduino Mega code:

#include 
#include   

void setup() {  

  // put your setup code here, to run once:
  Serial.begin(115200);
  SPI.begin();
  SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE0));

  // range pins
  pinMode(A7,OUTPUT);
  pinMode(A6,OUTPUT);
  pinMode(A5,OUTPUT);

  // range setting
  digitalWrite(A7,HIGH);
  digitalWrite(A6,LOW);
  digitalWrite(A5,LOW);

  pinMode(2,OUTPUT); //TEST
  pinMode(13,INPUT);//CLK
  pinMode(4,OUTPUT); //DXMIT
  digitalWrite(4,HIGH);
  pinMode(5,INPUT);  //DVALID, old routing

  digitalWrite(2,LOW); //TEST PIN LOW=off

  attachInterrupt(1, read_data, FALLING); //DVALID (re-routed)
}

long int a=99;
long int b=99;
long int c=99;
long int d=99;
long int e=99;

bool read_ok=false;
long int in1 = 0;
long int in2 = 0; 
void read_data() {

  // READ DATA
  digitalWrite(4,LOW);  //DXMIT

  a=0;
  b=0;
  c=0;
  d=0;
  e=0;
  a = SPI.transfer(0);
  b = SPI.transfer(0);
  c = SPI.transfer(0);
  d = SPI.transfer(0);
  e = SPI.transfer(0);

  digitalWrite(4,HIGH);
  in2 = (a << 12) | (b << 4) | (c >> 4);
  in1 = ((c & 0x0F) << 16) | (d << 8) | e; 

  in1 -= (1 << 12);
  in2 -= (1 << 12);
  
  
  read_ok=true;
}

void loop() {

  //1 DCLK_INF       SCLK
  //2 DVALID_INF     3 (patch)
  //3 SDIN           SDIN
  //4 DXMIT_INF      4
  //5 DOUT_INF       SDO
  //6 CONV_INF       3 
  //7 NC             
  //8 TEST_INF       2
  //9 NC
  //10 RANGE0_INF    AD7
  //11 NC
  //12 RANGE1_INF    AD6
  //13 NC
  //14 RANGE2_INF    AD5

  if(read_ok) {
    Serial.print(in2);
    Serial.print(" ");
    Serial.println(in1);

    read_ok=false;
  }
}

ATTINY85 code:

void setup() {
  // put your setup code here, to run once:
  pinMode(PB0,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  for(;;) {
    digitalWrite(PB0,1);
    delayMicroseconds(500);
    digitalWrite(PB0,0);
    delayMicroseconds(500);
  }
}

Reprogramming a ATTINY85 to use an external oscillator using the Arduino IDE

I’d read about using PIC series microprocessors as clock dividers. For a project I’ve been working on I wanted to do the same thing. I find working with PICs pretty painful so I thought I’d use the Attiny85 from a digispark I have.

The process is pretty straightforward, but I wanted to document it here.

In order to reprogram the ATTINY85 to use a different oscillator, you need an AVR programmer. It’s not possible to set the fuses using the digispark bootloader. An Arduino Uno (or a knockoff) can be programmed to be used as a device programmer for other AVRs. The Arduino ISP includes the software to do this under Examples->ArduinoISP.

You can then put a simple header together to attach to the ATTINY85. I recommend picking up a cheap SOIC8 clip from eBay. The wiring required is described here [1].

Here’s my version of this header:

With the ArduinoISP flashed onto your Uno, it’s now possible to reprogram the ATTINY85. The standard Arduino IDE does not include the board support package to do this however. You need to add the following under Preferences->Additional Board Manager URLs:

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

With this installed you should be able to select the attiny under Tools->Boards. Also select Arduino as ISP as the programmer. You may need to reflash the bootloader to set the fuses (not sure if this is required or not).

In my case, I also wanted to use an External Oscillator (not external crystal) with the ATTINY85. The damellis package does not include support for this so I had to add it to boards.txt. The location of this file may differ on your system. On my Linux PC it was at:

~/.arduino15/packages/attiny/hardware/avr/1.0.2/boards.txt

I was using a 10MHz external oscillator, so I added the following:

ATtinyX5.menu.clock.external20=External Osc 10MHz
ATtinyX5.menu.clock.external20.bootloader.low_fuses=0xf0
ATtinyX5.menu.clock.external20.bootloader.high_fuses=0xdf
ATtinyX5.menu.clock.external20.bootloader.extended_fuses=0xff
ATtinyX5.menu.clock.external20.build.f_cpu=10000000L

I also need to wire up the oscillator of course. You can connect it to pin P3 on the digispark header. Of course, the oscillator and digispark will also need power. Here’s my board, all hacked up, and ready to go:

Notes

[1] Backup of wiring image from: here.

DNA Synthesis Markets

A few years back Sriram Kosuri & George M Church published an interesting article on the applications of large scale de novo synthesis. Recently, a number of companies have popped up exploring new approaches to DNA synthesis.

I thought it might be fun to imagine what the ultimate market for ultra-high throughput DNA synthesis could be. The applications here assume the ability to produce perfect reads, of any length, for almost no cost (to the vendor).

What existing markets could we capture, and what potential new markets exist. The numbers and justifications below are part of this thought experiment, and shouldn’t be taken too seriously.

The table below summarises the global markets for each application discussed:

Market Market/year Global (MUSD)
DNA Data Storage 1500
Research Apps 1500
Bacteriophage synthesis 20000
Higher Organism synthesis 10?
DNA Origami 10?
DNA Computing 1000

DNA Data Storage

One application of large scale DNA synthesis being mooted is as a data storage media. The most attractive data storage application is as an offline storage media.

Currently, Magnetic tape is used for offline storage. It’s something like 4 times cheaper to store data on tape than on hard drives. The disadvantages of course is that it’s not available for random access. Storing data on DNA would have a similar access profile, so we can imagine that their market sizes might be similar.

Current tapes store ~15Tb of data, and cost in the region of 150USD. If we can slash the cost by a factor of 5, it’s likely DNA storage based devices could capture this market.

There are currently two main players in large capacity tape storage LTO8 and TS1155. In 2013 LTO tapes were selling ~25 million tapes a year [1]. Tape sales are increasing year-on-year. Assuming 50 million is ballpark correct (both tapes types). We assume we can sell 15TB of storage for ~30USD (5x cheaper than existing solutions) and capture the entire tape market. This gives us a market of 1500MUSD per year in DNA storage.

This is potentially an underestimate, as the market for tape based storage is increasing indicating a healthy appetite for offline storage solutions.

Research Applications

Existing research applications for oligonucleotide synthesis are clear. If you can produce longer or higher accuracy oligos, it’s likely that you can capture this entire market. One report suggests that the global market for oligonucleotide synthesis is currently in the region of 1500MUSD, and is growing [2].

Whole-genome syntheses

De novo synthesis of bacteriophages

Here’s where things get even more speculative. We all know that resistance to existing antibiotics is increasing, and that new antibiotics are taking longer than we’d like to come online.

One possible solution that has been suggested is to start prescribing bacteriophages [3]. Rather fascinatingly there’s an institute in Georgia that has been doing this for some time as described in this 1997 BBC documentary.

There are a number of issues with making bacteriophages a practical therapeutic. A significant hurdle [4] is that a bacteriophage is specific to a narrow range of hosts.

One approach might be to prescribe a complex cocktail of phages. A better (and potentially more practical approach) might be to figure out exactly which bacterial infection a patient has (through point of care sequencing) and then prescribe a phage to target exactly that infection.

This might be one phage out of a library of tens of thousands [4]. So, rather than every pharmacy storing such a large stock of phages, why not just have a DNA synthesiser in every clinic creating/culturing phages for patients [8].

The current US outpatient market for antibiotics is 269 million prescriptions per year. If we replace all these prescriptions with point of care bacteriophage synthesis at 15USD we get ~4000MUSD. I assume the worldwide market is 5x the US market giving 20000MUSD.

We might also consider other therapeutics applications of DNA synthesis, for example aptamer therapeutics. It’s harder to make a case for point of care synthesis here however.

De novo synthesis of higher organisms

De novo synthesis of the genomes of higher organisms is a fascinating idea, but the commercial applications are less clear to me. You might want to synthesis one novel organism, but you would then duplicate it through other means. It therefore seems like more of a research tool.

DNA Origami

DNA Origami is another application where it seems like there should be novel applications of de novo synthesis on a commercial scale. However, it’s not clear to me what these might be.

DNA Computing

Another speculative application might be using DNA for computing. It’s currently unclear what the killer application of DNA computing might be. But as we’re just throwing ideas around, lets assume we can solve a complex computational problem using DNA computing. In particular lets assume we can solve hashing problem and use that as the proof of work function for a cryptocurrency.

Figures for bitcoin mining rigs are all over the place, but mostly in the billions. As we’re just throwing numbers around here, let’s assume it could be a market of 1000MUSD a year and use this as a proxy for the size of the DNA Computing market.

Notes

[1]
~25 Million tapes sold per year
~150USD
https://en.wikipedia.org/wiki/Linear_Tape-Open

[2]
“The global oligonucleotide synthesis market generated $1.5 billion revenue in 2017 and is projected to advance at a CAGR of 10.8% during 2018–2023. The market is mainly driven by increasing research activities in synthetic biology, rising prevalence of cancer and infectious diseases, advancements in oligonucleotide synthesis technologies, and favorable government regulations.”
https://www.psmarketresearch.com/market-analysis/oligonucleotide-synthesis-market

[3]
www.bioprocessintl.com/manufacturing/nonantibody-therapeutics/bacteriophages-an-alternative-to-antibiotics-challenges-and-possible-solutions-for-bringing-them-to-market/

[4]
“However, from the biotechnological point of view the specificity of bacteriophages is a challenge; it means that the industry should be prepared to provide a tailored therapeutic phage or phage cocktail for each individual pathogenic bacterium. The challenge is vast since there are hundreds of pathogenic bacterial species, i.e. potential targets for phage therapy, and most of the species may contain dozens of sero- or genotypes that each may be susceptible to different phages. Therefore, to cover the whole field of infectious diseases there would be a need for a bank of thousands or tens of thousands of phages with different specificities.”
https://link.springer.com/article/10.1007/s10529-007-9346-1

[5] “In 2015 alone, approximately 269 million antibiotic prescriptions were dispensed from outpatient pharmacies”
https://www.cdc.gov/antibiotic-use/stewardship-report/outpatient.html

[6]
btcmanager.com/bitcoin-mining-industry-set-to-bring-in-4-bln-2017/
http://fortune.com/2018/02/24/bitcoin-mining-bitmain-profits/
https://www.businesswire.com/news/home/20180503005882/en/Top-Insights-Cryptocurrency-Mining-Hardware-Market-Technavio

[7] http://arep.med.harvard.edu/pdf/Kosuri_Church_2014.pdf

[8]
“Cross-genus rebooting of custom-made, synthetic bacteriophage genomes in L-form bacteria”
http://www.pnas.org/content/115/3/567

DNA Synthesis Research Groups

I’ve been looking for research groups actively investigating new approaches to DNA synthesis (published since 2014). While there are some interesting approaches, I’m surprised I’ve not been able to come up with more groups.

If you know of any, let me know!

Lab name Website Recent Publication
Keasling Lab Group Page De novo DNA synthesis using polymerase-nucleotide conjugates
Ingenuity Lab (closed)
Photo-cleavable nucleotides for primer free enzyme mediated DNA synthesis
Duhee Bang’s Lab Group Page Toward a new paradigm of DNA writing using a massively parallel sequencing platform and degenerate oligonucleotide
Tom Brown Group Group Page Gene assembly via one-pot chemical ligation of DNA promoted by DNA nanostructures
Church Group Group Page Large-scale de novo DNA synthesis: technologies and applications

Notes…

Primer-Independent DNA Synthesis by a Family B DNA Polymerase from Self-Replicating Mobile Genetic Elements
https://www.sciencedirect.com/science/article/pii/S2211124717314869

Template-Independent Enzymatic Oligonucleotide Synthesis (TiEOS): Its History, Prospects, and Challenges
https://cdn-pubs.acs.org/doi/abs/10.1021/acs.biochem.7b00937?journalCode=bichaw

Click to access KR101785074B1.pdf

The history and advances of reversible terminators used in new
generations of sequencing technology.

Large-scale de novo DNA synthesis: technologies and applications.