Skip to content

lenpai0/Looping_the_rooms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Looping the Rooms Project (FOR REFERENCE ONLY)

Note! There are still active bugs and unoptimized code that I am too lazy to troubleshoot and fix. This is all for reference only and will not receive any bug fixing updates.

looping the rooms

Song: Looping the Rooms / rusino

Intro

This code uses a PID control loop for the DC motor with built-in encoder and utilizes external interrupts to count the encoder pulse. Timer 1 is also being used to provide an updated target count every 2 beats of the song.

When the button is pressed, the song will start playing from the speaker and the motor will rotate every 2 beats (1 beat was too fast and unstable). The only way to stop is to either restart the board or take out the power as intended :)

Schematic

Looping the Rooms Schematic

Note

  1. USE AN EXTERNAL POWER SUPPLY FOR DEVICES LIKE THE DC MOTOR Microcontrollers like an Arduino are not design to output enough current for power hungry device like motors and speakers. Too much current draw can "brick" a component for good so be warned!

  2. NO SERVO CONTROL/NO PIN 9 AND 10 FOR PWM DUE TO TIMER 1 This program has configured timer1 to move the motor on beat of the song therefore disrupts any normal use of pin 9 and 10 PWM output and all servo controls. More info can be found here: https://deepbluembedded.com/arduino-timer-interrupts/

  3. Datasheet for the DFPlayer Mini suggest using a "resistor in series" between the microcontroller and DFPlayer if the microcontroller output is 5V. However, I think they meant voltage divider circuit because DFPlayer uses 3V3 and Arduino uses 5V and this resistor will only limit the current going in the player. But what do I know? I'm not an engineer.

  • The Arduino is being powered by the regulated 5V line from the MDD3A motor driver. Please research alternative ways of powering the Arduino before attempting to do this as there is no protection for reverse polarity or overvoltage. In this case, you can simply power the Arduino via USB connection :) https://docs.arduino.cc/learn/electronics/power-pins/#3v35v-pin

Resourced used

Usage

If you find yourself using this code to add to your project or make a video/tutorial with it, I simply ask that you credit me @lenpai0 and provide a link to this page so everything is traceable. Thanks and enjoy!

About

Note! There are still active bugs that I am too lazy to troubleshoot and fix. This is all for reference. This repository will include the code and schematic used to make the project.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages