RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Projects that are not for RC, but are cool and worthy of development.
mozgy
Posts: 14
Joined: Fri Jan 27, 2017 9:23 am
Country: Croatia

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by mozgy »

Heya,
jhsa wrote:Did you think that the 470k resistors might be pulldown resistors on the Attiny85 inputs?? :) I wouldn't put them there if they weren't necessary, specially not with that big value ;) But Im interested if your setup with the fets work.. If they don't it is very easy to just solder the resistors instead anyway.

João
I just did it as a pushbutton circuit, external pullup with mosfet acting as switch or button. I'd be grateful if you can point me to any better and detailed schematics how it should be done, ty.
Don't have any attiny85 atm, should have one next week so I'll testboard it. Similar circuit works with my atmel328p breakboard (no power mosfets, just LEDs).

--
Mozz

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

Re: RE: Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

mozgy wrote:]
I'd be grateful if you can point me to any better and detailed schematics how it should be done, ty.
Didn't you see the schematics on the first post? :o :)
That's the only schematics, the one I made.. i don't think that there is another project like this.. ;) At least I didn't find it :)

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
mozgy
Posts: 14
Joined: Fri Jan 27, 2017 9:23 am
Country: Croatia

Re: RE: Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by mozgy »

Heya,
jhsa wrote:
mozgy wrote:]
I'd be grateful if you can point me to any better and detailed schematics how it should be done, ty.
Didn't you see the schematics on the first post? :o :)
That's the only schematics, the one I made.. i don't think that there is another project like this.. ;) At least I didn't find it :)

João
I do apologize for not being precise, yes, I did see that schematics of yours, in fact mine is based on yours. What I meant is practice how should attiny pins be connected when acting as input (pulldown, pullup, pullleft ;) ). As I understood from previous arduino (atmel328p) experiments it can be both ways, I just used to build it as a pullup resistor.
If I'm wrong in that assumption please do say so !

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

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

Sometimes there are pullup resistors and sometime pulldown. I don't really remember what was the reason for that 470k resistor. I didn't write the code. Just adapted it. I can't code. :) I think someone in the arduino forum did it. Will have to look when I get to the PC. But I do believe that resistor is needed.. That is NOT a voltage divider as you suggested before :) Well, It might look like one, but the value of the resistor to ground is so high that practically all the input signal voltage passes to the ATtiny85 input pin.
My suggestion is try it your way. If it doesn't work for you then change it. The way I posted, it works.
Normally I test everything on a breadboard before I make PCBs to avoid wasting material and money if things don't work. That is the beauty of this. You can test before you build :) I am right now testing something else on the breadboard.

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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

I will be looking at making this even smaller so it can be installed inside a 9XR-PRO. Probably using double sided PCB.

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

mcmatrix
Posts: 8
Joined: Fri Feb 19, 2016 4:11 pm
Country: -

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by mcmatrix »

I'd like to build similar circuit using veroboard and dip components.
I was wondering if this circuit switching part (trans+irf) can be made simpler.
For example just using one npn transistor 2N2222A (ofcoz the circuit has to be simplified and redesigned a little).
Does anybody know what is the power consumption of multiprotocol 4-in-1 module (200ma-300ma)?
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

You can use an N Channel Mosfet. it doesn't need the transistor then, just connect it to the Attiny via the resistor.
Something like this.

The mosfet in this case has a few advantages over the transistor. For example, less resistance when ON, and therefore less dissipated heat so it can handle more load easily. It is also faster turning On and OFF.

João

EDIT: Updated the picture, forgot the resistor to ground
Attachments
RF Module Power Switch_N-Channel Mosfet.jpg
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
mcmatrix
Posts: 8
Joined: Fri Feb 19, 2016 4:11 pm
Country: -

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by mcmatrix »

jhsa wrote: Fri May 12, 2017 10:20 am You can use an N Channel Mosfet. it doesn't need the transistor then, just connect it to the Attiny via the resistor.
Something like this.

The mosfet in this case has a few advantages over the transistor. For example, less resistance when ON, and therefore less dissipated heat so it can handle more load easily. It is also faster turning On and OFF.

João

EDIT: Updated the picture, forgot the resistor to ground
Thank you.
Does IRF520N fit? At 5 V it delivers 3 Amps from its max of 9. Or logic level IRL540.
I have these locally available.
Maybe you can recommend something better in smaller form?
mcmatrix
Posts: 8
Joined: Fri Feb 19, 2016 4:11 pm
Country: -

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by mcmatrix »

Made it just for internal module. Ext module can be removed physically.
ppm_switch_module.jpg
ppm_switch_module_back.jpg
GND is controlled by the mosfet.
I havent tested yet, hopefully it will work.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

Be careful that the regulator's maximum input voltage seems to be 11.8V, so you CANNOT use a 3 cell battery to power the radio. Actually it is also not recommended for the Ar9x board, so either use a 2 cell LiPo, or 6 NiMh cells. I use the latter..

That Mosfet should be ok as your regulator is a 5V one.according to the datasheet it seems to start turning ON with a Gate - Source voltage of 4.5V
If your regulator was a 3.3V volt one, that same mosfet would not be suitable.

I used a 3.3V regulator on mine as a discharged 6 cell NiMh battery (at 1.1V per cell) has a total voltage of 6.6V, that means that for a 5V regulator, the regulator's dropout voltage should be less than 6.6 - 5 = 1.6V. That is a bit tight even for an AMS1117 regulator. So i went for a 3.3V one.
You seem to be using a switched type regulator that is also a step up device?? If so, the dropout voltage is not a problem..

Have you already programmed the ATtiny chip and tried it??

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
mcmatrix
Posts: 8
Joined: Fri Feb 19, 2016 4:11 pm
Country: -

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by mcmatrix »

I'm using Turnigy 1500mAH LiFe 3S 9.9v Transmitter Pack. Nominal voltage 9.9v, fully charged 10.x something, so it should be in safe range. The regulator is a small step-up/step-down converter S7V7F5. It has very nice wide input voltage range.
I havent yet programmed the chip but I'll post the results soon. I also try check the source code, i'm better in programming than in hardware :)
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

The code is working well, never had a problem. Not a single glitch :)

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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

I have just noticed that you put an 100K resistor on pin 2 instead of the 470K indicated on the schematic. Like that it might not work.
You also seem to have not soldered a 100K resistor from the mosfet's gate to ground. That could prevent the mosfet from turning OFF..

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
mcmatrix
Posts: 8
Joined: Fri Feb 19, 2016 4:11 pm
Country: -

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by mcmatrix »

The mosfet pulldown is there.
IMG_0955.JPG
You're right, i didnt had 470k so i replaced it with 100k :)
But if the correct value is important then i'll find tomorrow 470kohm and replace it.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

Yes it is important, I remember experimenting with different values, and if I remember well Mike suggested that I should increase the value to 470K, and it worked..

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
mcmatrix
Posts: 8
Joined: Fri Feb 19, 2016 4:11 pm
Country: -

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by mcmatrix »

OK, the resistor is replaced and I also installed recommended (when Vin more than 9V)
electrolytic capacitor between GND and BAT+ near to regulator pins.

Made new software version using pin change interrupts. The software is currently untested (don't use it with real flying models).
RF_Module_Power_Switch_Attiny85_Code_ver2.ino
Last edited by mcmatrix on Mon May 15, 2017 4:45 pm, edited 1 time in total.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

May I ask what is the problem with the original code? :)

João

Sent from my thor using Tapatalk


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
mcmatrix
Posts: 8
Joined: Fri Feb 19, 2016 4:11 pm
Country: -

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by mcmatrix »

jhsa wrote: Mon May 15, 2017 4:26 pm May I ask what is the problem with the original code? :)

João

Sent from my thor using Tapatalk
Probably nothing :)
I just liked the Mike's idea to use pin change interrupt.
Currently i'm not even sure that pcint version is correctly working.
Need to test it a lot before I dare to use it with real flying models.
Atleast i know that first version is rock solid. Thanks.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

Yeah, I have been using it (with models) for over a year.. :)
And I'm preparing a big(ger) model with IC engine that will be flown with my ar9x radio. The Ar9x has proven to be very reliable as well as this power switch, as far as my testing s concerned. I use the radio every day :)

João

Sent from my thor using Tapatalk


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
mcmatrix
Posts: 8
Joined: Fri Feb 19, 2016 4:11 pm
Country: -

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by mcmatrix »

Last version of single internal rf module switch.
rf_int_module_switch.jpg
Currently using attiny25, maybe attiny85 is better (more ram).
Code itself will fit both.

The initial bugs of RF_Module_Power_Switch_Attiny85_Code_ver2.ino software also fixed.
Atleast in a test bench everything was working.
Now I'll try to install internal module with this switch into transmitter.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

Nice.. :)

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
michel49
Posts: 192
Joined: Sun Oct 07, 2012 10:59 am
Country: -

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by michel49 »

Joao

please let me know if you have a file to send a PCB maker in China

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

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

Hmm, I make my own PCBs, so i don't know if my files are good to send to a fab house.. will check..
Need some time though :)
Might be able to use the same mosfets used on the ar9x board. They are powerful enough and smaller than the ones I've used..

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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

Before you decide to build this one, please follow the other thread and see if you like Mike's circuit. He said he will look into it when he has some time. :) If it works, it won't need any programming, and it will use less components :)

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
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by MikeB »

OK, just tested the circuit here: https://openrcforums.com/forum/viewtopi ... th#p139563 using a SKY board, external module connection and a DJT module.
All worked OK. I tested with PPM (both polarities), XJT (PXX), DSM and MULTI. The power to the module stayed stable.

I used 0.2uF as the capacitor, 1uF was slightly better when using PPM, POS polarity, which is the worst case. Changing R6 (10K) to a lower value (say 4K7) would also improve things as it would increase the charging current of the capacitor. I didn't try this as I used the small board with surface mount devices on it I have.

The SI2301 MOSFET I'm using is rated for a 2.5V gate-source voltage, 20V supply voltage and 1.9A load. Any other MOSFET you use should also meet (or exceed) these values.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

Nice Mike, did you also test while flashing a Multi Module? I think the timing is critical in this situation?

So, a 470nF cap could also be used, or is it the 1uF much better? I believe that with bigger cap it will take longer to turn OFF, right? This is desirable then..
Will check the AO3407 Mosfet. The gate-source Threshold voltage doesn't have to be as low as 2.5V, correct? Could it be a voltage lower than the lowest battery voltage?

Thanks

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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

Hi Mike, let me see if I understand how this works. ;)
When the transistor is ON, pulls the MOSFET's gate more negative than the source, turning it ON, the capacitor charges through R6.
When the transistor is OFF, the capacitor starts discharging through R5 (100K), still holding the Mosfet's Gate more negative than the source, keeping it ON until it is discharged and R5 starts bringing the gate to Source potential, turning it OFF.

Did I get it right, or not really?? :) :mrgreen:

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
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by MikeB »

Your description of how it works is correct.
The critical timing is how long it takes to discharge the capacitor to below the gates threshold voltage. The lower the gate threshold voltage the better for keeping the MOSFET on for a long time. Also, therefore, a larger value capacitor keeps it on for longer.
PPM is the worst case as the transistor is only on for 300uS, then off for 1-2mS, and off for a much longer time during the sync.pulse, 10mS or more is possible. This means the capacitor doesn't have long to charge, which is where a lower value for R6 is good, and does discharge for a relatively long time. During this discharge time, you need to be sure the gate voltage is kept high enough. Increasing R5 (100K) will also help, perhaps to as much as 220K.
I might try R6 = 4K7, R5=220K and a capacitor of 0.5 to 1uF when I build another circuit, although 0.2uF with those new value resistors should be OK.

I didn't test flashing a multi module, but that should work OK as the PPM/PXX/Serial signal is serial and idles high, so keeping the power turned on. The "invert serial" option is only used on serial data from the module to the Tx.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

MikeB wrote: Wed Nov 14, 2018 10:57 pm
The critical timing is how long it takes to discharge the capacitor to below the gates threshold voltage. The lower the gate threshold voltage the better for keeping the MOSFET on for a long time.
Also, therefore, a larger value capacitor keeps it on for longer.
In other words, we will have to adjust the capacitor value for the MOSFET we use..

PPM is the worst case as the transistor is only on for 300uS, then off for 1-2mS, and off for a much longer time during the sync.pulse, 10mS or more is possible. This means the capacitor doesn't have long to charge, which is where a lower value for R6 is good, and does discharge for a relatively long time. During this discharge time, you need to be sure the gate voltage is kept high enough. Increasing R5 (100K) will also help, perhaps to as much as 220K.
I might try R6 = 4K7, R5=220K and a capacitor of 0.5 to 1uF when I build another circuit, although 0.2uF with those new value resistors should be OK.
The time the circuit turns OFF is only critical if it is too short. Longer times are no problem at all. For example, If the circuit takes 2 or 3 seconds to turn OFF is ok. The important is that it stays ON while there is signal on the PPM/serial Pin

Will try to breadboard this as soon as possible. I am just finishing something else and will try this after :)

Thank you..
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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RF Module Soft Power Switch for AR9x, Skyboard, 9XR-PRO

Post by jhsa »

Mike, I have just had a look at the SI2301 datasheet, It looks like the Maximum Vgs is only +-8V.
Isn't that a bit too low, specially if you decrease the value of R6??
We are dealing with battery voltage here, not the 3 or 5V that power the Bluetooth..

João
Attachments
SI2301.pdf
(61.89 KiB) Downloaded 411 times
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

Post Reply

Return to “Other Electronic Projects”