可以放在AutoStrummer /进洞里of an acoustic guitar, and will strum the string set selected by 6 tactile buttons. A potentiometer allows for tempo control, and a menu system provides the user with a few rhythm choices for the strumming.
While time constraints did lead to some poor design choices (seeKnown Issuesbelow), the end result worked! However, I had to modify my guitar string heights slightly by placing spacers at the bridge, so it may not work on every guitar right off the bat. Also, it's sized formy吉他，所以它可能或可能不适合那里的每个声学吉他，我不确定。我的吉他洞是3.875“直径。
- FDPD Upload chip to upload data to microcontroller
- 12-30V Power supply, 300 mA min.
- Acoustic Guitar (pretty much required)
- 1x - Arduino Pro Mini, Nano, or other small sized micro-controller
- 1x - 电压调节器，线性 -LM2940T-9.0
- 6x - Tactile Buttons, With internal LED -- TL1240GQ1JCLR
- 1x - 28byJ-48步进电机（5V优先，12V似乎具有较低的顶峰）
- 1x - 电位计
- 1x - microSwitch.
- 1x - 步进电机驱动器芯片 - DRV8825或可比性
- 1x -PCB Prototype Board, 3cm x 7cm
- 1x - 2.1X5.5MM Power Jack --EJ501A
- 6x - 470 Ohm Resistors
- 1x - 22 µF Capacitor
- 1x - 100 µF Capacitor
- 1x - 100包4-40菲利普斯螺丝，1/4“（不使用所有100）
- 1x - 100包4-40菲利普斯螺钉，1/2“（不使用全部100）
- 12x - 4-40垫圈或坚果
- 2x - Spring
- Various pin connectors as needed
- Cheap Guitar Pick (or you can use my STL file to print one)
- Foam or Cotton Balls
The first step is to print each part out! While there are some identical components, I have included every part with a unique file. So just print every file provided.
All of the STL files can be found in the .zip file. Instructables won't let me upload a zip file for some reason, so just delete the '.txt' and it will work as a normal zip file.
Step 2: Assemble LH and RH Bases
Here we will assemble the part that latches into the hole of the guitar. Each side is identical, so you'll just do this step twice!
For the last step, place the slide into the base, and pop the screw into position so that it sits in the circular grooves on each part. The spring I used (see photo) was a bit too strong, which made it hard to install on the guitar. Try to use a decently strong spring, but weak enough where it can still slide under reasonable force.
Here we will simply screw the bases onto the mid-sections with 1/4" screws. Easy and quick! Each side should still be separate.
这张照片从后来的我的建造 - 所以不要担心泡沫，我们稍后会加。
Step 4: Assemble the Pick Box
Cut small squares of foam and put inside the pick box to keep the pick in the vertical position (each foam piece should be identical so forces are equal). If you don't have foam, I'm guessing cotton balls might work as well.
Screw the pick box to the pick slide and make sure to include the shim between the two. This ensures the pick is the appropriate height above the strings. You can always add more/less shims as necessary if your guitar strings are different. The shims I printed were too long and hit the pick, so I used metal cutters to trim them shorter.
Step 5: Stepper Motor Modification
在28By-48的情况下，红线为中心提供电源bothcoils. So we need to not only cut this wire completely, but also cut the trace on the motor's circuit board so the coils aren't shorted together at their middles.
Step 6: Attach Motor and Pick Slide
Lastly, screw the stepper motor onto the support post of the LH mid-section. Make sure to set the pin into the slot of the pick box so that when the motor moves it pushes the pick box side to side.
Step 7: Attach the Feet and RH Side
Step 8: Attach RH Side
Connect the RH side to the LH side with 1/2" screws through the stepper motor's mounting flange, the center post, and the back foot.
Take the LH and RH cover pieces, and connect together with the half-circular slide cover using 1/4" screws. We won't actually attach this cover to the rest of the strummer until the very end, but you will want to push everything together and in place as you assemble the circuit to make sure things fit.
Step 10: Add Foam
At this point, we can add some foam strips to the bottom of the strummer body where it would contact the guitar, and to the hole feet.
Cut squares just big enough for the clamping surface that would rub against the inner rim of the guitar hole. Use a glue stick to coat the foam, and then stick them to the plastic. Take two or three rubber bands and stretch them around all 4 feet, to make sure the foam sticks to the plastic as the glue dries.
For my guitar, I ended up using two layers of foam on one side, and one on the other. So do what works.
The guitar strings probably won't really be flat, which will make the pick box miss or get stuck on some of the strings. Look across the strings horizontally, and try to see which ones stick up too high, or not enough. Take the string shims and try to level the strings as best as possible by placing them between the strings and the bridge, so that the pick hits each string evenly. Use extra foam to raise the whole thing up if some strings are too high, or increase/reduce the pick box's shim (installed earlier). Just be careful to consider how everything will fit together in the end when changing shims!
Step 12: Arduino Sketch
The remaining program files were written by myself, partly as a learning experience and partly because the stepper libraries I tried to use weren't running my motor as expected for whatever reason (probably user error). You will want to modify the code so that the pins you use for each component are accurately programmed by changing the number next to the #define lines withinStrummerMain.cpp。
If you find that you want to use a higher voltage and think it will let you play faster, you can change the maximum tempo by changing the value in thepot.max_tempo（）function underSetup()inStrummerMain.cpp。This number is in Beats Per Minute.
Lastly, you can change the step positions that the stepper motor will use as points between strings by changing the values understruct stringpositions.inGlobalVars.h。在修改这些时，应注意，如将它们设置得太高会导致电机在外壳上停止并失去步骤。此外，在改变它们之前，它可能是一个好主意，因为它们最初通过测量CAD绘图中的角度而发现，并且可能难以通过试验和错误找到。
With the sketch ready to go, the last part is just uploading it into the chip. I used an FDTI shield board bySparkfun。这确实要求将针头标头焊接到板上，但是更容易上传草图更容易。
注意:我的3 d打印ULN200最初是由3.AN transistor driver board, but I later changed to a bipolar chip driver. Thus, I made a custom bracket to hold a small PCB prototype board for the additional circuitry. Depending on how you integrate your parts, you might need to make a slightly different bracket.
There are a few main components of the circuit, detailed below:
- Motor Driver Chip: This requiresstep那direction,5V供应pins, 4 motor pins, and separate power and ground. The program will pulse the step and direction pins as appropriate, and hold 5V high during motor operation to the reset and sleep pins of the stepper driver. When the motor isn't running, the 5V pin will drop low to keep the stepper from getting hot as it otherwise tries to provide 'holding torque' to the motor.
- Potentiometer: Supplied with 5V, and connected to ground on the other. We read the potentiometer setting with an analog input pin to see what tempo to play the strummer at.
- Voltage Regulator: The 5V stepper motor runs best when higher voltage runs through a current limiting chip driver. In my project, I supplied 22V to the DRV8825 (which can handle up to 48V), but limited the current to about 160mA. The Arduino, however, needs 12V or less. The voltage regulator thus reduces the 22V (this regulator can only handle 26V max) down to 9V, which the Arduino can easily convert to 5V. Two capacitors, as marked on the schematic, help filter any surges before and after the regulator. The 22 µF is required, but the 0.47 µF is optional if you have a good power supply and the distance between the supply and the strummer isn't too great.
- Microswitch: The microswitch helps zero the stepper motor during operation, which can easily miss a step or two due to the changing forces as it crosses strings. This needs an INPUT_PULLUP pin to read when the switch closes the connection to ground.
The actual circuit construction will be left somewhat up to you. Because PCB prototype boards are a pain to wire (and this one has a lot going on for the small space), you will have to get creative in how to fit it all together. The main things to consider are space considerations to make sure everything fits together still in the end, and efficiency. By efficiency, I mean that many things like the grounds can be bussed together into single wires.
However, you can see in the images above and following steps how I ended up wiring mine, for better or for worse. I would actually highly recommend creating an actual PCB in KiCad or another program, to save space and headache. If I were to do this project again, this is what I would do.
Step 14: Circuit Assembly: Voltage Regulator
Step 15: Circuit Assembly: Chip Driver
You will need to connect:
- 4 motor wires to A1, A2, B1, B2
- Dir pins
- VMOT to the high input voltage (pre-regulator)
- 2 GND pins to ground
- Reset and Sleep pins to 5V pin (needs to be a digital pin as program will turn this off/on)
在实际连接电机之前，您需要使用芯片上的电位器设置电流限制。因为160 mA是如此小（步进电机很便宜），锅需要几乎处于完整的0位置。你必须测试这是什么，但我很确定0 =完全cw。
To test, plug the motor into the power source with the motor DISCONNECTED, touch a multimeter probe to the pot screwhead, and then touch the other to ground. Keep turning the pot until the appropriate reference voltage is read (you'll have to read the chip's datasheet for the specific voltage-to-current formula).
Step 16: Circuit Assembly: Buttons and Arduino Board
Place each button on the prototype board so that they will fit between the squares of the strummer case as shown. Place a 470 Ohm resistor in each button's center for the internal LED. Solder the buttons and LED lines to pins, and then create a single ground bus wire for all the buttons and LEDs. Connect this ground bus to the board's ground pin.
The Arduino board can be soldered onto the PCB, offset to the side对面的of where the chip driver will sit. Take a lot of time to make sure there will be room, and really think out how you plan to lay out all the required connections. Refer to the schematic, andplan。这是很多放到一个小空间,所以即使是few mistakes will mean it won't end up fitting.
Step 17: Circuit Assembly: Potentiometer
The potentiometer needs to be connected to 5V power from the board's 5V output pin (not a digital pin), and the other side to ground. The center is then connected to an analog pin. Direction doesn't matter, unless you want to control the actual direction of rotation for increasing/decreasing tempo. The potentiometer just sits on the post in my design (feel free to glue it). So whenever you're ready to assemble it, just plop it on and it's ready to go!
Next, attach the microswitch to the mounting block using two 1/2" screws. Because the screws were too long, I added nuts as thick washers to reduce their length.
Next, take the microswitch mounting block, and attach it to the RH side loosely. You'll notice that the slots are oblong to allow for slight position adjustments. Screw in the microswitch, and adjust as appropriate so that the pick box just barely closes the switch when it is far right (but before it makes contact with the housing). Tighten the mounting block screws, so that the switch is secured at this position.
Route wires as appropriate. The housing has some slots for the stepper motor wires, and the photo above shows how I routed all the others. It took a bit of shoving together and bending (and a little bit of cutting of some of the plastic connectors), but I fit it all in there. Depending on how you do it, you could probably save a lot of space by smartly routing the prototype board.
You can see how nuts the wiring ended up being for my prototype board, as I severely underestimated the number of connections needed. If it looks messy, just do your best to fit it all in as smartly and neatly as possible.
Note: There is a central post to support the prototype board when the buttons are pushed. You will want to make sure no wires or soldered connections are in this central location on the board (it is offset slightly to the right though). Checking fit periodically as you put the circuit together is a must!
Once the circuit is assembled, we can now upload our final sketch into the Arduino chip using the FDPD pins of the chip. You can theoretically do this much earlier, but you may find that your pin layout has changed during the assembly due to space limitations, or you may even cause corruption of the program after handling the chip during assembly. (This happened to me during some troubleshooting, and it took me a bit to figure out what was wrong. After re-uploading the sketch into the chip, the strummer suddneely worked again).
Once the sketch is uploaded, you can put everything together with the screws. Except for the stepper motor and the circuit board, the screws should all be 1/4" 4-40's. The circuit board needed really small screws, which I pulled off some scrap hardware (but you could easily buy smaller screws for this).
Step 22: Play
You can now attach the strummer to your guitar. Compress the feet inwards, and drop them into the hole of the guitar so they clip in, making sure the back feet don't catch on the strings. Use foam to help level the strummer over the strings, and to also keep it from accidentally scratching the surface.
Plug your 22V power source (or other appropriately regulated voltage) into the jack, and the motor will zero. When it finishes zeroing, the LEDs will flash 3 times, and then it is ready to play!
Use the potentiometer to control how fast the stepper motor strums the next beat. The fastest speed is still relatively slow due to using such a cheap stepper motor, but higher voltages could theoretically allow faster speeds.
Enter 'Rhythm Menu Selection Mode' by holding the outermost strings, and both innermost strings (1,3,4,6) simultaneously for 3 seconds. Once in menu mode, you can select different rhythms by pressing the two center flashing buttons (for up and down). The LED on the high E string flashes on the downbeat of the rhythm to help identify what beat it's on. And the low E button can be held for another 3 seconds to exit the menu mode.
Step 23: Known Issues and Final Thoughts
第二,程序有漏洞,我没有able to identify yet, which basically causes the program to freeze up and stop playing occasionally. Simply unplugging the power and restarting solves the problem, but is rather annoying. Feel free to debug the program if you wish!
Lastly, the strings of a guitar are not as flat as one might initially think. The bridge of the guitar is actually curved, meaning that as the pick goes across the strings some are higher than others relative to the pick, causing the loudness of each pluck to change. And when the player presses a string, it changes this height enough to actually cause strings to not play at higher frets.
But enough of the pessimism! The guitar still plays, it was still a great learning experience, and it looks cool! I'm definitely interested in trying a second version at some point, and hope to improve upon the initial design. Maybe individual picks for each string to really get some riffs goin'?!