By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by CML

Build your own telemetry sensors.

May 2019 article - OpenXSensor

All Topics | Latest Posts

Search for:  in Thread Title in  

Michael Hadaway31/07/2019 10:05:37
avatar
12 forum posts

Hi Chris

When compiling the sketch I get an error regarding <Arduino.h>. The error report is.

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328P (3.3V, 8 MHz)"

In file included from C:\Users\oxfor\AppData\Local\Temp\arduino_modified_sketch_368203\sketch_may30a.ino:369:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:153:16: error: conflicting declaration of 'void setup()' with 'C' linkage

void setup(void);

^

C:\Users\oxfor\AppData\Local\Temp\arduino_modified_sketch_368203\sketch_may30a.ino:1:6: note: previous declaration with 'C++' linkage

void setup() {

^

In file included from C:\Users\oxfor\AppData\Local\Temp\arduino_modified_sketch_368203\sketch_may30a.ino:369:0:

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:154:15: error: conflicting declaration of 'void loop()' with 'C' linkage

void loop(void);

^

C:\Users\oxfor\AppData\Local\Temp\arduino_modified_sketch_368203\sketch_may30a.ino:133:6: note: previous declaration with 'C++' linkage

void loop() {

^

exit status 1
Error compiling for board Arduino Pro or Pro Mini.

Chris Bott - Moderator31/07/2019 11:11:05
avatar
Moderator
6810 forum posts
1427 photos
1 articles

Hi Michael

Wow there's a question.
As reported, I'm no expert at all, this has been my own voyage of discovery.

Hopefully someone with some real knowledge might come along.

In the meantime my guess would be that the sketch has somehow become corrupted.
What happens if you try to compile the original sketch as downloaded, before you try any changes?

Chris

Mike Blandford31/07/2019 12:45:35
avatar
618 forum posts
25 photos

Where did you get the Arduino IDE from?

Mike

Michael Hadaway31/07/2019 16:17:57
avatar
12 forum posts

Hello

Mike Blandfird may have a good point. I have downloaded the IDE ( Arduino 1.8.9 ) from Windows store 1.2.21.0.

Is this OK?

I note, Chris, that you say to compile the original sketch. I have been unable to find the sketch to download.

From your post 14/4/19 were the link "here" is given, I left click on openxsensor and find a lot of files.

I downloaded oXs_config_basic_h and oXs_ config_advanced_h as advised in the magazine article.

Then pasted into a new sketch file. Even before changes unable to compile.

Hopefully it will be clear to you were I am going wrong. Incidentally the sketch for the servo tester compiles OK

and the unit works as expected.

Mike Hadaway

Chris Bott - Moderator31/07/2019 16:40:18
avatar
Moderator
6810 forum posts
1427 photos
1 articles

Hi Mike

I think we can fix this fairly easily. Im at work just now so can't spend much time.

I downloaded the IDE from Arduino website here it's currently showing version 1.8.9. If you have used the servo tester sucessfully then your IDE is probably OK.

The openxsensor sketch comprises many files. it sounds like you don't have them all.

We'll have to work out the best way to point you to them. Or I might be able to email the whole thing in a zip file later.

Chris

Chris Bott - Moderator31/07/2019 18:41:41
avatar
Moderator
6810 forum posts
1427 photos
1 articles

The full .zip file is here

Once downloaded it needs unzipping but leaving in the file structure just as it comes.

As you'll see, there are a LOT of files in there.

Cheers
Chris

Michael Hadaway01/08/2019 08:50:20
avatar
12 forum posts

Thanks Chris. Will give it a go.

Mike

Michael Hadaway02/08/2019 10:05:01
avatar
12 forum posts

Thank you so much Chris. The zip file downloaded perfectly and compiles without errors.

I do get a warning that the global variables use 92% of dynamic memory and stability problems may occur.

However I presume that once I have edited the sketch for the sensors I am using, ie just current and voltage at first,

that the memory issue will be resolved.

Thanks again for you help and I hope that my experience may help others who may be having problems.

Cheers

Mike

Michael Hadaway10/08/2019 14:22:57
avatar
12 forum posts

I was compiling for a 168 board in error for a 328.

Now all OK.

Have tested my first sensor and can report getting good cell voltages.

encouraged to proceed.

Chris Bott - Moderator10/09/2019 09:22:12
avatar
Moderator
6810 forum posts
1427 photos
1 articles

Just a little bit of feedback. Between everyone that's contacted me, I've now sent out 102 PCBs. I've had a daft lingering hope that we'd crack the 100 barrier and now we have.

So - many many thanks for all the support and interest, it makes it feel very worthwhile.

Are there any more success stories?
Or have most people had a go and given up?

Chris

Former Member10/09/2019 09:56:39

[This posting has been removed]

Chris Bott - Moderator10/09/2019 10:14:23
avatar
Moderator
6810 forum posts
1427 photos
1 articles

I get that completely Andrew, I've had a very busy summer with hardly any modelling or flying done at all.

Michael Hadaway27/09/2019 12:49:14
avatar
12 forum posts

Hello. Sorry to be a bit tardy replying to your post. Due to health problems and other distractions I have put the project to one side for now.

I do have a working variometer and a voltage/current sensor using your supplied pcb give accurate cell readings but the standby current is reported to be about 130 A, with no VFAS detection.

I am using the latest sketch that has only config.h. not configbasic and configadvanced.

In config.h about line 130 there is define VFAS_SOURCE ADS_VOLT_6.

Suspect this line should be changed to VFAS_SOURCE VOLT_6

I don't like to give up so will continue when energy reserves return.

Peter Balcombe02/11/2019 19:47:50
39 forum posts
7 photos

Having recently received a batch of PCBs from Chris, I have just made up my first sensor using the AMASS XT60 module for VFAS & current sensing, intended to be fitted in an electrified glider.

The PCB has had the current sensor end cut off along the left hand line of the Arduino silk screen outline to reduce the electronics unit size.

I have swapped the normal A3/A6 usage to allow the use of a 3 way R/A header for connection to the XT60 sensor, current on A6 & VFAS on A7. This just needs a single break in the A6 track & a short link wire to the A3 pin. With a 47K resistor between the XT60 sensor output and Gnd (as used by Chris on his experimental XT60 sensor), I get accurate current readings (at least up to 8A using a bench PSU & halogen lamp load) with zero offset & 30mv/A settings in the advanced configuration file. As for Chris's test unit, I have fitted a mating XT60 connector to the sensor module via short power cables, and with a flying servo type connection to the 'electronics, this gives the option of easy insertion between battery & ESC when required.

I have used a 5 pin R/A header for Lipo balance lead connection instead of a JST-XH header in order to allow any LiPo up to 4S to be easily connected - just need to make sure the connector is the right way round!.

I have some pictures on my PC, but need to work out how to include these in a post!

Further testing is now required with an ESC to see if the calibration remains true.

By the way, inspection of the OpenXsensor code indicates that current sensor readings are averaged over 200mS & Voltage readings over 500mS. FrSky telemetry setup also allows further smoothing if the 'Filter' box is ticked in the individual sensor setup screen.

667ff85f-2176-41b2-af9b-ff0deecf8acc.jpeg
59c76cdf-5ffd-4dd8-9d68-74db29237bad.jpeg

727080df-5e2d-4bfc-a539-4f9fd1943a70.jpeg

Edited By Peter Balcombe on 02/11/2019 20:11:43

Dennis Mulhair20/03/2020 20:42:00
88 forum posts
22 photos

Hello Chris,

Just ccame across this brilliant forum when searching for telemetry. Am I too late to order 4 circuit boards please.

Dennis

Chris Bott - Moderator20/03/2020 20:51:44
avatar
Moderator
6810 forum posts
1427 photos
1 articles

Hi Dennis and welcome.

Do you mind if I have a look in the morning?

I'm fairly sure that the situation is this:-

I may have one or two of the latest version boards.

I'm sure I have plenty with the incorrect resistor numbering, these are electrically correct and work fine. They're not difficult to work out.

I'd like to check though and will send a PM here once I have.

PS - I ordered some PCBs for a different project over a month ago and there's no sign of them yet, so I think in the current climate, I'll not be placing an order for more sensor ones any time soon.

Peter Wedlake20/03/2020 21:01:50
3 forum posts

Hi Chris and Dennis

I still have seven spare PSB's of the early ones if required..

Cheers

Pete

Chris Bott - Moderator20/03/2020 21:06:25
avatar
Moderator
6810 forum posts
1427 photos
1 articles

Thanks Peter.

That could prove very useful if anyone needs one once I run out.
(Or particularly wants some with correct screen printing).

You never know, someone might pick this up as a self isolation project?

Chris Bott - Moderator20/03/2020 21:25:13
avatar
Moderator
6810 forum posts
1427 photos
1 articles
Posted by Michael Hadaway on 27/09/2019 12:49:14:

Hello. Sorry to be a bit tardy replying to your post. Due to health problems and other distractions I have put the project to one side for now.

I do have a working variometer and a voltage/current sensor using your supplied pcb give accurate cell readings but the standby current is reported to be about 130 A, with no VFAS detection.

I am using the latest sketch that has only config.h. not configbasic and configadvanced.

In config.h about line 130 there is define VFAS_SOURCE ADS_VOLT_6.

Suspect this line should be changed to VFAS_SOURCE VOLT_6

I don't like to give up so will continue when energy reserves return.

Hi Michael, I must apologise, I've only just seen your post.

I've just downloaded latest version and see it does indeed only have a config file called oXs_config.h

I'm not familiar with this version but it looks like a lot of work has gone into it to make it easier to understand configuration. The key is to read ther relevant section in oXs_configuration_description.h

It does look like you need to change that line 130 to define which voltage you wish to be used. I'd also think that the line:

// ***** 6.2 - Voltage parameters *****
#define PIN_VOLTAGE

needs the pins listing in order, to correspond to the PCB layout. Thus generating Voltage_1, Voltage_2 etc etc - in order.

However: I think your rather large curent offset is likely to be caused by the line:

#define MVOLT_AT_ZERO_AMP 2500 // in millivolt

needing correcting by measuring the sensor output voltage at zero amps and entering that value here.

Dennis Mulhair20/03/2020 21:41:27
88 forum posts
22 photos

Hi Chris, Peter,

I would like to make up 6 units and currently have 3 of the Arduino boards with the oblong reset button. I could take 3 of the older boards and 3 of the newer boards as a precaution to when I buy new processors, then I can be certain that they will fit without a problem. If that is ok.

Dennis

All Topics | Latest Posts

Please login to post a reply.

Latest Forum Posts
Support Our Partners
CML
electricwingman 2017
Slec
Sussex Model Centre
Sarik
Advertise With Us
Latest "For Sale" Ads
Has home isolation prompted you to start trad' building?
Q: The effects of Coronavirus

 Yes - for the first time
 Yes - but Ive bashed balsa before
 No - Ive existing projects on the bench
 No - Im strictly an ARTF person

Latest Reviews
Digital Back Issues

RCM&E Digital Back Issues

Contact us

Contact us

Magazine Locator

Want the latest issue of RCM&E? Use our magazine locator link to find your nearest stockist!

Find RCM&E!