Welcome to Multi-Rotor UK. Please login or sign up.

Friday,April 19, 2024, 15:28:19

Login with username, password and session length

Shoutbox

hoverfly:
17 Apr 2024 17:15:13
 :rolleyes:
Bad Raven:
26 Mar 2024 08:41:05
 :(
Andy7:
25 Mar 2024 14:49:21
An excess of work and rain.  :thumbdown:
Bad Raven:
23 Mar 2024 18:12:38
Almost a personal Blog, it would seem. LOTS of members, but NO posts.  :-/   :shrug:
Gaza07:
06 Mar 2024 16:59:49
Anyone still here  :shrug:
ched:
24 Dec 2023 11:48:48
Hope you all have a Great Christmas and a happy New Year.
Bad Raven:
20 Dec 2023 06:17:47
 ~~   :beer2: 
Gaza07:
19 Dec 2023 22:20:27
Merry Christmas All  :beer2:
Bad Raven:
01 Dec 2023 06:59:57
New Simulator Section started!   :beer2:
Bad Raven:
17 Jun 2023 06:52:23
Yes, smaller, same as lots of things as time passes.
Members
Stats
  • Total Posts: 201,425
  • Total Topics: 20,260
  • Online today: 34
  • Online ever: 530
  • (Tuesday,June 26, 2012, 08:34:46 )
Users Online
Users: 0
Guests: 29
Total: 29

Theme Changer





3d - Printworx

switching leds

Started by pheasant_plucker, Wednesday,December 26, 2012, 17:46:53

Previous topic - Next topic

pheasant_plucker

Is there any way to switch led strips on and off when arming/disarming the crius? My old Drotek board has a dedicated 1 amp output for this but I don';t see anything like it on this board.  I don';t mind constructing a transistor driver if there is a low current output I could use.

Gerry
The man serving me in the canteen said "Look, You can see the face of Jesus in the Margarine" The Asian guy next to me replied "I can't believe it's not Budda"
[url="http://www.namfc.co.uk/pictures/fly.gif"]http://www.namfc.co.uk/pictures/fly.gif[/url]

willumpie82

on the AIO there is a port A0~A5, they are mapped to the LED_SEQUENCER at mpng.
you can try using a ULN2803, this is a very common hex darlington driver.
paste that number into google together with "LED driver". that will give you some clues

I used an RGB ledcontroller from HK, lifted the driver-pins of the FETS from the PCB and wired those with a pull-down to that A-port on the AIO. I created some LED sequences at leds.pde and modified the RX routine to use copter information, like armed, battery and gps status, (have a look at the other led file from mpng)
Talon V2 quad X
crius AIO pro v1 (latest mpng)
cruis GPS v2, chinese elcheapo sonar, custom led works
4x plush 18 with BLheli 0.9
4x sk3 1130kv + 8x45
turnigy er9x with frsky telemitry enabled, backlight and lipo mods

pheasant_plucker

Thanks just the type of info I need.

Gerry
The man serving me in the canteen said "Look, You can see the face of Jesus in the Margarine" The Asian guy next to me replied "I can't believe it's not Budda"
[url="http://www.namfc.co.uk/pictures/fly.gif"]http://www.namfc.co.uk/pictures/fly.gif[/url]

lakis21

Quote from: willumpie82 on Thursday,December 27, 2012, 14:47:21
on the AIO there is a port A0~A5, they are mapped to the LED_SEQUENCER at mpng.
you can try using a ULN2803, this is a very common hex darlington driver.
paste that number into google together with "LED driver". that will give you some clues

I used an RGB ledcontroller from HK, lifted the driver-pins of the FETS from the PCB and wired those with a pull-down to that A-port on the AIO. I created some LED sequences at leds.pde and modified the RX routine to use copter information, like armed, battery and gps status, (have a look at the other led file from mpng)

Hello! Can you explain what did you done with LED Sequences , and what did you modified to have external leds for armed , battery and GPS?
I Have ready the same circuit withe leds with uln2803, as I did on arducopter, but I don';t know where to to start with megapirate and where to connect each led.
Thanks in advance!
Lakis

willumpie82

i';m currently using copter leds instead of ledsequencer

at config.h you have to modify the pins the leds are connected to (default A4:A7) i connected them to A2:A4 so modified

please check the attached code.

Code (config.h) Select

#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
#define COPTER_LED_1 A4         // Motor or Aux LED
#define COPTER_LED_2 A5         // Motor LED
#define COPTER_LED_3 A6         // Motor or GPS LED
#define COPTER_LED_4 A7         // Motor LED
#define COPTER_LED_5 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_6 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_7 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_8 NOT_A_PIN          // Pin not available on Pirate boards
#endif


Code (config.h) Select

#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
#define COPTER_LED_1 A2         // Motor or Aux LED
#define COPTER_LED_2 A3         // Motor LED
#define COPTER_LED_3 A4         // Motor or GPS LED
#define COPTER_LED_4 A5         // Motor LED
#define COPTER_LED_5 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_6 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_7 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_8 NOT_A_PIN          // Pin not available on Pirate boards
#endif


when all done, programmed etc goto missionplanner -> config -> advanced list
find the LED entry. this value has to be converted from binary > decimal

Code (leds.pde) Select

/////////////////////////////////////////////////////////////////////////////////////////////
//      Copter LEDS by Robert Lefebvre
//      Based on the work of U4eake, Bill Sanford, Max Levine, and Oliver
//      g.copter_leds_mode controls the copter leds function via bitmath
//      Zeroeth bit turns motor leds on and off:                                00000001
//      First bit turns GPS function on and off:                                00000010
//      Second bit turns Aux function on and off:                               00000100
//      Third bit turns on Beeper (legacy Piezo) function:                      00001000
//      Fourth bit toggles between Fast Flash or Oscillate on Low Battery:      00010000                (0) does Fast Flash, (1) does Oscillate
//      Fifth bit causes motor LEDs to Nav Blink:                               00100000
//      Sixth bit causes GPS LEDs to Nav Blink:                                 01000000
//      This code is written in order to be backwards compatible with the old Motor_LEDS code
//      I hope to include at least some of the Show_LEDS code in the future
//      copter_leds_GPS_blink controls the blinking of the GPS LEDS
//      copter_leds_motor_blink controls the blinking of the motor LEDS
//      Piezo Code and beeps once on Startup to verify operation
//      Piezo Enables Tone on reaching low battery or current alert
/////////////////////////////////////////////////////////////////////////////////////////////


I used 115 as decimal led value = 0b01110011

goodluck
Talon V2 quad X
crius AIO pro v1 (latest mpng)
cruis GPS v2, chinese elcheapo sonar, custom led works
4x plush 18 with BLheli 0.9
4x sk3 1130kv + 8x45
turnigy er9x with frsky telemitry enabled, backlight and lipo mods

lakis21

Thank you Thank you Thank you!!!!
Tomorrow I will try! and I will update!!!!
:beer2:

lakis21

Quote from: willumpie82 on Thursday,March 14, 2013, 14:52:34
i';m currently using copter leds instead of ledsequencer

at config.h you have to modify the pins the leds are connected to (default A4:A7) i connected them to A2:A4 so modified

please check the attached code.

Code (config.h) Select

#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
#define COPTER_LED_1 A4         // Motor or Aux LED
#define COPTER_LED_2 A5         // Motor LED
#define COPTER_LED_3 A6         // Motor or GPS LED
#define COPTER_LED_4 A7         // Motor LED
#define COPTER_LED_5 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_6 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_7 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_8 NOT_A_PIN          // Pin not available on Pirate boards
#endif


Code (config.h) Select

#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
#define COPTER_LED_1 A2         // Motor or Aux LED
#define COPTER_LED_2 A3         // Motor LED
#define COPTER_LED_3 A4         // Motor or GPS LED
#define COPTER_LED_4 A5         // Motor LED
#define COPTER_LED_5 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_6 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_7 NOT_A_PIN          // Pin not available on Pirate boards
#define COPTER_LED_8 NOT_A_PIN          // Pin not available on Pirate boards
#endif


when all done, programmed etc goto missionplanner -> config -> advanced list
find the LED entry. this value has to be converted from binary > decimal

Code (leds.pde) Select

/////////////////////////////////////////////////////////////////////////////////////////////
//      Copter LEDS by Robert Lefebvre
//      Based on the work of U4eake, Bill Sanford, Max Levine, and Oliver
//      g.copter_leds_mode controls the copter leds function via bitmath
//      Zeroeth bit turns motor leds on and off:                                00000001
//      First bit turns GPS function on and off:                                00000010
//      Second bit turns Aux function on and off:                               00000100
//      Third bit turns on Beeper (legacy Piezo) function:                      00001000
//      Fourth bit toggles between Fast Flash or Oscillate on Low Battery:      00010000                (0) does Fast Flash, (1) does Oscillate
//      Fifth bit causes motor LEDs to Nav Blink:                               00100000
//      Sixth bit causes GPS LEDs to Nav Blink:                                 01000000
//      This code is written in order to be backwards compatible with the old Motor_LEDS code
//      I hope to include at least some of the Show_LEDS code in the future
//      copter_leds_GPS_blink controls the blinking of the GPS LEDS
//      copter_leds_motor_blink controls the blinking of the motor LEDS
//      Piezo Code and beeps once on Startup to verify operation
//      Piezo Enables Tone on reaching low battery or current alert
/////////////////////////////////////////////////////////////////////////////////////////////


I used 115 as decimal led value = 0b01110011

goodluck

HI willumpie82,
I Setup the Megapirateng 2.9 R6.
I did the changes to config.h
I also setup the LED_MODE 115 OR 127 to the mission Planer
I connect My ULN2803 circuit, which is working on the APM 2.5, on A2,a3, A5 on crius but when I armed but the light doesn';t light.... :(
Do I have to make changes somewhere else except config.h?
Any Idea?
Which megapirate are you using?

Thank you for your time!

lakis21

All done!!! Perfect!
I forgot:
#define COPTER_LEDS ENABLED

GREAT!!!!!!!!!!
THANK YOU
:notworthy:

lakis21

@ willumpie82

Sorry for asking again. Do you know how the piezo buzzer works?

Thank you!
:smiley:

Phil1970

I am following the lakis scheme for connection leds to the crius aiop.

Difference is I use the AIOP v2, so pin 32 is a flat pad, so there will be precision soldering involved.

In the lakis scheme it is clear how to connect the plus wires, but what to do with the minus wire of the led strips???
Do I connect them somewhere on the ULN2803, or to a ground pin on the aiop?

lakis21

Quote from: Phil1970 on Thursday,August 22, 2013, 12:23:16
I am following the lakis scheme for connection leds to the crius aiop.

Difference is I use the AIOP v2, so pin 32 is a flat pad, so there will be precision soldering involved.

In the lakis scheme it is clear how to connect the plus wires, but what to do with the minus wire of the led strips???
Do I connect them somewhere on the ULN2803, or to a ground pin on the aiop?
Hello you have to connect on the 2803 .
Please look here:

Phil1970

#11
I';m still struggling to get leds and buzzer working on the AIOP v2.

I separated the buzzer from lakis scheme, cause I use 3cell lipo (11,1V) to power the leds, and the arduino buzzer only supports 5V. So I used a free motor connector (nr 11) to power it. The arduino buzzer has a third wire, which I believe is a signal wire. That one goes on the signal pin of motor connector 11. So all three wires from the arduino buzzer are now on motor connector 11.

Why? Cause the AIOP v2 has no pin 32. There is a flat pad labeled "32" but it very small and it';s hard to solder on a wire. Furthermore, it isn';t clear how to adress that pad "32" correctly. One post says "32", another says "42". None found working...

When I power up the AIOP v2 the buzzer now works, but keeps on buzzing (quite annoying). 

I changed in APM.Config.h:
#define COPTER_LEDS ENABLED            // Native ArduCopter LEDs

#define PIEZO ENABLED   
#define PIEZO_LOW_VOLTAGE DISABLED
#define PIEZO_ARMING ENABLED

in defines.h:
#define AN5  11  // direct GPIO pin, default as analog input, next to SW2 switch
#define PIEZO_PIN AN5           //Last pin on the back ADC connector

Any ideas someone?

For the leds, I followed the lakis scheme (without the buzzer connection, see above).

I changed in APM.Config.h:
#define COPTER_LEDS ENABLED            // Native ArduCopter LEDs

I found in Config.h (I did not change this):
#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
# define A_LED_PIN        13
# define B_LED_PIN        31
# define C_LED_PIN        30
# define LED_ON           HIGH
# define LED_OFF          LOW
# define SLIDE_SWITCH_PIN (-1)
# define PUSHBUTTON_PIN   (-1)
# define USB_MUX_PIN      (-1)
# define CLI_SLIDER_ENABLED DISABLED
# define OPTFLOW_CS_PIN   34
# define BATTERY_VOLT_PIN      0      // Battery voltage on A0
# define BATTERY_CURR_PIN      1      // Battery current on A1

and also this:


#ifndef COPTER_LEDS
   #define COPTER_LEDS DISABLED
#endif
#define COPTER_LED_ON      HIGH
#define COPTER_LED_OFF      LOW

and this:

#elif CONFIG_APM_HARDWARE == APM_HARDWARE_PIRATES
#define COPTER_LED_1 A2      // Motor or Aux LED
#define COPTER_LED_2 A3      // Motor LED
#define COPTER_LED_3 A4      // Motor or GPS LED
#define COPTER_LED_4 A5      // Motor LED
#define COPTER_LED_5 NOT_A_PIN      // Pin not available on Pirate boards
#define COPTER_LED_6 NOT_A_PIN      // Pin not available on Pirate boards
#define COPTER_LED_7 NOT_A_PIN      // Pin not available on Pirate boards
#define COPTER_LED_8 NOT_A_PIN      // Pin not available on Pirate boards
#endif

Oh yeah, I did put "99" in Mission Planner. When I power-up the leds flash as follows:

gps no-lock: 3led and ledstrip  - green bright slow flashing
motors disarmed: 3led and ledstrip - red bright slow flashing

gps lock-on: 3led green very faint fast flashing and green ledstrip off
motors armed: 3led red very faint fast flashing and green ledstrip off

remarks:
green 3led and ledstrip negative wires are connected together and soldered on ULN2803A pin18 and to A2 on aiop
red 3led and ledstrip negative wires are connected together and soldered on ULN2803A pin 17 and to A4 on aiop

If I put "127" in missionplanner I get no leds at all.

Please advise. Thanks

Phil1970

#12
Any help on the leds with AIOP v2 is welcomed

Phil1970

Could anyone help me out please?

I wired green 3leds and ledstrips and also red 3leds and ledstrips via an ULN2803A to my Crius Aiop v2 A2 and A4 wires. The positive wires are directly connected to a 11V (3S) lipo.

When I boot up the red and green leds blink, but when gps is locked and motors are armed the leds go to very faint fast flash, instead of solid green and red.

What did I possibly do wrong?

cgcrute

You could also try one of these IO boards:

http://www.rctimer.com/product_957.html

It has the ULN2003A for LED output on it. I';ve not used it yet for LEDs but it works well for attaching GPS with the cable that came with the Ublox rather than making one.
ZMR250
Naze32
Micro Titan Motors
SN02a ESCs
Mobius
Runcam Sky (with servo adjustable tilt)

Cheerson CX-10 ;-)

Taranis Transmitter