News:

LATEST RELEASE:  FPP 8.0 - Download from here - https://github.com/FalconChristmas/fpp/releases/tag/8.0

+-+-

+-User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+-Site Stats

Members
Total Members: 16528
Latest: fugley
New This Month: 16
New This Week: 1
New Today: 1
Stats
Total Posts: 133173
Total Topics: 16554
Most Online Today: 87
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 1
Guests: 62
Total: 63

How to connect a button (via GPIO) to a K16A-B

Started by pierlux, September 17, 2022, 11:34:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pierlux

I'm following these tutorials on how to connect a button to a GPIO port to trigger events in FPP (such as starting a sequence). 

On the K16A-B there's an I/O EXP connector and I expected to be able to use that to connect my button. Unfortunately I couldn't figure out what GPIO these were connected to – nor did the Zoom room.  

You cannot view this attachment.

Has anyone been successful at using them? Or would mind pointing me in the right direction? I promise to fully document this once I'm up and running.

dkulp

At the bottom of the GPIO inputs page, there should be a bunch of pins that start with "pca".   Those are the pins.  8 through 15 are available on the header.
Daniel Kulp - https://kulplights.com

pierlux

#2
Here's how to start a playlist when a button is pressed.  I striked the original text and made corrections based on comments below.    There also are more detailed diagrams in the FPP Manual, have a look at that too.

1. Material Needed
  • 3 female jumber wires to connect to the pins.
  • 2 wires to connect to your button
  • 1 x 200 ohms resistor
  • 1 momentary push button (that closes the circuit once pushed)
  • Optional: 1 x solderless breadboard to prototype this.

2. Setup the wiring
Following the circuit in the image below, you will connect the 3.3V pin to your button and the other side of the button to the GPIO pin of your choice (more on where to find the pins below).  When the button is open, the resistor will "pull" the voltage on the GPIO down to 0V by connecting it to the ground.  When the button is closed, +3.3V will travel to the GPIO pin triggering an event in FPP.

You cannot view this attachment.
3. Finding the GPIO pins
On a K16A-B board, the pins are located in the lower left part of the board. The connector is labeled I/O EXP and has +3.3V, G and pins 8-15 available to use as GPIOs.

You cannot view this attachment.

4. Configure FPP 6.1
In FPP's web interface, go to Input/Output Setup / GPIO Inputs.  At the bottom of the page, you will find entries prefixed with pca. In my case, entry pca9675-15 corresponds to pin 15 on the I/O EXP jumpers.

To play a song when the users releases the button, select Pull UpNone/External in the PULL UP/DOWN combo box. Then select Start Playlist in the COMMAND RISING EDGE combo box. Select a playlist name if you need to.

Restart FPPD and voilà! The button should work.

dkulp

If you are using an external pull down resistor, you don't want to enable the internal pull up resistor.  

The buttons on the board are wired the other way.   They connect the GPIO pin to ground.   The internal pull up resistor is enabled. (no external resistors).  The buttons don't need the 3.3V at all.   The trigger is on the falling edge then.   
   
Daniel Kulp - https://kulplights.com

Poporacer

Quote from: pierlux on September 17, 2022, 02:36:23 PMTo play a song when the users releases the button, select Pull Up in the PULL UP/DOWN combo box.
NO! like Dan stated (and it is covered in the FPP Manual) you do NOT want to configure the Pull UP/Down in the interface if you are using external Pull up/Down resistors using both can cause some overcurrent issues to the GPIO pins. The option states None/External and is the option if you are using External resistors. 

Quote from: pierlux on September 17, 2022, 02:36:23 PMThen select Start Playlist in the COMMAND RISING EDGE combo box.
You can actually trigger two events, one for when the button is pressed (in your case rising edge) and another one for when the button is released (Falling edge in your case)

I would be very careful following tutorials for stock BeagleBone or Pi computers. Once another device is connected to them, things can be dramatically different than how they are without the added hardware. But Nice write up! Thanks for the contribution.
If to err is human, I am more human than most people.

pierlux

#5
Thanks for the input, I'll check that. The thing is that there's just too little information on how to do this with a beaglebone. Woa, I had never opened the FPP Manual as Google only has the 5.0 and 1.x indexed.  There's way more details in there!

pierlux

I'm back this year with a new plan: have the button light up when the show is active (between 16h and 20h).  Essentially: my controller powers up at 15:30 and shuts down at 22:00.  Visitors can start a song by a push of the button between 16:00 and 20:00. From 20:00 to 22:00, I have a static display going on.

I'd like the light in the button to turn on between 16h and 20h.  I have a good idea on how to do it in FPP; I just want to make sure my wiring is sound.  Here's my plan greatly inspired by this tutorial.  In an ideal world, I'd reuse my existing 3 wire extensions, hence this 3 wire design.

You cannot view this attachment.
The LED and buttons are both connected to separate GPIOs.  One will be used to turn the LED on and off. The other will be used to react to the button press.  My understanding of the literature is that this is a "Internal resistor pulling high" setup.  Which means that when the button is pressed, this is will be a "falling event" and when released it will be a "rising event". 

The button will be about 25 feet from the controller box.  The LED will light up at 2V and can go up to 15V, therefore, the 3.3V minus the voltage loss over this cable length should do. 

Let me know if I am missing something!

Poporacer

Quote from: pierlux on May 18, 2023, 08:29:52 AMMy understanding of the literature is that this is a "Internal resistor pulling high" setup.
That is something that you have to configure, you can have it internally pull high or low or not use the internal resistors and wire it yourself.  https://falconchristmas.github.io/FPP_Manual.pdf#page=125
Other than that, it looks good
If to err is human, I am more human than most people.

pierlux

Quote from: Poporacer on May 18, 2023, 08:39:36 AM
Quote from: pierlux on May 18, 2023, 08:29:52 AMMy understanding of the literature is that this is a "Internal resistor pulling high" setup.
That is something that you have to configure, you can have it internally pull high or low or not use the internal resistors and wire it yourself.  https://falconchristmas.github.io/FPP_Manual.pdf#page=125
Other than that, it looks good
Well, given by proposed wiring and my plan not to use external resistors; am I right to set it up as "Internal resistor pulling high"?

k6ccc

One thing to keep in mind - and I don't the answer.  Most IC outputs can sink more current then they can source.  What I mean by that is that some particular IC may be able to sink for example 50 mA but only source 10 mA.  To make sure we're on the same page, what I mean by source and sink is this:  source is how much current can be supplied by the IC (normally at or near the operating voltage).  Sink is how much current the IC can absorb (normally at or near the IC ground voltage).  I have no clue what the current limits on the GPIO pins of the board in question.

The common way to deal with this difference is to have one end of the LED attached to voltage and use the GPIO to ground the other end to turn the LED on - as opposed to the wiring diagram shown earlier where one end of the LED is grounded and the GPIO supplies current to turn on.

Just food for thought...
Using LOR (mostly SuperStar) for all sequencing - using FPP only to drive P5 and P10 panels.
My show website:  http://newburghlights.org

Jim

pierlux

I see.  I've been looking into relays anyway as 3.3V barely turns on the LED. 

Would this schema work better?
You cannot view this attachment. 

pck

I would use a common emitter driver circuit to drive the led directly. A 2n2222 transistor would work with the base fed from the GPIO pin thru a 1k resistor.

k6ccc

3.3V will turn on an LED just fine, but very likely a much smaller resistor will be needed.
Personally I don't like having a CPU IO port directly driving a relay because of inductive spike upon de-key.  There are ways to mitigate that if you really need to.  However a transistor would do the job just as well - as pck also just said.
Using LOR (mostly SuperStar) for all sequencing - using FPP only to drive P5 and P10 panels.
My show website:  http://newburghlights.org

Jim

pck

K6ccc makes a good point. A typical led draws around 20ma so you could lower the resistor value to 180 ohms.

pck

I looked for the output specs for the GPIO pins and some say they are rated for 16ma with the default being 8ma. 180 ohms might be a little low for 16ma values. You could use a 220 ohm resistor for a 16ma output and that would only be if you changed from the default 8ma to 16 (i don't know how to do that). For the 8ma output you need a resistor of a little over 400 ohms. This probably would help your brightness much. For me, its best to go with a driver transistor. 

Support FPP

+- Recent Topics

K2-Pi0 Unable to Start FPPD by darylc
Today at 12:45:13 AM

Control lights directly from the GPIO of a PI by Poporacer
September 15, 2024, 12:25:42 PM

New K16s by dkulp
September 15, 2024, 08:23:40 AM

FPP After Hours Music Plugin has been updated by jcross
September 14, 2024, 08:49:51 PM

Intermittent Test Pattern failure on Channel Outputs > LED Panel by k6ccc
September 14, 2024, 08:11:30 PM

P5 Matrix on FPP 8.0 help by darylc
September 14, 2024, 07:09:50 PM

Does the Falcon f16v4 support TM1814 RGBW LEDs? by JonD
September 14, 2024, 03:12:11 PM

Does the Falcon f16v3 support TM1814 RGBW LEDs? by ric878
September 14, 2024, 01:53:57 PM

USB Monitor (AIDA64 Style) by jnealand
September 14, 2024, 08:39:50 AM

What am I missing - FPP 8 artnet input configuration by jnealand
September 14, 2024, 08:32:21 AM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod