Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Parallel > Serial > Parallel conversion

Status
Not open for further replies.
Sorry for misunderstanding.

I'll throw another idea into the ring then, it saves on space and uses a few less components: Don't use 5V as the supply, use something higher and drop it to 5V only for the controlling PIC. The higher voltage will let you wire the four LEDs in series although you will have to drive them through transistors. Forget the idea of wiring LEDs in parallel, it may work if the LEDS are very closely matched but there is a very high probability that they will be of unequal brightness or some will not light at all. To use them sucessfully in parallel you need a resistor in series with each LED. On the bright side (pun!) if you use a driver transistor you can run the LEDs at higher brightness, bearing in mind the maximum current you can typically draw from each PIC pin is about 20mA and there is a maximum for all pins combined of around 200mA. To be honest, I always design for a maximum current of about 5mA per pin and usually far less.

For example, use 12V as the supply (because it's commonly available) and use a resistor and Zener diode to regulate the PIC VDD at 5V. Four LEDS in series drop 2.2V * 4 = 8.8V so the single series resistor would be (12 - 8.8)/0.05 = 64 Ohms, a standard 68 Ohm will do fine. The idea isn't good if you want to use bi-colour LEDs though because reversing the polarity becomes more difficult.

Q. Are you planning on using one LED that produces 2 (or 3) colours or one LED of each colour in each position.

As you can see, there are multitudes of solutions. The problem isn't making it work, it's finding the easiest way to make it work.

Brian.
 

Re: Parallel > Serial > Parallel conversion

No worries.

I'd kind of discounted the idea of a higher source voltage because ideally I want this battery powered.

I did consider a 9v PP3 as the source, but with the voltage drop over the life of the battery I figured it would probably soon be under powered.

9v or 12v would be great from a DC source, but that means being close to a wall socket.

Can 9v be amplified/stabilised so that even when the cell drops there is still a constant stay supply?

As to the colours, week that is a classic example of me not taking the easy option.

The colours denote which team the player is on, so I could just use single colour LED's and be fine with it.

But I wanted to be clever and make the pieces universal.

I've been looking at 3 pin common anode LED's, I was hoping to find 4 pin 2 colour LED's, but it doesn't look like they exist. Maybe RGB LED's? I'll have to look.

That was one benefit of running the LED's in parallel with their own site resistor each, it meant the colour could be changed by switching grounds.
 

Re: Parallel > Serial > Parallel conversion

4 pin 2 colour LEDs exist in SMD but are wide angle.

What Colours, brightness and dispersion angle do you need? and Would like to have? (keeping a mind to availability)

I think the best battery is one with high power density, stable voltage and closest to the LED voltages and low cost.
That would be the CR123A battery Lithium, 3.0V using a MOSFET switch (RdsON< 1Ohm) would work well for B,G,W and 2V for R,Y,O options with a 1V drop resistor. A full wave bridge IC in SMT would be good for bi-directional colour drivers for low current or equivalent.

AS Brian indicated ( no pun intended) you can get very high Candle power at 20mA so you often dont need more than 5mA for indicators.

For more constant current thruout the entire SoC range a 3.6V LiPo is perfect or string many 16850 cells in series to have the discharge time you specify that you need and run strings in series.


Edit

I am still confused how these LEDs are supposed to look.
What game is it and what is the function and orientation of each LED in time or position.
 
Last edited:

I have RGB through-hole LEDs with a common cathode (but I find they are ugly - like cheap looking fairyland Christmas lights, and without sufficient current-limiting are possibly retina damaging devices!), four pins, if you use a PIC I guess you can set via the code the required voltage to turn each colour on, but I found they respond to "any old" voltage which would make using them a lot easier.

PP3 are perhaps a poor choice, unless the game will only last a few minutes or the power consumption is low. Here's an example datasheet:

https://data.energizer.com/PDFs/522.pdf


"Can 9v be amplified/stabilised so that even when the cell drops there is still a constant steady supply?"
- I read a datasheet the other day, but can't find it now, for what I think was more or less called a "buck/boost converter" or "buck/boost switching regulator" - it regulates the supply voltage down to the required voltage, then when the battery (voltage) has dropped to lower that the required voltage boosts the supply up, it looked a really handy device, sorry I can't find the datasheet or name...
 

You can use buck/boost to hold the voltage steady but it would be far more complicated than a bigger battery and the life may not be extended anyway. The extra current drawn in buck mode would place extra drain on the battery and in boost mode it converts additional current into the added voltage so the drain becomes even greater. It's good technology in some circumstances but as a way of extending the life of a feeble and non-renewable power source it isn't really suitable.

I would urge caution about recommending any particular battery type until the total load can be confirmed. The switch end would probably draw < 1mA and my best guess at the LED end is it could be as much as 24 * 5mA = 120mA but what isn't known is how many of these LED game peices will be on the board at a time. The total could be considerbly more than a small battery could manage.

Brian.
 
  • Like
Reactions: d123

    d123

    Points: 2
    Helpful Answer Positive Rating
Re: Parallel &gt; Serial &gt; Parallel conversion

4 pin 2 colour LEDs exist in SMD but are wide angle.

What Colours, brightness and dispersion angle do you need? and Would like to have? (keeping a mind to availability).

Don't really fancy working with SMD.

Colours - For the playing pieces, only red or green. There may be other LED's elsewhere, but I'll look at those later.

As for brightness/dispersion angle - I'll be honest and say I haven't considered those and think realistically anything will do. Bear in mind this is a table top board game, the lights will be viewed from arms length - max distance to be clearly visible should be 1-1.5m. Note - they shouldn't be that dim that they are difficult to see in daylight. Think model railway signals - they are about right in terms of brightness and visibility. Also, they may use traffic signal like shrouds.

I think the best battery is one with high power density, stable voltage and closest to the LED voltages and low cost.
That would be the CR123A battery Lithium, 3.0V using a MOSFET switch (RdsON< 1Ohm) would work well for B,G,W and 2V for R,Y,O options with a 1V drop resistor. A full wave bridge IC in SMT would be good for bi-directional colour drivers for low current or equivalent.

AS Brian indicated ( no pun intended) you can get very high Candle power at 20mA so you often dont need more than 5mA for indicators.

For more constant current thruout the entire SoC range a 3.6V LiPo is perfect or string many 16850 cells in series to have the discharge time you specify that you need and run strings in series.
The CR123A's sound like a plan. With the increase in high power LED torches they are much more abundant than they used to be which is good. However until I know the full amount, I will hold of speculating on the battery.

I am still confused how these LEDs are supposed to look.
What game is it and what is the function and orientation of each LED in time or position.
Sorry to be ambiguous, but I don't really want to mention the game in question directly. It's not mine and it's only just been released.

I'm doing this as a personal project, but I don't want to get pulled on copyright by discussing the mechanics in detail as I am trying to replicate it (for my own personal use).

However, I will try and explain the playing piece.

The switches control lamps on the board. The playing piece sits amongst 6 of these lamps, and replicates the lamps it sits amongst on its faces. The orientation of the lamps is dependent on the direction that the player who owns the pieces views the board from, not where the piece is placed. Not sure if this makes sense.

Lets call the player sides N, S, E & W. While there are playing positions on each players side, even if S's piece is in 1 of N's locations, the lights on the piece will still appear on S's piece as if he was viewing the playing board from his side of the table.

example.

○ ●
●X○
○ ○


X denotes the player, and he is positioned between the 6 lamps that will now replicate on his piece. If the player is S, then they will appear exactly as they do above. However, if the player is N, they will appear upside down and back to front.
● denotes a lit lamp
○ denotes an unlit lamp

S's piece would display
○ ●
● ○
● ○

While N's piece would display
○ ●
○ ●
● ○

As the pieces are individual to the player, there is no need for the piece to show the board from the direction of the other players, hence replicating the same image on all 4 faces. Thus allowing the competitors to easily see if the pattern the player is attempting to create is legal, without having to rotate the board to look at it from the position of the player whose turn it is.

I have RGB through-hole LEDs with a common cathode (but I find they are ugly - like cheap looking fairyland Christmas lights, and without sufficient current-limiting are possibly retina damaging devices!), four pins, if you use a PIC I guess you can set via the code the required voltage to turn each colour on, but I found they respond to "any old" voltage which would make using them a lot easier.

PP3 are perhaps a poor choice, unless the game will only last a few minutes or the power consumption is low. Here's an example datasheet:

https://data.energizer.com/PDFs/522.pdf

"Can 9v be amplified/stabilised so that even when the cell drops there is still a constant steady supply?"
- I read a datasheet the other day, but can't find it now, for what I think was more or less called a "buck/boost converter" or "buck/boost switching regulator" - it regulates the supply voltage down to the required voltage, then when the battery (voltage) has dropped to lower that the required voltage boosts the supply up, it looked a really handy device, sorry I can't find the datasheet or name...

Yes, I had kind of already discounted PP3 - mainly on the grounds that they would drop below the desired voltage to quickly, but also as stated above, of their poor capacity.

As to the Buck/Boost - that sounds interesting, but also overly complicated for the task at hand and not without drawbacks. I think I'll give that a miss.

I may ignore the bi-colour LED's in the long run, but I really would like to make the pieces universal.

You can use buck/boost to hold the voltage steady but it would be far more complicated than a bigger battery and the life may not be extended anyway. The extra current drawn in buck mode would place extra drain on the battery and in boost mode it converts additional current into the added voltage so the drain becomes even greater. It's good technology in some circumstances but as a way of extending the life of a feeble and non-renewable power source it isn't really suitable.

I would urge caution about recommending any particular battery type until the total load can be confirmed. The switch end would probably draw < 1mA and my best guess at the LED end is it could be as much as 24 * 5mA = 120mA but what isn't known is how many of these LED game peices will be on the board at a time. The total could be considerbly more than a small battery could manage.

Brian.

4 player pieces at any one time, so max there of 96 LED's. But there may be more, maybe 16, maybe 80. Plan for a total of 200 (all in multiples of 4) and we should be good to go.
 


Re: Parallel &gt; Serial &gt; Parallel conversion

What game is this for?

Already replied to that above...
Sorry to be ambiguous, but I don't really want to mention the game in question directly. It's not mine and it's only just been released.

- - - Updated - - -

Back to the dual color LED's.

Instead of the 3 pub common anode LED's, which need to be run in parallel (each with their own series resistor) to work, the bi-polar LED's do look interesting.

Could someone look at this and tell me of its suitable.

**broken link removed**

I'm now definitely looking at connecting transistors to the PIC outputs.

6 of them will turn the LED banks on or off.

A 7th (hopefully) will toggle either red or green. - this is a set and forget. One the players colour is decided, it shouldn't change until it is reset for a new game.

Hopefully it is this one that will toggle/set the circuit
 

Re: Parallel &gt; Serial &gt; Parallel conversion

I'm looking for a logical function table of all inputs and outputs and physical constraints 1st. Yes that is a binary input with 2 logical colors per state. the 3rd color is rapid toggling between R/G so it is a just Yellow unless you meant the tertiary level is Green, Off, Red then OK.

It is possible to send an analog voltage and decode that to simply indicate which of 24 LEDs is ON and which of 2 colors.
Or send it a Zigbee wireless data channel.... or .... or....

How do the states change? plugging into an unreliable jack or another connector, remote control, or other wizardry..

But I still cant see the forest for the trees or how small this "piece" is why no SMD's.
 

As you move around the board, plugging your piece into the board to make the electrical connection, the 6 switches that affect the lights on the piece change relative to the pieces position.

The switches relative to that position are then toggled by the player.

I only need 3 states, off, green and red.

Don't think of it as 24 LED's, just think of it as 6. There are 6 banks of 4 LED's, where each bank is either on or off. There are no other patterns to the bank.

No surface mount because I'm just not good enough with a soldering iron.

Size - about 10cm tall, about 5cm at the base tapering to the top.

Each face will be 2 LED's wide and 3 tall.
 

It should be possible to wire 4 bicolour LEDs between two pins of a PIC, They would have to be in parallel and each have a series resistor but at 5mA per LED it would still be within the drive curent and voltage capability of say a 16F628A. Suppose the LEDs were wired between pins RA0 and RB0, if both were low (or high) there would be no voltage between them so no LEDs light up, if RA0 was high and RB0 was low, it could light the red LED and if RA0 was low with RB0 high it would light the green LED. It needs 12 'ends' to wire the 6 LEDs but that's no problem for a '628A.

What is now concerning me is:
the 6 switches that affect the lights on the piece change relative to the pieces position.
Are you saying that unplugging the piece and putting it in a different socket (board location) may change the required combination of LEDS?

I still don't think analog is the solution, it would take a fairly complex signal with decoders to select the 64 different combinations of 6 LEDs. A voltage alone would be very prone to noise and the LSB uncertainty would likely make at least one LED flicker.

This game is certainly possible to build but I think it needs a full technical specification, or at least a full aspirational specification before delving much deeper. It has gone around in circles from a simple task to one that is quite complex and each new requirement is shifting the discussion in a different direction.

Brian.
 

I totally agree, I can't see analogue working at all well.

I see your now suggesting rubbing the LED's in parallel now.

As far as the pieces are concerned, they don't need to know where on the board they are, just the state of the 6 switches directly around them. I plan to do this by running a transmit PIC for every socket, and hard wire the switches to the PIC. With them all programmed identically it won't matter about their location.

Based on that I've cobbled together a rough circuit.

It only shows 1 pair of no colour LED's on 1 pin output, but that can just be duplicated out.

If the PIC is capable of sourcing 20mA per pin and sinking 120mA I might drop the transistors. Hell, I've been doing some more research, *IF* I can find the right LED's, I might even be able to drive then at 1mA!.
Screenshot_2015-11-13-18-08-55-1.png
 

Interesting ASCII art!

I'm not suggesting the LEDs should be wired across each other directly, that wouldn't work for the reasons already given. There is nothing wrong with wiring a resistor in series with each LED then wiring that series combination in parallel. 120mA is way too much to consider, you can drop the transistors if you keep the total current for the 4 LEDs below about 20mA. Let one PIC pin source the current and another pin sink it. If you use 12 pins, 6 as source, and 6 as sink, you can reverse both their polarities to change the colour and then use 2 pin bicolour LEDS. Cheaper LEDs and no transistors needed! A 16F628 has 16 input/output pins, you are using 2 for the serial link so if you use the remaining 12 for LEDs you still have 2 spares.

Brian.
 
QUOTE=betwixt;1480085]Interesting ASCII art![/quote]
Thanks, I only had my phone (hence the spelling mistakes) and despite me reading your reply almost after you posted it, it took me nearly all day to get enough time to reply. The ASCII art was the quickest way I could portray what I thought the circuit would look like.

I'm not suggesting the LEDs should be wired across each other directly, that wouldn't work for the reasons already given. There is nothing wrong with wiring a resistor in series with each LED then wiring that series combination in parallel.
Which, after my first mistake of not including a series resistor at all was how I was assuming they would be wired anyway. Good to know that is acceptable.

120mA is way too much to consider, you can drop the transistors if you keep the total current for the 4 LEDs below about 20mA. Let one PIC pin source the current and another pin sink it. If you use 12 pins, 6 as source, and 6 as sink, you can reverse both their polarities to change the colour and then use 2 pin bicolour LEDS. Cheaper LEDs and no transistors needed! A 16F628 has 16 input/output pins, you are using 2 for the serial link so if you use the remaining 12 for LEDs you still have 2 spares.

Brian.
Thanks - I was getting mixed up between the 3 pin and 2 pin LED's
 

I'll try to produce a schematic to explain better. I may be off-line for a few days though, with 200mm of rain expected here over the next three days it is very likely I'll lose signal on my satellite link. There is no landline or fast broadband in my area :(

Brian.
 
No problem.

You have been more than helpful.

I do have one query, above you mentioned putting the resistor on the "bright" side.

I always thought it didn't matter which side it was on, so long as it was there.

However, if it is important, how dies that work with a bipolar LED? Do you just stock it on one end, or half the value and put one either side?
 

WhooHoo! Internet back after several hours.... I'll type fast because it wont stay for long....

It doesn't matter which end of the LED the resistor is in. The current in a series circuit is the same everywhere in the circuit. Only one resistor per LED needed.
BiColour LED has two wires, you reverse the polarity to change the colour. It's essentially two LED dies wired head to toe across each other in one package.
If you alternate the polarity fast enough it visually appears as the additive colour of the two component colours, example: red and green look yellow.

Back to bailing out...

Brian.
 
OK. I'm struggling again.

I have worked out how to wire up a bi-polar LED or 4, to 2 logic pins...

https://everycircuit.com/circuit/5259754468278272

But doing that and using transistors is confusing me. I presume I need some form of H bridge if I want to use transistors to up the power.

I have also been playing about with common anode bi-colour configurations.

This is a sample of one branch...

https://everycircuit.com/circuit/6632329043771392

And here is a more detailed/expanded/confusing attempt. 4 banks of 4 bi-colour LED's.

https://everycircuit.com/circuit/6656051624542208

Only the PNP is shared. Each branch had it's own high and low side transistors.
 

Oh, and I know that circuit is messy and missing resistors, that was just to fit it in the confines of the available work space. All series resistors will be used when built (whichever design I go for).

And I've changed my tube on surface mount since I've been introduced to solder paste.
 

I do not (and will not) use Chrome so the diagrams are difficult to read but they look wrong anyway.

The problem is the voltage drop by combining LEDs is at the limit of what can be managed without adding more complex driver circuits. The pins of a PIC are not perfect power sources, as current is drawn from them, the voltage drops a little, similarly, when current is sunk into a logic low pin, the voltage on it rises. So if you power the LEDs directly from PIC pins, you may not get the full 5V you expect. With two LEDs in series you need to have at least 4.4V available which would be pushing your luck.

The system I would propose is far simpler than yours, wire four two pin bi-colour LEDs, each with a 470 Ohm series resistor, in parallel. Each LED has it's own resistor then the LED and resistor networks are wired in parallel. That gives you two end connections which will make all four LEDs light in one colour when one polarity is applied and the other colour if the polarity is reversed. One of these LEDs is on each side of your playing piece and the circuit is repeated 5 further times to make up the six per face you need.

To operate the LEDs, you wire the end connections between two PIC pins per LED. Lets say the top four LEDs are wired between PIC pins RA0 and RB0, the actual choice is yours and any pins can be used as long as you reserve the TX and RX pins for the serial link. Now, drive RA0 high and RB0 low, this makes something close to 5V appear across the LEDs and all four should light up in one colour. To change the colour, drive RA0 low and RB0 high, this makes the same voltage appear across the LEDs but with the opposite polarity so the other colour shows. To turn the LEDs off, drive RA0 and RB0 to the same logic level, it doesn't matter which, if the two are at the same logic level there wil be no voltage between them and the LEDs will be unpowered.

You can use the H-bridge method if you like but far more components are needed. You need to replicate the bridge six times and still need the same number of PIC pins to drive it anyway.

Brian.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top