Give the Clones a Chance
This post isn't strictly radio-related, but stick with it - it's more about a process than an end result. One of my health issues I alluded to in the previous post was heart-rate issues. Specifically, high resting heart rate due to congestive heart failure. (It's now controlled with medication, so this isn't my last stand.) Since I had a vested interest, I thought I'd branch out and build my own ECG for grins rather than diagnostic use. (Any info contained, herein, should not never be applied to diagnosis of anyone's heart problems - let the experts do that.)
I went down a typical path, and got a quick and dirty 1-lead (channel) prototype working using an AD8232 analog front end (AFE). I just looked at it's analog output using my Rigol. The 8232 produced a nice ECG waveform if I didn't move very much. It was also a bit susceptible to electric noise pickup (I'm too cheap to buy shielded snap leads). Anyway, the upshot of it was that I wanted a better AFE with some noise removal capability and the ability to run what's known as a 3-lead ECG (actually 4 electrodes).
Some digital searching turned up TI's ADS1293 AFE as a good candidate. It seemed to have all the features I wanted (and a whole lot more!), so I re-aimed the search at finding a hobbyist-affordable module/breakout board for this chip. One possibility was ProtoCentral's board - roughly $70 US + at least another $20 shipping (they're in India). That's a bit too salty for a "grins" (and non-radio) project. The second option was one of the ubiquitous Chinese clones available from our favorite mass-on-line retailer or auction site. These range from $35 - $45 and are known as CJMCU-1293 boards.
There weren't a lot of positive comments out there about this board, but I thought it might be worth a try. ProtoCentral did offer an open-source library for their ADS1293 board and a very understandable getting-started guide (https://protocentral.com/product/protocentral-ads1293-breakout-board/docs/getting-started/). I also found a Russian article (https://habr.com/ru/articles/806395/) that alleged good results with this board. Armed with these, I dove in, risking a whopping $40.
Well, it had two 3.5mm jack as input connectors just as the ProtoCentral (PC from now on) board does. Vcc was marked 5v - since the ADS1293 wants a 3.3v supply, I confirmed that there was a 3.3v regulator on board. It appeared to be well bypassed and there was at least one choke in line for noise/RFI suppression. I wired it up to an Arduino UNO I had on hand, following the PC getting-started guide. I uploaded this sketch (after installing their ADS1293 library): https://github.com/Protocentral/protocentral-ads1293-arduino/blob/main/examples/01-3-lead-ECG-stream/01-3-lead-ECG-stream.ino. I hooked up the four wires according to the PC guide: RA, LA, LL to the left-hand connector (top connector for a clockwise-rotated photo) and RL drive to the right hand connector. (Of course I used the required stick-on electrodes.) I eagerly powered it all up and looked at the Arduino serial plotter as suggested. Nothing! Just flat lines.
Well I could have gotten hosed on this one, or since I'm not dead yet, maybe something wasn't connected properly. I went back and traced the different snap connectors to their corresponding connections to the 3.5mm plug. Then stepped back and traced the connections from the ADS1293 to the two connectors. Turns out, this layout has the connector positions swapped relative to PC's board. Swapped plugs and powered up again. Same result - flat lines. As an afterthought, I collected a small amount of data from the serial monitor as s text file.
I wanted to look at the actual data I collected to see if all 3 channels were at a constant value. Is so, it would mean the the ADS1293 output was "railed". If there was some low amplitude "wiggle" in the values it could mean that there could actually be an ECG signal there, just with a large offset from zero. Next step was to import the data into a spreadsheet so I could plot it (removing the offset if necessary). Doing that revealed that this beast was actually working!
Both lead I and lead II looked like the real thing. I'm not sure if the large offset is "unusual" or just the product of looking at ADC counts directly. The ADS1293 has a 24-bit ADC, so I knew we weren't saturated (quite). I could work with this. At this point, I asked Claude to make me a program to display the data in real time on my desktop screen:
"Write a program that grabs streaming input over USB and displays it as three
channels, oscilloscope style with a adjustable sweep rate and y gain
(with auto scale/centering as one option). Incoming data stream will be lines
containing three comma- separated numbers. Lines will terminated with a
newline character. This is output from the serial monitor in an arduino
sketch. Use gtk toolkit to write the app (if possible) for use on a x86_64 PC
running Linux (Debian variant). Provide a makefile as part of the package."
Claude did as he was told this time and provided the goods. (I asked for some features to be added incrementally.) Here's the result:
Not bad for a board that's less than half the cost of ProtoCentral's board and way cheaper that any TI eval board for the 1293 could every hope to be.So here's my summary of this process:
1. Don't assume all inexpensive (far-east produced) breakout boards are garbage. A few surely are bad with terrible board layouts and counterfeit chips. But not universally so.
2. Hope for lab-grade performance, but realistically expect hobbyist-grade performance.
3. Check your board's power requirements, (power) polarity, and logic levels before first power-up.
4. Many of these boards are direct copies of the chip manufacturers' eval boards, but don't assume that. That was not true in this case.
5. If your board doesn't seem to work on first try, don't assume you have a bad board. It could be a matter of getting the connections to it sorted out. You might also have to trace some of the board's "wiring" to do that. There's no substitute for a good VOM with fine-tipped probes and a lot of patience.
6. Of course, you need a way to tell if your board is working (properly). That's trivial in this case. For RF modules, you may need an oscilloscope, VOM, spectrum analyzer or VNA. Fortunately, hobbyist-grade instrumentation can be found relatively for relatively low cost.






Comments
Post a Comment