Introduction: Smartphone Custom Programed Notification LED
Replace your fingerprint scanner with your custom programed notification LED. I made the mod on XIaomi Redmi Note 4X. We will use button backlight and reprogram it to use it as notification LED.
Step 1: Materials and LED
You will need:
- Tools to open your smartphone (guitar pics etc.)
- Thin wires
- Soldering Iron
- SMD Led
- LCD screen layers (to make the led correctly backlighted): reflector, plastic sheet, anti-glare and color filter (optional)
Cut all LED layers to fit your back cover hole (in my case finger print hole, you can drill your own). Combine them and glue the led to the plastic layer.
Step 2: Find Connectors
Find where to connect your new LED. I'm connecting it to button backlight pins. Make the path for the wires, trimming and drilling plastic phone parts.
Step 3: Soldering LED
Remove fingerprint scanner (if needed) and glue your LED and solder it to connectors. I connected LED positive pin directly to battery + because buttons backlight is driven by negative state so I used less wires (battery is closer than button light + pin) :P Remember to isolate everything (very important if you have alloy case). Close you phone and check if it works as buttons light, if it works lets go to the script.
Step 4: Android Bash Script
Script works very simply. It changes button light (notification LED now) state when the screen is off depending on real notification RGB LED state and USB charging. When screen is ON the LED works as hmm... led for design :P
Of course you can disable it in settings.
Script reads state of all RGB led colors and if some of them is greater than 0 it means that there is a notification and the custom led is blinking (I disabled charging notify so it is easy to know that it is notification not a charging).
If there is no notification and battery is charging the led will be ON. If the battery is charged led will blink 2 times quickly and then if there is a notification fill blink again. If you have different phone you will have to adjust the script (files' paths, battery max state).
Of course you need ROOT to execute the bash script in terminal emulator. First lines with "echo" add ADB, sh and bash to wake lock exception so the script will work all the time in background even if the screen is off.
That's all. More with Android hacking in the future! :D
Step 5: Accomplished
I am using polarizing filter as last led layer so the color is different depending on viewer angle.