Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
WShawn
 
Posts: 23
Joined: Sun Feb 19, 2017 5:33 pm

Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

Post by WShawn »

First-time post here.

I recently finished a PKE Meter replica I've been building, off and on (mostly off), for many years. Here's a video of the completed prop in its current state.

https://youtu.be/gct2NALXWS4

The electronics are controlled by a Teensy 3.2 with a Prop Shield LC holding the sound files and driving the speakers. My plan was to make several of these for myself and a friend, and perhaps offer kits, but with Teensy 3.2s being unavailable for at least six months I'm exploring other small microcontrollers, storage, and audio amps. It has to chase LEDs, light a few others, drive two servos, and play two sound files.

It seems like an Adafruit Itsy Bitsy M4 Express might be a decent replacement for the Teensy 3.2. I'd need other components to store the audio files and amplify the output of its DAC. Any thoughts on small components that could do this? As you can see, my space is limited:

Image

I'm still having some issues dialing in the exact rotations of servos. Also, the sound is too low. In my next iteration I hope to use a LiPo battery of some sort that would live exclusively in the handle, opening up space in the main shell for a larger speaker.

I'm not exactly an expert in all this. I had a friend work up the sketch for the Teensy. I designed the schematics, taught myself KiCAD, and designed PCBs for the main board and the wings. I had those fabricated at OSHPark.

For more context this thread on GBFans details most of the build:

https://www.gbfans.com/forum/viewtopic.php?t=46251

Thanks!

Shawn Marshall
Portland, OR

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

Re: Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

Post by michaelmeissner »

As a Teensy user primarily, it is a shame that many of the Teensy's are in short supply (the 4.0 and 4.1s have new boards coming soon, but you would need to rework the sound stuff).

I imagine you need 3-4 things that you currently use with the Teensy/Prop Shield:
  • Some way to play sounds, including amplification which the prop shield offers
  • Flash memory or SD card to hold data
  • Some way to drive neopixels or possibly dotstars
  • Maybe a motion sensor
Many of the Adafruit boards now have flash memory that you can use to store the files in. So you wouldn't need to have a flash memory chip like the Teensy prop shield offers if you get a board with flash memory built-in. The Itsy Bitsy M4 does have 2 megabytes of SPI flash built-in. I haven't written any code to use this flash memory yet, but I'm sure there are plenty of examples.

If you were to switch from Arduino to Circuit Python, CP offers the integrated flash memory support, including acting as a removable drive when you plug in the board to your computer's USB (which is really handy). But rewriting things in CP will be a major undertaking. But you can likely use Arduino functions to do the same thing.

One other thing that is nice is the Itsy Bitsy line offers a dedicated pin (pin 5) that automatically does the voltage translation from 3.3v to 5v to better drive neopixels. Unfortunately, it is only one line, so you can't drive dotstars with it. The Teensy LC had a similar pin (A3), but the LC might not be able to run some of the audio code.

Unfortunately as you've probably discovered, while the Itsy Bitsy line is the same size as the Teensy, the pinout is completely different.

You can hook up A0 to do analog writes to do mono sound output. You would need to use an amplifier to drive a speaker. Adafruit does sell a combined speaker + amplifier (https://www.adafruit.com/product/3885). Or it sells various amplifiers if you want to use your existing speaker (https://www.adafruit.com/product/2130). Unfortunately if you are using the Teensy Audio library, you would need to replace using that.

There are various motion sensors you can add on if you need them.

However, if you can tolerate a slightly bigger board, I would recommend looking into the feather line-up. In particular, there are several feather processors which have different capabilities (some have wifi, bluetooth, and/or motion sensing). You can then attach the featherwing prop-maker board. This board provides one JST plug for neopixels. A separate plug for a speaker (the plug includes amplification), a motion sensor, and 3 pins that can be used for higher voltage LEDs or servos. The board also has places to solder a switch that can turn off the power when being powered via a battery, and a place for either a mechanical switch with strain relief.

Within the feather eco-system there is a featherwings to run up to 8 servos and another to control motors:

User avatar
WShawn
 
Posts: 23
Joined: Sun Feb 19, 2017 5:33 pm

Re: Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

Post by WShawn »

Hi Michael:

Thank you for taking the time to reply; I appreciate it. I've seen your name on the PJRC forums.

I'm thinking the ItsyBitsy M4 Express and some sort of small audio amp might work best in for this prop.

A Feather and Prop Shield look cool, but I think those would be overkill for my needs here. I don't need motion detection, nor do I have to drive Neopixels, etc. In addition to driving some dumb LEDs and controlling two servos I just have to play and amplify the two sound files I'm using. I'm pretty sure I could get them to fit on the 2MB built-in flash of the ItsyBitsy M4.

I'm prepared to rework my schematic and PCB for a new microcontroller. My friend who helped with my Teensy version should be able to help reworking the code here. He might prefer switching to Circuit Python.

I'll have to find out how you get the sound files onto the flash chip (and what format has to be used). I'm also not clear just yet on how the DAC of the ItsyBitsy connects to the amp (like the one you linked to).

Cheers!

Shawn

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

Re: Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

Post by michaelmeissner »

For the Stemma speaker + amp, there are 3 wires.

If you are using a JST cable, the signal wire (white) hooks up to your DAC pin (A0). The ground wire (black) hooks up to your ground pin. The red wire hooks up to either 3.3 volts or USB/VIN from your microprocessor. If you are soldering wires to the alligator clip pads, the 'Sig' pad is the signal, the '+' pad is the power, and the '-' pad is ground.

If you aren't driving neopixels, another option is to look at the QT PY processors. But there the issue is to make sure they support sound. Some of the microprocessors in the QT PY line support having a DAC, some don't, and possibly they have other limitations.

Somebody else will have to chime in on how to update the flash, as I haven't written a sketch that does that.

User avatar
WShawn
 
Posts: 23
Joined: Sun Feb 19, 2017 5:33 pm

Re: Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

Post by WShawn »

Thank you again for your reply.

My preference would be to use something like the Adafruit Mono 2.5W Class D Audio Amplifier to drive a speaker of my own choosing, but I don't know how it would connect to an ItsyBitsy. What does the DAC pin connect to on the amp? Does it connect to the amp directly? As I wrote initially, I'm not exactly an expert in all this. Unless the amp has an input labeled "DAC IN" I'm kind of lost.

If you know of a tutorial/instructions that describes all of these please LMK.

I am using the Teensy Audio Library in my current (Teensy 3.2/Prop Shield) iteration. Where would one go to learn about how to replace that with something that would work with an ItsyBitsy?

Best.

Shawn

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

Re: Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

Post by michaelmeissner »

On the Adafruit Mono 2.5W Class D Audio Amplifier, you would attach:
  • Audio In+: DAC output, i.e. A0 in the case of the Itsy Bitsy or A14 in the case of the Teensy 3.2.
  • Audio In-: Ground.
  • Shutdown: Either don't connect it, or tie it to a a pin that you set to LOW to turn off the amplifier or HIGH to turn it on.
  • 2-5v: Connect it to either VIN/USB (for 5v) or 3.3v (for 3.3 volts). If you connect it to VIN/USB, it will be louder than if you connect it to 3.3 volts.
  • Ground: Ground.
While I bought an Itsy Bitsy M4, I haven't really used it other than running some simple neopixel sketches.

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

Re: Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

Post by michaelmeissner »

Note, on the Teensy 3.2, you would connect analog ground (between the VIN and 3.3v pins on the right side) to Analog - on the amplifier, and normal ground (next to pin 0 on the left side) to the ground pin. When I wrote the message, I forgot the Teensy 3.2 has both analog ground and normal grounds (the Teensy 4.0 and 4.1 only have a normal ground).

User avatar
WShawn
 
Posts: 23
Joined: Sun Feb 19, 2017 5:33 pm

Re: Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

Post by WShawn »

Thanks again for the direction; I appreciate it.

I remember reading stuff about analog ground and audio ground at some point. I guess I should refresh my memory about that.

Any suggestions on where my coding friend and I would look to find how to make audio playback work (since the Teensy Audio Library apparently won't work here?)

Cheers.

Shawn

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

Re: Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

Post by michaelmeissner »

Others will have to chime in. I don't have the experience with audio except in the Teensy environment.

User avatar
WShawn
 
Posts: 23
Joined: Sun Feb 19, 2017 5:33 pm

Re: Alternative to Teensy 3.2 and Prop Shield for PKE Meter Prop

Post by WShawn »

Acknowledged, thanks. I'll post some questions on the ItsyBitsy forum.

Cheers.

Shawn

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

Return to “General Project help”