Pedal Controller

by prampec in Circuits > USB

2389 Views, 3 Favorites, 0 Comments

Pedal Controller

cover.JPG

We are about to create a custom USB HID device with a Digispark board.

An USB device can act as a keyboard to send key strokes, or act as a mouse, depending on your needs.

The Digispark is like a small brother of the Arduino, but it is especially useful to build cheep USB devices.

In this tutorial we are going to build a pedal device, that acts as a mouse, to send mouse clicks with your foot.

Required Parts

vlcsnap-2018-01-19-23h52m44s453.jpg
vlcsnap-2018-01-20-00h01m40s671.jpg
  • Digispark board $1.25
  • Pedal $2.30 (Search for: AC 250V 10A SPDT NO NC Antislip Power Foot Pedal Switch Black JL)
  • Potentiometer: $0.30 (can be any kind with 3 legs between 100Ω to 100KΩ)
  • Cable laying around
  • A small box laying around *

Total costs is: $4

* - I have printed my own case for this project.

Printing the Case [optional]

Screen Shot 2018-02-05 at 09.13.55.jpg

You can print out the top cover according to my design.

https://www.thingiverse.com/thing:2760718

You will need to mount the Digispark board on a piece of hard wood (dimensions 27x28x12mm). This will add some weight for the box, so it is less likely to tip.

Connecting the Pedal

vlcsnap-2018-01-25-23h11m41s392.png

To disassemble the pedal, we need to loosen the screw and push out the shaft.

It comes with a useless piece of wire, that can be easily replaced with our cable with the appropriate length.

Basically any kid of wire can be used as it is a low voltage device.

Soldering the Circuit

Screen Shot 2018-01-17 at 23.51.41.png

We can now solder the circuit according to the schematic provided here.

Now the case can be closed.

Upload the Code

vlcsnap-2018-01-26-08h11m47s262.png
DIY USB Pedal Device

Before uploading the code we need to follow the steps provided by Digistump:

http://digistump.com/wiki/digispark/tutorials/conn...

After this done, the code can be uploaded to the device. (Code attached here!)

Of course you can modify the code to your needs, as mentioned before, even keyboard events can be performed.

For further details please visit the video linked!

(Also, please SUBSCIBE to my YouTube channel, as because of new requirements my channel will be likely to be demonetized without your help. Thanks!)