Jukebox Mike
Posts: 19
Joined: Fri Jul 06, 2018 3:19 pm
Location: FRANCE

Re: Illuminated push button

Sun Sep 16, 2018 2:53 pm

Hi again

I have established that the led still lights up with sufficient brightness at 3 volts. So do I need a current limiting resistor or not?
I was intending to connect the led between ground and the TXD pin ( serial console monitor ) - GPIO pin 14 , as per this article -

https://howchoo.com/g/ytzjyzy4m2e/build ... -indicator

Brandon92
Posts: 791
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Illuminated push button

Sun Sep 16, 2018 3:29 pm

I would advice to use a resistor. So, you know that the led doesn't draw to much current. And if you don't use one this could course a problem on your data line.

Jukebox Mike
Posts: 19
Joined: Fri Jul 06, 2018 3:19 pm
Location: FRANCE

Re: Illuminated push button

Sun Sep 16, 2018 3:51 pm

OK thanks.

I will do that. 330 ohms do you think?

Brandon92
Posts: 791
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Illuminated push button

Sun Sep 16, 2018 4:37 pm

I think that value is a little bit to big. However you could try it. But I don't think your LED is going to light up.

Lets assume that your led used exact 3V and you tx is exact 3.3V. And you want a current of 5mA trough your led:
R = (3.3-3)/0.005 = 60 Ohm.

Jukebox Mike
Posts: 19
Joined: Fri Jul 06, 2018 3:19 pm
Location: FRANCE

Re: Illuminated push button

Sun Sep 16, 2018 5:50 pm

Hi. Thanks for the info.
I know about the 5v0 and 3v3 pins, but was not sure about voltage between txd pin and ground.
I think also that my LED could still work at a little under 3v0 I will check it.
Maybe as I have got various resistors, I could start a little higher and work back towards 60 ohms.

Many thanks

Brandon92
Posts: 791
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Illuminated push button

Sun Sep 16, 2018 6:23 pm

Jukebox Mike wrote:
Sun Sep 16, 2018 5:50 pm
Hi. Thanks for the info.
I know about the 5v0 and 3v3 pins, but was not sure about voltage between txd pin and ground.
I think also that my LED could still work at a little under 3v0 I will check it.
Maybe as I have got various resistors, I could start a little higher and work back towards 60 ohms.

Many thanks
I assume it is 3.3V, because that is the maximum voltage that the Rpi GPIO can handle.
That's a good plan. If it light up with a higher resistor. Than you don't load the data bus as much.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Illuminated push button

Mon Sep 17, 2018 12:29 am

Jukebox Mike wrote:
Sun Sep 16, 2018 11:18 am
I have done just that. Problem is they come from China and I do not
expect to receive it for another 5 weeks

TaoBao ShenZhen SF Express Delivery Time

Ah, I usually place my TaoBao order to the ShenZhen factory direct or its flagship shop, and any order before 3pm usually shipped same day 5pm, and arrived next day evening.

So I have heard many couldn't-wait-any-longer guys actually move to ZhenShen, ...

16mm waterproof metal button switch, push on/release off or latch for power 250V/5A and LED 6V/12V/24/V220V/ Blue/Green/Red/Yellow ¥10 - 15
https://item.taobao.com/item.htm?spm=a1 ... dmg8j26111

MIT Innovation Node in Hong Kong - MIT 2015Nov09
http://news.mit.edu/2015/innovation-node-hong-kong-1109

Innovation Node aims to help students learn how to move ideas more rapidly from lab to market.

Increased opportunities for MIT students to conduct research ... focusing on innovation and entrepreneurship; internships at companies in the region; and the formation of a makerspace and startup programs for student entrepreneurs.

In preparing for a career in today’s global innovation economy, MIT’s students need an education that presents a global outlook on the challenges and opportunities in innovation and entrepreneurship

Major reason why MIT chose to establish an Innovation Node in Hong Kong is because it provides ready access to a unique manufacturing infrastructure that encourages rapid prototyping and scale-up.

About an hour’s commute from Hong Kong’s Central District lies Shenzhen, a city home to many scientists and engineers — and fast, low-volume manufacturing.

Manufacturers in Shenzhen have mastered the ability to take a prototype device to unit quantities of hundreds overnight,” ...

“This unparalleled speed of small quantity manufacturing is unique to Shenzhen.”

MIT students will learn hands-on lessons in designing and manufacturing for commercialization, giving students access and experience with this capability educates them in how to move more quickly from idea to product.”

Students will also be linked to opportunities along the Greater Pearl River Delta, a network of roughly a dozen major cities in southern China — including Hong Kong and Shenzhen — that serve as innovation hubs and economic drivers for the country.

Many MIT-based startups, in fact, already travel to Hong Kong and the Pearl River Delta region to prototype and produce devices ...
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Illuminated push button

Mon Sep 17, 2018 3:13 am

Burngate wrote:
Sun Sep 16, 2018 9:24 am
If it were me, and if they're really that cheap, I'd be buying more than one, then tearing one apart to find out what's really inside.
But that's just me.

Tearing down a made in Taiwan, 250VAC, 3A button switch with LED

So I am doing it! :lol:
Attachments
button_switch_with_led_2018sep1701.jpg
button_switch_with_led_2018sep1701.jpg (232.47 KiB) Viewed 1695 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Illuminated push button

Mon Sep 17, 2018 4:09 am

tlfong01 wrote:
Mon Sep 17, 2018 3:13 am
Tearing down a made in Taiwan, 250VAC, 3A button switch with LED
So I am doing it! :lol:

Testing Taiwan, 250VAC, 3A button switch with LED

Green LED - 2.5V 20mA

Orange LED - 2V 10mA
Attachments
button_switch_with_led_2018sep1702.jpg
button_switch_with_led_2018sep1702.jpg (235.98 KiB) Viewed 1685 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Illuminated push button

Mon Sep 17, 2018 6:16 am

tlfong01 wrote:
Mon Sep 17, 2018 4:09 am
Testing Taiwan, 250VAC, 3A button switch with LED
Green LED - 2.5V 20mA, Orange LED - 2V 10mA

LED Knowledge Update

Many years ago when I started playing with LED, I knew only red, green yellow ones. I was told that no one could make blue or white LEDs. But then some years later, there were blue and white LEDs. I also read that there are non polarized and non polarity LEDs. I also read that LED forward bias/satuarion/active voltage is 3V, not 2V any more.I got very confused and so started googling.

Understanding LED components - LED Chips - Yuji 2013/05/16
https://www.yujiintl.com/posts/view/und ... _led_chips

Understanding LED components - LED Packages - Yuji 2013/07/08
https://www.yujiintl.com/posts/view/und ... d_packages

Update2018sep17hkt2002

Why LED lighting can save you money - Yuji 2013may15
https://www.yujiintl.com/posts/view/why ... _you_money
Last edited by tlfong01 on Mon Sep 17, 2018 12:03 pm, edited 1 time in total.
I am an electronics and smart home hobbyist.

Jukebox Mike
Posts: 19
Joined: Fri Jul 06, 2018 3:19 pm
Location: FRANCE

Re: Illuminated push button

Mon Sep 17, 2018 8:34 am

RE:- I have done just that. Problem is they come from China and I do not
expect to receive it for another 5 weeks.

I live in France and normally I have to order from Shenzhen direct, although from time to time I can find stuff on-line from UK - MUCH higher cost and additional post & pack costs ( post free from Shenzen)
The orders are always delivered well within the quoted time frame ( anywhere from 2 weeks to 5 weeks )

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Illuminated push button

Mon Sep 17, 2018 9:32 am

Jukebox Mike wrote:
Mon Sep 17, 2018 8:34 am
I live in France and normally I have to order from Shenzhen direct, although from time to time I can find stuff on-line from UK - MUCH higher cost and additional post & pack costs ( post free from Shenzen)
The orders are always delivered well within the quoted time frame ( anywhere from 2 weeks to 5 weeks )

Cheap RGB LED module for learning

Well, if you are like me, playing with Rpi and electronics as a hobby, we can take our time and plan ahead. It is only those highly stressful young guys doing startups with very tight deadlines could not afford to wait.

And when I order something from TaoBao, I usually buy many more rubbish, seemingly useless things than I need, because the minimum express delivery fee is HKD35, and electronics components are usually very light. It is like going to a book shop and often buying too many books you never find time to read.

But sometimes I want to play with new toys, I would search toys box for toys I never played. Just now I wanted to learn new LED technology, I found some LED modules I bought perhaps one years ago.

And the big button switches I tore down earlier was bought more than 10 years ago!. :)

CU-553 RGB 0505 LED - ¥1.00
https://item.taobao.com/item.htm?spm=a3 ... 1726398458

https://es.aliexpress.com/item/CJMCU-55 ... 35374.html
Attachments
rgb_led_2018spe1701.jpg
rgb_led_2018spe1701.jpg (192.29 KiB) Viewed 1646 times
I am an electronics and smart home hobbyist.

Jukebox Mike
Posts: 19
Joined: Fri Jul 06, 2018 3:19 pm
Location: FRANCE

Re: Illuminated push button

Mon Sep 17, 2018 9:52 am

Hi.

Yes indeed. Plan ahead and allow the max. quoted delivery time. I have not been disappointed yet.
I have been playing with electronics since the 1960's and have somehow managed to keep up with things.
Have just (almost) completed a music player using Pi. I have installed Volumio as the software I have even managed to use up a couple of those
relay/timer modules to perform my wake up/send to sleep function using also the illuminated pushbutton which has been the main feature of this thread.

PiGraham
Posts: 3720
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Illuminated push button

Mon Sep 17, 2018 10:29 am

Jukebox Mike wrote:
Sun Sep 16, 2018 9:03 am
You are probably right on that.
Back to my LED question
I was intending to use it as a status lamp, ie LED on when Pi is active and LED off to tell me that Pi has gone to bed and I can pull the supply if I want to.
Two potential issues have come up -
1. over-current and the possible need for a resistor in series
2. under voltage and the need for a transistor

Any suggestions?

Use it with a series resistor. Brandon's suggestion / calculation of 60R is reasonable.

If 5mA lights it up bright enough then you don't need a transistor. That is only needed if you want more current than the gpio can supply directly.

My guess on the dual polarity is that there are two LEDs in there back to back and opposite polarity. That's the minimum component count to make an indicator that works on AC and DC.

Jukebox Mike
Posts: 19
Joined: Fri Jul 06, 2018 3:19 pm
Location: FRANCE

Re: Illuminated push button

Mon Sep 17, 2018 12:20 pm

Hi.

Thanks for the latest reply. I will go for it. I just had to order some more resistors as I found I am short on some values. It will be a matter of days now before I can put it to the test.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Illuminated push button

Mon Sep 17, 2018 1:57 pm

tlfong01 wrote:
Mon Sep 17, 2018 4:09 am
Testing Taiwan, 250VAC, 3A button switch with LED
Green LED - 2.5V 20mA
Orange LED - 2V 10mA

LED Current Measurements

I was very surprised to find that the big button switch LEDs take as big as 10mA to 20mA.

I usually use very small, 3mm (and sometimes 5mm) rectangular shape LEDs for my toy projects. At Vcc = 5V, I usually use the following current limiting resistors:

Red 1K2
Yel 560R
Grn 4K7
Blu 1K2

Yellow is usually very dim, so I use stronger 560R. Green LED is usually too bright, so I use 4K7 to weaken it. Some years ago I found green very weak. Perhaps the technologies has changed.

When I started playing with Arduino exactly 10 years ago, the standard series resistor is 560R. But I found 1K is bright enough for 5V drive. Perhaps my eye sight is a bit sensitive. I do have short sight and weak eye sight. :(

I originally thought that I could turn on red and yellow to get orange, and RGB to get white, but I was disappointed - I only see three distinctively separate little dots R, G, B.

In short, my first RGB LED experiment is disappointing. :(
Attachments
rgb_led_module_test_2018sep1701.jpg
rgb_led_module_test_2018sep1701.jpg (224.65 KiB) Viewed 1609 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Illuminated push button

Mon Sep 17, 2018 2:20 pm

PiGraham wrote:
Mon Sep 17, 2018 10:29 am
My guess on the dual polarity is that there are two LEDs in there back to back and opposite polarity. That's the minimum component count to make an indicator that works on AC and DC.

Is the non polarity LED thing using two LEDs in parallel, back to back?

I have a 220VAC 12W LED lamp/module. I watched a video by the funny guy Big Clive and learnt a lot about this kind of lamp. But I never knew or thought of the dual polarity or non polarity. I once wrongly thought that all 220VAC lamps should used a transformer to step down to 24V and then use a bridge rectifier to make it DC.

This morning I googled and read some articles and quickly jumped to the conclusion that the modern day non-polarity LED should use two LEDs in parallel, and back to back.

I read the article by ChaoYi Electronics and found the following they said very good.

Non polarity single colour LED consists of two same colour LED back to back, in parallel, in the same package (Note 1) .

The advantages are:

1. Application - for mains and AC power, reliable, simple, power efficient, can be used for both AC and DC power source.

2. Storage and transportation - because of the back to back diode, no fly back diode is needed, no electostatic discharge (ESD) problem.

3. Manufacturing - because of non polarity, no need to concern of any wrong polarity mistake, reduces production cost, failure rate, and maintenance.

Note 1 - I think because the two diodes are fabricated in the same die, therefore the extra manufacturing cost of the second diode is minimal, considering the main cost is in die fabrication (one or two diodes is 'almost' the same process), not extra materials of the second diode.

Appendix A - Non polarity LED references

(Chinese text only)Introduction to Non Polarity LED Characteristics - Chaoyi 2012jun12
http://www.chaoyi1688.com/Article/wujiLED_1.html

(Chinese text only) ChaoYi (EverLight)
http://www.chaoyi1688.com/Article/Introduction_1.html

Appendix B - My big LED Lamp and Big Clive video

220VAC 12W LED module
https://www.raspberrypi.org/forums/view ... e#p1344067
I am an electronics and smart home hobbyist.

snowbord
Posts: 12
Joined: Thu Dec 20, 2018 12:37 pm

Re: Illuminated push button

Thu Mar 21, 2019 2:35 pm

I'm following this thread with interest, as I have a similar conundrum. I however have taken a liking to these switches:
https://www.aliexpress.com/item/16mm-Me ... 26568.html

Now it gets interesting, as we have a huge choice of voltages to choose from - 3V, 5V, 6V, 12V and beyond. As stated in the description:
LED Voltage:Please choose the right Voltage in option. I am guessing these have built-in resistors, but will be running these offa a transistor (2N2222) so as to not stress out the GPIO pins.

I do have one of these rated at 12V and the LED works fine at 3V and 5V, although not as bright. I have also noticed the Adafruit switches are 6V (for the LED) and state 3-6V tolerance. I guess they light up the LED a lot dimmer at 3V, but why go for 6V when you can get 5V?
https://www.adafruit.com/product/481

Which voltage would you guys recommend? I am leaning towards 5V / 6V, but again why bother with 6V (although Adafruit do so).
Thanks!

Jukebox Mike
Posts: 19
Joined: Fri Jul 06, 2018 3:19 pm
Location: FRANCE

Re: Illuminated push button

Thu Mar 21, 2019 3:37 pm

Hi.

i finally established that my led was 5volts. I connected 120 ohms resistor in series and current draw is very small. Led not as bright as some I have seen but bright enough for me.

Return to “Beginners”