cross-posted from: feddit.uk/post/56789745
Device
I had this cheap chinese radio
MIABOO M20, which had a ton of cool features: portable, bluetooth, aux, and radio. But the speaker wasn’t great (mono), and the battery didn’t last very long Image So I took it apart (beer, force, pliers) with great effort since there’s not a single screwhole anywhere on it as it was all glued together #### Components: * Speaker * Battery (no markings, but big and blue cyclinder, looks like a 18650 Li-ion) * Main board - 2-pin JST speaker connection and another 2-pin JST (2.4mm pitch) - SD card slot - MCU, unknown 18140 - 18-pin FPC connector to the LED board * LED board - 54 Lights: - 4x5 grid of different coloured LEDs - 4 digits with colon and a dot - 4 bottom lights - 4 buttons - 18-pin FPC connectorLED Board
#### Front 7 sets of something that appear to feed into everything else. My guess with the 54 LED lights is that it’s probably a 7x8 grid, and this is the “7” part. Some markings on the board: * Q are where the transistors are * 2A I think are fuses? * 104 and 102 are common resistors, with R names etched into the board * O are the test contacts on the board – little circles of metal for me to test with a multimeter Image
[O2] [O14] Q5 Q4 Q7 Q6 Q8 Q10 Q9 | 2A| | 2A| | 2A| | 2A| | 2A| | 2A| | 2A| |104| |104| |104| |104| |104| |104| |104| |102| |102| |102| |102| |102| |102| |102| R41 [O4] [O5] [O7] R42 [O8] [O9] [O10] R47 R40 [O6] R50 R44 R46 R45 [O12] R48 R43 [O15] R51 R52 R53 [O1] [O3] R49 [O18] [O13] | 02 04 06 08 10 12 14 16 18| [O16] |01 03 05 07 09 11 13 15 17 | [O17] [O11] | F P C - C O N N E C T O R - P I N |So the 18 pins of the FFC cable (flat flexible cable?) are shown in the above FPC connector. I used a multimeter in continuity mode to trace each pin to each of the contacts, and wrote down when it beeped. I then changed the numbering of the O contacts in the above schema so that each O number corresponds to an FPC pin (e.g. FPC Pin 18 traces a path to O18 on the board) #### Back - Back has all the lights, see the videoInvestigating the Board
So I hooked the 18-pin 0.5mm pitch ribbon cable into a 0.5mm FPC breakout board (5 quid, ebay), and then stuck each pin into a GPIO on my Raspberry Pi for testing. #### Charlieplexing I’ve talked about charlieplexing in a previous post, but the main gist is that pairs of pins, 1 high and 1 low is what drives a single LED. I assumed this was the case with this LED board, but when I tested every single pair against every other pair, I got nothing. Not a blip. #### Broken lights? At first I thought I’d somehow botched the board when I was taking it apart, and was worried that the LEDs were simply broken. I didn’t know what to do, but after reading a bit I found out that a multimeter is the perfect tool for this because it has something known as Diode Mode which lets you literally put one probe on side of a diode, and another probe on the other side, and then it shoots a little tiny current through it. At first I thought this was just mumbo jumbo, but thought I would give it a go, and - OH MY GOD IT WORKS! - each LED I tested this way sparkled light at me. So I knew the board was working! I just have to figure out how to use the pins to get the signals down there. #### Actual broken lights Okay, so in my excitement in this discovery of Diode Mode on a multimeter, I then packed it away and got out my USB-to-TTL chip which also has VCC and Ground contacts. For some reason I thought I would just double check an LED again using the 5v from the USB and the Ground on an LED, and… nothing happened. Wondering what happened, I tried the 3v3 from the USB and the Ground on the LED, and… (-PEW-) I smelled something burning. I saw a little puff of smoke rising out of a blown LED, and wondering what happened, I stupidly did again on another LED, and another puff of smoking. ##### Oh dear So what happened? Well it turns out that circuits have resistors and fuses for a reason, and that if you run an unrestricted current across a sensitive diode, it’s probably going to blow up. # 🫢 The reason why the multimeter is the better tool here, is because it gives a teeny tiny 1-2mA between the probes, and a USB can give 1000 times amount. Yeah… Live and learn.
:::: spoiler Multiplexing the Pins So charlieplexing from the previous section did not work, meaning that the board probably isn’t completely GPIO driven, but might actually have some dedicated pins for power and ground.
Which one’s though?
Not really knowing what I was doing, I connected the LED board back to the main board via the FFC ribbon and powered on the main board. A few lights lit up (yes, this would have been an easier test earlier with the lights), and then I started measuring the voltage difference between each of the O pads.
O Pad voltage matrix
| O\O | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | |-----|---------|-----------|---------|-------|--------|-------|-------|--------|--------|-------|-------|-------|-----|-----|-----|----|----| | 1 | | | | | | | | | | | | | | | | | | | 2 | 2.9 | | | | | | | | | | | | | | | | | | 3 | -0.3 | -3.2 | | | | | | | | | | | | | | | | | 4 | .14-.17 | -2.8 | .4 | | | | | | | | | | | | | | | | 5 | .14-.17 | -2.8 | .4 | 0 | | | | | | | | | | | | | | | 6 | .14-.17 | -2.8 | .4 | 0 | -.002 | | | | | | | | | | | | | | 7 | .14-.17 | -2.8 | .4 | 0 | 0 | .001 | | | | | | | | | | | | | 8 | .14-.17 | -2.8 | .4 | 0 | 0 | .001 | -.001 | | | | | | | | | | | | 9 | .14-.17 | -2.8 | .4 | 0 | 0 | .001 | -.001 | 0 | | | | | | | | | | | 10 | .14-.17 | -2.8 | .4 | 0 | 0 | .001 | -.001 | 0 | -.001 | | | | | | | | | | 11 | 0.05 | -1.2 | 1.9 | 1.5 | .7 | .3 | -.05 | .3 | .3 | .3 | | | | | | | | | 12 | .8-1.1 | -1.7-2.0 | 1.1-1.4 | .3-.6 | .7-1.0 | .3-.7 | .4-.6 | .7-1.0 | .7-1.1 | .3-.6 | -.3-0 | | | | | | | | 13 | .45 | -2.4 | 1.1 | .7 | .7 | .3 | .7 | .7 | .7 | .6 | 0 | .4-.7 | | | | | | | 14 | .97 | -1.5 | 1.6 | .8 | .4 | .4 | .4 | .4 | .4 | .4 | .65 | .5-.8 | .3 | | | | | | 15 | .49 | -2.4 | .3 | .3 | .3 | -.04 | .3 | .3 | .3 | .3 | .06 | 0-.4 | .74 | -.8 | | | | | 16 | .5 | -2.3 | .8 | .02 | .01 | .4 | .4 | .4 | .02 | .4 | -.3 | .1-.4 | -.3 | -.3 | -.8 | | | | 17 | .4 | -2.4 | .3 | -.05 | .7 | .3 | .7 | .7 | .7 | .3 | 0 | .4-.6 | 0 | 0 | 0 | .8 | | | 18 | .3-.7 | -2.1–2.5 | .6-1.0 | -.04 | -.05 | -.05 | -.05 | -.05 | -.05 | -0.04 | -.77 | .3-.6 | -.7 | -.8 | -.4 | .4 | 0 |
Great… what does any of this tell us?
Well there’s a pretty high chance that the 2.9V that I got when I put the red probe on 1 and the black probe on 2, gave the highest the positive voltage across the board is the main power line (Pin 1).
There’s also a pretty high chance that the -3.2V I got when I put the red probe on 2 and the black probe on 3 is the main ground line (Pin 2). So I think the board operates at roughly 3.3 V, and the first two pins are power pins.
Okay, and does this work?
I moved Pins 1 and 2 in my initial setup on the Raspberry Pi to the 3v3 Pin and to the ground, and yep, things started lighting up!
I assumed that the rest of the lights were charlieplexed, and so I did pair testing on the other 16 pins, and I started getting individual LED’s to light up!
Using this information I started to write a little driver and will start using this for my halloween projects!