RC India
Welcome Guest, please login or register.
 
Pages: 1 2 [All]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools Topic Tools 
Read
« on: January 07, 2015, 05:43:01 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1




I have been planning to light up my quad for a while now. I received LED strips from quadkopters.com yesterday along with a JST harness. The LEDs are impressively bright. I need to rebuild my quad first and check if it flies but meanwhile I have been working on a RC switch for these lights. I was planning to go for a modded servo board but I have a free 3 position switch on my radio so I thought "Why not add a strobe feature too?". I have made the initial prototype, using Arduino. I plan to port it to Attiny to save space. I am using a TIP31C transistor to drive the 12V LEDs. I will be powering the LEDs either from the main battery or a separate one (my plane battery). The circuit will require a common ground so I will have to figure out how to implement that (maybe using the BAT port) with an LM7805 to power the Attiny.
Here is my code (my programming knowledge is very little. This code was made by cobbling together the Blink program as well as a program to read the PWM signals from the receiver by Nick Poole.):
/*
 RC PulseIn Joystick
 By: Nick Poole
 SparkFun Electronics
 Date: 5
 License: CC-BY SA 3.0 - Creative commons share-alike 3.0
 */

int ch1;
int led = 13;
void setup() {

  pinMode(5, INPUT); // Set our input pins as such
  pinMode(led, OUTPUT);


  Serial.begin(9600); // Pour a bowl of Serial

}

void loop() {

  ch1 = pulseIn(5, HIGH, 25000); // Read the pulse width of
  Serial.print("Switch:"); // Ch2 was y-axis
  Serial.println(map(ch1, 1000,2000,-500,500)); // center at 0


  {
    if(map(ch1, 1000,2000,-500,500)<-25){
      Serial.println("Lights Off");
      digitalWrite(led, LOW);
    };
    {
      if(map(ch1, 1000,2000,-500,500)>-25 && map(ch1, 1000,2000,-500,500)<0){
        Serial.println("Lights On");
        digitalWrite(led, HIGH);
      };
      {
        if(map(ch1, 1000,2000,-500,500)>10){
          Serial.println("Lights Blink");
          digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
          delay(50);               // wait for a second
          digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
          delay(50);               // wait for a second
        };

        delay(1000);// I put this here just to make the terminal
        // window neater
      }


    }
  }
}

Printing to the Serial monitor is unnecessary. It just makes reference easier. I would appreciate any tips, suggestions or advice.

Logged

 

Read
« Reply #1 on: January 07, 2015, 06:04:15 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



Good work Smiley
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #2 on: January 07, 2015, 07:25:44 PM »
ashok baijal
Plane Lover
Forum Hero
*****

Reputation Power: 7 
ashok baijal has no influence.
Offline Offline

City: Bangalore
State: Karnataka
RC Skills: Beginner
Posts: 595
Join Date: Oct, 2009



Electronics used to be one of my hobbies amongst others like Amateur Radio ( Call sign VU2AEY). A number of my circuit designs have been published in the 1980s in Electronics For You. However frequent transfers put an end to them. Would like to start with microcontrollers and have gone through books on PIC microcontrollers and  have the  PIC programmer and recently also got a usbasp for avr controllers. Need help in getting a practical start. Can any forum member help me in getting over the initial hump? I am writing on this thread as micro enthusiasts will read this thread.
Logged
 

Read
« Reply #3 on: January 07, 2015, 07:38:47 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



well ,so your planning to start in pic and avr.?
the current trend being Arduino - which is such a simplified platform where even novice in electronics can easily lear with a little knowledge in c programs...

For PIC and AVR you have to program in either assembly (Which is tedious) or use C compilers..
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #4 on: January 07, 2015, 07:42:09 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



For PIC microcontrollers, you can download MPLAB IDE, with Integrated C compiler..
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #5 on: January 07, 2015, 07:43:57 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



quick question, i too have the leds in my quadkopters cart Smiley
but,

How much reduce in battery life will be there with 4 LED strips ?

and, regarding the connections, does the JST connector go IN the Rx ?
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #6 on: January 07, 2015, 07:47:59 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



LEDs won't take up much power so that you experience a flight time decrease ...

No the JST don't go to Radio.
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #7 on: January 07, 2015, 07:49:25 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



ok so in the M6 port ? I have extra power to the Rx cable in the M5 port Tongue
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #8 on: January 07, 2015, 07:53:47 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



power to LED strip is not from receiver , it is directly fed from Battery - ESC power rail (Assume you are having 12V LRD strips)
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #9 on: January 07, 2015, 07:55:08 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



from the battery Huh? how do i connect it  :?
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #10 on: January 07, 2015, 07:58:51 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



I haven't installed the LEDs yet so I can't really tell about flight time changes. They should not draw more than 400 mA per meter. I am planning to power them from a separate battery anyway (WolfPack White 900 mAh 25C). To power them from a separate LiPo you will need a harness like this: http://www.quadkopters.com/product/night-flying-accessories/jst-power-breakout-cable-6-jst/
Alternatively, you could power them from the balance leads of the main LiPo using this harness:
http://www.ebay.in/itm/200975726673?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
I bought the last piece though  >Cheesy
Logged

 

Read
« Reply #11 on: January 07, 2015, 08:04:48 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



Ashok Sir, Arduino is a good way to get into microcontrollers. The language is very simple and there is a large user base, so you will have a lot of code and support available online. The only programming language I know is Python, but I dod not have too much trouble with Arduino. I download programs from the Internet or cobble together my own programs from existing ones. I think PIC microcontrollers are harder to work with though they can be programmed in BASIC. An Arduino Uno costs roughly around  Indian Rupees 1500 You will also need some accessories like discrete components, a solderless breadboard and jumper wires.
Logged

 

Read
« Reply #12 on: January 07, 2015, 08:05:24 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



DAMN IT !! Any alternative links to the Balance lead harness ?
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #13 on: January 07, 2015, 08:07:55 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



http://www.ebay.in/itm/JST-XH-to-JST-LED-Power-Distribution-Lead-4-JST-/181589874291

Cheaper XD
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #14 on: January 07, 2015, 08:10:03 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



Don't you have a power distribution board onboard ? solder the LED strip terminals to that
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #15 on: January 07, 2015, 08:11:28 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



Cheaper by 10 bucks. That's an amazing saving!  Giggle Anyway, you can go for it since you have a big 5000 mAh battery. The only problem is that you will have to unplug it to check your battery voltage. I bought these since I am using a power distribution harness- so much easier.
Logged

 

Read
« Reply #16 on: January 07, 2015, 08:14:54 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



BTW, @ parichya. If you plan to solder the LED strip wires yourself, buy some longer strips from ebay.in. They are much more economical.
Logged

 

Read
« Reply #17 on: January 07, 2015, 08:16:12 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



damn it XD

i need the balance lead for the lipo checker ..

Any other option to how i can connect it ? which doesnt involve soldering Tongue
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #18 on: January 07, 2015, 08:17:48 PM »
ashok baijal
Plane Lover
Forum Hero
*****

Reputation Power: 7 
ashok baijal has no influence.
Offline Offline

City: Bangalore
State: Karnataka
RC Skills: Beginner
Posts: 595
Join Date: Oct, 2009



@SK701. True Arduino is much simpler but C is no problem. I am quite conversant with C as once I was a faculty at SBIICM and C was one of the subjects I used to teach.
@Sooraj. Yes I have all the software/hardware. Was looking for the initial push into this world.
Nevertheless, once a start stumbling, I will take the liberty of contacting you guys for help
Logged
 

Read
« Reply #19 on: January 07, 2015, 08:18:21 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



Why don't you guys just remove the JST connectors from LED strip and solder the leads to some where in the power distribution network Huh?
Why buying another 100 Rupee conundrum, just for blinking some LEDs ?

And another thing guys, these 12V LED strip lights will be available in your local electronic shop for just ~350 Rs for 5 mtrs !!! - buy a pack and cut out as much as you need to light up to tens of Quads  Giggle
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #20 on: January 07, 2015, 08:19:38 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



@Sooraj. Yes I have all the software/hardware. Was looking for the initial push into this world.
Nevertheless, once a start stumbling, I will take the liberty of contacting you guys for help

An Initial push ? You mean a "Hello world" ?
Which PIC programmer you use ?
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #21 on: January 07, 2015, 08:21:22 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



Cant I get a balance lead splitter XD ?

Sooraj check mail btw
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #22 on: January 07, 2015, 08:22:24 PM »
ashok baijal
Plane Lover
Forum Hero
*****

Reputation Power: 7 
ashok baijal has no influence.
Offline Offline

City: Bangalore
State: Karnataka
RC Skills: Beginner
Posts: 595
Join Date: Oct, 2009



@Sooraj. Yep. Someone to hold my hand when the micro beeps out "Hello World" Grin Grin
Logged
 

Read
« Reply #23 on: January 07, 2015, 08:27:28 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



@parichya, for the money you invest in all the connectors, you can get 5 meters of LED strip !!  Giggle

@Ashok sir , start from anything you like - still a Blinking LED being the most common "Hell-world" for any microcontroller.
Have you been to any other micro controllers in past ?
you were an EFY writer ? awesome !
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #24 on: January 07, 2015, 08:29:06 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



I actually have some LED strip with me. but how will I power it ?
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #25 on: January 07, 2015, 08:31:37 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



Sooraj check mail Tongue
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #26 on: January 07, 2015, 08:32:28 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



solder two wires between strip and your power distribution board - check the polarity, and get rid of all connectors .
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #27 on: January 07, 2015, 08:38:42 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



i dont have a power distribution board Tongue
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #28 on: January 07, 2015, 08:42:09 PM »
sooraj.palakkad
with eyes in sky
Heli Lover
Forum Hero

*****

Reputation Power: 21 
sooraj.palakkad barely matters.sooraj.palakkad barely matters.
Offline Offline

City: Palakkad
State: Kerala
RC Skills: Expert
Posts: 2058
Join Date: Aug, 2014

SPN



So do you have a power harness ?
Logged

RC Hobbyist and an Aerial Cinematographer..
 

Read
« Reply #29 on: January 07, 2015, 08:42:51 PM »
parichya.gautam
Plane Lover
Forum Hero

*****

Reputation Power: 21 
parichya.gautam barely matters.parichya.gautam barely matters.
Offline Offline

City: NOIDA
State: Uttar Pradesh
RC Skills: Intermediate
Posts: 1591
Join Date: Oct, 2012

It all started from something small



no Tongue just the LED strip Tongue
Logged

Passion > Financial Constraints

To Contact:
FB: https://www.facebook.com/parichya
Mob: 8375066843
Mail: parichya.gautam@gmail.com
-------------------------------------------------------
My Products On Sale Catalogue: ( !!! LOWEST PRICE GUARANTEE ON ALL ITEMS !!! ) https://app.box.com/s/84m5t5ljrwat54rmrldjg74dtie28g44
-------------------------------------
Product Request Form: https://docs.google.com/forms/d/1-OccRCaAQux8hxpuTw_xI4k3Ll9QW9JyOr0XDijzPXA/viewform?us
 

Read
« Reply #30 on: January 07, 2015, 11:13:18 PM »
AnjanBabu
Aj Creations
Plane Lover
Forum Hero

*****

Reputation Power: 9 
AnjanBabu has no influence.
Offline Offline

City: Bangalore
State: Karnataka
RC Skills: Beginner
Posts: 576
Join Date: Jan, 2012



I made a very similar RC switch for switching the FPV on/off on my mini quad using a N-channel MOSFET (STP60NF06) and a SoIC ATtiny45 programmed on Arduino.
I'll post a picture of it tomorrow.

The code is very simple actually, only about 10 lines and 996 Bytes compiled, it'll work on any ATtiny you can get your hands on.
 
1. Read PWM from Rx using pulseIn()
2. Create a condition to check switch position from the PWM
3. Signal the MOSFET accordingly

You can get my code from here-- https://www.dropbox.com/s/eufdd6pk42nnple/RC_Switch_ATtiny45_.zip?dl=0

 Thumbs Up
Logged

Mechatronics engineer . Hopeless realist

anjanbabu.wordpress.com
 

Read
« Reply #31 on: May 27, 2015, 09:36:34 AM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



I am resurrecting this old thread because I have finally got around to building the actual switch. Here is my schematic:
http://i284.photobucket.com/albums/ll36/siddharth_kumanduri1/d4979436-983e-4dd7-bd64-c9454fadaedc_zpsstfibhaa.png
DIY RC switch for my quad lights


And this is my code:
Quote
/* This is the code for an RC light switch for my quadcopter */
unsigned long ch1;

void setup() {
  pinMode(4, INPUT); // Set our input pins as such
  pinMode(3, OUTPUT);
}

void loop() {
 
  ch1 = pulseIn(4, HIGH, 25000); // Read the pulse width of the channel

  if (ch1 > 1100) {         //assigned to a 2 position switch
    digitalWrite (3, HIGH); // turn on the lights
  }
  if (ch1 < 1000) {
    digitalWrite (3, LOW);  // turn off the lights

  }
}

For some weird reason I am only able to turn the lights on but not off. Does anybody know why? Do I need to connect a resistor between the Attiny pin and the transistor base? Or should it go between the base and emitter to sink any current leakage to ground? I need some help please.
Logged

 

Read
« Reply #32 on: May 27, 2015, 11:22:13 AM »
AnjanBabu
Aj Creations
Plane Lover
Forum Hero

*****

Reputation Power: 9 
AnjanBabu has no influence.
Offline Offline

City: Bangalore
State: Karnataka
RC Skills: Beginner
Posts: 576
Join Date: Jan, 2012



The transistor might need a pull-down, try adding the resistor.

Additionally, you could replace the transistor with a MOSFET. I use a STP6NF06 with an ATtiny45, it can handle up to ~10A cont. at 12v without a heating much.
Logged

Mechatronics engineer . Hopeless realist

anjanbabu.wordpress.com
 

Read
« Reply #33 on: May 27, 2015, 11:40:11 AM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



Thank you sir. By pull down you mean the base emitter-resistor right? What do you think would be a decent value to start with? I can also try a MOSFET. I didn't have any at home so I used a power BJT (TIP31C) which is more than sufficient for my needs.
Logged

 

Read
« Reply #34 on: May 27, 2015, 01:49:00 PM »
Himadri Roy
Plane Lover
Forum Hero

*****

Reputation Power: 12 
Himadri Roy has no influence.
Offline Offline

City: Navi mumbai
State: Maharashtra
RC Skills: Intermediate
Posts: 969
Join Date: Jan, 2015



For pull down commonly used resistor is 10K
And the pulldown resistor is on the Base of the Transistor.  Thumbs Up
Logged

For once you have tasted flight you will walk the earth with eyes skywards for there you have been and there you will long to return
- Leonardo Da Vinci

https://www.youtube.com/himadrifpv
 

Read
« Reply #35 on: May 27, 2015, 02:07:30 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



Thank you. I will try the 10K. The pulldown resistor goes from the base to the emitter right? The resistor connected to the base is usually to limit the current from the microcontroller (not an issue for me, the TIP31C can take 1A on the base)
Logged

 

Read
« Reply #36 on: May 27, 2015, 02:11:45 PM »
Himadri Roy
Plane Lover
Forum Hero

*****

Reputation Power: 12 
Himadri Roy has no influence.
Offline Offline

City: Navi mumbai
State: Maharashtra
RC Skills: Intermediate
Posts: 969
Join Date: Jan, 2015



Nope the resistor from the the base goes to ground

EDIT- yes you can connect the emitter and base with a 10K resistor that will also do!  Thumbs Up
Logged

For once you have tasted flight you will walk the earth with eyes skywards for there you have been and there you will long to return
- Leonardo Da Vinci

https://www.youtube.com/himadrifpv
 

Read
« Reply #37 on: May 27, 2015, 02:13:19 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



That is the same thing since my emitter is connected to the main ground. This transistor is NPN so I am using it as a low-side switch.
Logged

 

Read
« Reply #38 on: May 27, 2015, 02:38:46 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



UPDATE: Adding a 10K pulldown resistor from the base to ground did not make a difference
Logged

 

Read
« Reply #39 on: May 27, 2015, 08:39:59 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



I have added a 1K current limiting resistor on the base. No difference even if I use a different Attiny.
I have also conducted some further troubleshooting with my multimeter. When I first power up my circuit, the potential difference between the Attiny pin 3 and ground is 0. When I switch on the lights from my Tx, this goes to 4.95V. But when I switch the lights back off again, the voltage still stays at this level. This means that the Attiny pin is not going low. What could the cause be? This is an AtTiny85-20PU from BangGood flashed with 8MHz bootloader.
Logged

 

Read
« Reply #40 on: May 27, 2015, 09:26:28 PM »
Himadri Roy
Plane Lover
Forum Hero

*****

Reputation Power: 12 
Himadri Roy has no influence.
Offline Offline

City: Navi mumbai
State: Maharashtra
RC Skills: Intermediate
Posts: 969
Join Date: Jan, 2015



SK did you try out some simple trouble shooting like are those values in the if condition are correct?(do those values show up on the Serial when the switches are flicked in your desired position?)
Logged

For once you have tasted flight you will walk the earth with eyes skywards for there you have been and there you will long to return
- Leonardo Da Vinci

https://www.youtube.com/himadrifpv
 

Read
« Reply #41 on: May 27, 2015, 09:39:01 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



I have not yet figured out how to use Serial with my Attiny yet since the standard Serial commands give an error message. I did use this similar code snippet on my Arduino Uno:
Quote
int ch1;

void setup() {

  pinMode(5, INPUT);
  Serial.begin(9600);

}

void loop() {

  ch1 = pulseIn(5, HIGH, 25000);

  if (ch1 > 1700) {
    Serial.println("Left Switch: Engaged");
  }
  if (ch1 < 1300) {
    Serial.println("Left Switch: Disengaged");
    delay(1000);
  }
}

This snippet worked and the Serial Monitor said Engaged when the switch was on and Disengaged when it was off. I was also able to use my original RC lights code to turn on and off the pin 13 LED of my Uno.
Logged

 

Read
« Reply #42 on: May 28, 2015, 09:28:49 AM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



At last I got it working thanks to some help at RCGroups here. It was a software bug and all I needed to do was change my second if statement (if (ch1 < 1300)) to an else statement. This is because this condition was not being triggered. Here is my working code:

Quote
/* This is the code for an RC light switch for my quadcopter */
unsigned long ch1;

void setup() {
  pinMode(4, INPUT); // Set our input pins as such
  pinMode(3, OUTPUT);
}

void loop() {
 
  ch1 = pulseIn(4, HIGH, 25000); // Read the pulse width of the channel

  if (ch1 > 1700) {         //assigned to a 2 position switch
    digitalWrite (3, HIGH); // turn on the lights
  }
  else {
    digitalWrite (3, LOW);  // turn off the lights

  }
}

I will post a working video soon.
Logged

 

Read
« Reply #43 on: May 28, 2015, 12:35:10 PM »
akhilzid
Heli Lover
Forum Hero

*****

Reputation Power: 5 
akhilzid has no influence.
Offline Offline

City: Ernakulam
State: Kerala
RC Skills: Advanced
Posts: 541
Join Date: Sep, 2014



Good Project, here is the much better optimized code  Hats Off
Quote
#define InputPIN 4
#define OutputPIN 3

void setup() {
  pinMode(InputPIN, INPUT);
  pinMode(OutputPIN, OUTPUT);
}

void loop() {
  digitalWrite (OutputPIN,(pulseIn(InputPIN, HIGH, 2200) > 1500)? HIGH : LOW);
}
Logged
 

Read
« Reply #44 on: May 28, 2015, 01:09:11 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



Optimised indeed! Thanks a lot Sir. This code looks much neater (though it is only 16 bytes less). My code was uglier because it was a mashup of other sources and not really self-written. Now I know who to contact for any Arduino related help  Hats Off
Logged

 

Read
« Reply #45 on: May 28, 2015, 01:36:51 PM »
akhilzid
Heli Lover
Forum Hero

*****

Reputation Power: 5 
akhilzid has no influence.
Offline Offline

City: Ernakulam
State: Kerala
RC Skills: Advanced
Posts: 541
Join Date: Sep, 2014



Welcome dear.
Logged
 

Read
« Reply #46 on: May 29, 2015, 09:19:57 PM »
SK1701
Heli Lover
Forum Hero

*****

Reputation Power: 11 
SK1701 has no influence.
Offline Offline

City: Montreal/ Bangalore
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 888
Join Date: Oct, 2014

set acc_hardware = 1



Here is a short clip of the switch in action. Yes, I know it is a bad video, it is just to show the switch working:
Logged

 

Pages: 1 2 [All]   Go Up
Jump to:  

Related Topics
Subject Started by Replies Views Last post
RC operated switch for lights on airplane.
Radios and Receivers
gauravag 4 4002 Last post January 14, 2013, 12:33:54 AM
by coolpratheesh
LED lights !
Tools, Materials and Building Techniques
Sahevaan 12 8152 Last post December 26, 2013, 11:51:13 AM
by aman1256
RC electronic switch for switching on lights and other accessories
Self-designed, DIY and College Projects
coolpratheesh 21 10843 Last post May 17, 2013, 08:55:14 AM
by qwerty156
El Lights
For Sale
Nehutech 5 3097 Last post April 18, 2013, 03:48:03 PM
by Nehutech
Has anyone tried rc-lights.com?
Self-designed, DIY and College Projects
areebnazim 1 3322 Last post February 24, 2015, 05:56:06 AM
by krishnatr