Running Mouse
![signal-2023-05-21-131013.jpeg](/proxy/?url=https://content.instructables.com/FT5/J71F/LHW03VJ9/FT5J71FLHW03VJ9.jpg&filename=signal-2023-05-21-131013.jpeg)
![kut instructables.gif](/proxy/?url=https://content.instructables.com/FOV/ZSL7/LHW0494H/FOVZSL7LHW0494H.gif&filename=kut instructables.gif)
![schets 2.png](/proxy/?url=https://content.instructables.com/F0P/TZMF/LHNFFF9S/F0PTZMFLHNFFF9S.png&filename=schets 2.png)
![schets 1.png](/proxy/?url=https://content.instructables.com/F3Q/4M9J/LHNFFF9R/F3Q4M9JLHNFFF9R.png&filename=schets 1.png)
![signal-2023-05-18-150649_002.jpg](/proxy/?url=https://content.instructables.com/FZ5/YS1Z/LHT56GXT/FZ5YS1ZLHT56GXT.jpg&filename=signal-2023-05-18-150649_002.jpg)
This project was undertaken as part of a school assignment where I had to design an Arduino project within a 10-week timeframe, with the objective of creating a device that encompassed both input and output functionality. The result was the "Running Mouse," an innovative concept that powers its wheels and scurries away whenever you click the mouse all powered by two 9 volt battery's. Originally, I envisioned a teacup holder that would drive away when the cup got too cold, but due to the impracticality of constantly waiting for the cup to cool down for testing, I transformed the idea into a running computer mouse. Through this project, I gained valuable insights into power management, soldering techniques, and how to 3D print.
Downloads
Supplies
![needs.png](/proxy/?url=https://content.instructables.com/F2Z/VJ3B/LHNFFGNH/F2ZVJ3BLHNFFGNH.png&filename=needs.png)
Components:
- 1x Arduino Uno
- 1x L293D DC Motor Driver Shield (Make sure your shield is compatible with Arduino Uno and designed for motor control)
- 1x Mini Soldering Board
- 3x Non-hardcore Wires (1x Green wire, 1x Red wire, 1x Black wire)
- (Alternatively, you can use male-to-male wires and strip off the tips)
- 1x 10kΩ Resistor (Useful resource: https://resistorcolorcodecalc.com/)
- 1x Push Button
- 2x 9V battery connectors
- 2x 9V batteries
- 2x DAGU Robot DG02S MINI DC GearBox
- 2x Car Wheels
- 1x Swivel castor PUR 35mm (Can be almost any swivel castor)
- A computer mouse (to be used as the housing)
- Standard PLA plastic for 3D printing
Tools:
- 3D Printer
- Glue Gun
- Soldering Kit (including soldering iron, soldering acid, soldering wire)
- Mini Drill (or alternative tool for creating holes, can also use soldering iron)
- Screwdriver
- Wire Cutters
- File
- Portable USB adapter for a micro SD card (or a computer with a built-in micro SD card slot)
The Circuit
![running mouse_bb.png](/proxy/?url=https://content.instructables.com/F77/IVNR/LHUKNGY9/F77IVNRLHUKNGY9.png&filename=running mouse_bb.png)
![running mouse_schem.png](/proxy/?url=https://content.instructables.com/F7U/5LCQ/LHUKN7Q6/F7U5LCQLHUKN7Q6.png&filename=running mouse_schem.png)
![signal-2023-05-18-154819_002.jpg](/proxy/?url=https://content.instructables.com/FTS/5ZDQ/LHT56KFB/FTS5ZDQLHT56KFB.jpg&filename=signal-2023-05-18-154819_002.jpg)
![signal-2023-05-18-150649_029.jpg](/proxy/?url=https://content.instructables.com/FSZ/4K1E/LHT56GZQ/FSZ4K1ELHT56GZQ.jpg&filename=signal-2023-05-18-150649_029.jpg)
![signal-2023-05-18-150649_028.jpg](/proxy/?url=https://content.instructables.com/FX6/G4R5/LHT56GZR/FX6G4R5LHT56GZR.jpg&filename=signal-2023-05-18-150649_028.jpg)
![signal-2023-05-18-151604_003.jpg](/proxy/?url=https://content.instructables.com/F9C/I81Z/LHT56H5R/F9CI81ZLHT56H5R.jpg&filename=signal-2023-05-18-151604_003.jpg)
![signal-2023-05-18-152914_002.jpg](/proxy/?url=https://content.instructables.com/FP1/WMZD/LHT56IHB/FP1WMZDLHT56IHB.jpg&filename=signal-2023-05-18-152914_002.jpg)
![signal-2023-05-18-154819_004.jpg](/proxy/?url=https://content.instructables.com/FVC/E0O5/LHT56KED/FVCE0O5LHT56KED.jpg&filename=signal-2023-05-18-154819_004.jpg)
![signal-2023-05-18-154819_003.jpg](/proxy/?url=https://content.instructables.com/FLD/X5DZ/LHT56KEQ/FLDX5DZLHT56KEQ.jpg&filename=signal-2023-05-18-154819_003.jpg)
Wiring all the wires to the shield:
- Place the Arduino Uno on a flat surface.
- Carefully align the shield on top of the Arduino Uno, ensuring that the pins on the shield align with the corresponding holes on the Arduino. Gently press the shield into place.
- Take one of the 9V adapters and insert the red wire into the +M slot of the shield. Insert the black wire into the GND slot of the shield.
- Insert the green wire into the 2-pin slot on the shield. Strip the end of the green wire and insert it into the slot on the underside of the shield.
- Apply a small amount of soldering acid to the connection point and use soldering wire to secure the wire in place.
- Solder a red wire to the 5V slot and a black wire to the ground slot next to the 5V slot.
- Take the second 9V adapter. Solder the black wire of the adapter to the right ground slot on the shield. Solder the red wire of the adapter to the 9V slot next to the right ground slot.
- The wiring order is as follows:
- 5V slot: Red Wire
- Ground Left slot: Black Wire
- Ground Right slot: Black wire of the 9V adapter
- 9V slot: Red wire of the 9V adapter
Wiring the Button Board:
- Cut the soldering board to a size of 5 holes in width and 9 holes in length. (The smaller the better).
- Place the button on the soldering board, positioning it on the 3rd hole from the first hole in length and the 3rd hole from the first hole in width. Refer to the pictures for better understanding.
- Take the red wire from the 5V slot and solder it to the right underpin of the button.
- Take the black wire from the left slot and solder it to the board, just below the left side of the button. Do not solder it to the button itself.
- Take the 10k ohm resistor and solder it from the black wire to the button. You can solder the resistor in the width to save space, but if you prefer, soldering it in the length is also acceptable.
- Lastly, take the green wire connected to pin 2 and solder it to the back side of where the black pin is connected to the button. It should resemble the connection shown in this diagram: https://docs.arduino.cc/built-in-examples/digital/Button.
- Refer to the pictures for further clarification
That's it! You have successfully wired the Arduino Shield and Button Board. You can now proceed with the next steps of this project.
3D Printing Your Parts
![Model in 3d.PNG](/proxy/?url=https://content.instructables.com/FD0/CB2W/LHUKMVL4/FD0CB2WLHUKMVL4.png&filename=Model in 3d.PNG)
![Prepare slice.PNG](/proxy/?url=https://content.instructables.com/FTM/X1E3/LHUKMVPP/FTMX1E3LHUKMVPP.png&filename=Prepare slice.PNG)
![Prepare slice2.PNG](/proxy/?url=https://content.instructables.com/FBF/M4OV/LHUKMWR7/FBFM4OVLHUKMWR7.png&filename=Prepare slice2.PNG)
![Prepare slice3.PNG](/proxy/?url=https://content.instructables.com/FW0/H6CH/LHUKMWUA/FW0H6CHLHUKMWUA.png&filename=Prepare slice3.PNG)
![signal-2023-05-19-151830_002.jpg](/proxy/?url=https://content.instructables.com/FZ4/ZCD8/LHUKMWVF/FZ4ZCD8LHUKMWVF.jpg&filename=signal-2023-05-19-151830_002.jpg)
![signal-2023-05-19-152411_004.jpg](/proxy/?url=https://content.instructables.com/FRB/J51W/LHUKMX9R/FRBJ51WLHUKMX9R.jpg&filename=signal-2023-05-19-152411_004.jpg)
![signal-2023-05-19-152411_003.jpg](/proxy/?url=https://content.instructables.com/FFM/ZZYO/LHUKMXAI/FFMZZYOLHUKMXAI.jpg&filename=signal-2023-05-19-152411_003.jpg)
![signal-2023-05-19-152411_002.jpg](/proxy/?url=https://content.instructables.com/F9M/AN9I/LHUKMXAK/F9MAN9ILHUKMXAK.jpg&filename=signal-2023-05-19-152411_002.jpg)
![signal-2023-05-19-153129_002.jpeg](/proxy/?url=https://content.instructables.com/F7S/9UME/LHUKMYDH/F7S9UMELHUKMYDH.jpg&filename=signal-2023-05-19-153129_002.jpeg)
3D Printing the bottom part:
- Download the .stl file provided in this thread. I modeled the part myself using Blender and the MeasureIt add-on.
- Open the .stl file in a slicer program. I recommend using Cura, which you can download from this link: [Cura Download Link: Download Link Cura. Make sure you have the latest version of Cura installed if you choose to use it.
- In the slicer program, go to the "Prepare" tab and select your specific 3D printer model in the left corner. Also, choose the appropriate nozzle size and material type. For example, my printer is the Creality Ender 3 with a 0.4mm nozzle, and I used standard PLA material. It's essential to check and set these parameters because different materials have different heating/melting points, and the printer needs to be properly configured.
- Still in the "Prepare" tab on the right side, click on the settings to adjust support strength and other 3D printing parameters according to your preferences.
- Click the "Slice" button to start the slicing process. Allow the program to run and slice the model. You will be able to see the estimated print time and the amount of printing material required. In the "Preview" tab, you can visualize how the print will look. If necessary, you can go back to the previous step and adjust the print settings to reduce the printing time. Remember to slice again after making changes.
- After slicing, prepare a portable USB adapter for a micro SD card. If your computer has a built-in micro SD card slot, you can use that instead. Connect the adapter or insert the micro SD card into your computer.
- Save the sliced model as a .gcode file on the micro SD card by clicking "Save to Removable Drive" or a similar option in your slicer program.
- Safely eject the USB adapter or micro SD card from your computer and take it to your 3D printer.
- Turn on your 3D printer and select the option to print from the micro SD card.
- Locate and select the specific .gcode file you saved earlier, such as "CERERV2_RunningMouse.gcode."
- Begin the printing process and let it run for approximately 10 hours.
- Once the printing is complete, carefully remove any support structures that were printed along with the part.
- Make shure you download: "RunningMouse.stl", "RunningMouseCover.stl" and "RunningMouseBand.stl" and print these 3.
That's it! You've successfully printed the bottom part using your 3D printer and assembled the necessary components.
Glueing and Skrewing Bottom Part
![signal-2023-05-19-161114_002.jpeg](/proxy/?url=https://content.instructables.com/FGD/NTD8/LHUKMZDQ/FGDNTD8LHUKMZDQ.jpg&filename=signal-2023-05-19-161114_002.jpeg)
![signal-2023-05-18-150649_005.jpeg](/proxy/?url=https://content.instructables.com/FCI/PE8U/LHUKMZFA/FCIPE8ULHUKMZFA.jpg&filename=signal-2023-05-18-150649_005.jpeg)
![signal-2023-05-18-150649_006.jpeg](/proxy/?url=https://content.instructables.com/FX5/EDOF/LHUKMZPJ/FX5EDOFLHUKMZPJ.jpg&filename=signal-2023-05-18-150649_006.jpeg)
![signal-2023-05-18-150649_003.jpeg](/proxy/?url=https://content.instructables.com/FOK/4NOY/LHUKMZQG/FOK4NOYLHUKMZQG.jpg&filename=signal-2023-05-18-150649_003.jpeg)
![signal-2023-05-18-150649_004.jpeg](/proxy/?url=https://content.instructables.com/FA6/1O43/LHUKMZQH/FA61O43LHUKMZQH.jpg&filename=signal-2023-05-18-150649_004.jpeg)
![signal-2023-05-19-163829_006.jpeg](/proxy/?url=https://content.instructables.com/F2N/KEOW/LHUKN2DV/F2NKEOWLHUKN2DV.jpg&filename=signal-2023-05-19-163829_006.jpeg)
![signal-2023-05-19-163829_004.jpeg](/proxy/?url=https://content.instructables.com/FH1/4AFB/LHUKN2DW/FH14AFBLHUKN2DW.jpg&filename=signal-2023-05-19-163829_004.jpeg)
![signal-2023-05-19-163829_003.jpeg](/proxy/?url=https://content.instructables.com/FHQ/AON3/LHUKN2DX/FHQAON3LHUKN2DX.jpg&filename=signal-2023-05-19-163829_003.jpeg)
Glueing parts and skrewing it togheter:
- Grab your 3D print and the glue gun. Apply glue to the underside of the swivel castor and press it firmly against the block-shaped underside of the 3D print.
- Glue the two car motors onto the higher part of the underside of the 3D print. Make sure they are positioned in the tiny blocks provided. Attach the wheels to the car motors.
- Using a soldering iron or a tiny drill, create two small holes on the underside of your 3D print. These holes will allow the wires from the two motors to pass through. Note: It is not recommended to use a soldering iron for this step, as it may melt the plastic. Alternatively, use a tiny drill for creating the holes.
- Take the wires from the motors and pass them through the holes created in the previous step.
- Get the Arduino and shield that you prepared in Step 1. Unscrew the holes labeled M1 and M3 on the shield. These correspond to motor 3 and motor 1. There are four motor slots in total, but these slots are the most suitable for this configuration.
- Connect the wires from the motors to the respective holes on the Arduino shield. Ensure that the screws are tightened securely to avoid any loose connections while driving the Running Mouse.
- Check if the Arduino fits properly into place, ensuring all the connections are intact.
- The large hole on the side is used to insert the two 9V batteries.
- Note: Refer to Step 1 for the full schematic of this circuit.
Code
![code.PNG](/proxy/?url=https://content.instructables.com/FLZ/HL08/LHUKNDOK/FLZHL08LHUKNDOK.png&filename=code.PNG)
![signal-2023-05-19-180158_003.jpg](/proxy/?url=https://content.instructables.com/FRH/4XGX/LHUKNDK2/FRH4XGXLHUKNDK2.jpg&filename=signal-2023-05-19-180158_003.jpg)
![signal-2023-05-19-180158_002.jpeg](/proxy/?url=https://content.instructables.com/FS7/YC1D/LHUKNDK3/FS7YC1DLHUKNDK3.jpg&filename=signal-2023-05-19-180158_002.jpeg)
Getting the code on the arduino Uno:
- Begin by downloading the Arduino IDE from the official Arduino website. Visit their website at https://www.arduino.cc/en/software and follow the instructions to download the Arduino IDE for your operating system.
- Connect your Arduino Uno board to your computer using a USB cable. Ensure that the board is properly connected and powered.
- Launch the Arduino IDE on your computer once the installation is complete. The IDE provides an integrated development environment for programming and uploading code to your Arduino board.
- In the Arduino IDE, click on "File" and then select "Open". Search for the downloaded "RunningMouse.ino" file, which is downloadable in this thread. Open the file in the Arduino IDE.
- To enable the required functionality, you'll need to install the "Adafruit Motor Shield Library v1" from the library manager. Locate the library icon in the left sidebar of the Arduino IDE and click on it. In the library manager, search for "Adafruit Motor Shield Library v1" (not v2). Once found, click on the library and select the "Install" button. Wait for the library to finish installing.
- Now it's time to upload the code to your Arduino Uno board. Click on the blue arrow icon in the top-left corner of the Arduino IDE to compile and upload the code. The Arduino IDE will initiate the upload process and transfer the code to your board. Allow some time for the upload to complete.
- If you wish to customize the code, you have a couple of options. You can adjust the motor speed by locating the lines of code that define the speed, such as "M1.setSpeed(200);" and "M3.setSpeed(200);". Modify the numeric value to increase or decrease the speed as desired. Additionally, you can change the motor slot assignments by modifying lines like "AF_DCMotor M1(1);" and "AF_DCMotor M3(3);". Update the slot numbers based on your specific setup.
- Finally, it's important to understand how the code functions. The provided code reads input from a button and determines whether it was previously pressed. It then sets a corresponding value to indicate its state (on/off). This creates a switch-like behavior that allows you to turn the wheels on or off.
Congratulations! You have successfully completed the steps to download the Arduino IDE, connect your Arduino Uno board, and upload the provided code. You can now control motors using the Adafruit Motor Shield Library, and if desired, make customizations to suit your needs.
Downloads
Top and Finish
![FIDX11RLHW03CZF.jpg](/proxy/?url=https://content.instructables.com/FE7/7C18/LHW03W1X/FE77C18LHW03W1X.jpg&filename=FIDX11RLHW03CZF.jpg)
![FSDNUUJLHW03DE6.jpg](/proxy/?url=https://content.instructables.com/FJE/ETAT/LHW03W1S/FJEETATLHW03W1S.jpg&filename=FSDNUUJLHW03DE6.jpg)
![FRYTEDFLHW03FNI.jpg](/proxy/?url=https://content.instructables.com/FLB/3K6S/LHW03W1T/FLB3K6SLHW03W1T.jpg&filename=FRYTEDFLHW03FNI.jpg)
![F22GY6QLHW03DSB.jpg](/proxy/?url=https://content.instructables.com/FW0/4NXW/LHW03W21/FW04NXWLHW03W21.jpg&filename=F22GY6QLHW03DSB.jpg)
![FXG8MCRLHW03FBC.jpg](/proxy/?url=https://content.instructables.com/FB9/6NRE/LHW03W1Z/FB96NRELHW03W1Z.jpg&filename=FXG8MCRLHW03FBC.jpg)
![FH4IVN1LHW03FKR.jpg](/proxy/?url=https://content.instructables.com/FV6/VAML/LHW03W1Y/FV6VAMLLHW03W1Y.jpg&filename=FH4IVN1LHW03FKR.jpg)
![FNNGP9PLHW03FCO.jpg](/proxy/?url=https://content.instructables.com/FHE/AUT9/LHW03W1W/FHEAUT9LHW03W1W.jpg&filename=FNNGP9PLHW03FCO.jpg)
![FB76YMSLHW03G8Y.jpg](/proxy/?url=https://content.instructables.com/F14/22Y5/LHW03W1V/F1422Y5LHW03W1V.jpg&filename=FB76YMSLHW03G8Y.jpg)
![F1YU42MLHW03GAE.jpg](/proxy/?url=https://content.instructables.com/FUJ/23YT/LHW03W1U/FUJ23YTLHW03W1U.jpg&filename=F1YU42MLHW03GAE.jpg)
![F17TB0LLHW03HWJ.jpg](/proxy/?url=https://content.instructables.com/FF6/LMFJ/LHW03W20/FF6LMFJLHW03W20.jpg&filename=F17TB0LLHW03HWJ.jpg)
Glueing Top Part
- Begin by unscrewing your computer mouse and removing all the electronics. Cut off any loose wires. Take note of the original position of the mouse button as you will need it later.
- Use your 3D printer to print the top part of the RunningMouse.
- Apply glue to the bottom part of the mouse and attach the 3D-printed top part to it.
- Take the electronic button part that you soldered earlier and insert it through the corresponding hole in the bottom part of the RunningMouse. Adjust its position to match where the button originally was. You can use double-sided tape if necessary but I would recommend glue to keep it in place.
- If needed, trim any excess material or file down rough edges to make the button fit properly. Once you are satisfied with the alignment of the top part, glue the button part onto the bottom part of the mouse.
- Now, print the final part, which is a small bar.
- Apply glue to the holes on the small bar and attach it to the clicking mechanism of your mouse.
- Carefully put the mouse cover back on, ensuring that all the components are aligned correctly.
- Look at the pictures for a better explanation.
- Congratulations! You have successfully glued the top part of your mouse. Your "RunningMouse" is now ready for use!
- Open the top part hook up the 9v battery's and try holding the mouse button down to activate. Have fun!