#1
Posted 11 October 2011 - 11:39 PM
I would like to use this :
http://www.coolcompo...products_id=795
in order to provide CC with voltage / Current monitoring.
As cc has limited external world connectivity i see a quick way is to use an arduino to interface the sensor
and connect CC to it over i2c .
Is there a better way ?
Regards
c
#2
Posted 12 October 2011 - 12:02 AM
Would also love to see that - please keep us updated
#3
Posted 12 October 2011 - 12:10 AM
This is the eval board I'm using (comes populated for $15): http://ww1.microchip...eDoc/51737a.pdf
I'm using two of the four channels for K-type thermocouples and was planning to add voltage / current sensing to the 3rd and 4th channels for a gas engine monitoring system. V and I would be for the electronic ignition battery. I'm no electronics expert so this is by no means a well researched solution.... Does work though and hats off to the guys who wrote the low-level I2C code for OP!
I'll be uploading it shortly to Git in case it is of use to others.
Could be a much lower power option than the arduino.
Edited by Scott, 12 October 2011 - 12:13 AM.
#4
Posted 12 October 2011 - 12:01 PM
yes your i2c ADC is elegant i'll order one here :
http://jeelabs.com/p...cts/analog-plug its 10EUros and its small package compared to your dev board.
But untill i have it i'll use Arduino nano in slave mode emulating the MCP3424, i have it here then the code should work with adc without too many modifications.
If you can post your code it will be a good start for me.
I realy hate flying without voltage information.
Regards
Ps: Arduino can be usefull onboard anyway for example to make an intervalometter for camera etc.
Ps: It could be nice to have an arduino lib to decode uavtalk . so arduino can sniff infos on telemetry port .
I know all this will be included in the pro board but intill its available this is a good start to start playing with openpilot
regards
#5
Posted 12 October 2011 - 12:35 PM
Oyvind Amundsen
Norway
#6
Posted 12 October 2011 - 01:27 PM
i was planning to use Arduino Pro Mini 328 5V/16Mhz witch from what i understood does not have enough RAM.
i'll check out the other thread .
Regards
#7
Posted 12 October 2011 - 01:34 PM
pixaero, on 12 October 2011 - 01:27 PM, said:
With a little effort you might be able to get it to work.
1) If you only send/receive small messages, you can likely shrink down the tx/rx/ buffers, which default to 256 bytes each.
2) You should be able to remove the tx buffer with a bit of rearranging of the code. You should be able to stream messages out the serial port rather than building the message in a buffer and then streaming it out.
#8
Posted 13 October 2011 - 05:19 AM
Nice find with the miniature breakout board for the mcp3424. That will be a much better final solution.
I'll upload the code just as soon as I put all the specific files for this module into a separate branch. Will let you know here when it is in the git repository. Give me a day or so...
#9
Posted 13 October 2011 - 03:59 PM
Oyvind Amundsen
Norway
#10
Posted 14 October 2011 - 02:06 AM
This is working beta code that talks to two devices via I2C. The first is the mcp3424 chip with 4 analog inputs. My plan is for the following:
Channel 1: Cylinder head temperature
Channel 2: Exhaust gas temperature
Channel 3: Ignition battery voltage
Channel 4: Ignition battery current
[Thermocouple scaling factor could be wrong in this code.... likely to be updated very soon.]
The second device is the mcp9804 chip which is an accurate temperature sensor chip that is used to read the cold junction temperature that the thermocouples are relative to.
Care should be taken to tie the appropriate pins to Vcc or ground to set the correct I2C address for each device.
Attached is the circuit I'm using (sorry... no Eagle layout skills yet).
Both chips should run off 3.3 - 5V supply.
- Scott
MCP3424Thermocouplecircuit.png 63.25K
111 downloads
#11
Posted 14 October 2011 - 07:01 PM
#12
Posted 19 October 2011 - 09:41 PM
I got also MCP3424 today as you can see its not much smaller than arduino , and i think its good to have an arduino around to implement all kind of goodies for example on my MK i use arduino to tirgger camera on panoramic rotation , its good to do intervalometter too .
But anyway the i2c code is the same.
I'll setup the dev environement tomorrow and try to compile the module in the CC, i'll need to understand the Task prioritys and other pios stuff , but it look very clear and easy from your module !
regards
Attached Files
#13
Posted 28 October 2011 - 11:55 PM
#14
Posted 31 October 2011 - 06:47 AM
Also going to add another module just for reporting the main flight battery voltage/current and mAh consumed.
#15
Posted 31 October 2011 - 11:00 AM
Scott, on 31 October 2011 - 06:47 AM, said:
#16
Posted 31 October 2011 - 06:17 PM
#17
Posted 01 November 2011 - 05:57 AM
Latest code in Git.
Need to figure out how to run both GPS, telemetry and I2C from CC at the same time..... Probably a branch somewhere that will do it....
#18
Posted 01 November 2011 - 02:59 PM
#19
Posted 01 November 2011 - 09:39 PM
Scott, on 01 November 2011 - 05:57 AM, said:
Don't know how I missed this, but it looks fantastic. Congrats! Support for an external analog sensor board is really neat.
#20
Posted 02 November 2011 - 11:26 AM
yes its working with both Arduino (pretending to be MCP), i still have problems to compile the firmware on my laptop so i need to reinstall a proper dev environement.
Dont you think you should keep all in the same generic module called ExternalSensors with configurable mapping of MCP .
So anybody can use it to push yet another sensor data ?
I use arduino as bridge witch allow to output MikroCopter compatible data using http://www.mikrokopt.../NaviDataStruct , so it works directly with AltaStation code (or jeti telemetry) so you have the current / Voltage directly on your radio.
Regards
Scott, on 31 October 2011 - 06:47 AM, said:
Also going to add another module just for reporting the main flight battery voltage/current and mAh consumed.



Belgium
Germany
Australia
Norway
United States
Sweden
Luxembourg







