PDA

View Full Version : Home built computer



ootini
05-09-2014, 10:33 AM
Some of you that frequent the CCR sub forums may already know about this project. For those who don't I'm toying with the idea of building my own dive computer using cheapo Raspberry Pis.

Here's a copy of my latest post in the CCR home build forum about the project. Any thoughts, advice and other input is more than welcome.

Just to clarify this is basically a proof of concept experiment / toy. One day I may well take it to a swimming pool for testing, possibly even take it on a dive just to test a few bits and bobs. I'd just like to point out that I don't expect anyone to ever actually use it as a sole computer/controller on a dive. I'd like the opportunity to let a CCR diver take it along on a dive just to see how it reacts etc but obviously not connected directly to /controlling a live CCR.

With all this in mind I've decided to rethink what I'm trying to do and have decided it will be a staged project (including funky / cheesey names).

Stage 1
This will be a basic dive timer, nothing more, based on the Raspberry Pi. I'll need a raspberry Pi, obviously, with wet connectors, depth sensor, simple LED readout displaying time and depth. Should be nice and easy to code.

Must do:
Be waterproof
Sense depth
Count in water time
Inductive charging

Should do:

Could do:

Stage 2
A basic non gas switching, single algorithm OC dive computer. The next obvious step up from stage 1 is a computer using an "industry standard" algorithm calculating deco on the fly. Basically the same as most entry level computers. This will need a more advanced display and the addition of some user input buttons.

Must do:
As stage 1
Calculate deco at a sensible rate
Log dive information
Cope with repetitive dives
Calculate SI / no fly / de sat etc
Display everything properly (better than LED readout)

Should do:
Bluetooth or WiFi data transfer
Dive simulation / planning

Could do:
Digital compass
Accelerometer (although I'm not sure why this might be useful)
MP3 player (probably a bad idea)
Monitor cylinder pressure
Monitor light levels (might be handy to record this to know about overhead environments during log review?)

Stage 3
This is where things get more interesting, take stage 2 and add gas switching and the possibility of using more than one algorithm. Whether this is simultaneous or one at a time I've yet to decide. Would there be any benefit from being able to view the calculations of multiple algorithms underwater? Sounds like it could be dangerous, but again it's just an experiement / toy. Hardware would most likely remain as stage 2 other than tweaks and upgrades etc, the development would be in the software.

Must do:
As stage 2
Allow the diver to switch gasses
Allow the diver to switch deco algorithms

Should do:
More advanced logging.

Could do:
As stage 2

Stage 4
This is where I'd add CCR support. The ability to read cells using whatever logic / method seems most appropriate. (mCCR)

Must do:
Sense input from at least 2 cells
Allow diver or unit to define the number of cells in use
Calibrate o2 cells
Allow diver to define setpoints
Allow diver to switch setpoints during the dive
Monitor cells in a sensible way
Monitor cylinder pressures

Should do:
Alert diver to out of range cells (alarm, not just monitoring)
More advanced logging for cell info etc
Calculate bailout limitations

Could do:
Make recommendations, dil flush etc to verify cells
Automatic eperb jetison (probably a bad idea)
Wireless transmission of cell data
Cost of gas used based on OC ;)
Shut down monitoring of specific cells during the dive if they off message or fail etc
Dual system redundancy

Stage 5
An evolution of stage 4 that includes not only the ability to read CCR information but also control the CCR itself. (eCCR)

Must do:
As stage 4
Trigger solenoids based on loop information

Should do:
Automatically switch setpoints based on dive information or at least alert the diver to do so.
Stuff I haven't thought of yet.

Could do:
Automatic dil flushing (This might require custom eCCR hardware and I doubt I'll have the cash to buy a donor unit for hacking up)

humpbackdiving
05-09-2014, 10:45 AM
sounds brill and tasty - Raspberry Pie!

LearnerDiver
05-09-2014, 11:22 AM
Stage 1:
Easy enough to do except inductive charging can be very slow. Pi is probably a bit big, I did mine with an Arduino Nano and am now working with the Arduino Trinkets which are tiny.

Stage 2:
OLED readout?
You may find you need an accelerometer to correct the digital compass when it isn't flat, i.e. most of the time, and you can play with tracking but I found it pretty inaccurate.
MP3 player - there are plenty of modules available that would just drop in, mine uses an 8GB card but the fun part is the number of controls you need if you want to fully implement Volume +&-, Prev / Next, and of course on/off
Biggest problem I had with cylinder pressure is that the pressure sensors are physically quite big, then you need to add the ability to link to the main computer which makes then even bigger, hard wiring was much easier

Stages 4 & 5:
Add a HUD with Smithers code?
I've just been playing updating my HUD design & vest power switches to use the Neopixel RGB LEDs which are cheap and individually addressable so cut down on the wiring, pins, and LEDs needed

ootini
05-09-2014, 11:22 AM
I forgot to add "Battery monitoring" would be essential at all stages.

ootini
05-09-2014, 11:23 AM
Probably all mounted in something like this for now:

http://www.fuertecases.com/Merchant2/graphics/00000001/case_1050clear_ylw.jpg

Sleek eh?

LearnerDiver
05-09-2014, 11:28 AM
Agree with battery monitoring, but it really needs to be capacity rather than just voltage

If you need a custom casing or anything similar give me a shout, something like one of my small PLB canisters might be ideal?

ebt
05-09-2014, 11:52 AM
like learner says, you're better off with a custom housing. those face sealled peli cases tend to flex a bit too much.

Theres just so much to play with/learn...... fun, isnt it :)

LearnerDiver
05-09-2014, 12:01 PM
Theres just so much to play with/learn...... fun, isnt it :)

Thats the real fun part, you spend ages learning new stuff and building prototype after prototype, go off down dead end routes, find yet another sensor idea to play with, find you have to do massive redesign just for that one more "must have" bit, most of which just end up back in the parts box, but learn loads. I recently spent ages making a housing for an intelligent heated suit switch and then wasn't happy so it just went in the spares & bits box.

My dive buddy was taking the mick last time out as every time we dive his torch has changed where I've added something or tried something new so we try to keep up our standard if never diving two dives with the same kit... He reckons I should be making a Swiss Army Torch with all the bells and whistles...

ootini
09-09-2014, 09:08 AM
Anyone have any preferences or suggestions on the type of display they'd like to see on a computer? LCD? LED? OLED?
Size?

ootini
10-09-2014, 10:13 AM
http://files.hwkitchen.com/200000137-cf454cffdd/AMC2004A-B-Y6WFDY_arduino_10.JPG Too boring?

http://i1.wp.com/tronixstuff.com/wp-content/uploads/2013/04/example50p1.jpg Too complex?

I'm assuming back lit is essential? As is high contrast.

Any other considerations?

Woz
10-09-2014, 11:13 AM
The second one. Diving with a buddy with an oled screen is ace you can see what deco they have from the bloody surface.
If you need a hand with the design of the housing then give me a shout. I have a machine or two... :)
I also have access (although not used for a while) to rapid prototyping stuff at the Uni so if you need a short production run of something, there might be an option to do this.

ebt
10-09-2014, 11:22 AM
OLED is nicest from a brightness/clarirty perspective, although theres a lot of debate about how fragile they are and their performance in bright light.

I went second best with TFT and wired in an LDR circuit to control how much i drive the backlighting. Given the choice again I'd sniff around whats available in OLED world.

I had another idea to reduce the battery consumption on the display, stick a piezo to the underneath of the screen cover and use a tap to activate display. As i said before, theres *always* something more to fiddle with :)

Have you seen the shearwater NERD? that brings another dimension to the size debate...

Woz
10-09-2014, 12:07 PM
I dive with a VR3. Anything smaller than that would be a bonus.

https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpa1/v/t1.0-9/s720x720/15422_10154561743280368_8241365769923785888_n.jpg? oh=4ae6ecc33496996a307de0a6faa0e5ef&oe=54829082&__gda__=1418103637_3f2cfc19d4ea8593df963ad530cf8b8 1

ootini
10-09-2014, 01:06 PM
This looks nice but I don't seem to be able to find a UK supplier:

http://www.freetronics.com/products/128x128-pixel-oled-module

ebt
10-09-2014, 01:22 PM
Good luck. I bought most of my display stuff from holland, or via dx.com

in the uk hobbycomponents and robosavvy are reasonably good.

jamesp
10-09-2014, 02:15 PM
The second one. Diving with a buddy with an oled screen is ace you can see what deco they have from the bloody surface.
If you need a hand with the design of the housing then give me a shout. I have a machine or two... :)
I also have access (although not used for a while) to rapid prototyping stuff at the Uni so if you need a short production run of something, there might be an option to do this.

An ex Nottingham Uni Mech eng dept technician came to work for me, sporadically.
I dont know why he left the uni, he rated it a cushy number; but I sacked him.

witchieblackcat
10-09-2014, 02:17 PM
I prefer the colour screen although that will probably make things a little trickier.
But we're being bold so lets dismiss the seemingly easier black and green inspo handset lookalike.

Woz
10-09-2014, 02:21 PM
An ex Nottingham Uni Mech eng dept technician came to work for me, sporadically.
I dont know why he left the uni, he rated it a cushy number; but I sacked him.

http://www.nottingham.ac.uk/nimrc/index.aspx

bubbleless
10-09-2014, 02:51 PM
I would hope the display is slightly larger than 1.5 inches....... or with a magnifying glass, like the new hud / display thing shearwater

LearnerDiver
10-09-2014, 04:26 PM
This looks nice but I don't seem to be able to find a UK supplier:

http://www.freetronics.com/products/128x128-pixel-oled-module


http://www.jaycarelectronics.co.uk/productView.asp?ID=XC4270

https://www.coolcomponents.co.uk/serial-miniature-oled-module-1-5-oled-128-g2-gfx.html

http://electronics.ilsoft.co.uk/ColourOLED.aspx

http://www.digikey.co.uk/product-search/en/optoelectronics/display-modules-lcd-oled-graphic/524918


There are a good few similar ones about and the JayCar one looks the same, and is cheap

nigel hewitt
10-09-2014, 05:30 PM
I've been working on an OSTC2 for a few years now. I've been wondering about a DIY because there are things I'd like to add but I'd pot it solid.
The parts are too cheap to bother with anything else or you'd spend more on the case than several PCBs.

It would do a lot of tests then soak it in resin with hall effect switches to pick up magnet buttons.
I'd probably plagiarise the OSTC2 battery and USB connector because they do it very nicely.

ootini
11-09-2014, 11:04 AM
After some thinking, consideration, drinking and very useful advice from TDF users I've decided to go down the Arduino route instead. Probably going to start with an Uno R3, and if necessary upgrade to the Mega2560 R3.

ootini
11-09-2014, 11:07 AM
I reckon a quick breakdown if essentials parts is:

Arduino Uno R3
MS5803-14BA
128x128 Pixel OLED Display
An, as yet, unknown battery pack
Qi Wireless Receiver Module
BlueTooth module
A case of some description
A home built water contact switch
Plus a load of bits n bobs and things I've forgotten.
*EDIT* A real time clock will be required too.

ebt
11-09-2014, 11:51 AM
+switches to talk to the thing underwater (hall/piezo etc)
+FET's for things you want to trigger (alarm/buzzer and power monitor circuits)
+power management circuit/buck boost modules
+coffee
+pizza
+freemind to capture ideas/manage the build.
+a complete rebuild when its done to cut its power requirements right down ;)

<grins evilly>

ps. one BIG downfall of arduino seems to be the delays incurred when you write to a display module via SPI/I2C. worth bearing in mind.

ootini
11-09-2014, 12:10 PM
+switches to talk to the thing underwater (hall/piezo etc)
+FET's for things you want to trigger (alarm/buzzer and power monitor circuits)
+power management circuit/buck boost modules
+coffee
+pizza
+freemind to capture ideas/manage the build.
+a complete rebuild when its done to cut its power requirements right down ;)

<grins evilly>

ps. one BIG downfall of arduino seems to be the delays incurred when you write to a display module via SPI/I2C. worth bearing in mind.

Cheers, I'll keep it in mind!

edward
11-09-2014, 12:18 PM
have a look at the arduinoversusevil youtube channel. Nothing to do with diving but is run by an insane Canadian tool butcher, using Arduino to, for example, make an arc light from two pencils (and setting them on fire!)

ootini
11-09-2014, 01:51 PM
The second one. Diving with a buddy with an oled screen is ace you can see what deco they have from the bloody surface.
If you need a hand with the design of the housing then give me a shout. I have a machine or two... :)
I also have access (although not used for a while) to rapid prototyping stuff at the Uni so if you need a short production run of something, there might be an option to do this.

Cheers Woz. Although I've no idea how I'd communicate the design requirements to you. Other than a box, a bit bigger than an arduino, that's waterproof, but with some holes here n there on the sides, and a big hole at the top for a screen. :)

ootini
11-09-2014, 03:17 PM
Anyone with Arduino experience see any particular issues with using two separate units, connected via something like a fischer cable, using one unit as the master processor (possibly back mounted) and another handling just the display requirements (wrist mounted)?

I'm just contemplating an Arduino Uno acting as the master / calculator sending data down a cable to an Arduino Nano running the OLED display and nothing else.

LearnerDiver
11-09-2014, 04:36 PM
Anyone with Arduino experience see any particular issues with using two separate units, connected via something like a fischer cable, using one unit as the master processor (possibly back mounted) and another handling just the display requirements (wrist mounted)?

I'm just contemplating an Arduino Uno acting as the master / calculator sending data down a cable to an Arduino Nano running the OLED display and nothing else.

Wouldn't have thought you would need a dedicated processor for the OLED, using I2C you will only need 4 connectors and two of them are power so you are only using two pins. You could go master/slave with two main processors with auto-switchover on failure but that is complex, I considered it and dumped it on my HUD.

Have a look at the Nano or even a Trinket rather than UNO for size, I'm using Trinkets in my suit switches and a couple of other devices as they are tiny and dirt cheap but splitting into separate processor and displays makes things easier, just mount the processor unit on the breather and run the HUD and wrist display from it so your wrist display could be just an OLED screen and some piezo switches which also keeps its size down.

ebt
11-09-2014, 04:53 PM
I'd had similar thoughts in the past Dave, could be worth pursuing.

Some other things worth bearing in mind:

Try to stick to either I2C or SPI, so this means selecting components that share a common bus design.
You'll need some op-amps if you go down the rebreather/o2 cell route. they come in useful for buffering anyway.
Pick an operating voltage... 3.3/5v... stick to it. you'll probably be forced to pick this based on the display you find.

and when you get frustrated, google 'ardupilot' or 'jarduino' to see what can be done :)

ootini
11-09-2014, 06:38 PM
Wow! Ardupilot and Jarduino are both very impressive! Thanks for the links

ootini
11-09-2014, 06:51 PM
Wow! Ardupilot and Jarduino are both very impressive! Thanks for the links

ootini
11-09-2014, 06:51 PM
Is there any reason why this: https://www.coolcomponents.co.uk/usb-lipoly-charger-single-cell-1405.html couldn't be "butchered" to work with a 1000mah LiPoly battery pack and being charged with this: http://www.adafruit.com/blog/2013/06/14/new-product-inductive-charging-set-5v-500ma-max/ ?

ebt
11-09-2014, 07:44 PM
looks fine at first glance. remember that 3.3/5v decision? if you go 5v, you'll need to put a boost circuit on the batteries to power your widget.

joking aside, theres usually some good stuff on fleabay.... its worth looking there too :)

ootini
12-09-2014, 02:38 PM
I've decided I'll be polling the depth sensor once per second and writing the time.depth data to a log file every ten seconds (this seems to be about normal). How often should deco be recalculated? Every second? Every ten seconds? It's not a massive issue to do it every second if need be, just curious on everyone's thoughts?

ootini
12-09-2014, 03:52 PM
re: 3.3v or 5v I think the defining factor will be the pressure sensor as opposed to the display, as the only one that's widely available runs at 3.3v

https://www.coolcomponents.co.uk/pressure-sensor-ms5803-14ba-breakout.html

LearnerDiver
12-09-2014, 04:16 PM
Have a look at logic level converters, e.g https://www.sparkfun.com/products/12009 or https://www.coolcomponents.co.uk/logic-level-converter-bi-directional.html

ootini
17-09-2014, 12:26 PM
One thing I'll be adding to the stage 5 incarnation is CO2 monitoring. I've just noticed AP are charging 649 for their CO2 sensor, which seems a touch pricey to me, considering the sensor itself is $34.99

bubbleless
17-09-2014, 04:08 PM
battery boost a piece of cake as not using high current 1.5x2=3 3x2=6 then voltage reg to 5v

bubbleless
17-09-2014, 04:09 PM
or 2x3.7v 7.2reg to 5v

shapeshifter
11-04-2017, 10:36 AM
Did any more ever come of this ?

My own home-build met a 40m-induced watery grave and I'm on the point of buying an OSTC and trying to install my own software on it.

plazma
25-07-2017, 02:12 PM
Interesting projects. I recently started my own dive computer/rebreather controller project.
I got the PCB assembled few days ago. One memory chip is missing because the BOM import to Digikey failed.
More info can be found at FB CCR CustomBuilders group and at http://diyrebreathers.com/index.php?id=rebreather-controller

Is there any forums or mailing list related to decompression theory and coding?

http://diyrebreathers.com/data/uploads/pictures/pcb_assembled_top.jpg

shapeshifter
25-07-2017, 03:31 PM
Nice.

What are you planning for the housing and connectors ?

plazma
25-07-2017, 03:57 PM
Hardwired for rebreather. Bluetooth linked for the standalone unit.

The case will be milled out of POM. The screen is cut out of scratch resistant PC (Margard).

It is powered by any AA sized battery (primary or rechargeable).

This is the 0.8-4.2V input 3.3V output smps. It will be changed however. The quiescent current was too high in Vin>Vout mode.
http://i.imgur.com/O2nBDxB.jpg

shapeshifter
25-07-2017, 04:29 PM
So you're looking at an atmospheric pressure housing? Is there an advantage?

I used a weedy 1mm thick off-the-shelf potting box which I filled with paraffin wax. The failure point turned out to be air gaps in an around the screen.

On the subject of screens, what screen are you using? Display Tech make a very nice 2.4" ISP-TFT which I've been looking into.

plazma
25-07-2017, 04:38 PM
So you're looking at an atmospheric pressure housing? Is there an advantage?

I used a weedy 1mm thick off-the-shelf potting box which I filled with paraffin wax. The failure point turned out to be air gaps in an around the screen.

On the subject of screens, what screen are you using? Display Tech make a very nice 2.4" ISP-TFT which I've been looking into.

I was thinking of making an ambient pressure housing but the prototype will be atmospheric. The ambient pressure housing requires an OLED display. My guess is a TFT screen will get visible artifacts when pressure compresses the different layers in the screen structure.
I'm using a Samsung AMOLED screen. The AMOLED screen can be potted into an optical grace silicone potting material. If I'm going with the atmospheric housing after the prototype I will at least bond the OLED screen to the PC with LOCA (Liquid Optically Clear Adhesive).

plazma
25-07-2017, 04:40 PM
The schematic and layout was made with Altium Circuit Studio. It is a very good EDA package for the price (less than 500€).

shapeshifter
25-07-2017, 04:54 PM
Do you have a part number for the screen?

plazma
25-07-2017, 06:14 PM
How about a DIY NERD style display. This is a display manufactured by Kopin. The optics are Chinese and not so great. I have to ask an optical designer friend for better optics. The resolution is the same as the OLED screen. The module was ripped off a chinese stereo video headset. The module shows a Shearwater image just for testing. The image is focused about 1.5m away.
http://i.imgur.com/mBJqXam.jpg

shapeshifter
26-07-2017, 09:11 AM
I have a question about your PCB:

My computer is built from off-the shelf parts which means I end up with a lot more interconnects than I really need.

Realistically all I need to do is add an FPC connector and remove the USB from the existing adafruit M0 breakout, plus possibly merge in the sensor breakout for which the Eagle files are freely available.

Where did you get your board assembled and roughly com much does it cost ?

plazma
26-07-2017, 09:17 AM
I have a question about your PCB:

My computer is built from off-the shelf parts which means I end up with a lot more interconnects than I really need.

Realistically all I need to do is add an FPC connector and remove the USB from the existing adafruit M0 breakout, plus possibly merge in the sensor breakout for which the Eagle files are freely available.

Where did you get your board assembled and roughly com much does it cost ?The PCB was made at the University proto PCB lab. I soldered the components by hand with a fine tipped soldering iron and hot air. I was going to order the PCBs from China (PCBway or AllPCB) but got them (3pcs) for free from the University.

plazma
26-07-2017, 09:30 AM
On the subject of screens, what screen are you using? Display Tech make a very nice 2.4" ISP-TFT which I've been looking into.

The display is from an old Nokia phone. They are not manufactured anymore so they are only good for few units. If I would need to make many of these I would change to some TFT IPS model from Densitron. They are available in single units and are promised to have good availability in the future.

shapeshifter
26-07-2017, 04:57 PM
Hand-soldered those fine-pitch connectors and SMDs? Wow now I'm impressed.

plazma
26-07-2017, 05:02 PM
Copied from FB: The RGB led was a good selection. https://www.digikey.com/products/en?keywords=CLX6F-FKC-CNP1ST1E1BB7D3D3CT-ND
Good build in diffuser. Yellow was good. Other combined colors like white, cyan and magenda were not.

This is a new interesting led. It got a true white led built in. I'll probably change to it as soon as it is available.
http://www.cree.com/news-events/news/article/cree-opens-design-possibilities-for-architectural-lighting-with-new-clq6a-led

I'll also try these leds for a LED HUD.

plazma
26-07-2017, 05:06 PM
Hand-soldered those fine-pitch connectors and SMDs? Wow now I'm impressed.It was easy. No BGA chips :)

shapeshifter
28-07-2017, 03:17 PM
In any case, that's a nice piece of work. If you get round to making an atmospheric pressure housing, make two and I'll take the spare off your hands :)

plazma
28-07-2017, 05:16 PM
Well.... let see if some kind of group buy and open source project is possible after I have finished this.

plazma
01-08-2017, 10:15 AM
Rebreather controller / dive computer development kit
http://i.imgur.com/KtWapFx.jpg

Sensors and CAN still unconnected.