External activity led on Rpi Zero

Raspberry Pi hardware discussion (including peripherals)
Post Reply
User avatar
day
Posts: 134
Joined: Thu Jul 07, 2016 10:08 am
Has thanked: 87 times
Been thanked: 189 times

External activity led on Rpi Zero

Post by day » Fri Jul 29, 2016 9:30 am

Hi all,

I was wondering how easy would it be (and simply, "how?") to add an "external" activity led on the Rpi Zero ?

Any idea on how to do that ?

Is this up to date for the Pi Zero : http://elinux.org/Assign_GPIO_as_ACT-led ?
I would need to do all the steps ?

Thanks for any help

day

Zero
Posts: 157
Joined: Fri Sep 02, 2016 6:32 pm
Location: Bristol, UK
Has thanked: 11 times
Been thanked: 35 times

Re: External activity led on Rpi Zero

Post by Zero » Sat Sep 03, 2016 6:45 pm

Maybe de-soldering the one on the board and extending some leads to wherever you want it is an option?

User avatar
Tango
Posts: 15
Joined: Mon Nov 14, 2016 1:47 pm
Has thanked: 2 times
Been thanked: 6 times

Re: External activity led on Rpi Zero

Post by Tango » Thu Nov 24, 2016 12:46 pm

Take a look at Device Tree Overlays, you can assign the ext_act (activity led) to any GPIO.


Dale



ext_act_led: act {
label = "ext_act";
linux,default-trigger = "mmc";
gpios = <&gpio 19 0>;

User avatar
day
Posts: 134
Joined: Thu Jul 07, 2016 10:08 am
Has thanked: 87 times
Been thanked: 189 times

Re: External activity led on Rpi Zero

Post by day » Fri Nov 25, 2016 4:41 am

so after a quick search on @Tango's help (THANKS !!), here is the exact step to do (to test, didn't do it yet) :

1- create a deportedactivityled.dts file with this in it :

Code: Select all

/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2708";
	fragment@0 {
		target = <&leds>;
		__overlay__ {
			/*
			 * External LED to show CPU activity.
			 * Active-high, GPIO 19
			 */
			ext_act_led: act {
				label = "ext_act";
				linux,default-trigger = "cpu0";
				gpios = <&gpio 19 0>;
			};
		};
	};
};
2- compile it with a device-tree compiler (https://www.raspberrypi.org/documentati ... ce-tree.md)
(possible way, to test: using this compiler https://git.kernel.org/cgit/utils/dtc/dtc.git and this command "$ dtc -O dtb -o deportedactivityled.dtb deportedactivityled.dts")

3- copy to SD card (/boot/overlays)

4- add it in config.txt: dtoverlay=deportedactivityled.dtb

5- wire your led on GPIO 19 (or else change it as well in above code) (use this to get the resistor value needed : http://led.linear1.org/1led.wiz)

6- profit

User avatar
Tango
Posts: 15
Joined: Mon Nov 14, 2016 1:47 pm
Has thanked: 2 times
Been thanked: 6 times

Re: External activity led on Rpi Zero

Post by Tango » Sat Nov 26, 2016 4:42 am

Change cpu0 to mmc0 to use the SD card to trigger the LED instead of the CPU.

Dale

Mr_Nick666
Posts: 1
Joined: Sat Feb 11, 2017 4:52 am

Re: External activity led on Rpi Zero

Post by Mr_Nick666 » Sat Feb 11, 2017 4:57 am

EDIT:

When the CPU is doing it's bit my LED flashes away like a goodun now!

On the Pi3B I only needed to add this code to the boot/ config file and it works a charm! :D

Code: Select all

dtoverlay=pi3-act-led,gpio=19
On earlier Pis I believe it's even shorter

Code: Select all

dtparam=act_led_gpio=19
Just thought I'd share as there's been many nights of head scratching to find a very simple answer! :)

Nick

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest