Goal of this project is to develop functional Tricoder device, similar to type TR-580.
Well, it finally happened.
Few minutes before deadline, project files are being uploaded to github, video to youtube (its hell slow when you are hurry) and our tricorder is finally done.
What went wrong:
I'm not happy with I2C sensors, communication on I2C bus somehow flaky. However spectral analyser (with acoustic, magnetic and light input) works as expected, as well as Geiger counter. LEDs blinks, so the project is OK, at the end of the day ;-)
0,35mm nozzle print head on my 3D printer fell apart, from unknown reasons, just before I wanted to print parts for JJ Tricorder case. You know, Murphy's laws. I had one spare, however with higher diameter, something like 0,6mm or so, but I had no other way, so I installed new (old) one and started some calibration prints.
Julia worked on case design in the meantime.
I printed the plastic parts of case
And here it is, when idea comes physical. Yep, that's CRT display.
The same case, while waiting for button caps to print out.
Now I'm working on firmware. Basic functionality seems to work, tomorrow I'll upload here more photos of tricorder in action, maybe some video, and design files on GitHub.
Well, it's not far from one clock in the morning, time to save everything, backup and sleep. Monday mornings are always hard.
Board is now partially populated. MCUs work, sensors respond to their I2C address, we continue working on it.
Some more photos:
PGAs and opamps on the left side and row of I2C devices: MMA7455, unpopulated space for HIH6131, HMC5883L, 24LC64, MCP9800, MPL3115A2
Huh, lot of work and just a little bit of time...
As I mentioned before, we will need some MCU able to perform some FFT analysis. 128 or 256 point FFT should be enough. I did some tests and LPC1114 seems to perform well, able to do 256 point FFT in 5,5ms at 48MHz. Not bad.
I did some more experiments with PIC32 (namely PIC32MX150F128B) and was more happy about it, it performs the same task in 4,8ms - however at 12 times slower clock, 4MHz. As I have more experience with PIC32, I would use it too - and I was unsure which one to choose.
So I designed it as double core design.
Yes, there are two microcontrolelrs on board. Any maker can decide which one to use and software will be written in "multiplatform" way, where minor modification (some kind or #define or simply different makefile) will build binary for either MCU. A kind of low-level hardware abstraction will be needed, so higher-level software could use it with no regard to actual implementation in particular MCU. Actually, I can imagine any other MCU to be supported, considering enough horespower (seems like Cortex M0 at ~20-30MHz is minimum), ADC, SPI and I2C.
Whole circuit is divided into three boards - main board and two user IO boards, to accomodate tricorder housing.
On main board is the core of tricorder - all sensors, MCU, power circuits and display.
In fact, there is no rocket science involved. Just a MCU, few buttons and LEDs with serial expanders, sensors in basic application circuit and common 1,8" SPI color LCD from Ebay. For analog sensors, I designed small cascaded PGA with MCP6Sxx. Those are nice little SPI controlled PGAs. Notice the Vdd/2 source (R20/R21) with opamp as follower, biasing the output of PGA into Vdd/2 level, needed for sampling of AC signal with MCU AD input. GM counter part consists of simple 400V power source (555 circuit and associated circuitry), along with amplifier to allow direct conenction to digital input of MCU.
"No magic here" goes for first UI board too
and second UI board - just IO for buttons and LEDs.
Obviously, the most of the work will be done on software.
PCBs are designed in free version of Cadsoft Eagle.
By the way, all other tools used to design JJTC are either free as free beer or even free as freedom. Main development is done on Linux PCs, so all the software has to run on LInux OS.
Project design files are hosted at github
The JJ Tricorder (JJTC) projects seems to be stalled, however we worked hard on it, doing mostly the invisible work, like finding the components, sensors, choosing development tools and listing the final project goals, but I have PCB layout done.
Because JJTC revolves around sensors and processing the output of the same, this is key decision. Sensors will be grouped in three gropus :
- Analog sensors. There are four sensors in this group - sensor of sound (microcphone), magnetic field (inductor), light in visible and invisible (near infrared) spectrum. Output from those sensors will be routed through amplifier, presumably with selectable gain into analog input of MCU, allowing to display waveform and frequency spectrum of incoming signal. Analog bandwidth of this part will be ~ 20kHz, allowing inspection of whole audible spectrum.
Unfortunately, the near IR sensor will work upto ~1000nm of light wavelength, because it is silicon part, unable to detect higher wavelengths. Higher part of spectra, in 1000-5000nm, covers heat sources, for example. IR diodes for this part of spectrum are usually quite expensive, as it is made in low volume and from more exotic semiconductor materials.
- Digital sensors. There are five sensors in this group - sensors of temperature, humidity, accleration, magnetic field and atmospheric pressure. Sensors will share common I2C bus, with much narrower bandwidth, so that results will be displayed in numerical format or in history graph.
- Impulse sensor. There is only one planned - Geiger-Muealler tube. Voltage converter to approximately 400V is needed, adding another design challenge.
Stay tuned. Julia is working on design of JJTC case, I finished PCB design and PCBs are in the production, hoping on tomorrow delivery. There is a small surprise in the final design, uncommon in most of the hobby designs. Components are already on my table, so I can start populating the PCB as soon as the it arrives.
I expect major update on this project on tomorrow.
Today I and yesterday played a bit with CMSIS DSP library, because I wanted some small FFT function for LPC1114. I must admit, it was the most painful "punch in da face" type of fail I ever experienced. Totally unfriendly, poorly documented and not working out of the box. I spent whole day persuading it to work, but I wasn't able to get rid of hard fault trap whenever I got to bitreverse function.
Nevermind, I downloaded this
http://web.mit.edu/ghudson/dev/nokrb/third/gst-plugins/gst/spectrum/fix_fft.c code and adapted it to LPC1114 in no time, working flawlessly immediately. I added vector length computing routine. If I would do the correct choice (to avoid CMSIS, as I did ever before) at first time, I could spend weekend by more productive work, like getting sensors and display to work.
By the way, the code is slower, but absolutely OK for my purpose. On the other hand, it is much smaller - 5,5kB versus 13kB FLASH consumed, making huge difference in 32k FLASH part.
Well, lesson learned.
Just for fun, I hooked it to my old trustworty Philips scope, just to check timing (the small spikes whenever new FFT round begins).
I love the green trace.
Before actually desiging this project, we need to brainstorm it a little bit. The price tag for all components is set to 77,77EUR. We want it cheap and reproducible.
Problem is with case. It is oddly shaped and probably not much off the shelf enclosures will meet the needs. We need to 3D print it, or at least glue from polystyrene boards.
The main sensor array should consist of;
1, Optical - probably two photiodes (one for IR, one for VIS) with preamplifiers, or even single chip solutions (TSL252)
2, Magnetic - coil as pickup element. Not yet sure what to to with its signal.
3, Acoustic - condenser microphone, cheap and plentiful. Those three sensor could have the same processing path.
4, Pressure - something like BMP180 should do the job, to capture pressure increase/decrease.
5, GPS receiver
6, Acceleration and compass. Those 9DOF for whatever-copters should do the job.
First three sensor will have analog output, rest will have digital interface. Not yet deterimned what MCU to use, probably small ARM or lightweight DSP. Small graphical display, few buttons and few "blinkenlights" are planned as user IO. SD card for logging and USB interface would be fine.
Now we need to obtain some sensors and start playing.