custom PCB

Development & General Chat for the superb openxvario project.

Moderator: rainer

dschiedsch
Posts: 26
Joined: Tue Nov 10, 2015 2:37 pm
Country: -

custom PCB

Post by dschiedsch »

Hello guys
I went ahead and designed a custom pcb for openXsensor
it includes the atmel mcu, the ms5611 pressure sensor and the voltage dividers for lipo voltage monitoring
Have a look ant tell me what you think and if I have overlooked anything.
Design is in Altium and I will upload gerber files
Attachments
openxsensor-pcb-back.PNG
openXsensor-3d.PNG
openxsensor-pcb.PNG
openXsensor-schematic.PNG

nppc
Posts: 32
Joined: Fri Jun 07, 2013 5:37 pm
Country: Germany
Location: Hessen

Re: custom PCB

Post by nppc »

Very nice size! It is would be nice to have it ordered from OSHPark, for example. 8-)

For my small DLG I wanted to make similar PCB, but to have ms5611 as a separate breakout board. I'm afraid, that to solder pressure sensor by hands is quite difficult, isn't it? :?

Thank you! Beautiful work!

Pavel

EDIT: Ah yes, I do not see decoupling capacitor for pressure sensor. It gives better readings.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: custom PCB

Post by mstrens »

Perhaps can you add some pad on some digital pins in order to connect
- a PPM signal
- a RPM sensor
- a GPS sensor (this requires 2 digital pins (one being the uart Rx).

For small DLG, would it not be better to reduce the width from 20mm to about 15mm (even if the length must be extended to 35/40 mm).
Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: custom PCB

Post by Carbo »

nppc wrote:I'm afraid, that to solder pressure sensor by hands is quite difficult, isn't it? :?
I'm afraid, the rest of it, for example the atmel, is also not very easy to solder. Or is there a chance, to let it produce completely including the components?
SupraGo
Posts: 33
Joined: Tue Dec 27, 2011 9:09 pm
Country: -
Location: Alberta, Calgary

Re: custom PCB

Post by SupraGo »

Great first post!!
Longer and thinner for a DLG or anything that doesn't have much space would be nice, but the board is pretty small as it is. Depends how much work the OP is willing to put in on this and his ideas for development.
Have soldered a few Atmel chips that size and they are not that bad. Tack apposite corners down, load up with solder and wipe all the legs. Check for any bridges and remove. There are videos out there to show you just how to do it.
Will be watching how this develops.
Bill

mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: custom PCB

Post by mstrens »

On arduino pro mini and other AVR328p there are normally some components for the clock ( quartz/ condo).
Is this not required in order to get a stable clock for the MCU.
Note : I did not check the datasheet if it is really mandatory.
andrewju
Posts: 784
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: custom PCB

Post by andrewju »

I thought about a similar project some time ago. But I found an Arduino Pro Mini and an MS5611 module from China is cheaper than getting plain chips and soldering them onto a complete new board. That's how I designed my 'oXs Lighter' board. Of course, a custom board has its advantages, especially if weight & size have strict limitations.
dschiedsch
Posts: 26
Joined: Tue Nov 10, 2015 2:37 pm
Country: -

Re: custom PCB

Post by dschiedsch »

Hi
based on your comments I added a resonator (not sure if the internal RC-oscillator wouldn't be enough but footprint is there)
and four testpads for pwm serial/other sensors on the top portion
attached is another 3d shot
and the gerber files

I will order a small series of pcbs (10 at the moment)
at either iteadstudio or oshpark
if there is interest I can make the order bigger

Concerning soldering the atmega is quite easy to solder (for someone having soldered smds)
for the pressure sensor you would need a hotair rework station or a reflow oven.

concerning decoupling I'm actually using a second ldo with LC pi filter for the ms5611 is there any more decoupling you would suggest

greets
Attachments
openXsensor-pcb.PDF
(3.63 MiB) Downloaded 532 times
openXsensor-gerber.zip
(100.52 KiB) Downloaded 334 times
openXsensor-3d.PNG
nppc
Posts: 32
Joined: Fri Jun 07, 2013 5:37 pm
Country: Germany
Location: Hessen

Re: custom PCB

Post by nppc »

Yeah, dedicated LDO reg for pressure sensor is enough, no need of additional cap. 8-)

But in general I think it would be nice to make the device working from 1S LiPo. For this you can use 3.0V LDO (with less than 200mV dropout, for example MIC5501) or without LDO, and use 8Mhz resonator. But then voltage sense pins are not needed, so it is actually another variation of the DIY board.

But I'm agree with andrewju that for this project is easier to use Arduino Pro Mini and pressure sensor breakout board.
Making own PCB is worth if you need really small size and light weight device (for DLG, powering from 1-2S Lipo).

Pavel
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: custom PCB

Post by mstrens »

Just for info, if some one is interested, I have some pcb which are about 1/2 pro mini size, the mS5611 (gy 83?) being also 1/2 pro mini size.
The pcb and MS5611 are put near each other on top of pro mini.
Pcb is connected to promini directly with only pin header; MS5611 is connected to pcb with 4 direct short connections (3 mm).
Pcb support an optional voltage regulator and one resistor dividers (to measure total voltalge).

If you are interrested, I have pcb. Drawing is free available in eagle format.

I have also a pcb (= pro mini size) with support airspeed sensor, 4 dividers, ppm, connection to current sensor.
User avatar
Tempo
Posts: 83
Joined: Tue Feb 04, 2014 4:04 pm
Country: -

Re: custom PCB

Post by Tempo »

Another example viewtopic.php?f=86&t=4433&hilit=sensor&start=450#p85568
same size as "arduino pro mini" 33mm x 18mm :


hageha wrote:I have now made ​​even a simple design for a sensor with Alti / Vario and voltage display for 3 or 4 Lipo.
Additional voltage regulator stabilizes the input voltage to approximately 8 volts.
4 pieces, as XR and DR version working properly
http://www.ebay.de/itm/310862173882?_tr ... EBIDX%3AIT

http://www.ebay.de/itm/130839929399?_tr ... EBIDX%3AIT
K800_DSCI2169.JPG
K800_DSCI2169.JPG (34.34 KiB) Viewed 19193 times
K800_DSCI2170.JPG
nppc
Posts: 32
Joined: Fri Jun 07, 2013 5:37 pm
Country: Germany
Location: Hessen

Re: custom PCB

Post by nppc »

hageha, very beauriful and clean design! 8-)

Yesterday I did small test - miniOXS for 1 hour. :D
It works fine from 1S LiPo. :!:
MiniOXS 8Mhz 3.3V
MiniOXS 8Mhz 3.3V
I removed unneeded parts of the PCB from Arduino Pro Mini board (serial connections, reset button and LDO). And I reused an LDO from pressure sensor. 1S battery is connected to the MS5611 board (VCC/GND) and power for the Mega is taken from out of the pressure sensor LDO. I do not know what LDO is used on pressure sensor board, so, if somebody have an idea, I'm would be happy to know. :roll:

I will also test powering Arduino directly from 1S...

This is the idea for a DIY PCB (with ATmega) that I think will be useful for many DLG flyers. Maybe couple of voltage dividers for 2S LiPo will be fine too on this PCB.

Pavel
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: custom PCB

Post by jhsa »

The voltage divider you could build it on the cable itself using a little piece of stripboard for example. ;)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
Tempo
Posts: 83
Joined: Tue Feb 04, 2014 4:04 pm
Country: -

Re: custom PCB

Post by Tempo »

nppc wrote:...
I removed unneeded parts of the PCB from Arduino Pro Mini board (serial connections, reset button and LDO). And I reused an LDO from pressure sensor. 1S battery is connected to the MS5611 board (VCC/GND) and power for the Mega is taken from out of the pressure sensor LDO. I do not know what LDO is used on pressure sensor board, so, if somebody have an idea, I'm would be happy to know. :roll: ...
GY-63_PCB.JPG
LDO on GY-63-MS5611-board is in my case "KB33" which means "mic5205". Input voltage 2.5V ...16V :
mic5205.pdf
datasheet mic5205
(828.54 KiB) Downloaded 353 times
Atmega328 works with voltage up to 6V and down to 3V. Using unstable voltage of one Lipo with Atmega328 is possible, but better is stable voltage of LDO from GY-63-board and 8MHz Atmega328 ;)

@nppc: Make it easy make´s it better for DLGliders :lol:
viewtopic.php?f=86&t=7961&p=105009#p105009
nppc
Posts: 32
Joined: Fri Jun 07, 2013 5:37 pm
Country: Germany
Location: Hessen

Re: custom PCB

Post by nppc »

Thank you temo for the datasheet! I also found one reference for the LDO on this board and it seems that there is a good quantity of variations. One I found on this forum is ME6211 (viewtopic.php?f=86&t=6808&p=94148&hilit=me6211#p94148) and it rated for maximum 6 volts as Input voltage. :o

As of the using of LDO on Pressure sensor board for arduino, as you can see on a photo, I'm taking Vout of GY-63 LDO as VCC voltage for Arduino Pro Mini. But this is not the right (electrically) way to do, because two pull up resistors for I2C on GY-63 board is connected to the Vin of the GY-63 LDO. It means that if Arduino is powered with 3.3V (Vout from LDO), but pullup resistors pulling I2C pins of arduino to 4.2V, then this is not the best case for arduino. It worked for me, but it is better (electrically) to supply to VCC of arduino unregulated 1S voltage. In case of 2S we should have LDO on arduino and supply GY-63 from the VCC pin of Arduino (5V).

So, if dschiedsch would like to design another version of board for DLGs then it is possible to make universal board for 1S or 2S voltage. :roll:

Pavel
dschiedsch
Posts: 26
Joined: Tue Nov 10, 2015 2:37 pm
Country: -

Re: custom PCB

Post by dschiedsch »

Hi
what would be on the wishlist for a DLG version?

In the meantime I've ordered PCBs for my version to check out if everything works
I'm still unsusre about the resonator
User avatar
Tempo
Posts: 83
Joined: Tue Feb 04, 2014 4:04 pm
Country: -

Re: custom PCB

Post by Tempo »

dschiedsch wrote:Hi
what would be on the wishlist for a DLG version?...
1. small geometric dimension e.g. 15mm x 30mm like design of "openaltimeter" http://openaltimeter.org/index.html with only holes and flat points for electrical contact
2. arduino-6-pins for flashing firmware
3. high precission MS5611

But shown selfmade modifications of chinese arduino-pro-mini PCB with chinese MS5611-module is cheapest choice. And it´s small enough ;)
Using arduino-pro-mini with TWI-modules is another way for rare space in DLGliders viewtopic.php?f=86&t=7789#p103592 :)
dschiedsch
Posts: 26
Joined: Tue Nov 10, 2015 2:37 pm
Country: -

Re: custom PCB

Post by dschiedsch »

Hi
I was thinking about integration with the receiver
Since the FrSky protocol was reverse engineered
http://www.rcgroups.com/forums/showthread.php?t=2124647
I was thinking about integrating both for minimal space.
Not sure how well this would work though
nppc
Posts: 32
Joined: Fri Jun 07, 2013 5:37 pm
Country: Germany
Location: Hessen

Re: custom PCB

Post by nppc »

Thank you dschiedsch for willing to make PCB for DLG! :)

In case of 2S power, DLG PCB should have resistor divider to measure each cell.

I do not know how far is the reverse engineering of FrSky Telemetry protocol went. So far I seen only implemented RSSI and A1/A2 data. We should wait until other Telemetry data will be implemented in DIY FrSky. But if pads for RF module is not taking much space, why not...

I think TX/RX pads for programming should present, but no need to have it through holes. Just pads are enough. I do not think, that somebody will very often re-flash openXsensor firmware in DLG. Mine I flashed ones and do not see any need to remove it from DLG for re-flashing. Or maybe I'm wrong and it is good to have 6 standard arduino pins as tempo mentioned. ;)

Thank you!
Pavel
User avatar
Tempo
Posts: 83
Joined: Tue Feb 04, 2014 4:04 pm
Country: -

Re: custom PCB

Post by Tempo »

dschiedsch wrote:Hi
I was thinking about integration with the receiver
Since the FrSky protocol was reverse engineered
http://www.rcgroups.com/forums/showthread.php?t=2124647
I was thinking about integrating both for minimal space.
Not sure how well this would work though
Do you mean this 8-) :

One PCB 30mm x 15 mm = FrskyReceiverOpenXsensorVarioVoltagedivider with one Atmega328 and fusioned ReceiverOpenXsoftware?
Frsky_Tx2.jpg
combined with
K800_DSCI2169.JPG
K800_DSCI2169.JPG (34.34 KiB) Viewed 19027 times
dschiedsch
Posts: 26
Joined: Tue Nov 10, 2015 2:37 pm
Country: -

Re: custom PCB

Post by dschiedsch »

Yeah that was the idea
Now I chatted with the creator of the diy rx software and he tells me that the telemetry protocol is not fully reversed yet. So I will send him one of the above pcbs so he has a telemetry sensor with which he can check the protocol.

He says there is enough space left in the atmega flash but has to check whether the processing time is sufficient to combine everything.

Still I think this is promising.
So next step is to get the above boards working and then I will have a look at combining everything ;-)

And after that maybe a gyro for stabilisation :-)
dschiedsch
Posts: 26
Joined: Tue Nov 10, 2015 2:37 pm
Country: -

Re: custom PCB

Post by dschiedsch »

Hi all
Yesterday I received the pcbs and populated them
I flashed openXsensor v4
and they're running
Tested on a X4R receiver
Only problem I have is that the cell Voltages display fine if I send them as Acc or A3 A4 values but not if I send them as Cells
Especially anything beyond two cells seems doen't update on the taranis tried with a 3S pack
Does anyone know what this is?
My config is attached
Attachments
oXs_config.h
(8.89 KiB) Downloaded 250 times
openXsensor.jpg
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: custom PCB

Post by mstrens »

Config seems me ok.
If you define a 3 cells and ask for sending CELLS_1_2 and CELLS_3_4 it is important that you connect simultanously at least the lowest cells.
So if you connect ground, cell1 , cell2 and cell3, it should work. Cell1 would be VOLT1, Cell2 would be VOLT2-VOLT1, Cell3 would be VOLT3-VOLT2.
If you connect ground, cell1 , cell2, it should work too.
Still, if you connect ground and e.g. only cell2, it will not work. This is because oXs will try to calculate Cell1 and will probably get a result of 0 volt (VOLT1= 0) which is out of range (allowed range is between 500 and 4500)? It will then try to calculate Cells2 (VOLT2-VOLT1) and will find a value like 8000mv which is also out of range.
Could this explain the issue you faced?
If not, could you provide the values reported on Taranis (AccX, AccY, AccZ) for VOLT1, VOLT2, VOLT3 with the current set up
dschiedsch
Posts: 26
Joined: Tue Nov 10, 2015 2:37 pm
Country: -

Re: custom PCB

Post by dschiedsch »

Hi Thx for the answer
My measurements were done with a 3S lipo connected to cell1,cell2,cell3
The reported voltages in the AccX,AccY and AccZ field look fine (3917,7815,11718) Which I guess translate to 3.917V, 7.815V and 11.718V
Which is correct.
However the voltages reported in the Cell field seem to have a problem
cell1 and cell2 report fine (3.91V, 3.89V)
but cell 3 doesn't output any data. (not 0V but rather no updates at all)

I'm running openTx 2.1.6.
Maybe it has something to do with this.

I also checked the data stream on the s.port on a logic analyzer
I think the second cell data field is output correctly:
The data stream is:
0x10 0x01 0x03 0x32 0x9F 0x07 0x00 0x13

My understanding is:
0x10 ... start of reply
0x0301 ... 2nd cell field
0x32 ... don't know
0x00079F ... cell data 0V and 3.902V
0x13 ... checksum but I don't know if it's correct

Regards
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: custom PCB

Post by mstrens »

0x10 0x01 0x03 0x32 0x9F 0x07 0x00 0x13 has to be decoded as:
0x10 ... start of reply

0x0301 ... 2nd cell field

0x32 0x9F 0x07 0x00 has to be put in reverse order for decoding: so it becomes 0x00 0x07 0x9F 0x32.
This has then to be regrouped in 12bits, 12 bits, 4 bits and 4 bits => 0x000 0x79F 0x3 0x2
Where
- 0x000 = voltage of second cell (in this frame!! so here cell4 )/ 2 ; so 0 is OK
- 0x79F = voltage of first cell (so here cell3) / 2 ; 0X79F = 1951 (decimal) ; In fact Cell3 = 11718 - 7815 = 3903 and so 3903 / 2 = 1951 . So it is OK
- 0x3 = Total number of cells = 3 for 3s
- 0x2 = Number of first cell in this frame ; 2 means cells 3 because cells nummering starts at 0 (0 = cell1, 1 = cell2, 3 = cell3)

0x13 ... checksum but I don't know if it's correct

I expect that the issue results from 0x0301; It could be that openTx 2.1 expects 0x0300 for all cells (and makes the difference between the different cells using the "Number of first cell in this frame").

Perhaps can you make a test changing the code of oXs (I currently do not yet use openTx 2.1). It is easy:
In file oXs_OUT_Frsky.cpp, you should find a line with
fieldID = CELLS_SECOND_ID ;

Please change it in:
fieldID = CELLS_FIRST_ID ;

Let me now if this solves the issue and I wil update the code on Gthub.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: custom PCB

Post by Kilrah »

mstrens wrote: I expect that the issue results from 0x0301; It could be that openTx 2.1 expects 0x0300 for all cells (and makes the difference between the different cells using the "Number of first cell in this frame").
Only 0x0300 should be used indeed regardless of version.

0x0301 would be considered in the protocol as a completely independent, second cell sensor e.g. for another pack or for >6 cells.
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: custom PCB

Post by mstrens »

Ok, I will fix it in oXs.
Just for my understanding, do you also consider that there are 2 (3...) packs when OpenTx get back the code 0x3000 from different sensors replying on different SENSOR_ID (SENSOR_ID means here the code being sent by Rxfor polling).
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: custom PCB

Post by Kilrah »

Yes. A sensor is a given set of physical ID and data ID, change either one and it's another sensor.
dschiedsch
Posts: 26
Joined: Tue Nov 10, 2015 2:37 pm
Country: -

Re: custom PCB

Post by dschiedsch »

Hi I just tested the change
I also changed the CELLS_5_6 field to CELLS_FIRST_ID

Tested with 3s pack works perfectly now
Have to get a 6s pack to check for the rest but I guess this is working fine now.
Thanks for the fast help, it would have taken me some time to figure that one out.

Also I checked with a 3S pack and NUMBEROFCELLS = 3 everything works fine
if I set NUMBEROFCELLS=6 the voltages still report fine but min and delta values on openTx are wrong (which I would expect)
But is it possible to autodetect number of cells so that you don't have to change the code if you want to use a different pack?
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: custom PCB

Post by mstrens »

It should be possible in oXs to autodetect that the connected lipo has less cells that the max number of cells defined in the set up.
In this case, oXs could adapt automatically the number of cells being transmitted.

The parameter Number of cells has to be maintained in the set up because it could be that e.g. you build a device in order to support max 4 cells and that you use VOLT5 to measure e.g. the temperature. oXs has to know that VOLT5 may not be included in cells calculation.

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”