Analog input for X8R
- MikeB
- 9x Developer
- Posts: 18002
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Analog input for X8R
Reason for project.
FrSky have chosen not to put any analog input ports on the X8R receiver. Many users would find one such input very useful.
Implementation:
Use a small Arduino to read an analog signal and send this to the X8R using the SPort protocol.
I used a Mini Lite, but the Pro Mini is the basically the same device.
Connections:
SPort +V ---> Arduino +9V
SPort -V ---> Arduino 0V
SPort signal <--- Arduino I/O 4
Arduino 0V <--- Analog ground
Arduino A3 <--- Analog input 0-3.3V (tolerates 4.5V)
Here is my first code effort.
Unzip the files as an Arduino sketch and download to the Arduino Mini.
Mike.
FrSky have chosen not to put any analog input ports on the X8R receiver. Many users would find one such input very useful.
Implementation:
Use a small Arduino to read an analog signal and send this to the X8R using the SPort protocol.
I used a Mini Lite, but the Pro Mini is the basically the same device.
Connections:
SPort +V ---> Arduino +9V
SPort -V ---> Arduino 0V
SPort signal <--- Arduino I/O 4
Arduino 0V <--- Analog ground
Arduino A3 <--- Analog input 0-3.3V (tolerates 4.5V)
Here is my first code effort.
Unzip the files as an Arduino sketch and download to the Arduino Mini.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- Rob Thomson
- Site Admin
- Posts: 4543
- Joined: Tue Dec 27, 2011 11:34 am
- Country: United Kingdom
- Location: Albury, Guildford
- Contact:
Re: Analog input for X8R
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
- ShowMaster
- Posts: 4327
- Joined: Thu Dec 29, 2011 3:44 am
- Country: -
- Location: Los Angeles, CA USA
Re: Analog input for X8R
Pro mini's on order now.
Re: Analog input for X8R
Cool
Just one thing, why create an independent codebase instead of simply integrating it in the openxsensor? Then there's only one page, codebase, set of instructions etc to maintain for one thing that does it all...
Especially as the hardware is the same, and that it's only a couple of lines to add to measure an additional analog input and put the value out
Just one thing, why create an independent codebase instead of simply integrating it in the openxsensor? Then there's only one page, codebase, set of instructions etc to maintain for one thing that does it all...
Especially as the hardware is the same, and that it's only a couple of lines to add to measure an additional analog input and put the value out
- Rob Thomson
- Site Admin
- Posts: 4543
- Joined: Tue Dec 27, 2011 11:34 am
- Country: United Kingdom
- Location: Albury, Guildford
- Contact:
Re: Analog input for X8R
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
Re: Analog input for X8R
the oXs already measures voltage.. My question is, will we have a define for choosing what system the sensor will be running with? "D" or "X" series? Better a difine to choose between the two or the complete thing will be a mess
Or maybe making 2 codes.. D series and X series. then we just flash the one we are using.. less confusion and more space in the arduino.
Just my two bottles of whiskey..
João
Or maybe making 2 codes.. D series and X series. then we just flash the one we are using.. less confusion and more space in the arduino.
Just my two bottles of whiskey..
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
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
Re: Analog input for X8R
or none at alljhsa wrote:My question is, will we have a define for choosing what system the sensor will be running with? "D" or "X" series?
as I use it without frsky receivers
Reinhard
- MikeB
- 9x Developer
- Posts: 18002
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Analog input for X8R
I thought I'd keep things simple for those that just want the analog input. They don't need the pressure sensor and this, I think, makes it easy to just have the analog input.Kilrah wrote:Just one thing, why create an independent codebase instead of simply integrating it in the openxsensor? Then there's only one page, codebase, set of instructions etc to maintain for one thing that does it all...
I was also thinking it might be useable on a smaller processor, although with the low cost of some Arduino mini clones it probably isn't worth the effort.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Analog input for X8R
you mean an attiny?? If possible it would make it smaller in my opinion..
João
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
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
- MikeB
- 9x Developer
- Posts: 18002
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Analog input for X8R
Yes. With the code as it is, you would need an external crystal (or resonator). I could look into using the internal oscillator, but I would then need to measure the incoming baud rate to get the outgoing baudrate correct. If I got that working then the whole thing might just need to be the processor, no external compomemts at all.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Analog input for X8R
Exactly.. A bit of strip board with the same size as the attiny to avoid shorts and give some solder points. a bit of shrink tube and done. very small A1/2 ports for the X8R
João
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
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
- MikeB
- 9x Developer
- Posts: 18002
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Analog input for X8R
As a result of some other testing of the SPort in general, I will need to be changing the SPort driver code.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- ShowMaster
- Posts: 4327
- Joined: Thu Dec 29, 2011 3:44 am
- Country: -
- Location: Los Angeles, CA USA
Re: Analog input for X8R
FTDI cable?
I'm ordering many of the Arduino components mentioned as well as the sensor for the OpenXsensor. I thought I'd do my best to learn about all this. So do I own anything Frsky that's FTDI cable? A search says USB to rs232 but some mention to TTL maybe?
I have USB to castle creation programing adapter cables. Also the Frsky USB to rs232 cable. I also have a Arduino UNO. Also USBasp
Will any of these work? If not I need a link to one.
Thanks
I'm ordering many of the Arduino components mentioned as well as the sensor for the OpenXsensor. I thought I'd do my best to learn about all this. So do I own anything Frsky that's FTDI cable? A search says USB to rs232 but some mention to TTL maybe?
I have USB to castle creation programing adapter cables. Also the Frsky USB to rs232 cable. I also have a Arduino UNO. Also USBasp
Will any of these work? If not I need a link to one.
Thanks
Re: Analog input for X8R
I'd love to make some of these with a bare ATtiny or a little stripboard. Using an external resonator will work for me. Will the code work at 16Mhz? I was thinking I might order up some chips and resonators to try out.
I was going to try this exact thing myself, but FrSky hasn't gotten back to me for a while about specs/NDA.
I was going to try this exact thing myself, but FrSky hasn't gotten back to me for a while about specs/NDA.
- MikeB
- 9x Developer
- Posts: 18002
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Analog input for X8R
The code is for 16MHz. I think you will need a minimum of 4K flash to fit the code in.
It should work on an ATtiny, you only need one analog input and one digital I/O.
Mike.
It should work on an ATtiny, you only need one analog input and one digital I/O.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Analog input for X8R
Is it really impossible to re-route the existing analogue port or just hellish difficult??
This does seem to be a sledgehammer to crack a nut
This does seem to be a sledgehammer to crack a nut
Re: Analog input for X8R
From what I have read, to get to the existing A1, you have to separate 2 boards inside the receiver box as the only place you could get to it is between them. And then it's probably some fine pitch solder work, which I can handle, but it's a lot easier to just solder a chip, resonator and 4 wires up. Oh, and 2 resistors.Clivew wrote:Is it really impossible to re-route the existing analogue port or just hellish difficult??
This does seem to be a sledgehammer to crack a nut
Re: Analog input for X8R
It just seems overly complicated to me, adding yet another module and connectors.
I would love to see some closeup photos of the board(s).
I was always told "simplificate, and add more lightness"
I would love to see some closeup photos of the board(s).
I was always told "simplificate, and add more lightness"
Re: Analog input for X8R
I think, in this case, the easiest way is really to use the attiny :p
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
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
- MikeB
- 9x Developer
- Posts: 18002
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Analog input for X8R
Preserves your Rx warranty, keeps the existing internal analog data and gives me a chance to program the SPort driver!
Also, we can probably include some other inputs of some sort if not using the openXsensor.
Mike.
Also, we can probably include some other inputs of some sort if not using the openXsensor.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Analog input for X8R
I want to do it the hard way (after someone else did it of course!)
Re: Analog input for X8R
Aha, in that case I'm with you all the wayMikeB wrote:Preserves your Rx warranty, keeps the existing internal analog data and gives me a chance to program the SPort driver!
Also, we can probably include some other inputs of some sort if not using the openXsensor.
Mike.
(I would still be interested to see what is involved for a simple model solution without extra
modules/cables though!)
Clive
Last edited by Clivew on Thu Oct 17, 2013 12:10 am, edited 1 time in total.
Re: Analog input for X8R
Dismantling a receiver completely? no, not me mrgreen:
João
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
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
- MikeB
- 9x Developer
- Posts: 18002
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Analog input for X8R
Clivew: Have you read this thread from here?
http://openrcforums.com/forum/viewtopic ... X8R#p59640
Mike.
http://openrcforums.com/forum/viewtopic ... X8R#p59640
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Analog input for X8R
Thanks Mike, missed that one completely!
- MikeB
- 9x Developer
- Posts: 18002
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Analog input for X8R
I'm looking into implementing this on an attiny13 (8-pin device). I've converted the code to a 'proper' makefile project. Arduino adds too much coe not required, and the attiny13 only has 1K of flash. It also doesn't have a bootloader.
The program is currently around 520 bytes, so I have some spare flash. I've still to actually test it!
You have to use the internal oscillator, but I intend to add code to detect the actual bit rate from the SPort receive data and adjust the timing to match.
My intention is to use a 3.3V regulator to power the attiny, and this will also therefore act as the reference voltage for the A2D.
So I'm looking at, a 3.3V regulator, 2 small caps and the attiny13.
Mike.
The program is currently around 520 bytes, so I have some spare flash. I've still to actually test it!
You have to use the internal oscillator, but I intend to add code to detect the actual bit rate from the SPort receive data and adjust the timing to match.
My intention is to use a 3.3V regulator to power the attiny, and this will also therefore act as the reference voltage for the A2D.
So I'm looking at, a 3.3V regulator, 2 small caps and the attiny13.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
Re: Analog input for X8R
5V would give you better resolution? Or you are using 3.3V to keep things compatible with the frsky sensors?
I use the 5V on the openXsensor. the sensor just takes 2 resistors.. I can see an advantage on the 3.3V though. You just get power from the 5V BEC and it will be regulated to 3.3V while at 5 you would have to power it from batt voltage, as the voltage from the receiver/BEC might fluctuate a bit with the load from the servos.. Or is my thinking wrong?
João
I use the 5V on the openXsensor. the sensor just takes 2 resistors.. I can see an advantage on the 3.3V though. You just get power from the 5V BEC and it will be regulated to 3.3V while at 5 you would have to power it from batt voltage, as the voltage from the receiver/BEC might fluctuate a bit with the load from the servos.. Or is my thinking wrong?
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
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
- ShowMaster
- Posts: 4327
- Joined: Thu Dec 29, 2011 3:44 am
- Country: -
- Location: Los Angeles, CA USA
Re: Analog input for X8R
FYI
X8R photo
The top board covers the A1 resistor area and probably needs to be removed.
As for rec warranty,
I'm not sure the $ to replace the rec if I need the feature is worth worrying about. No reason to think the rec will fail under the warranty time.
If only Frsky would not be so secret about their plans and release dates now that they have a following. If HK gets their new 9XR to market this year at an attractive price and can fold it may shift the $. As good as the Taranis is, it's main selling feature is what it does for the price. Lower the price with the same features and suddenly the sales shift to that product. Many just want a programmable/flashable tx that talks and displays telemetry at the lowest price. That could be the new 9XR.
Let's go Frsky, get your release dates in print.
In the meantime Mike, keep the good ideas gong. We all want to use our x8r with the same features the D rec have. It is so easy to use the A1 and A2 ports in the D receiver.
X8R photo
The top board covers the A1 resistor area and probably needs to be removed.
As for rec warranty,
I'm not sure the $ to replace the rec if I need the feature is worth worrying about. No reason to think the rec will fail under the warranty time.
If only Frsky would not be so secret about their plans and release dates now that they have a following. If HK gets their new 9XR to market this year at an attractive price and can fold it may shift the $. As good as the Taranis is, it's main selling feature is what it does for the price. Lower the price with the same features and suddenly the sales shift to that product. Many just want a programmable/flashable tx that talks and displays telemetry at the lowest price. That could be the new 9XR.
Let's go Frsky, get your release dates in print.
In the meantime Mike, keep the good ideas gong. We all want to use our x8r with the same features the D rec have. It is so easy to use the A1 and A2 ports in the D receiver.
- MikeB
- 9x Developer
- Posts: 18002
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Analog input for X8R
We are replaceing an A2D that provides 8 bit resolution at 3.3V reference, so this is providing the same. Also, unlike the mega328 on the openX sensor, the attiny13 does not have the 1.1V bandgap reference to correct for changes in supply voltage.
A 3.3V regulator also handles powering from a 4/5 cell NiMh receiver battery.
Mike.
A 3.3V regulator also handles powering from a 4/5 cell NiMh receiver battery.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- ShowMaster
- Posts: 4327
- Joined: Thu Dec 29, 2011 3:44 am
- Country: -
- Location: Los Angeles, CA USA
Re: Analog input for X8R
I'm in!