Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:09 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : RC switch DPST

Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 08:23am 02 Nov 2018
Copy link to clipboard 
Print this post

Flying RC airplanes is one of my hobbies. Electronics in RC airplanes is generally bought, since homebrew is far more expensive. But sometimes something pops up that makes it worth designing something yourself.

This forum is the heart of the micromite world, so this article might be a bit out of place here, but I wanted to share it anyway.



For my model aircraft I needed a remote controlled switch for aircraft lighting, and other functions.
The aircraft lights consist of 12V LED strips.
This switch allows 2 groups of LED's to be controlled independent.
The switch uses an 08M2 to convert the PWM RC input signal and drive the power switches.

There are 2 jumpers in the circuit, that allow programming the switch detection levels (PWM level that turns on the particular switch).

Installation:
connect the circuit to the receiver channel (i.e. the GEAR switch)
put JP1 on (if there is a LED strip attached, it will light up if 12V is connected)
Turn on the receiver and transmitter in the required setting for this function.
The 08M2 will (after 1 second) start measuring the PWM , and store it in internal memory.

Repeat this for JP2 (remove JP1).
Remove both JP1 and JP2. The circuit is ready for use.

Attached are photo's of the prototype, and the circuit diagram.






The code is pretty simple (otherwise I could not write it...).


' ------------------------------------- RC switch -------------------------------------

' Uses 1-2mSec RC PWM signal to trigger 2 power FET's to control auxilliary functions
' in an RC car, boat or airplane. Uses PICAXE 08M2

' OUTL and OUTR have pull down resistors (no accidental firing) and drive N channel
' power FET's. These can be controlled individually from the RC transmitter, for lighting,
' dropoff of sweets, or for launching rockets (fireworks).

' the software has 2 modes
'
' learning mode -----------------------------------------------------------------------------
' at powerup OUTL and OUTR serve as configuration pins. When one of these pins is
' connected to Vcc, then the software reads the PWM value from the RC receiver and
' stores it in EEprom. From now on it will use this value as a trigger for this switch channel.
' method: set controls at RC transmitter in correct setting for channel L. Set OUTL high (jumper).
' Now Power on RC receiver and RC switch. Wait 2 seconds (to learn PWM). switch off receiver
' and RC switch. Repeat procedure for channel R.
' please be aware that during learning mode the power FET's will be ON.

' operating mode ---------------------------------------------------------------------------
' in this mode the RC switch listens to the PWM signal from the RC receiver.
' When it receives a PWM that is withing +/- 20uSec in pulse width identical to the stored
' value in EEprom, it switches ON the associated power FET (and switches off the other one).
' in all other PWM values both FET's are off.

' PICAXE08M2
' +----_----+
' +5V +1 8+ GND
' NC +2 7+ NC
' NC +3 6+ 1 OUTL
' PWM 3 +4 5+ 2 OUTR
' +---------+

' version control
' 0.1 pwmin, detect at fixed levels
' 0.2 jumpers on out1 and out2 used to program values in eeprom. no jumper = run
' potmeter is not being used anymore, but jumpers
' 0.3 jumpers inverted to prevent accidental firing during initialization with pull ups.
' lost 2 rockets because of this flaw....

Init:
'set outputs OUTL and OUTR to INPUT mode to check if learning mode is required
input 1
input 2

CheckMode:
'check if we need to calibrate, or execute
'the outputs are at this moment still inputs and pulled low (pulldown)
'unless config jumper to Vcc is placed

pause 250 ' time to settle inputs this pause also
' minimizes EEprom writes by slowing
' the read PWM - write EEprom loop.
if pin1=1 then CalPinL ' OUTL is Vcc
if pin2=1 then CalPinR ' OUTR is Vcc

pause 250
low 1 ' both FET's off
low 2
goto RunMode

CalPinL:
pulsin C.3,1,w1 ' get pwm input for L
write 1,b2 ' store value for L in mem 1 (b2 is low byte of w1)
goto CheckMode

CalPinR:
pulsin C.3,1,w1 ' get pwm input for R
write 2,b2 ' store value for R in mem 2 (b2 is low byte of w1)
goto CheckMode

RunMode:
pulsin C.3,1,w1 ' get pwm input
w1 = w1 + 2 ' prepare for jitter window +2 / -2
b4 = 0

read 1, b1 ' compare pwm to value for L with threshold +/- 2
b1 = w1 - b1
if b1 < 4 then
high 1 ' on L
low 2 ' off R
b4 = 1 ' note we fire
end if

read 2, b1 ' compare pwm to value for R with threshold +/- 2
b1 = w1 - b1
if b1 < 4 then
high 2 ' on R
low 1 ' off L
b4 = 1 ' note we fire
end if

if b4 = 0 then ' check if no fire trigger
low 1 ' off L
low 2 ' off R
end if

pause 100 ' here we skip up to 5 PWM cycles, but not critical
' for the application
goto RunMode





The power FET's can switch significant current, more than needed for LED strips, to also cover other applications. One of such applications is the annual festival at our airport on new years day, where we have fireworks....launched from an RC controlled airplane.






For those who like to know the igniters, they are from china, 50 pieces for USD 5.




Happy flying.....

Edited by Volhout 2018-11-03
PicomiteVGA PETSCII ROBOTS
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 12:31pm 02 Nov 2018
Copy link to clipboard 
Print this post

Nice project, and thanks for sharing. Good documentation and clear code.

My only question would be about the use of the IRF744 Mosfets. In the datasheet, the "Typical Transfer Characteristics" chart shows about 5 amps at 5V VGS, Gate-to-Source Voltage (V) (which may be more than adequate for your purposes).

A "logic-level" mosfet like the IRLZ44N will allow much more current for 5V VGS.

RDS-On for the IRF744 is .63 Ohms (at 10V VGS); for the IRLZ44N, .025 Ohms at 5V, 25A. (Other mosfets will have even better characteristics for critical circumstances.)

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Boppa
Guru

Joined: 08/11/2016
Location: Australia
Posts: 814
Posted: 12:43pm 02 Nov 2018
Copy link to clipboard 
Print this post

LOL- an 'armed drone'!
Be good in those places where people like shooting at drones- now the drones can shoot back....
(yeah I know its an RC plane not a drone, but hey would be fun to do)

Havent actually flown one since I was a kid, and back then the price of a RC one was more than my budget would allow, so I just had the tethered one on a string controlled
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 11:00pm 02 Nov 2018
Copy link to clipboard 
Print this post

Can you link us to where you got the igniters from?
Smoke makes things work. When the smoke gets out, it stops!
 
Bill.b

Senior Member

Joined: 25/06/2011
Location: Australia
Posts: 235
Posted: 03:15am 03 Nov 2018
Copy link to clipboard 
Print this post

Hi all

The new Xiaomi FIMI A3 Drone comes with sockets for Servos, lights and firework igniter






https://www.banggood.com/Xiaomi-FIMI-A3-5_8G-1KM-FPV-With-2-axis-Gimbal-1080P-Camera-25mins-Flight-Time-GPS-RC-Drone-Qua dcopter-RTF-p-1368969.html?rmmds=category&ID=533034&cur_warehouse=CN

Bill

Edited by Bill.b 2018-11-04
In the interests of the environment, this post has been constructed entirely from recycled electrons.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 04:50pm 03 Nov 2018
Copy link to clipboard 
Print this post

  Grogster said   Can you link us to where you got the igniters from?


Google is your best friend. They can be found in a variety of prices and wire length on
Ebay
Alibaba
Amazon

They typically fire around 3 volts, and contain magnesium, so they burn bright.

There are 2 ways of using them.

1 remove the protective top and insert directly into the firework.
2 fireworks that have a fuse, cut short the fuse and use the protective top to keet fuse and igniter pressed together. This gives a delay of roughly one second if the fuse is cut very short.

Success....

About the fets, yes better fets can be selected. This is what I had in the box.
If I would bring this out commercially I would sure go for SMT parts with logic levels.Edited by Volhout 2018-11-05
PicomiteVGA PETSCII ROBOTS
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025