Modification of NeoPixel Goggles?

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
NotAllWhoWander
 
Posts: 3
Joined: Thu Feb 12, 2015 1:05 pm

Modification of NeoPixel Goggles?

Post by NotAllWhoWander »

Hi all,

Software dev just getting into hardware things, stupid question ahead.

I'm working on a costume prop for a play, going off of the https://learn.adafruit.com/kaleidoscope ... -soldering guide. I have the kit with the Trinket M0 (https://www.adafruit.com/product/2221). However, I have learned that I'm "not great" at soldering, especially the JST power connector. I went through 2-3 spare boards trying to get something workable, but while the battery looks like it powers up the Trinket, the normal program I was testing via USB (using a tactile switch https://www.adafruit.com/product/1685 with one wire connected to GND and another to Pin 2) that would fade/switch the on-board pixel color when the switch was flipped no longer works. I see the on-board pixel flicker/change color and it doesn't quite look right. I'm assuming I just don't have a good enough connection with the board, or I damaged something during installation?

Question for a hopefully easier modification:
Can I instead of using a LiPo battery pack with a soldered on JST, just plug in a standard battery pack to the USB port and power the Neo Pixels off of either the USB or 3V pins?

Thanks!

User avatar
mikeysklar
 
Posts: 14165
Joined: Mon Aug 01, 2016 8:10 pm

Re: Modification of NeoPixel Goggles?

Post by mikeysklar »

Yes, you can just use a standard USB battery pack going into the USB port. The only drawback to that is the trinket 3v3 voltage regulator will have a max current of 500mA.

If you want to post photos of your soldering maybe there is something we can recommend.

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

Re: Modification of NeoPixel Goggles?

Post by michaelmeissner »

One thought is to switch to the Gemma M0 instead of the Trinket M0. The Gemma has a battery port built-in. And more importantly to me, it has an on/off switch, so you can turn the prop off when you need to (for example, talking to somebody where the lights might be distracting). The downside of the Gemma is it has only 3 data pins instead of 5 that the trinket has. For a simple neopixel prop, you only need one pin for data (though I usually tend to add a button to switch from doing the flashy pattern to a more simple pattern with just solid colors when the lights might be excessive).

Another advantage of the Gemma M0 is you can build a basic neopixel prop without doing any soldering by stripping the wires and wrapping them around the holes in the Gemma. However, I have found that if you do this, you don't want to move the prop around, because eventually the stranded wire will break. I've been meaning to try hot glue to better anchor the wires to prevent the flexing and breaking.

Note, the Gemma does not support battery charging (but neither does the trinket if you solder the JST port to the board). You would need to be able to remove the batteries and charge them separately.

If you want to use the USB connection to charge the battery and are up for some simple pin soldering (as opposed to the surface mount solder you need for the Trinket M0 to attach the battery connector), consider using one of the QT PY boards, and its battery BFF. You would solder the battery BFF to the back of the QT PY board, and then solder the 3 wires of the neopixel to ground, 5v, and the data pin. Like in the Gemma, you do have to be careful about the wires flexing and breaking.

If you don't mind a slightly bigger form factor, one step up would be to go to one of the feathers, which includes built-in battery charging. Unfortunately, my feather boards are slighting larger than my goggles that I got from Spirit of Halloween.

Lets see, links for the things I mentioned:

User avatar
NotAllWhoWander
 
Posts: 3
Joined: Thu Feb 12, 2015 1:05 pm

Re: Modification of NeoPixel Goggles?

Post by NotAllWhoWander »

Thanks folks!

If I used the 5V USB off the Trinket (granted, I'd need a quad stepper to convert the 3.3V data up to 5V) would it allow me to drive more neopixels? I also just realized that I could skip the JST header and use the BAT/GND pins for the battery, I think 90% of my issues are with getting the surface mount to work. I have a smaller solder tip as well as more sacrificial boards coming, there's no way I'll kill all of them is there? :)

I wonder if part of the issue is with the ground connection, I'll try to get a picture of things when I can. I did try to connect a 16 pixel ring to the ground/data/3V (taking care to connect first the ground, then the data, and finally the 3V), but as soon as I connected it to the voltage the red reset LED flashed and the main LED turned purple and stayed quite mad at me until I disconnected everything and rebooted it. Since I'm using a tactile switch, that means that I'm either keeping Pin 2 connected with ground continuously on/off depending on the switch position, could that cause any issues?

Appreciate the suggestion for other boards! I should probably be a bit more specific on what I'm doing with it. I'm in a local theatre Shakespeare production of "Much Ado About Nothing", set in a quasi-dystopian cyber-ish punk future (b/c let's face it, it's all been done already lol), I'm playing the character of Leonato, and I had the idea of making him a bit of a cyborg.

I have an "eyepatch" goggle that will only cover one eye, and the idea was to put one 16 pixel ring (as well as possibly the small jewel in the center). They wouldn't change or swirl colors or anything, just stay a solid blue color until a couple scenes where he flips his lid and I'll use a button stashed somewhere on my costume to flip the LEDs to red. Side note, are there any good options for buttons that can be stashed somewhere on one's person and not too easy to accidentally press? Currently trying a tactile switch.

(I know it's not suggested to wear the goggles with the pixels, but I think I can mitigate most of the issues raised, I will only be covering one eye, and will probably put some sort of blackout cloth between my eye and the electronics anyhow as I won't need to see out of it. Additionally, the pixels will stay a single solid color and not shift, and the whole thing only needs to be on while I'm on stage)

That does free me up quite a bit in terms of form factor, I plan on bundling the three wires and sealing them in heat-shrink tubing to run from the goggle to an interior coat pocket that will have all the hardware and batteries. If such a thing exists, I'd love to use a board that supports CircuitPython, battery power in via the USB port (I've got tons of different form factor standard usb battery packs), and 5V data and power out to easily drive all ~23 or so pixels at once (not full white, mostly either just red or blue, with a short transition through purple when they flip). I don't mind trying a handfull of things, as really the biggest concern is just getting shipped so I can have time to iterate towards a solution.

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

Re: Modification of NeoPixel Goggles?

Post by michaelmeissner »

This is where it gets into non-hard/fast rules, and some ancient history with neopixels. Note, I've only been using the LEDs, I don't know some of the electrical details, etc. So this is my interpretation of things.

The original neopixels using the first WS2812 chips had more strict voltage limits than the current SK6812 based neopixels. But back then, the dominant board was the 5v Ardunio UNO using the AVR 328p. With the AVR 328p since it ran at 5 volts, you didn't have any voltage issue. Both the power and the data pins were 5 volts, which was in the official limits for the chip (4.5 - 6 volts or some such).

The microprocessor world changed so that the 5v boards fell out of favor, and the 3.3 volt ARM boards starting becoming favored, and people started to have to worry about voltage differences. With the earlier neopixels and 3.3v processors, you had to boost the current of the data signal so that it would be in the range that the WS2812 processor in the neopixel would see the voltage change in a reliable fashion. If you didn't boost the voltage, sometimes it would work, and sometimes it would not. Back then in the Teensy forum we had a lot of discussion of 'grumpy' neopixels where certain rings or strands needed the proper boosting. Because neopixels have just a single data wire, the protocol has a strict timing sequence where each bit has to be delivered within a timing window. Many of the voltage level shifters used for I2C and SPI buses are too slow to use for neopixels. You need to use buffered shifters that are unidirectional.

In addition to processors that ran at 3.3 volts, people started using the single cell lithium ion battery to power their gadgets. A single cell battery has a nominal voltage of 3.7 volts (or 3.6 volts earlier). When it is freshly charged, it produces 4.2 volts, and it goes down to 3.4 volts where it is dead. The 3.3 voltage converted in the microprocessor needs the input voltage to be higher than 3.3 volts to operate properly (but not so high or the voltage regulator will burn out).

Adafruit shifted their neopixels from using World Semi chips (i.e. WS2812 and variants) to the SZ Led Color chips (i.e. SK6812). These SK6812 chips have the property that the data signal only needs to be 2.6 volts or so. This means for at least small numbers of neopixels (i.e. 100 or less) you don't need to do the level shifting, providing the LEDs that you are using are SK6812's. But if you have WS2812 variants, you typically need the data signal to be within 0.7 volts of the power signal. I.e. if you are powering the circuit with 5.0 volts from USB, you would need the data signal to be 4.3 volts. But if you are using a li-ion battery, you would need 3.5 volts if the battery is freshly charged (i.e. 4.2 volts), and 3.0 volts after the battery has been used for a bit. However, the world is not digital, while those are the limits written in the spec sheet, some chips will be more forgiving.

The Uberguide still has the recommendation that you need a voltage shifter. But if you look in a lot of the recent how-tos, they often times 'forget' to do the shifting, because it works when you are using recent Adafruit neopixels with SK6812. But if you are using an older neopixel from Adafruit (including one you just bought that has been sitting in a warehouse for 5+ years) or a LED from some other source, perhaps it has WS2812's and perhaps it has SK6812's. To paraphrase the famous Clint Eastwood line, "Do you feel lucky"?

Another 'feature' of the SK6812's are that for a few LEDs, you can often run them at 3.3 volts instead of 3.7 - 4.2 volts. Now, if you do, you might have some color accuracy problems particularly in the blue and green colors. In addition, the voltage regulator of many of the microprocessors can't provide that much power. But for the small configurations, running the neopixels with voltage from your power source (i.e. 3.4 - 4.2 volts from a battery or 5 volts from USB).

So what would I recommend given your description? The key to your setup is you don't need it to be ultra-small (i.e. fit in the lens of a goggle with the other lens holding the battery). You can have bigger boards and batteries and such.

First off all, use a USB battery to power your gear and not a single cycle li-ion battery. It is a lot easier to replace the battery and recharge it. With the JST connector, it can be hard to remove the battery. Also in smaller cosplay environments, you don't want to remove the battery, but recharge it in place.

Second if you have the right neopixels and you have a small number of neopixels, don't bother with voltage level shifting. Just connect VIN to the power, your data pin to the neopixel data, and connect the grounds. Whether you need to use the capacitor and resistor mentioned in the Uberguide, depends on your setup. I suspect many of us don't bother with either, particularly if you are powering it via a battery.

Or alternatively, do the level shifting if you want to be sure. If you don't need ultra-small, and are willing to spend a few more dollars, I would recommend getting a feather board and the Adafruit prop-maker feather wing. This wing has the proper resistor and capacitor, and it has a 3-pin JST connector that allows for sturdier connections and the ability to more easily change the neopixels. You won't have the issue with wires breaking that I mentioned with the Gemma's. If you don't wand to solder, you can get certain feathers with the pins soldered onto the board, and with the prop-maker board with headers. For example: Note, I haven't actually used the Huzzah32 + Adafruit prop-maker boards at present. I have the pieces, but I have been dithering. Some of my neopixel setups use the Teensy LC which has a level shift for one pin specifically for neopixels. In the past, I've also used the Teensy (not Adafruit) LC-prop shield that has 2 level shifters for doing neopixels or dotstarts. I've also soldered a few level shifters up. But most recently, I've just been avoiding using the level shifter. However, with my builds, I often have stricter size requirements (such as a wooden bowtie with a neopixel ring, and I needed the microprocesser and battery to both be hidden by the bowtie, or suspenders where the feathers are just a little too wide to be used to hide the microprocessor.

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

Re: Modification of NeoPixel Goggles?

Post by michaelmeissner »

BTW, another thing to think about is the Hallowing M4 (or the older Hallowing M0) Now the main code does the single eye, but you might be able to slip in both operating a neopixel ring and the eye. You would need to do the eye and then at an appropriate time do the ring. It would be harder to do both at the same time (there is one place in the Hallowing M0 code where you can slip in the neopixel support that I used a few years ago when I was doing the eyes with Teensy 3.2/3.5/3.6s and in theory it should work for the Hallowing M0 -- I haven't looked int he Hallowing M4 code).

The M0/M4 have 4 pins that can be used as touch sensors (i.e. you don't need separate buttons). It also has an accelerometers to recognize motion.

For a stage production, I would recommend getting at least the lens holder (and hide the rest of the Hallowing under makeup and such). The lenses are cool, but the problem is if you are active, eventually the double sided tape used to keep the display on the board comes apart if you don't use the lens holder. Unfortunately since the lens holder is circular it really only works for doing things like eyes.

FWIW, there is this learning guide for making the Hallowing M0 into a light saber using the touch buttons and accelerometer for the saber swing. It does not use the actual display. If you are going to make a saber, be sure to attach the display either with a lens holder or tape. This code will not work on the M4: Then there is the Monster M4SK, but that likely won't work for your environment. It needs two lens holders (and maybe lenses) to keep the displays in place:

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

Re: Modification of NeoPixel Goggles?

Post by michaelmeissner »

Another option would be to use the LED glasses kit. You don't have have do the scrolling text with it. You can just do the two neopixel rings. Because there are slits in the panel, you can wear it as glasses and be able to see out of it (sort of): You mentioned putting a jewel inside of the 16-LED ring. There is also this specialized ring has 3 sets of rings that are already part of the unit. For cosplay (and possibly theater) projects that want strands of neopixels, I really like the following: Note, unfortunately the above strands are inconsistent in terms of whether you connect the male or the female JST plug. You might need to create a male-male or female-female gender changer to go between these units.

For hooking up on projects, I find the first strand easier to put in random things because the wires are individual, while with the other three, the wires are joined together, and are a little harder to hide.

The second and third strands have the wires together, and it likely might be stronger than the first with repeated stresses.

The last strand uses neopixel dots, and the LEDs are smaller. For cosplay where you are closer to people, I like that strand because the lights are more subtle, but for theater, they aren't as bright, and it may be harder to see from the audience.

Then this is this. I've bought it, but it is in my pile of neopixel stuff to be used some day. For theater and active cosplay, I can imagine you will need to inspect the neopixels every so often, and glue on more crystals as they fall off. I think these crystals are made for the standard neopixels and not the strands I mentioned above.

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

Return to “Trinket ATTiny, Trinket M0”