Go Down

Topic: Converting Analog Sound to DC Motor Movement (Read 141 times) previous topic - next topic

fbrown4

I'm fairly new to arduino and coding, but I'm very handy with a soldering iron and computer.   I'm working on a gift for a friend based on the Alexa controlled Billy Big Mouth Bass.



I chose to build it with a old Arduino Nano and a L298N H-bridge to drive the 5V brushed motors in the bass.  I am not using an Uno / Motor Shield as used in the tutorial above, so my understanding is some of the same coding is not available to me.

Wiring
The wiring is generally correct at this point.  I have the 4 AA's 6.5V wired to the L298N and the 5V reg (4.8V) on the L298N powering the Nano.  I have the L298N wired correctly to the bass motors, and the bass moves correctly.  I currently have no PWM outputs run to the L298N.  I have the left channel from the 3.5 jack wired to the A7 on the Nano.   I also have the stock button on the front of the bass wired between ground and A5 on the Nano.  The stock crappy speaker is wired to the right channel audio.

What I want the Bass to Do
  • I want the bass to "sit up" and look forward when the button is pressed.  When the button is pressed again, I want the bass to "lay down."  This appears to be working correctly with the current code
  • I want bass lips to move with the music playing.  I have a solid set of data from the audio sensor, but I cannot get the audio to sync well with the lips.   I know my current code (trial and error) is not ideal for this situation.


Current Code
https://pastebin.com/U2Cpruzs

Request
If anyone has any thought or suggestions, I would greatly appreciate it.  This is my first arduino project where I haven't just copied and pasted someone else's code.  Thank you!

wvmarle

Please post your complete code and complete circuit diagram (i.e. no Fritzing). Unclickable external links don't do it, just post it here.

Then please post a detailed description on what it does, and how that differs from what you want it to do.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

TomGeorge

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

Go Up