Can I get a 32.768 output?

Status
Not open for further replies.

Marty

Member
Hi all, my first post. I'm trying to make a 0 - 30 PSI (, ~2 ATM, ~30' H2O) depth and pitch controller (see ISRsubRace.org for why). (Later, more on the rest of the system if people are interested.) So I'd like to integrate an InterSema MS5541C to a Teensy 3.1. Digikey 223-1099-1-ND, btw. (This module, with a 3 wire interface, rather than trying to buffer and amplify then digitize the bare sensor, for a mere ~$15 more seems to be a bargain. (This class of sensors seems to be entirely developed for wireless tire pressure monitoring systems.))

So the 5541 says it wants a low jitter square system clock signal (aside from the serial interface clock which I'll bit bang along with the data in and out). I'm ordering some watch crystals but it occurred to me that I need to have that oscillator signal put out to a DIO pin. Is this simple, impossible, do-able thru interrupting every ~3 us, or what?
___________
Also, anyone have experience waterproofing electronics to 30' on the cheap? __Marty
 
You can use the tone library (or the IntervalTimer library). The tone library is based on the IntervalTimer library.

Code:
tone(pin,freq);
tone(2,32768);
Tone library: https://www.pjrc.com/teensy/td_pulse.html#tone
IntervalTimer library: https://www.pjrc.com/teensy/td_timing_IntervalTimer.html

If you are using a real-time clock: They have sometimes a programmable square wave output.

Edit: How to mount a pressure sensor:
 
Last edited:
You can also get a very low jitter square wave using analogWrite() and analogWriteFrequency(), on any of the PWM pins.
 
You guys are great! I was beginning to feel unrequited; I see that it's only been ~24 hours tho so I think I'm impatient. It's as if y'all have real lives to attend to in addition to tending this group! :- )

WMXZ--No, I hadn't seen this. I promise I'll do a good job of absorbing it, thanks!

HW and PS (or is that PJ, I see after reading your AboutUs?)--Thanks both; Dooh! <slap> Analog synthesizer! <blush> I'm guessing I can output a square wave or chop it programmatically into one. If not it's a transistor and a few resistors, easy.

The .... gee, the specs on the clock are like +/-2.5 Khz, getting on 10%. I wonder how dire the admonition about jitter really is.

The sealing--Wow, how do you guys find this stuff? I think I suffer from OldzTimer's disease; you know, can't set the microwave clock or search that interweb thing.

Great. Now I'm a bit intimidated by the whole sealing process. Looks like having a machine shop (or 3D printer??) is presumed. Well. My 5541s have a nice dollop of white RTV-like stuff sealing the business end of that cylinder, the 'barrel'. Once I get it working in my homemade pressure chamber (4" PVC pipe connecting to my air compressor, quick disconnect and everything) I'm thinking of trying merely gooping Silicone sealant or epoxy around the entirety of the bottom and sides of the module except the barrel. Or if that maybe drips under the bottom and kills the sensor I'll put the whole thing in a little bag with connecting wires sealed thru, and let the bag expand/contract; shouldn't be any differential pressure on the bag. <fingers crossed>.

Thanks, guys!
 
On sealing:
Minimize the possibilities, where water can sneak in. Water is tremendous! (especially sweet water). However, your expected static pressure is not is not so high, so it is doable.

Using the o-ring approach, as suggested in the datasheet, requires some precision machinery and experience.

An easy solution, you could keep in mind, is to put the sensor in a small air-tight plastic-bag, having only a 6-wire cable coming out. Fill the bag with oil (vegetable oil should work), close the opening where the cable comes out, with abundant epoxy. Put some protective foam around it, so the bag does not get punched and you are ready to go.

You could pod everything but 'barrel' in epoxy, but if you wanted to reuse the sensor for something else, you have more work removing the epoxy. Also there is no guarantee that the interface between epoxy and the sensor is free of air channels, where water can be pressed in.
 
If you use epoxy, beware any epoxy coming directly in contact with surface mount electronic parts. Most 2-part epoxies change volume as they dry, which can exert shearing force on the surface mount parts if the final product is a hard material.

There are special "potting compounds" made for SMT electronics, which dry to a flexible rubber-like material.
 
If you use epoxy, beware any epoxy coming directly in contact with surface mount electronic parts. Most 2-part epoxies change volume as they dry, which can exert shearing force on the surface mount parts if the final product is a hard material.

There are special "potting compounds" made for SMT electronics, which dry to a flexible rubber-like material.

Thanks, excellent point about the expansion issue. That's especially scary to contemplate as it's one of those failure modes where I'd just be left wondering what happened and probably have no recourse but to ignorantly blame something and try it again, blindly. Repeat. <shudder>

I'm thinking of silicone caulk or RTV; I have some, it's readily available and in the volumes I'd be using it in it's a gell and wouldn't have flow issues--I wouldn't need to let it harden. It'd be nice to be able to do this in vacuum to avoid bubbles but I don't have either a good vacuum or a remote dispenser or manipulator.

I wonder if caulk or RTV is corrosive to tin, lead, copper, ...? I guess I'll find out.

HW, thanks, I missed that on my tour thru the site (btw lemme stop effusing thanks all over everyone; I'm very excited to have found you guys and get energy playing you, my invisible friends. How 'bout you just presume my thanks and I may occasionally and randomly say so out loud?). On sealing those wires, I'm extremely suspicious of the axial watertightness of the insulation of hookup wire. I believe the insulation is extruded around (intruded??) the wires but it obviously doesn't go between each strand so there's a nominal leak path. I'd've stripped the insulation back from the board and ensured that I worked the epoxy in between the strands. If I wanted to get perfectionist I might try also to have the epoxy come up over the wires' insulation. On my little pressure test tank I used magnet wires to avoid the issue.

More, painfully slowly, as it happens...
 
On sealing those wires, I'm extremely suspicious of the axial watertightness of the insulation of hookup wire.
Usually you would use an underwater connector, but this solution is a little bit expensive. Any structure, that avoids that the cable is moving, bending close to the epoxy will keep the connection water tight.

Also, your application is not extreme, have a look at http://soundtags.st-andrews.ac.uk/dtags/ , it does not address your problem directly, but shows extreme deep sea instrumentation (over 2000 m) and mentions some procedures to operate electronics in the ocean, completely without pressure housing.
 
Hello my invisible friends, I'm pursuing this project again after some quiescent time. A question, in a moment but a note on coping with water(proofing). Instead of conformal coating or a pressure vessel, it occurred to me that if a board were enclosed in, say, nitrile glove with the wires properly fed out (sealed), and a bit of air space left in there, there would both be no differential pressure inside to outside and the electronics would be left without goo all over it should I need to play with them. Preliminary testing with superglue and RVT convinces me the idea could be reasonable (at 30' I will halve the air volume, easy to cope with, and the integrity of the thin glove is not a problem, I can protect them) lead me to prefer RTV. The superglue adheres nicely to nitrile but there is no volume to it; I am uneasy that I can seal the glove completely around the wires. The RTV has some body to it which makes handling easier but doesn't seal permanently, it can be pulled off the nitrile. But seems to be a fine seal nonetheless.

Re connectors I'm taking a gamble and using Molex crimp contacts (C-grid III or something) which mate to a regular 0.1" spacing double row header like for ribbon cables. Both header and receptacle contacts have a flash of gold on the mating surfaces. I won't at the beginning but am prepared to solder the crimps if necessary. Fingers crossed, it'll be really gratifying if it works. The contacts can be pulled out of the receptacle housing and reworked rearranged. They're inexpensive enough, too.

Question--Since the MS5541C pressure sensor is not a proper SPI device, has no device select, reading two of these devices becomes more difficult. I'm wondering whether I can flip back and forth between the primary and the alternate SPI pin sets. I'm looking for knowledge or opinions whether that'll work, whether just bit banging them (I'm not very time-crunched, I could), using some other SPI library (I thought there was a dual SPI port library out there but perhaps I'm being lame, I can't find it), break down and add gates to the two MS5541C's MISO pins, or what. Thoughts, please?
 
If you're building a watch with a depth gauge, that looks like a good sensor to use. There's a lot more pressure sensors out there which might be better for your application. You can get them with tubing connections so they don't have to be waterproofed and you can get analog ones which will interface nicely with the Teensy. Most of the "5V" analog sensors work perfectly fine at 3.3V.

Did you solve the waterproofing of the wires coming into the underwater enclosure? I read an article a long time ago which said that water will travel along the wires inside the insulation. The only way to properly waterproof the connections was to strip the insulation from every wire where it goes through the silicone sealant.
 
Morgan and WHguy, hi and thanks. There was a better sensor (MS5803 sounds right) but at the time I selected and bought, there weren't any I could actually locate. I'm moderately locked in now, and as long as I can make it work it's ok. Plan is to try HWguy's SPI.sets; as long as I can SPI.set it and then SPI.set it differently there ought to be no problem going back and forth. I didn't want an analog piezoresistive sensor as they require significant linearity and temperature compensating; the digital ones have provided for pretty high accuracy w/cal factors and temp sensor and all. I'm hoping I don't have to worry about crosstalk; the run length is <10' and this isn't super high bandwidth technology.

The water wicking is definitely a concern so I'm just not going to go there. I'm going to make all the waterproofing penetrations via solid conductors, either magnet wire (the insulation is a type of varnish, which bonds itself to the wire, no leakage) or headers (ala Digikey WM8275-ND 6 pin for these sensors). The contact surfaces themselves are gold, 30u, we'll see how the survive. The crimps will be wet of course (and not gold), so I will almost certainly follow them up with solder. The concern will be to not let the solder wick up the wire since that'd stiffen it and eventually break it from handling.

Digikey WM8057-ND housing and WM3627CT-ND contacts, btw. Teensy will have at least a 40 pin header, into which many housings can go side-by-side.

Anyone know of other sources of cheap stranded hookup wire like Hamfests?
 
Status
Not open for further replies.
Back
Top