Flashing an LED - Page 1
Forum section: electronics / beginners

author: Assafl
author_rank: Frequent Contributor
timestamp: August 12, 2016, 11:36:54 am
content: This isn't a question - but a thought. A comment made by someone on the Ahmed's-LED-clock-to-school-fiasco thread got me thinking about flashing an LED. It is one of the first things we did as electronics hobbyists, using a flip-flop, an NE555, or an Arduino. And then we evolved as hobbyists to liking more complex stuff.Well, I admit to have never given up liking (and being proud of) flashing an LED 40 year later. But not just for the lighting effects.I think a flashing LED makes for an awesome debugging tool. I like to double the role of an LED to not just show power butwhat the system is doing.As examples, on my coffee roaster, LEDs on the heater circuit show the PWM to the heaters. Even more debugging is an LED showing the phase detector operation.On my coffee grinder, the main and only LED flickers with the measured RMS current to the motor (to show load above a threshold). This last one was extremely helpful in setting the threshold as running the Arduino circuit with a USB port connected (so I can monitor the Serial out) - was dangerous.A hard disk LED, an Ethernet port LED are other examples of how an LED can be used not just as a fancy light (or - not so fancy anymore) - but as a real tool to depict system operation.For beginners, I think the main problem is figuring out:1. What value can tell me the important thing about the system (that it is working or has a problem)?2. How do I convert the value to an LED brightness and flicker (best) or morse code (awful).As examples, for the grinder, the purpose of the Arduino is to measure motor load by measuring the RMS current to the motor, and shut the motor off when grinding is done. So I multiplex two measurements on the LED: RMS as PWM brightness - and threshold when the LED turns off. This way I can tell if the Hall Effect sensor is alive (LED works when it grinds); and that the threshold is correct (LED is lit when grinding).Just a thought for whomever out there has an LED pin and is wondering if it is useful or not... Comments and ideas welcome (of course).

author: Zero999
author_rank: Super Contributor
timestamp: August 12, 2016, 06:36:16 pm
content: What an odd thread?If I want an LED which flashes continuously and nothing else, I wouldn't bother with a 555 or anything like that. I'd just buy an LED with the flasher built-in.

author: Assafl
author_rank: Frequent Contributor
timestamp: August 12, 2016, 06:59:14 pm
content: In the early 80's flashing LEDs were hard to come by. But NE555 were everywhere.Anyway, the idea is not to Flash an LED - but to make the flashing convey something useful.

author: zapta
author_rank: Super Contributor
timestamp: August 12, 2016, 08:41:35 pm
content: Quote from: Assafl on August 12, 2016, 06:59:14 pmI used that idea in a few projects. The LED module accepts a 32 bit pattern and displays it continuously, one but at a time. Very handy.

author: Assafl
author_rank: Frequent Contributor
timestamp: August 12, 2016, 09:32:43 pm
content: I find that flashin a code is tough to get to an easily decipherable state. How do you make it easy to decode the 32 bit long pattern?

author: zapta
author_rank: Super Contributor
timestamp: August 12, 2016, 09:44:26 pm
content: Quote from: Assafl on August 12, 2016, 09:32:43 pmI just encode easy to recognize patterns, fast blinking, slow blinking, dot dot dot space blinking, reverse polarity blinking, etc. With a little bit of creativity you can always come up with one new pattern

author: Assafl
author_rank: Frequent Contributor
timestamp: August 13, 2016, 07:39:58 am
content: The Mooshineter uses that kind of blink patterns. Cool, but I guess I am dyslexic as I always have to look up the blink patterns.

author: Seekonk
author_rank: Super Contributor
timestamp: August 13, 2016, 12:49:33 pm
content: I have a micro running my entire off grid camp, refrigerator, hot water, multiple MPPT chargers. The display is just two LED. One red flashes about every 8 seconds just to show it is on. It also flashes for every degree above the set point of the fridge. A bit later there will be a long flash, indicating battery, if the battery is just below a full charge, there are two more flashes indicating lower states of battery.A blue LED is for the fridge. It flashes for every minute the fridge has been on, max 8. If the fridge is not on, it will show the delay in minutes, preventing a hot start, before the fridge can come on. At a glance I can easy tell the state of the system from 20 fees away. A single flash means the world is happy. I don't want more than that. Identifiers like long flashes are very helpful.I wasn't thrilled with my firat car with an onboard computer. The flash sequence was too fast and the digits were bunched in together. It was very hard to read. I had to hookit up to a chart recorder to decipher.

author: Assafl
author_rank: Frequent Contributor
timestamp: August 13, 2016, 03:01:20 pm
content: An LCD would be nice but try reading that from 20ft away.Sometimes 2 LEDs are needed - or a multicolor LED. One can imagine a PID circuit showing the temp as green if okay, blue if cold and red if hot.