I cant find a suitable microcontroller for multiple LEDS

Thread Starter

AnasMalas

Joined Nov 27, 2015
66
This sure escalated quickly... i looked up pickit and i need to ship the thing for 10$ and wait 2 weeks... bleh

i am digging up a breadboard to try using chalieplexing with electrical connections rather than using a microcontroller to make me understand the concept without the complications of a microcontroller which i will leave for later... so high impedance is no battery, high is positive and low is negative. easy
 

be80be

Joined Jul 5, 2008
2,072
This is on a 16f628
Kind of shows things you can do with just a few pins keep in mind I'm a plant electrician learned programming as hobby when I got laid off 6 years ago.
 

be80be

Joined Jul 5, 2008
2,072
AnasMalas You could buy 15 ATtiny2313A chips and program them with your arduino as isp using the same code same ide.
Cost would be less then $50 to make 15 of these.
If you went with the atmega328 you'd be at $100 for 15 of these and that includes everything you need but the wire.
The parts come from Thailand I don't no how shipping would be to you but you don't need a whole arduino just the atmega leds resistors and a cap and resonator 8 mhz or 16 doesn't matter which and a power switch use your power bank as power it's output is regulated at 5 volts. be easy to make happen.
 
Last edited:

spinnaker

Joined Oct 29, 2009
7,830
This sure escalated quickly... i looked up pickit and i need to ship the thing for 10$ and wait 2 weeks... bleh

i am digging up a breadboard to try using chalieplexing with electrical connections rather than using a microcontroller to make me understand the concept without the complications of a microcontroller which i will leave for later... so high impedance is no battery, high is positive and low is negative. easy
If you can get a picaxe that will get you started. Never tried one since I have a PicKit III

http://www.picaxe.com/What-is-PICAXE

You won't need a programmer and it looks like you will need to use their version of Basic.

Contact Microchip too. Maybe there is some place more local you can get a programmer. Of course it might take 2 weeks to get an asnwer. ;)
 

be80be

Joined Jul 5, 2008
2,072
Heres the OP something to look at and get started with .atmega.png

Pic axe it's $6.86 for the just the chip the atmel atmega328 $1.83 if the op can get them from here http://www.ebay.com/itm/like/111545418197?ul_noapp=true&chn=ps&lpid=82
that brings this way down for 15 of these less then $40 for parts. That for all the parts to make 15 of these and the chip comes with bootloader on it so it's plug and play with the arduino ide.
 
Last edited:

hp1729

Joined Nov 23, 2015
2,304
i would want no less than 6 LEDs on at the same time. i think that crosses CP off my list? i will have a look at shift registers, but i just want to confirm one thing: if i later decide to do CP, my idea was to make the turning on each LED its separate class or code block, so that if i want to turn an LED on i would just call that block. that is how i do a similar thing in C++, is this correct practice using MCU?
I support the idea of a shift register for the output and diming them by a single PWM output by dimming the power to the LEDs. Most any processor would work. A PWM pin is easy but you can just control how long a normal output is high and accomplish the same thing. Even a simple PIC12... processor (8-pin) is all that is used on the LED strings on amusement games and slot machines.
 

hp1729

Joined Nov 23, 2015
2,304
i would want no less than 6 LEDs on at the same time. i think that crosses CP off my list? i will have a look at shift registers, but i just want to confirm one thing: if i later decide to do CP, my idea was to make the turning on each LED its separate class or code block, so that if i want to turn an LED on i would just call that block. that is how i do a similar thing in C++, is this correct practice using MCU?
Even a simple PIC12... processor.
 

Attachments

be80be

Joined Jul 5, 2008
2,072
Yes a 8 pin pic would work don't even need shift register but the OP said he wasn't ready to learn that.
complications of a microcontroller which i will leave for later
only reason I posted the atmega stuff is that It's something he said he new how to use a arduino and the code is in C++ for arduino so he would have already learned something he could use.
microcontroller are not complicated it's us that make complications.

for i =0 to 8 and if x >= to 100 can be done in a simple mine set so can his gift.
It's like arrays I wrote some code and it looked like I wasn't getting the right out put so I ask people posted links and code that did the samething I was like ok but that's not my problem they could of said your code looks right are you sure it's not something the serial is doing to the output.
Thats where the complications come into play the print serial changed the format to dec and I was thinking it was a hex and an simple
print serial (A,hex) fix the whole thing.
Each problem is there's And we give answers base on are opinions more then trying to see there problems and miss the simple stuff .
 

Thread Starter

AnasMalas

Joined Nov 27, 2015
66
Heres the OP something to look at and get started with .View attachment 95492

Pic axe it's $6.86 for the just the chip the atmel atmega328 $1.83 if the op can get them from here http://www.ebay.com/itm/like/111545418197?ul_noapp=true&chn=ps&lpid=82
that brings this way down for 15 of these less then $40 for parts. That for all the parts to make 15 of these and the chip comes with bootloader on it so it's plug and play with the arduino ide.
Thanks for the link! first time i see free shipping to UAE! Normally there isnt even shipping as an option to UAE! but one question: are these guaranteed to be genuine?
also there are only 7 remaining. will they be back into stock?

Yes a 8 pin pic would work don't even need shift register but the OP said he wasn't ready to learn that.
only reason I posted the atmega stuff is that It's something he said he new how to use a arduino and the code is in C++ for arduino so he would have already learned something he could use.
microcontroller are not complicated it's us that make complications.

for i =0 to 8 and if x >= to 100 can be done in a simple mine set so can his gift.
It's like arrays I wrote some code and it looked like I wasn't getting the right out put so I ask people posted links and code that did the samething I was like ok but that's not my problem they could of said your code looks right are you sure it's not something the serial is doing to the output.
Thats where the complications come into play the print serial changed the format to dec and I was thinking it was a hex and an simple
print serial (A,hex) fix the whole thing.
Each problem is there's And we give answers base on are opinions more then trying to see there problems and miss the simple stuff .
I will program microcontrollers. i was talking about charlieplixing because i dont understand the concept itself.

Thanks for the suggestions. but i dont have 150-300$ to spare... could buy the new pi zero but i want to get started with microcontrollers





Now one question for all:
if pwm doesnt work too well with shift registers does bit angle modulation work with shift registers?
 

be80be

Joined Jul 5, 2008
2,072
I've had good luck from them but there lot's more places to get them cheap I played with one today you don't need to do any charlieplexing with a atmega 328 there 18 outputs free you could just hook the leds to one of them and have 15 leds to do whatever you want.
I'd use a 470 ohm resistor leds would still be nice and bright.
 

be80be

Joined Jul 5, 2008
2,072
Setting a atmega to z state is not like a pic if done wrong it powers the led with the pullups.
LED sequencer program sounds good
 

Thread Starter

AnasMalas

Joined Nov 27, 2015
66
I found some parts that i think are pretty good for me, although i am not sure if i do understand them as i am still new to this stuff...

the part is from TI, its number is
TLC5926
- it has 16 output channels
-120 mA current per channel (good for paralleling)
so far so good for my needs. but it also says 256 analog dimming steps... for a moment i thought this meant that each channel could be dimmed in 256 steps. but thinking about it maybe this is just universal for all the outputs?

Here is a 16 channel part that includes "65536 Per Channel PWM Steps"
TLC5943
Is this part good by any chance? did I solve this problem?
 

be80be

Joined Jul 5, 2008
2,072
Still need microcontroller There not that cheap and there not easy to solder as pdip chip there good for leds but you need to know they don't source power they sink it.
Why do you see this as problem you said you could use a arduino it wouldn't take two hours to write code for this.
 

Thread Starter

AnasMalas

Joined Nov 27, 2015
66
Still need microcontroller There not that cheap and there not easy to solder as pdip chip there good for leds but you need to know they don't source power they sink it.
Why do you see this as problem you said you could use a arduino it wouldn't take two hours to write code for this.
I did not really understand that statement. i know these need to be controlled by a micro controller. but are these the ones i need to power 15 LEDs with PWM dimming? if they dont provide power rather sink it i could connect all the LEDs to the positive and let this chip be the negative. Also a transistor could be used, possibly a p-type...
 

ErnieM

Joined Apr 24, 2011
8,377
Here is a 16 channel part that includes "65536 Per Channel PWM Steps"
TLC5943
Is this part good by any chance? did I solve this problem?
If you mean did you switch from one problem to several others then yes it is a good part. If you mean will this get you to your goal before you leave your school then the answer is less certain.

I see you have been lead down the road where a tiny processor with lots of external parts is the way to go. I strongly recommend you take an approach where you have one processor with enough pins so there is one pin to drive each LED. Then your total bill of materials is the battery, the processor, 16 resistors, and 16 LEDs.

PWM can be done by either a hardware device inside the processor, or using software to bang pins on and off. Even for 16 pins this isn't so hard, but if you have trouble then you still have a device that turns 16 LEDs on and off.

The Microchip devices I use have 25mA max per pin, and 200mA per device, so you could run 16 LEDs at 10 mA per device and still be well within both limits.

The development kit I mentioned previously can do all this.
 

Thread Starter

AnasMalas

Joined Nov 27, 2015
66
If you mean did you switch from one problem to several others then yes it is a good part. If you mean will this get you to your goal before you leave your school then the answer is less certain.

I see you have been lead down the road where a tiny processor with lots of external parts is the way to go. I strongly recommend you take an approach where you have one processor with enough pins so there is one pin to drive each LED. Then your total bill of materials is the battery, the processor, 16 resistors, and 16 LEDs.

PWM can be done by either a hardware device inside the processor, or using software to bang pins on and off. Even for 16 pins this isn't so hard, but if you have trouble then you still have a device that turns 16 LEDs on and off.

The Microchip devices I use have 25mA max per pin, and 200mA per device, so you could run 16 LEDs at 10 mA per device and still be well within both limits.

The development kit I mentioned previously can do all this.
So far the only chips I found with more than 6 pwm pins where either 10$ MCUs or 1.5 $ shift registers driven by 0.5 $ MCUs
I think it would be more economical to do this. Maybe it would need more code and time, and that shift register needs 28 pin SMD connection. Much rather have that than have a 200 pin SMD MCU having 15 pwm pins....
Maybe I am missing a cheap MCU with 15 pwm output pins.
Maybe I havent understood bit angle modulation and havent realized that its available in multiple of the chips. Especially if they where recommended before I am sorry. But I posted this thread because I do not have knowledge or experience. Which I am sure most if not all of you have.
 

spinnaker

Joined Oct 29, 2009
7,830
If each LED does not need it's own brightness then you really only need one PWM pin. The LEDs could be turned on and off with there individual output pins and an additional PWM pin could make and break their common connection to ground.
 

spinnaker

Joined Oct 29, 2009
7,830
And any pin binary out can be a PWM pin. Not as convenient as on board PWM but it can work. You can do it the easy way with delays (in which case the MCU is tied up during the delay) or with a timer. If you use a timer and get really creative with counters and flags then each pin could have it's own individual PWM frequency and duty cycle.
 

be80be

Joined Jul 5, 2008
2,072
Where are you finding these $10 uC at my I have bunch I'd sell back for that price LOL
http://www.taydaelectronics.com/ic-integrated-circuits/microcontrollers.html
Atmega 328 $3.50 each
Banggood.com $2.00 each
Ebay less then $2.00 each
leds 2 cent's resistors 1 cent
disbelief going to cost you your time and money.

And I would go with a 28 pin chip most have 18 to 20 I/O pins open.
and coding would be dead simple. I showed my 9 year old twins 6 years ago how to light the M of their first name
with a pic18f2550 it took them maybe a hour to have them leds rolling around the way they wanted it to.
They even soldered it. no pwm but I'm sure they could've figured how it works too.
You don't need PMW you make a array holding the led you want lit.
then you send the lit leds out in a loop and start sending blanks with them off loop it right and you have fading and blinking and what
ever you want to happen just like film of a movie.
 
Top