simple project help for a newbie?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
Izmuntil
 
Posts: 17
Joined: Sun Aug 10, 2014 4:13 am

simple project help for a newbie?

Post by Izmuntil »

so i have never done anything with electronics before, so i am trying to figure out everything i am supposed to do before actually buying anything. i am simply trying to connect a trinket into a digital RGB LED strip. i have asked reddit as well as gone to my local electronics store (who were sort of helpful), but they weren't able to clear up as much stuff as i'd hoped
so far, i would need:

for LED strip
* 5V DC Battery to power the LED strip itself (or more if the regulator takes some of the amps?)
* maybe a LDO regulator so it doesnt eat up some of the amps from the battery (guy at store recommended it)
* a regulator for the above battery (i dont know what kind/type)
* a 6.3V, 1000 µF large capacitor

for trinket
* a 9V battery (im not sure why i'd need a 9V battery)
* a 5V trinket (why not a 3V one?)
* a 300-500 ohm resistor (the guy at the store said what wattage, and there is nothing in the guide about that)

besides that, i would only need to wire the things together, which seems like the simplest task. could someone clear up whatever i am missing/if there is anything else that i'd need?
thanks

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: simple project help for a newbie?

Post by adafruit_support_bill »

You can power both the leds and the Trinket from 3xAA batteries (4.5v). The processor and LEDs don't mind being slightly under 5v. You do not need a regulator unless your battery voltage is higher than 5v.

Using a 3.3v Trinket, you can run the whole thing from a 3.7v LiPo cell.

There are many Trinket/Neopixel projects in the Adafrut Learning System.
This one shows you a typical way to wire up and power a Trinket with Neopixels.
https://learn.adafruit.com/larson-scanner-shades

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: simple project help for a newbie?

Post by michaelmeissner »

Most micro-processors have step-down voltage regulators. They take power at a higher voltage, use some power for the regulator itself, and then emit the specified voltage on the other end (5.5 - 16v for the 5v trinket, 3.5v - 16v for the 3.3v trinket or gemma). Note, the voltage regulator used typically is not that efficient when you use 16 volts, as it wastes most of the energy into heat and not into the electronics. There are more efficient regulators, but they are more expensive. Likewise there are boost circuits that can take a lower voltage and produce a higher voltage (at the expense of less amps).

9 volt batteries used in smoke detectors are quite common and cheap. However, they don't hold that much power, and are generally not rechargeable. If you want something that will run an hour or two, the 9v battery will work, but if you are going to use it often, you want another solution.

In terms of the 3.3v processors (3.3v trinket & gemma), it has been my experience that you can power neopixels fine with 3.7v li-poly batteries, but you run into troubles if you are using 5v power from USB, such as when you are programming the chip.

Also, it is my opinion, that trinket and gemma are perhaps harder for new people to start on, because they have limitations the bigger processors don't have. On the other hand, they are cheap. It is a cost/benefit tradeoff.

Next we get to wiring. There are two schools of thought. One is the wearable chips (gemma, flora) are made to be connected with wiring that is twisted on to the processor and is perhaps easier to start out with. The other is to go to the breadboard solution, where you get some header pins and solder them into the trinket, and hook them up to the breadboard and then use wires in the breadboard to hook up the lights, etc. If you buy the larger Uno or similar development systems, it has the pins soldered into headers, so you could just use jumper wires.

I would think the Flora budget pack (https://www.adafruit.com/products/1405) might be a good way to get your feet wet. You would need the led strip as well (the budget pack has 4 separate leds, so if you only needed 4 lights, it would already have them). The Gemma budget pack would also work, but note the Gemma is more constrained in terms of future growth (https://www.adafruit.com/products/1657).

To upgrade the battery, you would need at battery (https://www.adafruit.com/products/1578 should give you a couple of hours of run time), and charger (https://www.adafruit.com/products/1905).

In terms of a trinket, you might need: As you can see, having to do soldering, adds a bit to your costs. Instead if you go with the Uno budget pack, it will have things you need (plus some extras when you want to go past just doing lights), and all you would need are the neopixels: https://www.adafruit.com/products/193

User avatar
Izmuntil
 
Posts: 17
Joined: Sun Aug 10, 2014 4:13 am

Re: simple project help for a newbie?

Post by Izmuntil »

as i understand it, if i get the 5V trinket, i wouldn't be able to use the Li poly battery (which isnt that big of a problem, i have 4 NiMH batteries), and by keeping the 5V, it is easier to program it via USB cable. i am confused, how should you get around this? do all computers use 5V power from the USB? why are the 3V trinkets so popular if it is difficult to program them?

* so instead of the 9V battery, i guess i could power them both from the 5V battery.
* is there a downside to using a single source to power trinket and LED strip?

* what is the reason for using a breadboard? * why do i need a JST cable?
  • it seems like it is just an extension cable, and not necessary if the battery and the LED strip are going to be close together
* so i no longer need the regulator
* everything is powered from the 5V source (or a 3.7 Li poly battery if its a 3V trinket?)
* and i just follow the project that Bill posted and it should be fine

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: simple project help for a newbie?

Post by adafruit_support_bill »

by keeping the 5V, it is easier to program it via USB cable.
That is not an issue. Both versions are programmable via USB.
* so instead of the 9V battery, i guess i could power them both from the 5V battery.
* is there a downside to using a single source to power trinket and LED strip?
There is no downside to this. In fact it makes life easier. Many of our projects (such as the one I linked earlier) are designed around a single battery power source.
* what is the reason for using a breadboard?
this project that Bill posted (https://learn.adafruit.com/larson-scann ... s?view=all) gives and example of how to wire a trinket and LED strip, and it doesn't use a breadboard
Breadboards are for prototyping. It makes it easier to change things and test things. If you are building from a proven design, you do not need the breadboard.
* why do i need a JST cable?
it seems like it is just an extension cable, and not necessary if the battery and the LED strip are going to be close together
Our LiPo batteries have JST plugs and the battery input of the Trinket has a JST socket. If you use a LiPo battery, you can just plug it in.
* so i no longer need the regulator
* everything is powered from the 5V source (or a 3.7 Li poly battery if its a 3V trinket?)
* and i just follow the project that Bill posted and it should be fine
Yes! If you go for the 5v option, you can use 3x alkaline cells for 4.5v or 4x NiMH (e.g. Eneloop) for 4.8v. Both are close enough to 5v to work.

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: simple project help for a newbie?

Post by michaelmeissner »

It is always a trade-off. For some things, 3.3v processors are easier to use, for somethings 5v processors are easier to use. The 3.3v processors use less power, and can be run off a single li-poly battery which the current chemistry formulation delivers 3.7 volts (4.2 volts when freshly charged). Many of the newer sensors only work at 3.3v. The 3.3v processors can run off of USB if the power is regulated down to 3.3v. The 5v processors can run off of USB (which is spec'ed to provide 5 volts) without conversion and also the common 9v battery. For microprocessors that use the ATmel chips (i.e Arduinos, and most compatibles), the microprocessor will run faster at 5v than 3.3v. Microprocessors that use ARM chips inside, only run at 3.3v, and the ARM chip typically runs much faster than the ATmel chip.

Note, neopixels have several issues with power. One is the amount of voltage supplied in the power wire. The current spec says 3.5 - 5.3 volts. If you have a 3.3v processor, and the power pin comes from the 3.3v power regulated pin, the neopixel probably will not work because the voltage is below the spec (I have several neopixels that will not work at 3.3v, but some of the older ones do work, even though it is out of spec). If you are powering a 3.3v processor with a 3.7v li-poly battery, and feed the neopixel power wire straight from the battery, it should work for the current generation of neopixels. I recall that some of the earlier neopixels claimed a minimum voltage of 4v, which made them problematical to run on a 3.3v processor.

The second issue is the signaling that is done to tell the neopixel which color and how much power to use via the data pin. The data pin is just signalling, the bulk of the power to light the led comes from power line. The issue here is at what voltage for the data pin will the chip recognize that the pin is high instead of low. Usually a good rule of thumb is 70%, so at 5.0v power, the chip should be feed at least 3.5v. A 3.3v processor would might not be read as true because the voltage is too low. I have several neopixels that do not respond correctly if I feed them 5v of power and a 3.3v signal. There are various ways to do a level shift of the 3.3v signal to 5v, that I recently have explored.

The third issue with neopixels is they take a lot of energy. If you turn all 3 leds on in a single neopixel to their highest power level, the led will consume 60 mA of power. Now, a neopixel at full brightness is painful for humans that are nearby to see. If you are lighting a bunch of neopixels and the power is coming from the regulated power lines of the chip, you can blow the regulator by trying to use too much power. In fact, I did this to one particular chip (it was a competitor to the Trinket) which had a fairly weak power regulator. For my goggles and such, I tend to set the max power to 30 per led (that is the sum of red + blue + green power levels is less than or equal to 30), which for a pair of 16 LED rings, gives a max power of about 75 mA. Even at a power level of 30, I've had some people that were talking to me complain about the brightness. With the processor itself using maybe 25 - 40 mA, that gives me a comfortable margin under 150 mA that most of the processors I use have (except of course the one I blew up). For a pair of 24 LED rings, I might reduce the power to maybe 25 or 20, just to keep it under the margin. When you get past 50 or so neopixels, you need to start looking at using separate power supplies for the neopixels. However, for wearable costumes, etc. that are powered from a single battery and don't do high light levels, you can power things from a single source if you take some care in the setup.

Now, if you are powering your microprocessor from USB, if the USB is powered from the computer, you might only get 100 mA of power. If you are using a powered USB hub you might be able to get more power that through the computer. If you are using something meant to charge a cell phone, who knows how much power they give, since they are relying on the cell phone to ask for the appropriate amount of power. Another issue with cell phone batteries, is they sometimes try to be too clever, and turn themselves off if the voltage is too low.

I'm just coming off a session to appropriate wire up my Teensy 3.0/3.1's for neopixels. A lot of the level converters sold are made for i2c conversions that runs at 100kHZ (i2c is a bus that allows multiple chips to communicate). Unfortunately they may not be fast enough for neopixels that run at 800kHZ. I didn't want to get into too detail, since you are just starting out. That is why I was trying to simplify things that in general, if you run a 5v microprocessor, and feed the neopixels 5v power, things will work. And if you wanted to use li-poly batteries, a 3.3v processor would work when it is powered via the battery (so when you program it via usb, it may not work, until you unplug it from usb, and use the li-poly battery -- it is a kludge, but as long as you know to do it, a workable one).

So my ramblings probably have de-clarified things, and made you more confused. I wish things were simpler (for example, if neopixels worked at 3.3 - 6v, it would solve some of these problems).

User avatar
Izmuntil
 
Posts: 17
Joined: Sun Aug 10, 2014 4:13 am

Re: simple project help for a newbie?

Post by Izmuntil »

@Bill alright thank you for clearing these things up!

i don't see a any other kind of socket besides the USB one on both the 3V and 5V trinkets, do you mean the GEMMA? actually, should i get the GEMMA instead of one of the other trinkets? i thought the 5V trinkets were the cheapest option, but i guess not.

if i go with GEMMA, then i should get the 3.7v Li poly battery, as it runs on 3.3V. should i get the 150 mAh battery, and what does that number mean? does .6 Wh mean it will run for .6 of an hour at 1 Watt? so the LED strip(http://www.adafruit.com/products/1460) would run for 5.7 hours at 9.5V?

additionally, the uberguide (https://learn.adafruit.com/adafruit-neo ... e?view=all) says to attach a ~470 ohm resistor (there is even a capacitor in the photo of the LED strip itself), but in the guide you posted there isnt one. the same goes for the large 6.3V capacitor, what happened to them?

@michael, yea that did make some things confusing.
* i dont think it will be running off of USB power?
* what do you mean:
If you are powering a 3.3v processor with a 3.7v li-poly battery, and feed the neopixel power wire straight from the battery, it should work

* does that mean feeding the power into the LEDs first, and not the microprocessor?
* i thought that simply trying to make what appears here (https://learn.adafruit.com/larson-scann ... -soldering) with the GEMMA board would be fine, are you saying that might not work? would switching back to a 5V trinket be simpler in that case?
* i dont know what you are talking about in the second issue
as for the third issue, i won't be putting it at full brightness, as the Neopixels will be almost right next to my face, so they will be low enough for me to see comfortably

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: simple project help for a newbie?

Post by michaelmeissner »

There are many ways to wire things up, and each of the microprocessors have different features, so it makes it complicated.

If you have a Gemma, it has 2 main ports to provide power. You can hook up a mini USB cable to the silver/gold connector or you can attach a li-poly battery with a JST plug to the white JST plug. Using either of these, you get the power it provides through the Vout pin (i.e. 5v for USB, 3.7v for a li-poly battery). Assuming the Vout pin is connected to the neopixel, the leds will get either 5v or 3.7v. Lets say you use pin 1 as a control for the LEDs. Pin 1 is always 3.3v. So, if you are powering the Gemma via 5v like you do when you are programming the board, some neopixels will not register the appropriate signals from pin 1 to turn on/off when you are powering the chip. So in this case, you program the Gemma, and things may/may not work. You unplug the USB cable, and plug in the li-poly battery that you plan to use, and things should now work.

There is another power output pin on the Gemma, the 3.3v pin (between the JST connector and DO). If you hook the neopixel power pin to this instead of Vout, some neopixels will not function at 3.3v power. Some will work (as I said, several of my neopixels will work at 3.3v, but not all of them, and it is out of spec with the current neopixels).

I tend to think the 'best' way for a Gemma to use neopixels is to use a li-poly battery.

Next up, the 5v trinket. The trinket has 2 ways of being powered, either the mini USB plug, or by hooking up a power source to the BAT+ and ground pins. If you are using USB power, you can use the USB+ port to get access to full power available through the USB plug at 5v. If you use the 5v pin, you can only draw 150 mA of power. On the other hand, if you are providing power directly to BAT+/ground, you must insure that the power is at least 5.5v (and less than 16v). In theory, you could hook up the neopixel to this power pin, but the voltage is too high for the neopixels, and you would need to regulate it down to 5v. So, if you hook up a 9v battery to Bat+/ground, you can use the 5v pin to provide up to 150 mA power to the neopixels. The 5v trinket does not have a JST connector, and needs more than 3.7v, so you would need to use 2 paired li-poly batteries (to provide 7.4v), or AA/AAA battery holders. The data signal is 5v in the 5v trinket.

I tend to think the 'best' way for a 5v trinket to use neopixels is to use something that provides USB power, and use USB+ pin.

The 3.3v trinket should be similar to the Gemma (except it doesn't have a JST connector, you would have to connect the battery to the Bat+/ground pins). I don't own one, so I can't talk in detail about it.

The Uno is powered by either USB or a 6-20 volt power connection (7-12 volts is recommended). If you are powering it via USB, you can use the VIN pin to get the power before it goes through the regulator, otherwise you use the 5v power for a moderate amount of power. Data pins are 5v. I tend to think the simplest approach with the Uno is use the 5v pin for moderate neopixel power.

The Teensy 3.x is powered either by USB or a 3.7 to 5.5 volts to the VIN pin. If you are powering the Teensy via USB, the VUSB pin gives the 5v power from the USB device. Normally VIN/VUSB are tied together, but you wire it up so the USB does not provide power, and you have to manually tie VIN and VUSB together. If you are powering the device via a li-poly batter, it is like the Gemma, in that you can feed the neopixels the 3.7v from the VIN, and signaling will be 3.3v. If you are powering via USB or similar 5v power, it may work if you feed it 5v power and 3.3v, but as I said, it may not work. The solution there is to level shift the power of the signaling to 5v. I have used a TXS0102 level shifter (from DSS circuits) and I have recently moved to the Pololu level shifter with external pullup resistors. However, the best way to do level shifting is with a 74HCT245 chip.

If you are doing hundreds or thousands of lights, you want to use the Teensy and the octows2811 shield (that incorporates the appropriate resistors, capacitors, and 74HCT245) and library, and it will handle the various level conversions, etc. and run 8 parallel strands of lights at the same time. I don't do that may lights.

So, getting back to the point, I tend to think at the end of the day, that a beginner is probably best served by going with a 5v processor, and not have to worry about level shifting. The one exception is if you were going to use the li-poly battery, use that with 3.3v processors, and realize it might be a little more complex in programming it. However, you will see various Gemma tutorials for wearables using neopixels. Some of these were written with older neopixels that might be more tolerant of 3.3v, and others assume the use of the li-poly battery, which can save a lot of space compared to AA batteries.

User avatar
Izmuntil
 
Posts: 17
Joined: Sun Aug 10, 2014 4:13 am

Re: simple project help for a newbie?

Post by Izmuntil »

so i can power the 3.3V GEMMA with a 5V battery? i thought if you gave it more energy than what it shows, it might have a chance of destroying it in some way, thats why i thought it needed the 3.7V battery, because its similar to the voltage of the GEMMA.

i think i understand what you mean by programming it. so you try and program the GEMMA, and the USB cable attached to your computer is 5V. when you debug the code it doesnt work because the trinket is meant for 3.3V, but when you unplug the USB and power it from the Li-poly battery, it SHOULD work. is this the "level shifting" you are talking about? the solution that i see is simply switching between computer and Li-poly battery every time you want to test the code, is that a viable way to get around this problem?

since i am new to this, i think it would be easier to just tell me which one is the easiest or the correct/incorrect way to hook it up.
i've found 2 different ways people are hooking these up for the GEMMA:
* the first one (https://learn.adafruit.com/assets/15057) uses 3 x AAA batteries, so 4.8V, so i guess it's okay to use ~5V to power the thing
* the second one (https://learn.adafruit.com/assets/11056) uses the 3.7V Li-poly battery, it also has a different way of wiring to the LED strip, which seems strange

would both of these be fine? i switched from the 5V to the GEMMA because it is for wearable projects and because it has the JST connector, and seemed simpler than trying to attach another JST extension to the middle of the LED strip, but would you recommend the GEMMA for someone like me?
you mention that there are 2 possibilities:
* using the Li-poly battery is easier, but then one would need a 3.3V processor (GEMMA) to go with it. if one goes that route, it is harder to code
  • i assume this is the "level shifting" thing
* using a 5V trinket, but then i would have to power it with 5V, and possibly attach the power to the LEDs just like in (https://learn.adafruit.com/assets/11055)
  • by using this way, i wouldnt have to worry about different results when debugging the processor
are both of these correct, and would you recommend the GEMMA trinket over the 5V trinket?

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: simple project help for a newbie?

Post by michaelmeissner »

Note, just to be clear, I'm a software guy, so hopefully I won't be too far off in my explanations. It's just, I've been dealing with this recently....

The microprocessors listed here all have voltage regulators that allow you to power them with more voltage then they run at. The voltage regulator reduces the power to the desired voltage. If the voltage is under the limit for the regulator, most regulators just pass the voltage straight through. As has been mentioned, with most electronics, you power it with a little under or over the spec, and it will work. Obviously, it depends on the components, but a usual rule of thumb is about 10% under, so for a 5v processor, you might get away with 4.5v - 5.5v.

For the Gemma, you can feed it 3.5 - 16v, and the voltage regulator will reduce it to 3.3v. Now, the regulators used in the microprocessors, aren't that efficient, and if you feed 16v to Gemma, it will radiate a lot of heat to get rid of the excess power.

The second method of using the Gemma is how I power the goggles you can see on my icon photo.

When I'm changing the pattern I have to hook up the USB cable, and the VOUT pin now has 5v on it. So, after I reflash the program, it may/may not work when it is connected with 5v power. So I switch to the li-poly to see if the lights work fine.

I'm kind of conflicted about the Gemma/Trinket. Speaking as somebody who has at least 6 different microprocessors floating around, I no longer actively program the Gemma, Trinket, or other ATtiny85 based processors because they are too limited for the things I want to do. In particular, it makes debugging harder, because these chips don't have standard USB support, and you can't do Serial.println's to trace the program's execution path. In addition, I program on Linux, and the Adafruit support is somewhat problematical for Gemma/Trinket (but it works for the laptop I do programming on, but it may not work on the next Linux box I get). However, for a starter microprocessor, the Gemma/Trinket seems to be good platform for a lot of programs, and certainly it is a lot cheaper point of entry than some of the other solutions. If you can afford it, the Adafruit Flora avoids many of the issues that the Gemma has, but it still uses the li-poly battery, which I like for wearables.

However, I tend to think the Arduino Uno, is perhaps the best platform to begin with. That is because just about everybody has an Uno, and you can find lots and lots of examples that are known to run on the Uno. You can also extend the Uno with various shields. After you get your footing on the Uno, you can then figure out where you want to go that the Uno doesn't do.

User avatar
Izmuntil
 
Posts: 17
Joined: Sun Aug 10, 2014 4:13 am

Re: simple project help for a newbie?

Post by Izmuntil »

i know the project is going to be expensive, but if there is an option to make it cheaper, i'd rather go that route. the Gemma is a lot cheaper than the Uno, and flora, and those would bump the project into the "too much" range.
i only need it to power the LED strip so i dont mind it being limited. i have a PC so i won't have a problem like you have when using Linux. i just need to know why there are differences in the wiring, and if both are capable of turning it on, and also which tutorial to follow

the things i think i need to get right now:
* Gemma 3.3V
* 3.7 Li-poly battery (or 4 NiMH batteries for 4.8V, but the closer to 3.3V the better)
* 30 LED/m strip
* wiring to hold it together
* friend has a soldering iron so that isnt necessary

does that sound good to you?

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: simple project help for a newbie?

Post by michaelmeissner »

Sounds good to go. Have fun!

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: simple project help for a newbie?

Post by michaelmeissner »

One thing that bites me is never hold the battery by the wires. Or else, sooner or later, you will need to re-solder the wires back to the battery. I wish those batteries had strain relief to prevent the wires coming out (or that I could remember not to hold it by the wires).

User avatar
Izmuntil
 
Posts: 17
Joined: Sun Aug 10, 2014 4:13 am

Re: simple project help for a newbie?

Post by Izmuntil »

one more thing, why are the wiring diagrams different in the 2 diagrams i posted?
https://learn.adafruit.com/assets/11056
https://learn.adafruit.com/assets/15057

are both acceptable?

besides that, i think im set to go, thanks!

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: simple project help for a newbie?

Post by adafruit_support_bill »

why are the wiring diagrams different in the 2 diagrams i posted?
Some of the LED strips have a different arrangement of pins. As long as you follow the labels on the pins, you should not have any problems:

GND ->GND
Vout -> +5v
D1 -> DIN

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”