Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: A couple of questions

  1. #1

    A couple of questions

    My current project prototype consists of:
    -Arduino nano (Atmega328P), 5V signal and power
    -Adafruit NXP Precision 9DoF Breakout (3.3 or 5V logic/power), I2C bus. This has the FX0S8700 accelerometer and FXAS21002 gyroscope
    -Adafruit RGBW Neopixels. 5V
    -DFRobot DFPlayer Mini MP3 player/with amp. Serial coms, SD card. 3.3v logic, 4.2V power. 24 bit DAC output
    -Pololu 5V voltage converter
    - 3w 4ohm 22mm speaker
    - Peripherals are powered outside of nano
    - Speaker and LED's can pull about 1.2A in bursts

    This prototype has given me a platform to work on the project coding (via PlatformIO / Visual Studio code) which I expect to take quite a while to complete, but I am not currently blocked. I am writing my code against a higher level interface to hide the hardware as much as possible and let me unit test the logic and integration test the hardware.

    In the meantime I am working on the next generation design for my project. I have a couple of requirements that I wanted to run by you guys. I am considering the Adafruit Itsy Bitsy m4 as well as the Teensy 3.5 / 3.6

    Requirements that my next design needs to address:

    - I need a "no power / extremely low power mode" that wakes up on significant movement. My goal would be run it in this sleeping mode for at least 6 months on 3350maH. Right now I am using the nano in a low power state that wakes up every 4 seconds and checks to see if there is movement on the accellerometer. I am thinking of replacing this with a mechanical/spring vibration switch that drives the shutdown switch on the power regulator. This would stop/start power to entire project. Or alternatively leave the microcontroller powered but in a state where it can trigger on an interrupt pulled down by the switch. While not specific to the micro controller, is there anything in the Teensy that might fit well with this requirement? Maybe the Teensy Snooze code with the interrupt driver? I may very well need to build a separate sub-circuit to power on via the vibration switch just to get the most out of the batteries.

    - Next I need a "low power running mode" where I am processing the accellerometer input looking for a particular gesture, but other wise is not using much power. I would need to take a measurement every 100ms and I would know know if the activating orientation is found after 5 samples. This means I need to disable any onboard features that might suck power (USB/indicator lights, etc). Once the simple gesture is recognized I will be activating the rest of the peripherals. Perhaps the Snooze low power timer would work, but I am not sure if the I2C bus would remain powered.

    - The DFPlayer (at $8.99) is a sweet piece of work, but it has some issues. It has no real low power mode and consumes 50ma even when it is not "on". I have to put a mosfet to isolate this from the rest of the project to truly turn it off. I originally tried to drive my speakers using a SD card + PAM8302 audio amp driven by PWM port from nano, but I had to work with WAV files and it consumed too much CPU and resources. I see the 12bit DAC on the teensy, and the excellent audio library and built-in SD support and I am thinking I can drop the DFPlayer and drive it from the Teensy and use mp3 files as well. This might address issues I have had with switching between clips quickly and also allow me to merge 2-3 sounds simultaneously. I really don't know the quality of the 12bit DAC versus the 24 bit DAC but that sounds significant. What is your opinion on sound quality differences? If it is good then I can put into a d-class audio amp. If it is bad then can the Teensy Audio library drive I2S instead? Then I could send it to an DAC/AMP to drive the speaker? Like the MAX98357 I2S Amp Breakout. As far as I know AdaFruit does not have the audio library for the m4 architecture so this would be a real selling point for me.

    - And finally, is the Teensy environment compatible with AdaFruit's sensor library and NeoPixel library?

    Thank you for taking time to read all of this.
    Last edited by DilvishEhldar; 02-03-2019 at 08:22 PM.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,692
    Maybe ask this on Adafruit's forum, since you're using their products?

  3. #3
    Hmm, This post is about using the teensy 3.5 or 3.6 as the micro-controller for my project. Nonetheless, I apologize if I wasted your time.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,692
    On the matter of DAC quality, even 10 bits is plenty if you're driving a tiny 22mm diameter speaker.

    When it comes to high quality DACs, the number of bits is usually meaningless. They all accept more bits input than they're capable of faithfully reproducing as an actual analog output.

    The specs to look at are unweighted signal-to-noise ratio, or signal-to-noise+distortion ratio (many specs are "A weighted", which inflates the number somewhat - remember, datasheets are first and foremost a sales pitch - objective docs is the secondary goal). Normally these are given in dB. In terms of "bits", each bit is approx 6 dB. There are no DACs with 144 dB signal to noise ratio. Modern tech just isn't that good. Most good quality DACs are in the 90 to 100 dB range. The very best are in the 110 to 120 dB range.

    The 12 bit DAC on Teensy 3.x when used with typical amplified computer speakers, listening in an ordinary room sounds quite good. For a hi-fi stereo system or excellent quality headphones, you probably want a 16 bit DAC. Whether more than 16 bits matters is questionable. Even if you have the very best gear, analog circuitry just isn't better than 18-19 bits resolution.

  5. #5
    Thank you for your response. Iíll order a couple of these boards and give it a try. I look forward to working with your awesome audio library.

  6. #6
    I have placed the order. Thanks again for your response.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •