Author Topic: Questing about simplifying LED schematic  (Read 1697 times)

0 Members and 1 Guest are viewing this topic.

Offline SjoerdTopic starter

  • Newbie
  • Posts: 8
  • Country: nl
Re: Questing about simplifying LED schematic
« Reply #25 on: November 23, 2024, 08:14:19 pm »
1. Oops - that's is wrong. Thank you. On the breadboard the caps are hooked to GND. On the schematic I clearly wired that incorrectly - will correct that.
2. Regarding the bi-directional LED. I thought I was being clever since the arduino can also sink current so: If I make D5 HIGH, the current flows though the red LED to GND. If I make D6 LOW, the current flows from Vcc through the green LED sinking into D6.. This works. Also it save me a pin. I could wired it like "D6 - 330ohm - BI-LED - D7" but in think it's a waste of a pin and I need to alter the code so that D7 = ! D6.. The only extra benefit is that I could have a 3rd state: OFF when both D6 and D7 are either HIGH or LOW.
3. The 4 sensor are on an entirely different circuit. They have a different power-supply and therefore different grounds - I do not want to mix those (I think I mentioned that before, not sure)
 

Offline PGPG

  • Frequent Contributor
  • **
  • Posts: 374
  • Country: pl
Re: Questing about simplifying LED schematic
« Reply #26 on: November 23, 2024, 09:09:25 pm »
2.
You wrongly explain what is going on with currents. Through resistor you 'don't use' in one on second situation current flows all the time. So what you loose is 5/0.66 = 7.6mA continually lost current. Some my devices consumes less average current than you are losing here
To count LED current replace this divider by equal source that is voltage source having Vcc/2 = 2.5V and resistor in serie equal to paralel connection of your resistors so 165Ω.
So assuming LED voltage drop being 1.8V (red) and 2V (green) the current in LED is set by (2.5V-1.8V)/165Ω or (2.5V-1.8V)/165Ω.
If you try to do such trick having VCC = 3.3V you will get voltage too small for LEDs.
Saving pin is only important if you don't have spare one. If you really need to save a pin you can invert your output using for example 74HC1G14.
You can also use Red/Green LED having 3 pins and not 2.
« Last Edit: November 23, 2024, 09:11:32 pm by PGPG »
 

Offline SjoerdTopic starter

  • Newbie
  • Posts: 8
  • Country: nl
Re: Questing about simplifying LED schematic
« Reply #27 on: November 24, 2024, 09:31:45 am »
At 2) - you are still talking about the radio status led? Because there are no led's attached to the 74hc14. Only the 4 of the data-in lines of the 1st 74hc165 (U2) have those and all of th data-out lines of the 74hc595. I'm not sure if I had any 3-pin leds laying around. I need to check the starter kits I have if there is one in there. Makes indeed more sense to use different pin for different LEDs now that you mentioned a 3pin LED.

This is the altered "debounce circuit":
2444993-0
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13022
  • Country: ch
Re: Questing about simplifying LED schematic
« Reply #28 on: November 24, 2024, 11:53:35 am »
But take in mind, that I have never even seen easyeda.

I decided to make a short look what easyeda is.
My first impression is that you work somewhere there and not at your PC. It is not for me. I'm too old for such solutions :). I just prefer to myself take care of my files and not let it to someone else.
I don't know what are the rules for example if some day someone will just say: "We finish offering this and we just disappearing." What happens with all your work?

It also looks for me that in free version you can't use your private libraries.
What !?
I am using only my own libraries to be sure that I take care of everything.

I see easyeda is simply not for me, but may be it is really good piece of software.

With KiCad everything works at my PC. If at any moment someone will decide to close that project (may be a commercial firm will find a way to close competition - don't know if it is possible, but...) I will have its last version working. Maybe I'm oversensitive, but even impossible things sometimes happen in this world.
There is a downloadable version of EasyEDA, too.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 13022
  • Country: ch
Re: Questing about simplifying LED schematic
« Reply #29 on: November 24, 2024, 12:04:14 pm »
At 2) - you are still talking about the radio status led? Because there are no led's attached to the 74hc14. Only the 4 of the data-in lines of the 1st 74hc165 (U2) have those and all of th data-out lines of the 74hc595. I'm not sure if I had any 3-pin leds laying around. I need to check the starter kits I have if there is one in there. Makes indeed more sense to use different pin for different LEDs now that you mentioned a 3pin LED.
Yes, he means the radio status LED.

What he’s saying is that the way you have it now wastes power because you always have current flowing (5V/660 ohms = 7.6mA) even with the LED off, and that because the voltage is ~2.5V, many modern LEDs won’t even work.

He is saying you could create a single-pin solution by using another inverter so that you always have a complementary version of the arduino pin: if arduino pin is high, the inverter output is low; if arduino pin is low, inverter output is high. The bidirectional LED gets connected between the arduino pin and the inverter output. The downside to this solution is that you need the inverter, and that you cannot turn the LED off: it’s always either red or green.
 

Offline PlainName

  • Super Contributor
  • ***
  • Posts: 7464
  • Country: va
Re: Questing about simplifying LED schematic
« Reply #30 on: November 24, 2024, 12:28:18 pm »
Quote
And before any starts off with "that's all wrong" and such

Don't know about the workings, but it's refreshing to see a properly-drawn schematic that doesn't replace wires with labelled ports. In contrast to many shown by new users on this forum, yours is easily readable and conveys intent very well.

 :-+
 
The following users thanked this post: Ian.M, tooki, Sjoerd

Offline SjoerdTopic starter

  • Newbie
  • Posts: 8
  • Country: nl
Re: Questing about simplifying LED schematic
« Reply #31 on: November 24, 2024, 12:51:36 pm »
Thank you so much for this comment. :)

About the workings - this is the "transmitter". The state of the four 12v sensors will be transmitted to a receiver which repeats the state of those sensor. The 4 user buttons are "overrides". I programmed the Arduino so the 4 user buttons behave like toggles. The 8 dips are for setting the address but not using them yet - this project was to learn about shift-registers in the first place and when I stumbled upon a Arduino nano with build in rf I figured lets make something.

For the schematic, I've been looking at how others do it and some are a pain to read and more messy that a plate of spaghetti. Also, the founder of EEV, Dave, has a video I watched a couple of months a go (#1129 - Creating a Nice Readable Schematic) which gave me some good guidelines.

There is still room for improvement though.

I'm still struggling with KiCAD a bit but I will get there.
« Last Edit: November 24, 2024, 01:34:44 pm by Sjoerd »
 

Offline PGPG

  • Frequent Contributor
  • **
  • Posts: 374
  • Country: pl
Re: Questing about simplifying LED schematic
« Reply #32 on: November 24, 2024, 01:52:37 pm »
Thank you so much for this comment. :)

If it makes you happy, I can also confirm that I have the same opinion about your scheme.

My schematic differs from yours in thet I am placing blocking capacitors near VCC pin and use GND symbol to connect their second pin (like you use VCC symbol). It is because GND I have always made as w whole filled layer so GND connection has small impedance while VCC not and the good place for blocking capacitor is near IC VCC pin.

There is still room for improvement though.

Your debouce circuits have 1k*100n = 100us time constants. I don't know what are real time contacts can bouncing but much longer time is certainly not noticeable for human pressing the button and as HC inputs are very high impedance there is absolutely nothing agains using 100k+100n with 10ms time constant. IC with Schmitt input can get slowly changing signal with no risk of instability.

I'm still struggling with KiCAD a bit but I will get there.
It was me who suggested you KiCad.
If you have any questions come to KiCad users forum. I'm there since 2017. You will identify me by my avatar (unfortunately here any logins I could think of based on my name were occupied).



 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf