-
Position sensing with a linear optical array
08/13/2015 at 18:08 • 0 commentsAmong non-contact position sensing methods used in mechanics laboratories, high speed cameras plus image processing is fairly common. However, this method is resource intensive, and a less expensive method is presented as a demo.
The TCD1304AP is a 3648 element optical array available in a DIP package.
It's basically 3648 photosensors aligned in a straight line, and each has a storage capacitor.
In order to acquire data, the user first sends a pulse that connects each sensor with its capacitor for a fixed duration ( the equivalent of shutters in cameras).Once the shutter closes, the voltage on each sensor's capacitor represents the amount of light it received.
A series of pulses must then be supplied by the host, and upon receipt of each pulse the TCD1304 connects the capacitors one by one to its analog output pin. The host must simultaneously read and digitize the output analog data with its ADC. -
An even more affordable variant
08/12/2015 at 14:29 • 0 commentshttps://hackaday.io/project/6490-a-versatile-labtool !
WHY?
The present form has several components that significantly add to the cost, and may not be required by the majority of users. Many of these can be provided in the form of add-on boards, thereby creating the need for a modular design.Most of the Add-on slots in the current state are separate Berg headers dedicated to specific data buses. Therefore, a unified, durable expansion port that supports all the available slots in addition to a few analog I/O has been implemented. Some remappable pins as well as the 16Mhz clock used by the DDS have been routed to the expansion slot.
Figure : Present state of development of the vLabtool. An optional standalone mode has been implemented.
I'm trying to meet the deadline for the Best Product prize, so it will be taking up all of my time.
The gist of differences is here. :
+ : BOM Less than $50 with component costs calculated with element14 prices.
+ : An optional standalone mode. If the device detects an ssd1306 OLED plugged into an I2C slot during boot-up, it displays a few readings until the PC takes over. This allows it to be battery powered, and be made portable.
- : 4-channel oscilloscope reduced to 2-channel.
+ : 12-bit offset control, and up to 32x gain for 8 analog inputs with various input ranges. These include 2x +/-16V inputs, +/-2V input, I2V convertor, Power supply ripple monitoring, and four unipolar inputs.
+ : NRF24L01+ transceiver added to base board. Firmware routines allow faster data transfer, and automatic node registration.
- : Inductance to frequency converter removed. It can be easily redesigned as an add-on board which also measures capacitance faster than the CTMU.
- : The AD9833 is pricey, and only one of them has been made part of the base board in the vLabtool.
+ : A 15KHz fixed amplitude sine wave generator has been added as compensation. It can be used in conjunction with the lone DDS for experiments such as amplitude modulation.
+ : A 2x10 pin expansion connector consisting of SPI, I2C, UART, 2xAnalog inputs, 16MHz output, raw output of the DDS , etc. A 4-pin, 3.5mm socket dedicated for I2C sensors is also included.
+ : 2.5ppm accuracy clock generator Fox925b. This provides much greater accuracy than the 30ppm crystals that were previously employed.
- : Several hundred banana sockets
- : TP4056 Li-ion charging IC. These are easily available as breakout boards, and may also be added to the wireless nodes at very little additional expense.
*ESP8266 continues to enjoy PCB real estate as an alternate communication channel.
-----------------------------------------------------------------------------------------------------------------------------------
-
Non-contact, short range position sensing
06/19/2015 at 04:50 • 0 commentsThe inductance of a solenoid depends on the properties of its core. Adding a ferromagnetic material will raise it, and a diamagnetic material will do the opposite.
The Inductance meter on the device simply pairs the externally plugged in inductor with a high stability capacitor on the inside. The resultant tank circuit is driven at its resonant frequency which is measured by the frequency counter. Frequency of oscillations is given byWhere the inductance L, depends on the solenoid, and its core. C is 1000pF.
The video shows the frequency counter with a resolution of .2Hz connected to the L meter's output logging variations in a solenoid's inductance. Inserting a ferromagnetic material changes the frequency( A key in this case gives up to 6000 points after being pushed 1cm into the core . After calibrating, and accounting for noise, the resolution is less than 10 microns )
This method has tremendous applications in mechanics labs. However , It won't match up to optical methods when it comes to being unobtrusive. The oscillating field of the solenoid should cause a minor perturbation in the ferromagnetic piece attached to the body being recorded.
-
Amplitude Modulation with an analog Multiplier
06/17/2015 at 14:12 • 0 commentsThe expansion slots are meant to accommodate more complex instruments, and a lock-in amplifier is one of the add-ons I hope to make. Phase correlated sine waves are part of the package already, so only a multiplier and a low pass filter are needed.
As a first step, I played around with the AD633 analog multiplier, and tried out amplitude modulation using only the tools available on board.
The schematic is in the examples section of the AD633 datasheet. The red trace is the modulated output. A carrier of 10KHz was modulated with 150Hz.
A quick Fourier transform of the modulated wave shows the side bands.
Accurate Fourier transformations require a sampling period much greater than the largest wavelength that makes up the input waveform, so I'm polishing a live streaming protocol that won't rely on handshakes, and will send ADC readings at the maximum rate possible without dropped packets.
Here's a screencast of an old streaming app showing the modulated waveform, followed by an FFT of the same. The timebase shown is incorrect, and I'll be fixing it.
-
Calibrating the calibrator
06/17/2015 at 03:58 • 0 commentsThe last log dealt with testing a 24-bit ADC, the AD7718 , and I may have mentioned that its main aim for now was to serve as a calibration tool.
However, In order to use it as one, It itself must first be calibrated against some industry standard high resolution DMM. Even though the datasheet for the AD7718 claims a pretty high accuracy, any measurement tool is only as accurate as its reference, which in this case is the REF196. The REF196 is an ultra stable voltage reference, but may have an initial offset.
Another source of error is the OPA2277 level shifting op-amps.
I have access to a Keithley 2100 multimeter, and am using it for this calibration.
Using python-usbtmc, it can easily be interfaced . Code is as simple as
import usbtmc DMM = usbtmc.Instrument(0x05E6,0x2100) #V-id,P-id print DMM.ask('*IDN?') DMM.write('SENS:VOLT:NPLC 1\n') DMM.write(':SENS:VOLT:DC:RES 1E-6\n')
For now I've calibrated the unipolar inputs on the PCB.
Here's a screenshot of a simple calibration program that sweeps a voltage source and records the values read by the Keithley2100, and the AD7718. The data will be used to generate a fitting polynomial.
At lower voltages, both agree pretty well, but en route to 3.3V, the gap increases to about 1.5mV roughly linearly. This offset is to be expected from the voltage reference, and calibration will take care of it. What's important is that the calibration be valid over a wide temperature range, and that's the whole point of using a voltage reference and low drift op-amps.
Update: After applying the calibration factors, the readings from the AD7718 correspond to professional DDMs to within a +/-100uV margin. Averaging brings it down to <10uV, since the noise floor for this roughly designed board is around 100uV. Moving on to opto-isolation.
-
Add-ons : High resolution ADCs
06/14/2015 at 19:10 • 0 commentsTested the AD7718 24-bit ADC with a custom PCB.
AIN1-AIN4 have been broken out into pin headers directly , and can be used as unipolar inputs/differential pairs.
AIN5-AIN8 will be used to measure bipolar signals. The inputs for these are attenuated and buffered using high precision Op-Amps OPA2277(offset<10uV , drift<0.1uV/C ), and then level shifted.
The StickVise that Hackaday handed out a couple of weeks ago has turned out to be incredibly useful since I use surface mount parts a lot
Fig : Schematic
Now that its functionality has been reasonably tested in terms of software control, and noise spread is below 100uV, an opto-isolated version can be made which should give much better resolution. I hope to post histograms and other characterization results soon.
Unipolar inputs were tested using unbuffered voltages from the 12-bit DAC of the main board.
Differential inputs were checked out using a Peltier plate used a voltage generator.
The main aim of this add-on board for now is to serve as a calibration tool for all the analog inputs on the main board. The AD7718 will first be calibrated against a 6.5 digit standard DMM from Keithley, and then be used as a calibration tool.
The PCB features the REF196 voltage reference, as well as an AD5680 18-bit DAC(as yet untested )
A PCB for a 22-bit ADC MCP3553 is also on its way .
-
Wireless Nodes!
06/04/2015 at 16:49 • 0 commentsAn easy to use RF link can be a very valuable addition for large scale experiments with multiple data acquisition points spread out over a wide area that rules out the use of wires due to hassles/expenditure/nature of the data.
The NRF24L01+ radio modules offer data rates up to 2MbPS, and configurable addresses with up to five bytes each. So, technically speaking, you can implement more nodes than you'll ever need.
Here's a demo. There's no sound, but I've tried to make up for it by annotating the whole thing.
The master radio transmits using the ShockBurst mode, and the slave nodes acknowledge along with Payloads that contain whatever data they had been instructed to gather. They also handle dropped packets gracefully by attempting a few retransmits without user firmware intervention.
Here's everything that went into making the slave node prototype featured in the video.
The PIC used has a shared SPI, I2C peripheral module, so each time I2C data is required, a quick pin remapping is carried out to switch between the I2C sensor and the SPI NRF radio.
-
Incorporating commonly available sensors into the framework
06/01/2015 at 05:34 • 2 commentsThanks to the vibrant hobbyist market, several sensors which would otherwise have remained inaccessible owing to their reflow-only footprints, are now available in amateur friendly breakout boards with clearly labeled pins.
I bought up a bunch of these, and tested most of them. Several of these use SPI/I2C, and companion classes to support them can be coded on the PC side without having to touch the firmware. Some however, use non-standard/timing critical protocols, so I have added support for them in the firmware. These include ( I may have mentioned them in a previous log somewwhere ), the HX711 weighing sensor(24-bit fully differential, 128x PGA), DHT22(humidity), and a 3648 element optical array from Toshiba.
Here's an example of what a Python side class for a sensor may look like.
#HMC5883L 3-axis magnetometer import Labtools.interface as interface import time from numpy import int16 class HMC5883L: def __init__(self,ADDRESS=0x1E): self.ADDRESS = ADDRESS self.I = interface.Interface() def connect(self): self.I.I2C.start(self.ADDRESS,0) #writing mode self.I.I2C.send(0x01) #gain self.I.I2C.send(0<<5) #smallest range self.I.I2C.stop() self.I.I2C.start(self.ADDRESS,0) #writing mode self.I.I2C.send(0x02) #Mode self.I.I2C.send(0) #Continuous measurement self.I.I2C.stop() def __getVals__(self,addr,bytes): self.I.I2C.start(self.ADDRESS,0) self.I.I2C.send(addr) #read raw values starting from address self.I.I2C.restart(self.ADDRESS,1) vals=self.I.I2C.read(bytes) self.I.I2C.stop() return vals def read(self): vals=self.__getVals__(0x03,6) x=int16((vals[0]<<8)|vals[1]) #conversion to signed datatype y=int16((vals[2]<<8)|vals[3]) z=int16((vals[4]<<8)|vals[5]) return x,y,z ''' a=HMC5883L() a.connect() while 1: print a.read() '''
The above code ignores error codes returned by the I2C functions, and needs much work.
refer to http://pythonhosted.org/LabtoolSuite/interface.html for a rough programmer's manual generated using Sphinx.
A UART relay has been implemented, but it's fairly buggy at this point. When activated, all data sent to the device is ignored, and relayed directly to the output port, and vice versa. It can be used to test UART devices like bluetooth modems with little overhead.
There are two modes. One where the device returns to normal functionality if no data is exchanged for more than one second, and another where a power cycle is required for the device to return to normal functioning. Can possibly be used for programming secondary microcontrollers with bootloaders such as the ESP8266.
Here's some example output from a BOLUTEK bluetooth modem(left side of the box in the picture above), after I activated the relay.
The 1ms delay between characters is to prevent buffer overflows caused by the much lower BAUD rate of the modem. I could alter the vLabtool's BAUD rate to keep up, but like I said, there are many problems with this feature that need to be looked at.
Here's an elaborate explanation on how the DHT-22 sends data, along with the timing details for all the pulses. I will soon write a dedicated loop in the firmware which collects and sorts the pulse width encoded data in real time, but using the logic analyzer first gave me an accurate idea of what the timing details are.
The code is self explanatory.
Currently testing a PIC16F1618+NRF24L01+ combo for making wireless sensor nodes.
-
Laser cutting enclosures
05/28/2015 at 08:09 • 0 commentsAn enclosure needed to be designed for the prototypes, so I proceeded to visit several laser cutting facilities armed with a few different designs.
Top panel cut out from translucent red acrylic. The edge was bent by heating .
I also tried Clear, and black acrylic
-
Streaming ADC data
05/28/2015 at 07:40 • 0 commentsWhile the oscilloscope can capture up to 10K samples, and then dump them into the PC for processing, the streaming mode dumps datapoints continuously at the maximum speed possible . If the python program reading the data fails to keep up, buffer overflows will lead to lost datapoints. ADC data can currently be streamed at 125KSPS.
PyQtGraph is amazingly adept at plotting large datasets being updated in real time. Right-click and drag to zoom along either axis
A 50Hz sine wave was initally monitored, and then changed to 500Hz.Screencast recorded using RecordMyDesktop.