Page 2 of 3

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

Posted: Fri Jan 27, 2017 6:12 pm
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

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

Posted: Fri Jan 27, 2017 6:25 pm
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

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

Posted: Fri Jan 27, 2017 7:31 pm
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

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

Posted: Fri Jan 27, 2017 9:06 pm
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

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

Posted: Thu Mar 02, 2017 11:34 am
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

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

Posted: Fri May 12, 2017 9:22 am
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)?

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

Posted: Fri May 12, 2017 10:20 am
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

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

Posted: Fri May 12, 2017 10:41 am
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?

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

Posted: Sun May 14, 2017 1:22 pm
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.

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

Posted: Sun May 14, 2017 4:05 pm
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

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

Posted: Sun May 14, 2017 7:38 pm
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 :)

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

Posted: Sun May 14, 2017 7:45 pm
by jhsa
The code is working well, never had a problem. Not a single glitch :)

João

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

Posted: Sun May 14, 2017 7:54 pm
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

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

Posted: Sun May 14, 2017 8:13 pm
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.

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

Posted: Sun May 14, 2017 8:18 pm
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

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

Posted: Mon May 15, 2017 4:04 pm
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

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

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

João

Sent from my thor using Tapatalk



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

Posted: Mon May 15, 2017 4:38 pm
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.

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

Posted: Mon May 15, 2017 5:36 pm
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



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

Posted: Tue May 16, 2017 11:11 am
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.

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

Posted: Tue May 16, 2017 12:22 pm
by jhsa
Nice.. :)

João

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

Posted: Wed Nov 14, 2018 4:26 pm
by michel49
Joao

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

MP

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

Posted: Wed Nov 14, 2018 5:09 pm
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

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

Posted: Wed Nov 14, 2018 5:18 pm
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

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

Posted: Wed Nov 14, 2018 5:46 pm
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

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

Posted: Wed Nov 14, 2018 7:10 pm
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

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

Posted: Wed Nov 14, 2018 7:22 pm
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

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

Posted: Wed Nov 14, 2018 10:57 pm
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

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

Posted: Wed Nov 14, 2018 11:52 pm
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

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

Posted: Thu Nov 15, 2018 12:05 am
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