I have a MDBT42Q breakout board, driven by 7,2 V (Li-Ion 2S) and a Chinese button with builtin LED + resistor(?) that is rated for 12 V and below 2 mA at my voltage.
So I thought the simplest way to run this LED from a port is:
But the LED is lit always (a bit dimly) and only changes brightness when I do D15.set() or D15.reset().
I have tried any other pinMode too and it always lights up, never goes completely dark.
I would try to avoid any additional components like transistors if possible since I have gotten away without so far in this project and have just to wire up the board somehow to buton and a servo motor.
However, 3,3 V seems not to be enough to light the LED and that's why I came up with the opendrain thing to run it of the (higher) battery voltage.
What am I doing wrong?
I definitely wouldn't recommend that at all - it could cause lasting damage to your board.
What's happening is when the port is open drain, it's being pulled up to 7.2v by the LED, and the only thing stopping the MDBT42Q from being fried is an internal protection diode in the chip (the IO is only meant to have 3.3v on it).
I'm afraid all I can really suggest is:
I think those are probably the simplest options. On the Puck.js we have a built in FET, but then that lacks the voltage regulator so would have to stay running off the coin cell
Thanks @Gordon for clarifying - I almost have suspected something like that.
And meanwhile I wired back to just run the Button LED between gnd and the port.
It is a bit dimly still, but it is enough for me at the moment.
Not easy to pull the button apart though since the back is pressed in.
It one of these cheap china ones here: https://www.amazon.de/Gebildet-Momentanen-wasserdichte-Drucktaste-LED-Kontrollleuchte/dp/B088CNW12P/
Wow, those buttons look awesome! I might have to put an order in for some of those :)
But as you say, it doesn't look possible to easily change the LED :(
One more option is a 'voltage multiplier' : https://www.allaboutcircuits.com/textbook/semiconductors/chpt-3/voltage-multipliers/
It's still extra components (far more than just a FET) but it would allow you to run the MDBT42 off even a single LiPo battery and still get a higher voltage to light the LED.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem