martins single channel Tx

Button pushers
Post Reply
chlluk
Posts: 87
Joined: 19 Feb 2018, 15:38

martins single channel Tx

Post by chlluk »

Hi
I would like to take a shot at building Martins single channel tx. I do however feel its a task thats beyond me.
There are a lot of files regarding the subject. Some are corrupted and will not open. Others are updates with code changes and changes to connections.
I would like to get an up to date and complete set of documents that would give me a chance to complete the project.
Clive
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: martins single channel Tx

Post by Martin »

Do you already have the display module you intend to use?

Most use the 16x2 LCD module, but you can connect it to the Arduino with either 12 wires (including power and backlight) or via an I2C interface, which then uses just two power wires plus two signal wires.

There are also options for the control inputs - not the main 'single channel button' but the auxiliary controls that allow you to navigate the menus and (possibly) also control the plane. There is the analogue joystick version, the 'five button' version, or the rotary encoder version.

It's also possible to add a 'buddy box' connector, and if you use a D8 FrSky RF module, monitor the telemetry from the model.

To keep it as simple as possible, I'd recommend the 16x2 LCD without the I2C interface, ignore the telemetry, even if you are using a FrSky D8 module, and use a rotary encoder for the auxiliary control.

I've attached a schematic. It shows 'Joystick module' but the connections are the same if you use a rotary encoder.

If you have a display with a backlight, and connect up the backlight, you just connect it to VCC and GND, with a current limiting resistor in the VCC line. - about 220 ohms is a good starting value. Some LCD modules have a current-limiting resistor built in - and some don't have a backlight, or work fine (in daylight) with the backlight not connected - which will give increased battery life.

Some display modules have a 'contrast adjust' trim pot built onto the board - in which case there's no need to wire the external one.

diagram.jpg
rotary-encoder.jpg
chlluk
Posts: 87
Joined: 19 Feb 2018, 15:38

Re: martins single channel Tx

Post by chlluk »

Hi martin
Have now fitted rotary encoder. Menus work fine,am able to set battery voltage. Im using 6.8 just to test. However first line of menu says low voltage 0.00v and is still running constantly.
Clive
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: martins single channel Tx

Post by Martin »

I think it's because the battery scaling hasn't been set. It's normally stored in the EEPROM (at location 13) as part of the 'reset / calibrate' function that you don't need to do for the rotary encoder version.

Probably easiest to modify the sketch to set the correct battery scaling value immediately after the (wrong) value has been read from the EEPROM

1. Find the line eeprom::getGD(); in the main singleChannelTx.ino file: it's at the 149th line of the file - you can just do a search (Ctrl-F) for getGD
2. Add the line below, immediately below that line:

Code: Select all

	eeprom::gd.batteryScale = 160;
Another way to do it, is to run the tiny sketch below just once, which will write the correct value to the eeprom, and then go back to the actual sketch. The sketch below doesn't alter any of the model memories - it only changes the battery voltage scaling value.

Code: Select all

#include <EEPROM.h>
void setup (void) {
// store default battery scaling value (160) at location 13 in eeprom
	EEPROM.write(13, 160);
}

void loop (void) {
}
Explanation of where the 160 value comes from:

See the two resistors in the schematic - the 10K and 22K, linking the battery voltage (after the switch) to A2 and GND.
The idea is to scale the incoming battery voltage (which is likely above the 5V limit you can wire to an Arduino pin) down to less than 5V.

With the 10K / 22K combo as shown, the Arduino sees the battery voltage scaled by 10 / (22 + 10) on pin A2 - so it can measure battery voltages up to 16V. At 16V the A/D would read 1024 (though it actually only goes up to 1023). The sketch turns the A/D value into a (float) voltage by the calculation:

batteryVolts = (float)eeprom::gd.batteryScale * analogRead(A2) / 10240;

and 160 * 1024 / 10240 = 16 volts.
chlluk
Posts: 87
Joined: 19 Feb 2018, 15:38

Re: martins single channel Tx

Post by chlluk »

Hi Martin
Have come back to this project after being involved in something else. I have added the necersary code that you suggested. However still no joy.
Have put project in box to be completed after my demise by someone else.
My final setup was as follows.
Board DiyMore pro mini strong with power correction as per all other Phil green projects in order to get neat output power and data line on one 3 pin plug.
PPM output changed to digital 0(RXD).
I2c display connected as described.
digital encoder fitted as described.
A2 jumped to Vcc to give input voltage.
On power up with changes to script , display illuminates , various characters appear and then crashes.
Zero activety on Rf module
Clive
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: martins single channel Tx

Post by Martin »

Sorry to hear that, Clive.

If you can get the bits to me, and back, I'm happy to diagnose what's wrong and get it working for you. How practical and/or costly that might be will depend on where you live. I live in Studley, Warwickshire (close to Redditch and Stratford-upon-Avon).

PM me if you want to try that.
Last edited by Martin on 05 Feb 2023, 08:01, edited 1 time in total.
bluejets
Posts: 316
Joined: 19 Jun 2019, 04:09

Re: martins single channel Tx

Post by bluejets »

Is there a link to the original?
Did a search and came up with modification posts but cannot find the original.
User avatar
Mike_K
Posts: 669
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

Re: martins single channel Tx

Post by Mike_K »

Try this link

viewtopic.php?p=417
Post Reply