I'm looking to make the trinket m0 control 8 1515 neopixels. But I need to convert 3.3v logic to 5v logic. I know there are a few logic level shifters available on adafruit, but I was hoping I could get recommendations on the smallest one that would do the job?
Additionally, I'd like to have a super tiny speaker for an audio output of a sound loop of about 10 seconds. Any recommendations on speakers and other components needed for that with the trinket m0 would be super appreciated!
Thanks!
Tinket m0 with neopixel logic
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- michaelmeissner
- Posts: 1822
- Joined: Wed Aug 29, 2012 12:40 am
Re: Tinket m0 with neopixel logic
Typically for neopixels, the 74AHCT125 (https://www.adafruit.com/product/1787) is the level shifter that is recommended. It is one of the few level shifters available in through hole format (i.e. suitable for breadboard and prototype boards). It can shift 4 pins in parallel, but for the Trinket M0 you would probably would only use 1 pin.
If you can handle surface mount soldering, you can get a smaller form factor that only shifts 1 pin. For example, in the past, I have used something similar to (note, the part I used is currently out of stock, but this is listed as a direct replacement):
- 74AHC1G125W5-7 shifter: https://www.digikey.com/en/products/det ... -7/2639306
- BOB-00717 (SOT23 TO DIP ADAPTER): https://www.digikey.com/en/products/det ... 17/5318740
- Adafruit NeoPXL8 Featherwing for M4 processors: https://www.adafruit.com/product/4537
- Adafruit M4 Feather Express: https://www.adafruit.com/product/3857
- mtsamperi
- Posts: 20
- Joined: Wed Apr 13, 2022 11:42 am
Re: Tinket m0 with neopixel logic
Thanks so much for the detailed response!
I'm comfortable with Surface mount soldering so I'd likely go with the parts you listed. Any chance you'd be able to help me figure out the wiring diagram (I'm unsure of which pins to solder to what to get it working properly)?
Also, I'm only planning on powering 8 individual neopixels.
since I'm trying to output a short audio clip loop, I'm actually guessing the Trinket is not the board to go with for this. Now I'm looking at the QT Py haxpress. Any insight on running a short audio loop on that board using an Surface mounted speaker?
for the neopixels I think I could use the same single pin shifter you linked.
Thanks!
I'm comfortable with Surface mount soldering so I'd likely go with the parts you listed. Any chance you'd be able to help me figure out the wiring diagram (I'm unsure of which pins to solder to what to get it working properly)?
Also, I'm only planning on powering 8 individual neopixels.
since I'm trying to output a short audio clip loop, I'm actually guessing the Trinket is not the board to go with for this. Now I'm looking at the QT Py haxpress. Any insight on running a short audio loop on that board using an Surface mounted speaker?
for the neopixels I think I could use the same single pin shifter you linked.
Thanks!
- michaelmeissner
- Posts: 1822
- Joined: Wed Aug 29, 2012 12:40 am
Re: Tinket m0 with neopixel logic
I forgot to mention the audio part. I really like the Stemma Speaker if you don't need really large volume. It includes both a speaker and amplifier, so all you have to do is connect the ground wire to GND, the USB (or 3.3v) power to POWER, and A0 (on the Trinket M0) to the SIGNAL pin. I believe the Trinket M0 has enough horse power to drive the speaker to play sounds, but I haven't used it myself.
Before the Stemma Speaker came out, I tended to use the breadboard board speaker soldered into a prototype board:
I would use an amplifier like:
But for a surface mounted speaker and amplifier, you will need to look elsewhere. My SMT skills are fairly limited. I've only soldered the level shifter and PSram to the Teensy 4.1.
In terms of other microprocessors, to do audio without using a separate audio shield or featherwing, make sure the microprocessor has a pin that can do direct digital to audio (DAC). Some of the ESP32 processors and the Teensy 4.x processors don't have a DAC pin. There are some of the combination boards that include an amplifier in the board, and you would have to just attach a speaker.
I haven't wired up the level shifter in perhaps 2 years now. But going from the data sheet, there are 3 connections (OE, A, GND) on one side, and 2 connections (VCC and Y) on the other side:
On the Trinket M0, you would likely want to use pin 4 (A4) which would allow you to use the Adafruit Neopixel ZeroDMA library. This library is friendlier when you are using sound and such that needs to use interrupts. For only 8 neopixels and a small sound, you may not need to use the ZeroDMA library, but it may make sense to plan for using it.
An alternative to playing sound in the microprocessor is to off load it, such as with Adafruit Audio FX board.
For a smaller footprint, I might look at the DFRobot boards:
In terms of other microprocessors, to do audio without using a separate audio shield or featherwing, make sure the microprocessor has a pin that can do direct digital to audio (DAC). Some of the ESP32 processors and the Teensy 4.x processors don't have a DAC pin. There are some of the combination boards that include an amplifier in the board, and you would have to just attach a speaker.
I haven't wired up the level shifter in perhaps 2 years now. But going from the data sheet, there are 3 connections (OE, A, GND) on one side, and 2 connections (VCC and Y) on the other side:
- You connect ground to GND and OE and to the ground pin on the neopixel;
- You connect the data signal to A;
- You connect your 5v power to VCC and to the power pin on the neopixel; (and)
- You connect the Y pin to the data input pin on the neopixel.
On the Trinket M0, you would likely want to use pin 4 (A4) which would allow you to use the Adafruit Neopixel ZeroDMA library. This library is friendlier when you are using sound and such that needs to use interrupts. For only 8 neopixels and a small sound, you may not need to use the ZeroDMA library, but it may make sense to plan for using it.
An alternative to playing sound in the microprocessor is to off load it, such as with Adafruit Audio FX board.
For a smaller footprint, I might look at the DFRobot boards:
- Dfplayer mini-MP3 player using a micro-SD card;
- Gravity: UART MP3 Voice Module with 8MB Flash Memory; (or)
- Fermion: DFPlayer Pro - A mini MP3 Player with On-board 128MB Storage
Please be positive and constructive with your questions and comments.