RGB keyboard LEDs?

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
Post Reply
crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

RGB keyboard LEDs?

Post by crj » Wed Mar 07, 2018 3:39 pm

This thread about modding Elite to run some LEDs set me thinking:
  • Adafruit sell their NeoPixel LEDs in a 5mm form factor
  • The keyboard LEDs on a Beeb are 5mm
  • Each LED mounts to the keyboard PCB with a pair of holes at 0.1" spacing
  • There's at least 10mm of clearance above the keyboard PCB and below the metal keyswitch seating plate
So I'm pondering the idea of a tiny circuit board which would replace the keyboard LEDs on a BBC micro with RGB ones. That would be pretty cool. (-8

Although at first glance it looks like there would be a need to solder through-hole LEDs to one side of the board and pins down to the keyboard PCB on the other within the same footprint, I realised it ought to be possible to pull a stunt like this:
Image

However, there's a major headache I can see: how to get such a board into place. It looks like you'd have to desolder every single key to get the seating plate out of the way; if that's not an option, the board would somehow need to be wiggled into place. Anyone got any suggestions?

Another slight headache is that, though it would be very cool, I find myself thoroughly unsure what I'd actually do with them.

A final paranoia: are the LEDs mounted in the same orientation on every issue of the keyboard PCB?

Coeus
Posts: 775
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: RGB keyboard LEDs?

Post by Coeus » Wed Mar 07, 2018 5:50 pm

What do these RGB LEDs do? Can you change the colour of them from the BBC?

You remind me that back in the day I replaced two of the LEDs in my BBC keyboard so the caps lock LED is green, the shift lock LED remains red and the cassette motor LED is yellow. I thought that was cool but it does also have the advantage you can tell which one was lit in the dark. Blue ones were not cheaply available then.

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Wed Mar 07, 2018 7:19 pm

Coeus wrote:What do these RGB LEDs do?
The Adafruit NeoPixel is an RGB LED with integrated control IC. You connect +5V and Gnd to each one. You daisy-chain them, connecting the DOUT of one to the DIN of the next. You can then control every LED in the entire chain independently for red, green and blue intensity using a single output pin on a microcontroller.

This page gives a good overview of how funky they can be.

One downside is that the timing requirements for controlling them are incredibly precise: you have to waggle the wire with a timing accuracy of ±0.15μs. The Beeb wouldn't stand a chance and apparently even a Raspberry Pi struggles. There needs to be a small, cheap microcontroller interfacing them to... whatever. Adafruit themselves offer a bunch of options, starting with the $6.95 Trinket.

If, if people thought this was cool enough to be worth pursuing, my instinct would be to integrate an ATmega32U4 or similar into the carrier board. That's got plenty of interfaces, and enough pins that it could connect to the signals for the original LEDs and provide a compatability mode (i.e. each LED is either red or off) unless told otherwise.

(It would need to scavenge a ground connection from somewhere on the keyboard, but I just took a look at a keyboard and it seems that's available from over by the "ashtray".)

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Wed Mar 07, 2018 9:01 pm

crj wrote:(It would need to scavenge a ground connection from somewhere on the keyboard, but I just took a look at a keyboard and it seems that's available from over by the "ashtray".)
...but only if you've got the speech upgrade. Drat.

Next closest is the speaker, but firstly I'm guessing that might be a pretty noisy source of ground reference and secondly it would be nice if the keyboard LEDs worked with the speaker unplugged. It'd probably be necessary to run a wire all the way round to the IC up by F1, or the adjacent smoothing capacitor. Ah well. Could be worse.

User avatar
1024MAK
Posts: 7416
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: RGB keyboard LEDs?

Post by 1024MAK » Thu Mar 08, 2018 8:02 am

That sounds like a lot of work.

If I change the LEDs in one of my machines, I think I would go for the self/automatic colour changing type. These are RGB LEDs with two legs. They slowly cycle through the various colours without needing any external controls :D

And I already have a bag full of cheap Chinese colour changing LEDs.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
danielj
Posts: 6161
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: RGB keyboard LEDs?

Post by danielj » Thu Mar 08, 2018 9:15 am

I'd start thinking my coffee had been adulterated... :lol:

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Thu Mar 08, 2018 5:04 pm

1024MAK wrote:That sounds like a lot of work.
Do you mean a lot of development work, or a lot of work to fit?
If I change the LEDs in one of my machines, I think I would go for the self/automatic colour changing type.
Psychedelic, but it wouldn't enable you to display a richer palette of status indications than you already have.

To fit such a thing you'd have to desolder the existing LEDs, in my book that's less destructive (and certainly more reversible) than something like the extra holes you have to drill for the Retroclinic DataCentre LEDs.

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Thu Mar 08, 2018 5:33 pm

...I'm being dense.

Having been blinded by the coolness of the NeoPixel LEDs, I've just realised it would be much simpler to use conventional common-anode RGB LEDs. Pass red and anode straight through to the keyboard PCB; run six wires elsewhere for the three greens and blues.

If I knocked up a trivial circuit board with gigantic surface mount pads for the six green and blue cathodes, I bet it would be reasonably straightforward for anyone with a pair of needle-nose pliers to bend the pins and solder them down, even in the limited space available. I may give it a go.

User avatar
simoni
Posts: 400
Joined: Wed May 25, 2016 6:18 pm
Contact:

Re: RGB keyboard LEDs?

Post by simoni » Sat Mar 10, 2018 10:10 pm

You could also consider making a small PCB to hold the new leds which is mounted above the keyboard PCB (since there is plenty of height available). This could simply be affixed into the GND pins of the keyboard PCB (since the top will be held in place by the case itself). If you put a right-angle pin header along the side of the new board, you'd also simplify your wiring and make it removable.

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Sun Mar 11, 2018 4:11 am

Agreed. Putting the new board above the keyboard's seating plate has occurred to me as an option.

I stopped putting stuff here because the number of people saying they wanted anything of the sort was approximately zero, but I've continued thinking.

My plan as it currently stands is to make a board with an ATtiny85, as used on the Adafruit Trinket, which already has open-source support for driving NeoPixel. The ATtiny85 has 6 GPIOs, so 1 to drive the NeoPixels, 3 to sense the lines to the original LEDs, 2 for an I2C port.

I'm then thinking that the way to make everything hold together robustly is to 3D-print a little three-part frame which holds the LED PCB and has three protrusions downwards, each containing two tubes for wires. That could lead to a straightforward installation process:
  • Solder one end of a piece of insulated wire to the LED PCB's ground connection
  • Desolder existing LEDs
  • Introduce long pieces of bare wire upwards through keyboard PCB and seating plate. Solder them to the keyboard PCB
  • Thread wires through the tubes in part A of the frame
  • Insert part B to separate the wires, diverting them North and South of where the NeoPixels are mounted
  • Thread the wires through the LED PCB
  • Drop the LED PCB onto the frame and slide part C on from one end to retain it
  • Solder the wires to it and trim them to length
  • Solder the other end of the ground wire to a suitable point on the keyboard PCB
Well, when I sat straightforward, I recognise I'd need some diagrams and photos if I wanted anyone else to be able to follow it, but I reckon it would be a five-minute job that could be done by anyone who can solder.

cmorley
Posts: 458
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford
Contact:

Re: RGB keyboard LEDs?

Post by cmorley » Sun Mar 11, 2018 11:45 am

crj wrote:I stopped putting stuff here because the number of people saying they wanted anything of the sort was approximately zero, but I've continued thinking.
Don't not post. I've found that many people (including me) read the posts about people's projects for curiosity without posting or engaging in the topic. Several threads I started seem to be me talking to myself but the read counters suggest many people (or bots? ;) ) are following.

As for the LEDs... it would be possible to use the ext rom connector PL14 and some bridges on IC99 (if not fitted) to get IO from the system VIA to your LED controller. With a buffer board you could drive multicoloured 5mm LEDs in the original locations from the 6502 and a custom ROM image perhaps.

User avatar
1024MAK
Posts: 7416
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: RGB keyboard LEDs?

Post by 1024MAK » Sun Mar 11, 2018 12:53 pm

Just out of interest, what kind of additional information do you foresee being indicated by these LEDs?

That is, what is it's main application apart from a possible modified Elite?

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Sun Mar 11, 2018 8:53 pm

cmorley wrote:Don't not post. I've found that many people (including me) read the posts about people's projects for curiosity without posting or engaging in the topic. Several threads I started seem to be me talking to myself but the read counters suggest many people (or bots? ;) ) are following.
I've not spotted read counters; where are they hiding?

A sense of limited interest in something partly discourages me from posting about it, but more than that discourages me from thinking about it. I tend to have more ideas than I know what to do with, so it makes sense to focus on ones other people also find cool. Not that I seem able to dictate to my brain what it should and shouldn't think about...
As for the LEDs... it would be possible to use the ext rom connector PL14 and some bridges on IC99 (if not fitted) to get IO from the system VIA to your LED controller. With a buffer board you could drive multicoloured 5mm LEDs in the original locations from the 6502 and a custom ROM image perhaps.
Hmm. Well. You could. But given that would involve bodging mainboard IC99, committing keyboard SK1/2 and sourcing a scarce SIL ribbon cable, I'm tempted to say that it would be simpler just to run a suitable cable directly from an LED PCB to whatever's controlling it. Especially as making it play nice with a speech system if that's installed looks quite challenging.

cmorley
Posts: 458
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford
Contact:

Re: RGB keyboard LEDs?

Post by cmorley » Sun Mar 11, 2018 8:59 pm

crj wrote:I've not spotted read counters; where are they hiding?
counters.png

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Sun Mar 11, 2018 9:02 pm

1024MAK wrote:Just out of interest, what kind of additional information do you foresee being indicated by these LEDs?

That is, what is it's main application apart from a possible modified Elite?
To be clear, although this thinking came out of talking about a modified Elite, I'm not at all thinking in terms of that as a use for it.

I do have a specific expansion I'm already thinking about that would benefit from a few status LEDs, and I'm still trying to avoid being drawn on that. But it might be more generally useful as a way to provide a drive activity light for SD card readers, an alternative to drilling extra LED holes for the RetroClinic DataCentre or what-have-you. Some people might like the idea of dynamically configuring the colour of the LEDs, providing a BBC-Master-style power LED for the model B or whatever.

Maybe people would like some status LEDs for PiTubeDirect, even?

I admit "because I thought of it and it's possible" is a major motivator, though. (-8

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Sun Mar 11, 2018 9:03 pm

cmorley wrote:[Image]
Oh! In the list of postings. After you mentioned it, I looked for it everywhere on the page for the posting itself. D'oh!

SteveF
Posts: 508
Joined: Fri Aug 28, 2015 8:34 pm
Contact:

Re: RGB keyboard LEDs?

Post by SteveF » Sun Mar 11, 2018 10:16 pm

cmorley wrote:
crj wrote:I stopped putting stuff here because the number of people saying they wanted anything of the sort was approximately zero, but I've continued thinking.
Don't not post. I've found that many people (including me) read the posts about people's projects for curiosity without posting or engaging in the topic. Several threads I started seem to be me talking to myself but the read counters suggest many people (or bots? ;) ) are following.
I try to avoid posting too many "That's really cool!" posts myself to keep the noise levels down, but I can see how it might be discouraging. I completely agree with cmorley on this - I read all sorts of threads on here and think they're cool, even if I wouldn't really want to own one myself (for hardware projects) or use it (for software projects). It's just nice to see all the creative stuff people can do with these old machines.

User avatar
simoni
Posts: 400
Joined: Wed May 25, 2016 6:18 pm
Contact:

Re: RGB keyboard LEDs?

Post by simoni » Mon Mar 12, 2018 6:04 am

Rather than making it too single purpose, you could just wire it up for the 3 normal indicators plus power; then place some headers on the board for other 'triggers'. For example, people with datacentres/IDE solutions often want another LED to show drive activity - you could simply hop it over to your adapter or, for the Elite thing, use it as a front end. If the headers are wired to 'act' like LEDs (i.e. any wire that should go to an LED can drive them) - then you would have a drop-in-place solution that avoids drilling more holes in the case - which is pretty useful IMHO.

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Mon Mar 12, 2018 9:27 am

I like the idea of making it generic. On the other hand, there's an argument that 5V I2C is already as generic as interfaces come. A little board using the same ATtiny85 could inject four signals… and because it's I2C you could daisy-chain as many as you wanted.

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Mon Mar 12, 2018 10:24 am

(Incidentally, it's perhaps worth highlighting that the ATtiny85 costs only £1 for the DIP version sold singly, less wholesale and/or surface-mount.)

User avatar
myelin
Posts: 410
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: RGB keyboard LEDs?

Post by myelin » Mon Mar 12, 2018 5:34 pm

SteveF wrote:I try to avoid posting too many "That's really cool!" posts myself to keep the noise levels down, but I can see how it might be discouraging. I completely agree with cmorley on this - I read all sorts of threads on here and think they're cool, even if I wouldn't really want to own one myself (for hardware projects) or use it (for software projects). It's just nice to see all the creative stuff people can do with these old machines.
Me too! I love hearing about new projects, and reading updates on existing ones, even ones that are only in the planning stage.

I feel your pain w.r.t. having too many ideas and not enough time to implement them... I have such a backlog right now on all the things I want to do / I think would be cool / I've promised other people!
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Tue Mar 13, 2018 6:06 pm

To those I've chatted to about various projects: this thread is evidence of how rapidly and wildly my scheming can veer from one place to another before I ever put soldering iron to PCB or code to text editor.

(For better or worse. On the one hand, this idea is clearly steadily improving; on the other, it's not steadily getting implemented.)

So here's the new scheme: be modular, and be solderless. I'm thinking of putting I2C over Molex PicoBlade 4-pin connectors at 5V, wired VCC, SDA, GND, SCL. Give each module two connectors, so they can daisy-chain. Pre-wired leads are readily available in an assortment of lengths up to 60cm.

(Sidebar: being careful about power, pull-ups and ground loops, I'm tentatively defining three modes of attachment:
  • Independently powered: VCC is n/c; GND is joined to local GND via a 100ohm resistor
  • Power consumer
  • Power source: provides +5V and the reference ground; pulls SDA and SCL weakly to VCC. But because there must be exactly one power source on the bus, each power source should have four links you can break to make it independently powered)
Now, make a keyboard LED module which has three NeoPixels in the correct spacing. This doesn't have to attach electrically to the keyboard PCB, so it only needs to anchor mechanically to the holes in the seating plate; I have a plan for a straightforward 3D-printed part that would do this. An advantage of this configuration means it can be tested before committing to desoldering the existing keyboard LEDs. A further advantage is that someone averse to soldering could instead snip out the existing LEDs.

Secondly, make a keyboard interfacing module which is interposed between the keyboard ribbon cable and the keyboard PCB. That provides power, ground, the LED signals and, as a bonus, also reset. Since it wouldn't have to modify any of the signals, only observe them, it could use a straightforward stacking header.

Those two modules between them are enough to get back to square one of having working keyboard LEDs. (-8

Then modules could be provided which controlled the LEDs from individual binary signals, from the user port or 1MHz bus, from the RetroClinic DataCentre's LED multiway connector, etc. And it could link to anything else in the existing I2C ecosystem.

User avatar
MartinB
Posts: 4698
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: RGB keyboard LEDs?

Post by MartinB » Tue Mar 13, 2018 8:43 pm

crj wrote:So here's the new scheme: be modular, and be solderless. I'm thinking of putting I2C over Molex PicoBlade 4-pin connectors at 5V, wired VCC, SDA, GND, SCL. Give each module two connectors, so they can daisy-chain. Pre-wired leads are readily available in an assortment of lengths up to 60cm.
I think I've lost track of what constitutes the 'module', (I'm easily lost) but do they allow you to set a range of I2C addresses? (Because you can only daisy-chain as many as there are different device addresses.)

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Tue Mar 13, 2018 9:18 pm

(As an aside, a few hours on I'm now leaning towards 0.1" connectors rather than PicoBlade. They're not polarised, but on the other hand they're easier to work with in all sorts of ways.)
MartinB wrote:I think I've lost track of what constitutes the 'module'
It's something sitting on the I2C bus, either transmitting status information to be reflected to the user via LEDs, or receiving that information. Though those uses could, I guess, be interspersed with other things using the same bus in different ways.
do they allow you to set a range of I2C addresses? (Because you can only daisy-chain as many as there are different device addresses.)
Some I2C devices provide links to change their address. The ATtiny85 doesn't have enough spare pins for that, but its address (and, indeed, most of the I2C stack) is done in software not hardware, so it could be programmed to have whatever address was desired.

Given I've currently only thought of half a dozen or so ideas for different modules, 128 addresses is ample!

User avatar
richardtoohey
Posts: 3563
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: RGB keyboard LEDs?

Post by richardtoohey » Sun Apr 01, 2018 11:52 pm

crj wrote:To those I've chatted to about various projects: this thread is evidence of how rapidly and wildly my scheming can veer from one place to another
Your mention of the Adafruit Trinket sent me off to their site, and now I've got some Trinket M0s and I am learning about I2C and SPI and CircuitPython. Not sure it will end up with anything useful, but fun learning ... :D

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: RGB keyboard LEDs?

Post by crj » Mon Apr 02, 2018 1:05 am

Excellent! (-8

Limor "Lady Ada" Fried has spoken a few times about the maker culture of today feeling very like the home computer revolution of the late seventies and early eighties. The kids who'd have been hacking in BASIC 40 years ago are now messing about with 3D printers and a pile of electronic modules wired together.

There are whole classes of product that can now be designed in bedrooms that previously needed a few million pounds of mechanical engineering lab. It's mainframes and micros all over again.

User avatar
richardtoohey
Posts: 3563
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: RGB keyboard LEDs?

Post by richardtoohey » Mon Apr 02, 2018 1:11 am

These Trinkets - "new" M0 ones - are great - no micro/mini HDMI, no power supply needed, no installs, no IDE, no yadda yadda. Plug into USB, edit/save main.py, your new code is running.

Serial console, Ctrl-C and you drop into a command prompt and can play directly and interactively.

Pins, blinking lights, USB HID keyboard stuff ... =P~ :D

Just immediate on, start typing, like turning on a BBC B. :D

(Well, maybe a mount command (if required) and a cu/screen for the serial console access.)

Great tutorials online, forums, projects ...

Anyway, I'm drifting off-topic ... [-X

Post Reply