AVR Freaks

General Electronics - Couple Questions(RGB LED, Microcontroller, Replicate Signal)

fuzzy123 - Jan 19, 2009 - 09:17 AM
Post subject: Couple Questions(RGB LED, Microcontroller, Replicate Signal)
Hey guys... I'm new here obviously Wink I'm not sure if this is the right section to post this in, so let me know if it's not.

I had a few questions...

I want to make a pair of gloves with RGB LEDs in the tips.. I was thinking of using the STROBE FX's chip...

The toy only uses 1 RGB LED... Is there a way to replicate the signal so i can use 1 board for all 5 leds?

Or does anyone recommend a better way of going about this, such as using my own micro controller?

If you don't know what a strobe fx is.. here's a pic and a video... (Note: Neither is me)



http://www.youtube.com/watch?v=wVxsweaRKkE


Thanks in advance!!
Nephazz - Jan 19, 2009 - 07:20 PM
Post subject: RE: Couple Questions(RGB LED, Microcontroller, Replicate Sig
read me
fuzzy123 - Jan 19, 2009 - 08:40 PM
Post subject: RE: Couple Questions(RGB LED, Microcontroller, Replicate Sig
Thanks for the reply, I skimmed through it and will start reading several of those articles, but it would be great if people can still throw in their knowledge/ideas Smile
DocJC - Jan 19, 2009 - 09:03 PM
Post subject: RE: Couple Questions(RGB LED, Microcontroller, Replicate Sig
Hello Fuzzy123

Welcome to the forum.

The link above should help get you started, and keep you busy for a long while...

Cool video, I had not seen that before.

One option, of course, is to buy 10 of the devices you already have, and thread them through the finger slips for a glove, with the 5 controllers anchored at your wrist.

Of course you miss out on all of the fun and learning if you do it that way.

You did not mention if you have any experience in programming or in electronics. Neither is a pre-requisit, but either/both would make this a faster/easier project.

To answer your question, flashing 5 leds with one microcontroller is certainly doable. The key issue is how many colors do you want each LED to be capable of, and how fast do you wish to be able to change their colors?

You need a chip, (actually several, in case you accidentally destroy one), a programmer, a power supply, a language, some wire and some leds and some resistors...

You may wish to start by flashing one led, on and off. This gets you started with the language, programmer, chip, etc.

Then switch to an RGB LED, and flash it, then learn to control its color.

Then add four more.

Learning about interrupts along the way will make the project either easier, or harder, depending on one's perspective.

Depending on where in the world you live, (you can add this to your profile on the forum), Spark Fun Electronics SFE , would be one source for the microcontroller chip, breadboard, power supply, etc. They also have some "development boards", that may be of interest. They also have a tutorial on hooking up an AVR on a breadboard and flashing an LED, a great starting point for your project.

Much depends on your background, and budget.

Sounds like a fun project.

JC
fuzzy123 - Jan 19, 2009 - 09:28 PM
Post subject: RE: Couple Questions(RGB LED, Microcontroller, Replicate Sig
Thanks JC! I have been involved with computers for a long time... I'm semi knowledgeable with coding java & C and I have several friends who can help me with this.

I have 6 months to complete this project... Preferably 3 months. with a budget of $1000(don't want to spend this much, but I will if i have to).

Overall, I probably want to put the power supply & micro controller in my pocket. and run a wire up my shirt to my hands...

I live in San Diego, CA ...


Overall, Looks like I need to spend a lot of time learning, but it should be fun!

Thanks again for the input.
fuzzy123 - Jan 19, 2009 - 10:24 PM
Post subject: RE: Couple Questions(RGB LED, Microcontroller, Replicate Sig
So.. as far as chips/boards... What would you recommend?

should I go with a Arduino board?
DocJC - Jan 20, 2009 - 02:33 AM
Post subject: RE: Couple Questions(RGB LED, Microcontroller, Replicate Sig
Your background in programming will help a lot.

I don't know C, but I believe it will be a good foundation for learning one of the embedded microcontroller versions of C.

I've never played with an Arduino, but they are very popular, and I've heard lots of good things about them. It would certainly be a reasonable starting point. I do not know enough about them, however, to say you can do 5 or 10 pulse width modulation signals on that platform with ease, or how one sets up interrupts on them.

There is an Arduino forum which may be worth browsing a bit to read some threads on PWM and interrupts.

Asking which chip / board is "best" is a lot like asking "What's the best car?" on a car forum... You will get a different answer from everyone you speak with.

That said, you might wish to start with an ATMega168. This is a 28 pin, 20MHz, 16K, 5 V uC. It may end up have more speed and memory and pins than you need, but so what! Your building one of them, and it costs $4.11 at SFE in quantity one in a Dip Chip format, (breadboardable).

Multi-color LEDs come in several formates. Some have 3 leads, some have 4 leads, (R, G, B, and Gnd). If you were to tie 5, 4-lead leds to a uC, you would use up 5 * 3 = 15 I/O pins, for separate control of each of the 3 LEDs inside each of the multi-color LEDs.

The M168 can run on a 20 MHz crystal, mounted externally, using 2 more pins, or can run at 8 MHz on its internal RC oscillator.

Six more pins are committed: Vcc, Gnd, Gnd, Reset\, AVcc, Aref.

Two more thoughts to be aware of, with this general approach:

Each pin can source or sink about 20 mA, (40 mA absolute max per pin), and there is a 200 mA limit for the entire chip. 200 mA / 15 LEDs, (3 individual LEDs within each of 5 multi-color LEDs) = 13 mA per LED. Say 10 mA per LED, and they could all be ON, simultaneously, while remaining in spec for the chip, without using any external LED driver transistors.

Next, this approach would require running 15 PWM's in software. There are PWM's built in to the AVR's which are set it and forget it operation, very convienient, but there are only 0-several per chip, not 15.

There are lots of development boards out there...

SFE has a 28 pin AVR board for ~$17, with a power supply, crystal, RS-232 interface, but without the AVR.

A breadboard is doable, also.

With your budget you could afford to purchase an STK500, both for programming a development. You plug your M168 into it, and start your program development by learning how to PWM the 8 on-board LEDs, then expand to an attached breadboard with your 5 multi-color LEDs.

Enough for now, gotta run.

JC
Nephazz - Jan 20, 2009 - 05:25 AM
Post subject: RE: Couple Questions(RGB LED, Microcontroller, Replicate Sig
The STK500 is really a nice piece of electronics Smile You'll probably need an USB/RS232 converter. (RS232 = COM) Don't pay more than $10 for one.

Buy some differen RGB LED and test which model you like before you get 5 or 10 of 'em. They cost like $2 a piece.

Quote:

Say 10 mA per LED, and they could all be ON, simultaneously, while remaining in spec for the chip, without using any external LED driver transistors.


Isn't 10mA a little low?
fuzzy123 - Jan 20, 2009 - 07:29 AM
Post subject: RE: Couple Questions(RGB LED, Microcontroller, Replicate Sig
Thanks for the input!

Looks like I'm going to have to do some hands on learning...

If i wanted to use a single controller to control all 10 (maybe 12 if i put one on each palm) ... Is there a better chip to go with?

Also, I would like to be able to Power On/Off & Have another button to switch patterns.

Things to Purchase:::
•STK500
•Various RGB LEDS & Some single color leds for practice/fun/future projects
•Resistors
•USB/RS232 converter (I do have a Parallel port on my computer, but i think I will get one anyway, because the new computer I am building doesn't have one.)
•buttons
•???

I apologize that I don't know exactly what to get... I know many people get irritated about newbies asking step by step what they need... So if you feel that way, let me know and I will do my own research.

Usually though, once someone helps me get on my feet, i am able to progress without asking about every little question later Smile
firestorm099 - Jan 20, 2009 - 10:57 AM
Post subject:
Hi Fuzzy - sounds like a great project to learn with, and the advice so far is all great - you should be able to get some startup kit (I highly recommend the STK500 too), and pay for all the components and still be well within your budget Smile

A little research will show you that the Arduino is basically a mini development-platform with an Atmel chip at it's heart - they break out the pins, and have several supporting components, and provide a higher-level development environment than just going straight for it with the micro... So if you decided to go with the Atmega8 (or the 168 as suggested - which is a great chip), you'd be starting off on a slightly more involved route.

That said, your project is as much about how much you want to learn, versus the time to complete and the cost - as has already been said - there are soooo many ways you could do this, and therein lies the fun Very Happy

If form-factor, size and integration into the gloves is your main concern (rather than just something that functionally does the job), try having a look at http://www.sparkfun.com/commerce/product_info.php?products_id=8617 for the deluxe kit and some ideas - you can even wash them if they get dirty Wink
fuzzy123 - Jan 20, 2009 - 11:34 AM
Post subject:
Very interesting firestorm!

The lily pad setup is very cool.

Right now, I don't really mind a wire running up my shirt down my arm to the glove Wink ...

I'd love to learn a lot & have the basics done within a couple months.

What I currently don't understand is once the chip is programmed and ready, what will it be housed in? Would a breadboard setup be the best way to go?

The setup I currently am visualizing is:
Battery & Circuit board in pocket or maybe in a pocket sewn in my shirt... With a wire running up the shirt down each arm. The wire then is split and individual wires will go to each LED. Also a button on the glove itself that will allow me to change patterns on the fly.

Would this be correct?
fuzzy123 - Jan 20, 2009 - 11:53 AM
Post subject:
I have been reading up for a little while now and it seems that JC's first post seems to have most of the answers to what I need Razz

If i decide to go with the 28 Pin AVR Development Board you recommended, I would enclose this in some sort of case and that is what i would carry, along with a battery, correct? With this board, can I add a buttons to power on/off & to toggle the next pattern?

Also when I am developing & testing I connect it to the STK500 via the secondary RS232 port?
DocJC - Jan 20, 2009 - 04:11 PM
Post subject:
Almost...

The board also has a 10 pin connector for ISP programming the uC. The STK500 has a ISP source header, and a jumper cable is used to connect it to one of three headers on the STK500, for programming the various chips ON the STK500. You can also route this jumper cable to your own board, or breadboard, to program chips OFF the STK500.

One can program uC's via an RS-232 port IF the uC has a Bootloader installed. This program reads data via the RS-232 and downloads/installs a new program to be run on the uC. The M168 from the factory does not have a bootloader pre-installed. This presents the classic chicken or egg question. You need a programmer to load a bootloader so that you don't need the programmer...

Start with the STK500 and you will be off to a great start. The STK500 comes, I believe, with 1 or 2 uC's provided, so you can even start flashing a few LEDs before you get any other components. The board has 8 LEDs and some push button switches included on the board.

A breadboard is great for testing and tweaking circuits, but NOT for a final project. The components are held in place by the pressure of the contacts, and can easily fall out or short out amoungst each other. Typically, one might develop the project on a breadboard, then move to a board where the components are soldered in place for the final version.

Nephazz notes that 10 mA per LED may be a little low. How bright the LEDs are will depend on the LEDs selected. There are LEDs that put out more light at 2 mA these days than LEDs put out at 20 mA not so many years ago... I have one current project, (no pun intended), using 3 Watt LEDs at 1 amp. The range of possibilities is enormous.

He raises a good point, however. At 10 mA per LED the chip will always be within specification, and no external drivers are needed. Functional, but not as runway landing lights. The suggestion to test a few LEDs before committing to a design is a good one.

If this is a one-off school project, and the OP has mostly software and little hardware experience, it would be desirable to keep the hardware end of the project as simple as possible, while still functional. Adding drive transistors, (or a driver array chip, e.g. ULN2803 or similar), significantly increases the hardware complexity and layout complexity for a first project.

Similarly, implimenting multiplexing would simplify the additional driver circuitry, but the complexity of the software would increase significantly.

Given that the OP presumably has other class work, a limited timeframe, and its his first hardware project, I think the goal ought to be functionality and success, rather than the optimal/ultimate device. When Version I works, he can always use it as the foundation upon which to later develop V 2 at his leisure.

Just some thoughts for you to ponder.

JC
Nephazz - Jan 20, 2009 - 04:13 PM
Post subject:
For resistors: get a whole bunch of 1/4 W carbon film. I bought 25 pieces of every value between like 1 Ohm and 100 MOhm
DocJC - Jan 20, 2009 - 04:16 PM
Post subject:
One more thought...

It is worth noting that the LEDs on the STK500 include a driver transistor for each LED, and that they use negative logic. Outputting a 1 to a given LED turns it Off, outputting a 0 turns it on.

JC
Nephazz - Jan 20, 2009 - 07:32 PM
Post subject:
good point Doc

another idea:
Connect 8 output pins together and use them to drive one LED. This way one could get:
8 * 20 mA = 160 mA
for the LED. Then time-multiplex all LEDs. Which means: After lighting one LED for say 10 ms switch to the next LED. Light this one for 10 ms, turn it off and light LED3. This will be so fast that the eye doesn't recognize. Switching would be done via transitors. Those ULN chips are really nice. I use one type of 'em and it's like: give him voltage, connect the item to drive, connect the logic stuff and be happy.

Explanation of "drivers" in electronics:
Let's say your µC can pull out 5 V and 20 mA of current. But you need 12 V and 150 mA. Then you get a switching device which can handle the big current and voltage.
You supply your driver with a source which gives 12 V and can give 150 mA or more. The trick is that the driver can be turned on/off by the small 5 V signal from the µC. Whenever you switch it on the driver connects your LED with the 12 V source. When the 5 V output goes Low (because your programm tells it to do so) the driver disconnects the LED from the 12 V source.
Feel free to ask questions.

A micro controller (µC) doesn't need much stuff to run. Just give him some voltage and enough current and he'll run all day. They have onboard stuff which generates a clock.
You can also use an external clock to get it ticking. Most people use extremly accurate clock crystals this way but I think of a different use:
Connect the external clock input pin with a bomb-proof pushbutton. Whenever the button is pushed the µC gets 5 V on his clock input and executes an instruction. Now get a really angry monkey and let him bash the button Twisted Evil
fuzzy123 - Jan 20, 2009 - 10:21 PM
Post subject:
I purchased the STK500. It should arrive before the end of the week.

Now for everything else Razz
Nephazz - Jan 21, 2009 - 05:18 AM
Post subject:
yai, it gets serious Exclamation
DocJC - Jan 21, 2009 - 04:39 PM
Post subject:
This thread: Which Books Should Be on my Shelf (crwper), lists several books and magazines that are helpful to those interested in the hardware side of things.

Perhaps it, too, will become a "sticky" some day.

JC
fuzzy123 - Jan 24, 2009 - 03:48 AM
Post subject:
Doc,

You reference the 28pin AVR DEV board in your second post (http://www.sparkfun.com/commerce/product_info.php?products_id=29)

Would this be ideal for my setup? (At least Version 1)

What would my options be in terms of power supply? a small battery pack with AA or 9V that would attach to the power jack?


Also, what about wiring? How can I get the data from my pant pocket to my hands in a neat/tidy manner?
DocJC - Jan 24, 2009 - 04:26 AM
Post subject:
I would suggest undertaking this project a step at a time.

The 28 pin board would probably be fine, but it is currently out of stock...

So, work with your new STK500 for now.

You can use one of the two microcontrollers that comes with the STK500 to get started.

The STK500 already has 8 leds, and its own power supply.

Learn to flash them in various patterns.

Then learn to dim them.

When you can do this you will have accomplished a lot.

Then, work to expand the system to 15 LEDs, (5 multi-color LEDS).

You may wish to test this on a bread board, (good choice), or go straight to the board sited above, (less optimal choice), after you can do the above.

LEDs will be drawing a lot of current. On an STK500 it doesn't matter, as the power supply will be a wall wart and the STK500's own power supply.

For the eventual project you will need a battery power supply. Although a 9 V battery feeding a 5 V regulator is enticing due to its small size, your circuit will quickly drain the battery.

A bunch of AA batteries will last longer.

Start with the above, then focus on the power supply in a bit. Short answer, (hard for me...), you will do well with a 5 V, 3 terminal linear regulator, such as a 7805. Using a "low drop out" version will allow you to get more useful energy out of your batteries.

You may find that you put the batteries and circuit board in a small camera case, worn on your belt, with wires going to the LEDs. LOTS of wires, however.

It would be, perhaps, better if the circuit board was also within the glove, with just short wires to the LEDS in each finger, and a long wire to the battery pack on your belt.

JC
fuzzy123 - Jan 24, 2009 - 11:09 AM
Post subject:
Once the STK500 comes in, i will focus my attention on learning how to use it and how to control the LEDS...


As for circuit board placement... I agree, placing the circuit board within the glove is a better idea... (on the back of the hand would be optimal)

If i do that, would it be best to go with a board like this?:
http://www.sparkfun.com/commerce/produc ... ts_id=8465


Also, it shows that it is an Arduino bootloader.. Would the programming be identical or would it be different than what I learn using the STK500?
crwper - Jan 24, 2009 - 05:42 PM
Post subject:
The bootloader is optional, really. You can program the thing directly using 6-pin ISP, or using the USB bootloader.

Michael
fuzzy123 - Jan 25, 2009 - 08:16 AM
Post subject:
Okay cool... I guess I will focus on learning now, if UPS would hurry up.. haha
fuzzy123 - Jan 28, 2009 - 08:46 AM
Post subject:
So the STK500 has arrived! I was able to set everything up. And I have realized my programming isn't up to par Sad . Are there certain step by step tutorials for the STK500 or any other guides that you guys recommended?
Nephazz - Jan 28, 2009 - 06:59 PM
Post subject:
yeah

this one got me started:
http://salgat.angelfire.com/AVRINTRO1.htm
takes some time to load, def. worth waiting
DocJC - Jan 29, 2009 - 12:54 AM
Post subject:
Don't forget to check out Stu-San's Sticky Link, Here for an extensive list of links to help get one up to speed, and their project of the ground!

JC
fuzzy123 - May 31, 2009 - 03:25 AM
Post subject:
So.. i've been busy with life for the past couple months, but in my spare time i've been able to do a decent amount (with help from salgat)...


I've been messing with the STK.. learning basics, and I'm able to do control the LEDS to do everything that i need (but controlling the RGB leds are going to kill me)



I've decided to use the ATmega644p chip. for each glove that will be located on the back of the hand. with wires running to 5 RGB LEDS in the fingertips and 3 in the palm..

These are the LEDs i have:
http://cgi.ebay.com/50PCS-RGB-Ultra-Bri ... .m20.l1116


I'm going to use a single rechargeable (2450 mAh) 3.6 Volt AA Lithium Battery for each glove.. which will be located near the chip or attached to a wristband.


I'm going to have 2 lily pad buttons on the thumb side of the index finger to control patterns,etc..
These:
http://www.sparkfun.com/commerce/produc ... ts_id=8776




.. My next step is to setup the breadboard and use my AVRISP.. I'd really like to finish this before the end of the month.. I have all the materials that I need to complete a prototype, but not 100% knowledgeable on the programming.


Let me know what you guys think.. also if you have any suggestions and/or can help me in any way Razz
UNiXWHoRe - May 31, 2009 - 05:30 AM
Post subject:
If it was me I would make one glove self-contained. Controller, LEDs, battery, the whole shabang. This way if something breaks you still have another one functional.
fuzzy123 - May 31, 2009 - 09:45 AM
Post subject:
yeah thats what i think I will do. I just hope the weight of the AA battery on the back of my hand doesn't become bothersome.
fuzzy123 - May 31, 2009 - 10:33 AM
Post subject:
maybe something like this::

All the stuff would be attached to the outside of the first glove.. and a 2nd glove will go on top of it.

Suggestions?



AndersAnd - May 31, 2009 - 12:19 PM
Post subject:
How much current power does these leds use?
fuzzy123 wrote:
I'm going to use a single rechargeable (2450 mAh) 3.6 Volt AA Lithium Battery for each glove.. which will be located near the chip or attached to a wristband.

Instead of a round AA cell wouldn't it be better with a flat battery pack?
Here's an example of a small rechargable 3.7V 2000mAh Li-polymer battery: http://www.sparkfun.com/commerce/produc ... ts_id=8483


LiPoly Charger - Single Cell 3.7-7V Input: http://www.sparkfun.com/commerce/produc ... cts_id=726
LiPoly Fast Charger - 5-12V Input: http://www.sparkfun.com/commerce/produc ... ts_id=8293

Maybe you should place the electronics and battery on a vwrist band? Don't know what will be most comfortable.
bobgardner - May 31, 2009 - 06:56 PM
Post subject:
Sorry for being dense, but I bet all the old guys here are missing the Use Case here. Let me take a whack at it as I see it... You walk in to a bar with these things wired up on your bod and ask a girl if you can buy her a drink, and when she gets lubed enough to be easily impressed, you start waving your hands around and subliminal messages start appearing in thin air like "You are getting sleepy. Ask him to take you home". Maybe she thinks she's the only one that can see em. Its an Electronic Geek Pick Up Line, batteries not included?
fuzzy123 - May 31, 2009 - 08:36 PM
Post subject:
Thanks AndersAnd. I was looking for thin pack like that. The only problem i have with it is that it's about 2inches all around, which will take up the entire back of my hand. Where will i stick the micro?

A wrist band would work though... Know of any other batteries? I need a 3v minimum.


Bob, Good guess! Razz.. sadly they are for a different purpose... This video pretty much explains it... http://www.youtube.com/watch?v=mN02HYBG_1Q


Those are just inova lights that are placed in the fingertips.

Wanted to have it done for::
http://www.youtube.com/watch?v=DNqouRV0bCg
fuzzy123 - Jun 16, 2009 - 10:05 PM
Post subject:
So.. I've decided to to with the smaller version of the battery above..

http://www.sparkfun.com/commerce/produc ... cts_id=339


I was able to breadboard a sample.. and I also decided to route the micro controller like this:




For now i'm just going to use a protoboard to hold it all together since I only have about a week. Eventually i'll learn eagle and have a better version made.



One of my last problems is putting it together... How can I easily mount the wires so they stay where they are supposed to, but the whole thing can be removed from the glove after it gets dirty.

Any tips for organizing wire? I'm going to have 4 wires down each finger and like 6 on the index fingers.
All times are GMT + 1 Hour
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits