Author Topic: Dwergmuis: DIY mouse  (Read 14050 times)

0 Members and 1 Guest are viewing this topic.

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Dwergmuis: DIY mouse
« on: Thu, 13 March 2014, 04:08:35 »
I’m currently using a sweet mech keyboard with a small 2-button logitech pebble. This needs to change.
I have not quite found the mouse I’m looking for, so I’m building it.

I’m a developer with a small bit of Arduino experience. I never did 3D printing, but I can work with wood and clay, so maybe I’ll make a wooden mouse.
I think I would make a model with clay, build the structural parts with triplex and the exterior with basla.

I read damorgue and The_Ed are up to something, but I have probably only found and read half of their story.

After some searching, I found two no-brainer choices for the USB interface and the optical sensor.
The Teensy USB 3.1 https://www.pjrc.com/teensy/ and the ADNS-9800 Optical Laser Sensor https://www.tindie.com/products/jkicklighter/adns-9800-optical-laser-sensor/

For the other parts I’m less sure what to get.

I need a couple of  buttons. There was some argument about which ones to get, but I want to make it work first. Nitpicking is for later. So these will do for now http://nl.rs-online.com/web/p/microswitches/0150798/

I don’t need the scroll wheel to click and tilt. Let’s keep it simple. So that means I can just stick a piece of triplex on a rotary encoder, right?

I remember that when I tore down machines as a kid, I would often find these black disks with holes and an a lens with wires. But looking on RS, I come up with stuff like this. http://nl.rs-online.com/web/p/optical-rotary-encoders/7816809/ Is 24 steps enough? The ones with 100+ steps are bigger and a lot more expensive.

Pictures: http://www.flickr.com/photos/pepijndevos/sets/72157642384113763/
Code: https://github.com/pepijndevos/dwergmuis
« Last Edit: Fri, 21 March 2014, 09:40:56 by pepijndevos »

Offline plainbriny

  • Posts: 192
  • Location: Taiwan
Re: Dwergmuis: DIY mouse
« Reply #1 on: Thu, 13 March 2014, 08:33:03 »
After some searching, I found two no-brainer choices for the USB interface and the optical sensor.
The Teensy USB 3.1 https://www.pjrc.com/teensy/ and the ADNS-9800 Optical Laser Sensor https://www.tindie.com/products/jkicklighter/adns-9800-optical-laser-sensor/

IMHO teensy is overkill for mouse, how about attiny 85? much cheaper, simpler, and smaller.
I am thinking about getting a couple for testing myself

Offline FoxWolf1

  • Posts: 850
  • 154
Re: Dwergmuis: DIY mouse
« Reply #2 on: Thu, 13 March 2014, 11:43:10 »
ADNS-9800 seems like a poor choice of sensor. Most modern laser-based optical sensors are fairly widely acknowledged to sacrifice actual tracking quality for higher specification numbers. ADNS-3310 or ADNS-3090 will give you a more consistent relationship between sensor motion and cursor motion, with a much lower degree of speed-influenced variation (a.k.a. unpredictable acceleration) than ADNS-9800.
Oberhofer Model 1101 | PadTech Hall Effect (Prototype) | RK RC930-104 v2 | IBM Model M | Noppoo TANK | Keycool Hero 104

Offline vun

  • Posts: 1499
  • Location: Norway
  • Just one more thing
Re: Dwergmuis: DIY mouse
« Reply #3 on: Thu, 13 March 2014, 12:09:30 »
ADNS-9800 seems like a poor choice of sensor. Most modern laser-based optical sensors are fairly widely acknowledged to sacrifice actual tracking quality for higher specification numbers. ADNS-3310 or ADNS-3090 will give you a more consistent relationship between sensor motion and cursor motion, with a much lower degree of speed-influenced variation (a.k.a. unpredictable acceleration) than ADNS-9800.

The problem is getting the sensor; afaik the 9800 is much easier to get.

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #4 on: Thu, 13 March 2014, 12:23:36 »
Yes I could probably use an Attiny and a better sensor, but then I have to do a lot more work on the hardware side.

I'd have to find a tiny with USB support, preferably in a DIP.
Get assorted resistors and resonators to get the tiny to run.
Make a breadboard with programmer header and USB port, possibly including a 3.3v regulator.
Arduino makes no sense on a tiny, so pure AVR.

As the author of the ADNS-9800 board noted, these chips are hard to get by, and must be bought in bulk.
Worry about assorted components to get it to run.
Possibly do a real PCB and surface-mount soldering.
Get the optics right.

To be honest that sounds like a big hassle for little gain. As long as the ADNS-9800 isn't terribly bad...

An over-powered ARM chip in a mouse actually sounds like a lot of fun.

Offline jacobolus

  • Posts: 3661
  • Location: San Francisco, CA
Re: Dwergmuis: DIY mouse
« Reply #5 on: Thu, 13 March 2014, 15:50:03 »
I also bought a couple of those sensors and a Teensy 3.1, which I intend to use in a trackball project, but I haven’t started on that yet. If you figure out how to get it working for a mouse project, I’d definitely be interested to hear how it goes, see what kind of code you use, etc.

IMHO teensy is overkill for mouse, how about attiny 85? much cheaper, simpler, and smaller.
I am thinking about getting a couple for testing myself

Anyone making a hobby project from scratch, and willing to put many hours of work in, should pick whatever microcontroller is easiest to work with, since the price of the microcontroller is basically insignificant in comparison to the time spent.

Offline clickclack123

  • Posts: 357
  • Location: Australia, Mate!
Re: Dwergmuis: DIY mouse
« Reply #6 on: Thu, 13 March 2014, 19:24:45 »
After some searching, I found two no-brainer choices for the USB interface and the optical sensor.
The Teensy USB 3.1 https://www.pjrc.com/teensy/ and the ADNS-9800 Optical Laser Sensor https://www.tindie.com/products/jkicklighter/adns-9800-optical-laser-sensor/

IMHO teensy is overkill for mouse, how about attiny 85? much cheaper, simpler, and smaller.
I am thinking about getting a couple for testing myself

I'd use a cheap Arduino Pro Micro clone... small, built in usb, cheap ($5 on ebay, shipped), lots of libraries avalable, and easily enough power for a mouse.

57373-0


Offline plainbriny

  • Posts: 192
  • Location: Taiwan
Re: Dwergmuis: DIY mouse
« Reply #7 on: Fri, 14 March 2014, 01:16:39 »
Anyone making a hobby project from scratch, and willing to put many hours of work in, should pick whatever microcontroller is easiest to work with, since the price of the microcontroller is basically insignificant in comparison to the time spent.

I agree, teensy or arduino are both easier to use and get than attiny
 

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: Dwergmuis: DIY mouse
« Reply #8 on: Fri, 14 March 2014, 02:42:38 »
A second alternative is what I did in my first mouse, just use the innards from a mouse with a good sensor and controller. Eg, there are mice with "perfect" sensors and neat firmwares but sucky ergonomics and build quality where you can just take the PCB and wire new switches to it. If you want to make a mouse larger than the original it is easy, and even if you want to make a smaller one the PCB is often not very large and might fit into a smaller casing.

Edit: I know this solution feels boring and you don't get the same satisfaction. I thought I should mention it as it is often overlooked and far simpler.
« Last Edit: Fri, 14 March 2014, 02:44:43 by damorgue »

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #9 on: Fri, 14 March 2014, 10:08:00 »
Parts ordered.

Yes, modding a mouse is way easier, but not as fun.
I read the first Rodent was built this way.

I checked the local print shop, which advertises 3D printing.
They even print metal. As long as you produce a STL or OBJ file.

But I had trouble making anything more sophisticated than a ball in 3D.
Even if I got something that looked like a mouse, I'd have no idea how it feels in my hands.
3D scanning seems like an option.

I'm still in favor of making it from wood. It feels nicer than plastic and is easier to work with.
The mouse buttons will need to be a flat piece of 1mm triplex, which is an interesting constraint.
I think I have seen an older Razer which big flat buttons.

I'm choosing from 2 build methods.

A massive piece of balsa. Take away everything that is not mouse-shaped.
Stronger, heavier and less space inside.

Ribs. Either completely covered in basla or with balsa spars and a fabric skin.
This is exactly how plane wings are made. Light and strong with enough space for a fuel tank and landing gear.
Easy to curve along the wood grain, hard in the other direction.

I might end up mixing the two. A curved palm rest from solid balsa with ribs for the less curved front section containing the electronics.
« Last Edit: Fri, 14 March 2014, 10:12:05 by pepijndevos »

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: Dwergmuis: DIY mouse
« Reply #10 on: Fri, 14 March 2014, 11:15:07 »
It is always easier to get a sense of size and ergonomics with a physical object. I made one in clay first and then used that as a base for CAD. I wouldn't want to make one from scratch. It would probably end up feeling really awkward once held IRL.

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #11 on: Sat, 15 March 2014, 09:09:28 »
I bought some clay and wood to make a first prototype.

The clay was easy. I bought half a kilo and just played with it until it felt right.
Then played with my other hand. Finally straightened it out a bit for easier construction.


Clay shape by fliebel, on Flickr

Then I sliced the clay model to pieces and drew them on some paper.
I then put the paper over a plank of balsa and cut them out.
I did change the second rib to have a bit more of a grip.


Outline of the ribs by fliebel, on Flickr

I put the clay model together again and drew the base plate on the wood. I added a margin to create finger rests.
This looks a bit odd because I should have used a ruler and be more precise.

Currently waiting for the glue between the ribs and the base plate to cure.


Ribs on base plate by fliebel, on Flickr

More pictures: http://www.flickr.com/photos/pepijndevos/sets/72157642384113763/


Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: Dwergmuis: DIY mouse
« Reply #12 on: Sat, 15 March 2014, 11:14:32 »
Great progress. Have you decided how to create the shell on top of it?

I believe paper and polyester are great when it comes to creating complex hulls with less demand on toughness.

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #13 on: Sat, 15 March 2014, 12:34:13 »
Paper? Polyester? Please elaborate.
I don't imagine you mean origami paper, which is great for complex shapes, but you know... folds.
I have never worked with polyester. Can you buy it in sheets, or how does that work?

The current plan is just sheets of balsa. If you put them in warm water they bend quite easily. At least in one direction.
Though I already found out I need thinner balsa. The 2.5mm sheet I bought is kind of tough.
1.5mm would be a piece of cake, and strong enough for office use. Maybe 2mm for fanatic gaming  :))

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: Dwergmuis: DIY mouse
« Reply #14 on: Sat, 15 March 2014, 13:11:14 »
I meant polyester resin. It is often used in prop and replica stuff. Often you start out with a polygon model of something, then use a program to flatten the model into stripes of polygons with numbered edges and small extra surfaces which allow you to glue them together.

First google hit shows someone doing this. They then use polyester to make it durable and sand it to a more exact shape. The smaller the initial polygons the less filling and sanding you will have to do but on the other hand you will have far more stripes of polygons to glue together. You could probably ask findecanor more on this particular method.

Edit: PEPAKURA was the word I was looking for. Use it as a keyword and you will find tons of information along with the program.
« Last Edit: Sat, 15 March 2014, 13:13:19 by damorgue »

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #15 on: Sun, 16 March 2014, 13:35:34 »
Done! :cool:

I put all the parts together and did some sanding.

The back is just a stack of wood, sanded into shape. Tedious but easy.

The sides and top where soaked in water, dried and glued together.
I needed a lot of pushpins and tape to keep everything in place.


Palm rest by fliebel, on Flickr

The final result...


Done by fliebel, on Flickr

It's so sloppy, but so nice!

Things I want to do differently in the final version:
  • Use thinner wood for the shell.
  • A triplex base plate.
  • Wider finger rests.
  • More narrow backside.
  • Get rid of the rib under the buttons... so you can press them.
  • Build top-down.
  • Make the base plate detachable.
  • Use a ruler.

Again, more pictures at http://www.flickr.com/photos/pepijndevos/sets/72157642384113763/

Bonus points if you spotted the wooden RasPi
« Last Edit: Sun, 16 March 2014, 14:43:35 by pepijndevos »

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #16 on: Thu, 20 March 2014, 08:48:10 »
All the components except the laser have arrived, so I started playing with the Teensy.

I attached the rotary encoder and tried to make it scroll.

The neat thing is that the Teensy has interrupts on all pins.
What is less cool is bouncing.

I found this bounce-resistant code, but it wasn't enough.
http://hifiduino.wordpress.com/2010/10/20/rotaryencoder-hw-sw-no-debounce/

So in the end I just added hardware debouncing with two 0.1uF caps.


Scroller by fliebel, on Flickr

The code is pretty simple so far.
The only annoying thing is that the mouse jumps to the center of the screen when I do anything at all.

Code: [Select]
volatile int scroll_steps = 0;

void setup() {
  pinMode(0, INPUT_PULLUP);
  pinMode(1, INPUT_PULLUP);
  pinMode(13, OUTPUT);
 
  attachInterrupt(0, read_encoder, CHANGE);
  attachInterrupt(1, read_encoder, CHANGE);
}

void loop() {
  if (scroll_steps) {
    Mouse.scroll(scroll_steps);
    scroll_steps = 0;
  }
}

void read_encoder()
{
  int8_t enc_states[] = {0,-1,1,0,1,0,0,-1,-1,0,0,1,0,1,-1,0};
  static uint8_t old_AB = 0;
  uint8_t dir;

  old_AB <<= 2;                   //remember previous state
  old_AB |= ( PIND & 0x03 );  //add current state
  scroll_steps += ( enc_states[( old_AB & 0x0f )]);
}

That doesn't appear to work...

Offline blackbox

  • Posts: 725
Re: Dwergmuis: DIY mouse
« Reply #17 on: Thu, 20 March 2014, 09:40:45 »
Exiting project! Maybe it will be a kit mouse that can be bought in the future.
Keyboards: Dell AT102W (matias standard clicky), Maltron two-hand 3D fully ergonomic keyboard (Vintage MX Black). CM QF XT (MX Grey) IBM model M

The LAN table!
http://geekhack.org/index.php?topic=62536.0

Offline clickclack123

  • Posts: 357
  • Location: Australia, Mate!
Re: Dwergmuis: DIY mouse
« Reply #18 on: Thu, 20 March 2014, 17:18:29 »
Good stuff!

I love to see people actually work with their hands to create something new and unique.

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #19 on: Thu, 20 March 2014, 19:11:11 »
A kit is definitely possible. I'm very careful to document everything I do.
I'm not yet sure how much work I want to put in helping others to a wooden mouse.
I might just release the drawings and BOM, or prepare kits, or make mice, or all of the above.

I need to think about debouncing more.
For the scroll wheel some lag is acceptable, but the buttons have to be instantaneous.

How can these gaming mice have <1ms response time if your switch spends 5ms bouncing around.
I saw there are dedicated debouncing IC's. Maybe that's how?
I have not actually tested these Cherry things, maybe they barely bounce at all.

Maybe I'll just debounce in software.
It's probably best to register an edge ASAP, but THEN wait for it to settle. So you can click instantly, but not double-click in 5ms.
Sounds acceptable. Now to do it entirely non-blocking and interrupt-based.

Offline damorgue

  • Posts: 1176
  • Location: Sweden
    • Personal portfolio
Re: Dwergmuis: DIY mouse
« Reply #20 on: Fri, 21 March 2014, 04:12:02 »
Did you get your rotary encoder to work? My first one which I took from a mouse behaved weirdly in that its sequence was:


It should be
11
10
00
01
11
...etc
but it skipped 01 so the libraries I found didn't work.

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #21 on: Fri, 21 March 2014, 09:40:16 »
The best way to figure out what’s going on with your encoder is to look at it with an oscilloscope.
I use this one a lot. Money well spent. http://www.pdamusician.com/dpscope/

I hooked up my encoder to the scope, to look at the bouncing.
It turns out that it does a lot of bouncing.

I also found out the debouncing caps I added where much to big.
If I turn it quickly, voltage never reaches 1V.
This is considered a LOW or undefined logic level. I wonder how that even worked.

Now I added smaller 0.01uF caps.
No more bouncing and it reaches 3.3V fast enough.


Debounced! by fliebel, on Flickr

With the encoder working properly, I started with the buttons.


Switch bouncing by fliebel, on Flickr

Again, a lot of bouncing going on here, but I found it doesn’t matter a thing.
I thought the 3 pins on the switch where just convenient, but it turns out to be an essential feature.
This post explains it perfectly: http://www.ganssle.com/debouncing-pt2.htm

So in my code I just have 2 interrupts, one for the rising and one for the falling edge.
They just set a flag, so it doesn't matter if it bounces ten times or more.

Code: [Select]
enum button_state {
   BUTTON_RELEASED     = 0,
   BUTTON_ACK_RELEASED = 1,
   BUTTON_PRESSED      = 2,
   BUTTON_ACK_PRESSED  = 3
};
volatile enum button_state left_state = BUTTON_ACK_RELEASED;

void setup() {
  pinMode(11, INPUT_PULLUP);
  pinMode(12, INPUT_PULLUP);
  attachInterrupt(11, left_press, RISING);
  attachInterrupt(12, left_release, RISING);
}

void loop() {
  if (!(left_state & 1)) { // not ACK
    left_state = (enum button_state)((int)left_state | 1); // ACK
     Mouse.set_buttons(((left_state & 2) >> 1), 0, 0);
  }
}

void left_press() {
  if (left_state == BUTTON_ACK_RELEASED) {
    left_state = BUTTON_PRESSED;
  }
}

void left_release() {
  if (left_state == BUTTON_ACK_PRESSED) {
    left_state = BUTTON_RELEASED;
  }
}

Both the encoder and the switch work very reliably now.
Here is a video, showing of a single click, a double click, and holding the button for a bit:

I put the full code on Github now: https://github.com/pepijndevos/dwergmuis
I’ll put that at the top together with the Flickr set for people to look at.

Now I need to be patient and wait for the laser.

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #22 on: Thu, 27 March 2014, 13:47:30 »
The laser arrived!




I basically connected all the wires to the breadboard using the cable from my ISP programmer and a bunch of jumper wires.
Then I took this code and adapted it to the Teensy 3.1

https://github.com/mrjohnk/ADNS-9800/blob/master/ADNS9800test.ino

I had to change a few things, which I'll put up on Github later.

I'm super excited to put everything together, and start on the final version.
Today I bought some more tools and wood, and I started messing with Sketchup to make a blueprint.

[edit] Pushed.


The most interesting part I changed is that it uses a burst read to read all registers at once.
It also does so outside of the interrupt.
https://github.com/pepijndevos/Dwergmuis/blob/master/dwergmuis.ino#L153-L174

However, it suffers from a heisenbug where it stops moving sometimes.
Adding serial prints makes this go away of course.
What I think might be happening is that it misses a falling edge, and then never reads the sensor.
« Last Edit: Thu, 27 March 2014, 18:11:20 by pepijndevos »

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #23 on: Sat, 29 March 2014, 17:41:52 »
I started working on the second and hopefully final case.

I used computer assisted drawing, also known as CAD or more concretely Sketchup.
I modeled the mouse in 3D and then painstakingly unfolded it.
This resulted in a shell that could be made of one piece of wood, but in practice of two.
Balsa usually comes in 10x100cm pieces.



I first failed miserably at clamping the shell to the ribs, so I bought super glue and tried again.
Wood glue is so much nicer, but keeping the wood firmly in place is tricky.
With super glue, you can just use your hands to hold the shell in place for a minute.
Trust me, after two days your fingers will be back to normal. :thumb:

This time I also spent more time sanding the palm rest into shape.
It took a while, but the result after gluing them together is rewarding.



This time I can't just glue everything to the base plate, so I had to come up with a way to open it.
I used epoxy glue and some triplex triangles to glue nuts to the inside of the mouse.
Then I drilled holes in the base plate, and small dents using a larger drill.



The hole for the laser is made by drilling a hole, and putting a jigsaw in the hole.
You can then just saw a shape and loosen the jigsaw.

Note that I messed up the alignment of the two original rear holes I planned initially.
Adding another hole close to an existing hole is ugly and a recipe for disaster.
Instead, I made a new hole in the palm rest.

I screwed in the front screws, and drilled right trough the base plate into the palm rest.
Then I used a larger drill on the palm rest to embed a nut in the rest.
As long as you don't get epoxy on the inside of the nut, this can't go wrong.

More photos are again on Flickr.
The next step will be to attach the mouse buttons, and then insert the electronics.


Offline blackbox

  • Posts: 725
Re: Dwergmuis: DIY mouse
« Reply #24 on: Sun, 30 March 2014, 07:25:50 »
Cool! Keep posting!
Keyboards: Dell AT102W (matias standard clicky), Maltron two-hand 3D fully ergonomic keyboard (Vintage MX Black). CM QF XT (MX Grey) IBM model M

The LAN table!
http://geekhack.org/index.php?topic=62536.0

Offline clickclack123

  • Posts: 357
  • Location: Australia, Mate!
Re: Dwergmuis: DIY mouse
« Reply #25 on: Sun, 30 March 2014, 17:16:12 »
The best way to figure out what’s going on with your encoder is to look at it with an oscilloscope.
I use this one a lot. Money well spent. http://www.pdamusician.com/dpscope/

I hooked up my encoder to the scope, to look at the bouncing.
It turns out that it does a lot of bouncing.

I also found out the debouncing caps I added where much to big.
If I turn it quickly, voltage never reaches 1V.
This is considered a LOW or undefined logic level. I wonder how that even worked.

Now I added smaller 0.01uF caps.
No more bouncing and it reaches 3.3V fast enough.

I know you've already finished with the debouncing, but you could have used some of the Ergodox or Hasu's TMK code for debouncing. Ergodox doesn't have any caps for debouncing, and works perfectly.

Great stuff by the way. I love reading these DIY worklogs!

Offline Findecanor

  • Posts: 5037
  • Location: Koriko
Re: Dwergmuis: DIY mouse
« Reply #26 on: Sun, 30 March 2014, 23:31:09 »
Really cool project! Keep posting!

clickclack123: He seems to be on top of the debouncing problem already. I think it is harder to understand the debouncing code in ErgoDox and tmk_firmware than in the article he linked to. Anyway, I had read the code and summed up how they do it in this post, and there is also a discussion on different algorithms in that thread.
« Last Edit: Sun, 30 March 2014, 23:40:23 by Findecanor »

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #27 on: Mon, 31 March 2014, 09:25:30 »
Thanks for the kind words. Really encouraging.

The bouncing seems to be fine.
The buttons are double-throw, so I have 2 interrupts per button on the falling edge that set a flag.
Idempotent interrupts!
The encoder has the caps and the tricky code.
This might change, but seems to be working.

I set out to transfer the Teensy from the breadboard to the veroboard.
That was harder than it looked.
The right button did not work and I made a short in the encoder, so it would only go one way.

Those are working again. I have not yet connected the optical sensor.

I made a miiiiiinor oversight.
Where is the USB cable gonna go?
Fuuuuuuu. Not much room for a plug.



Now I wish the Teensy had them on header pins instead of a micro USB connector.
I could strip all the plastic from the connector.
Ideally the cable would come out in the center, but the scroll wheel is in the way.
I was thinking to ge one of those nice braided cables, but they are so fat.
Ideas welcome…

Offline Findecanor

  • Posts: 5037
  • Location: Koriko
Re: Dwergmuis: DIY mouse
« Reply #28 on: Tue, 01 April 2014, 02:31:44 »
How about putting the microswitches farther apart so that they would be closer to the centre of each button?
Let the cable snake around the scroll wheel and attach to the Teensy from behind... You may also want to think about letting the cable snake around a few posts (bolts in the stripboard maybe) as a way of fastening it.

Offline jacobolus

  • Posts: 3661
  • Location: San Francisco, CA
Re: Dwergmuis: DIY mouse
« Reply #29 on: Tue, 01 April 2014, 02:46:10 »
Many people seem to like mouse microswitches, but I really don’t like them: no travel and they require a lot of force. Mouse buttons is one thing that I think (lubed) Cherry ML switches actually would work reasonably well for. [Cherry ML is way too scratchy without lube to be nice for anything, but lubing them is too much of a pain in the ass to want to do for a keyboard.]

Offline jacobolus

  • Posts: 3661
  • Location: San Francisco, CA
Re: Dwergmuis: DIY mouse
« Reply #30 on: Tue, 01 April 2014, 02:47:18 »
By the way, pepijndevos, awesome work so far! Keep it up! I’m really impressed by the bent wood top.

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #31 on: Tue, 01 April 2014, 10:20:19 »
Micro switches will do for now. Maybe I'll become an evangelist in a future revision. Now it just has to click.

I'm not sure about reversing the Teensy. I'd have to start from scratch basically.
Also, the plug still has to go somewhere. But yea, maybe it fits when sticking trough the sensor compartment.
Current plan is to buy a cable, strip all the bulk, and try to make it fit.

Meanwhile, a small interlude on making nice plugs.
This would be an image guide if I had four hands(three to solder, one for the camera).



The plug itself is not all that nice, basically two female headers glued together.

Start by striping the wires.
Apply a bit of tin to the wire and the plug individually. No drops or bulk.
Hold the wire parallel to the plug and touch it with the iron.

If it doesn't work right away, stop and let everything cool down.
If you heat it for too long both the plug and the cable will start to melt.

Now let everything cool down completely before sliding the heat shrink in place, or it'll shrink prematurely.
If you want to tube both ends, slide the tubes on the wire before soldering. Been there...

Finally use a lighter to shrink the tubes.
If you want to avoid grime on the cable(see blue cable), hold the lighter next to the cable, not under it.
« Last Edit: Tue, 01 April 2014, 12:06:45 by pepijndevos »

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #32 on: Fri, 04 April 2014, 11:01:07 »
Not sure whether to laugh or cry :-\

I got a USB cable, cut it open, put it back together and glued the button on top. So it's done!
It's called micro USB for a reason, so soldering was a bit of a challenge.

Maybe I should put some varnish on this thing...



But it's not very nice to use at all.

The actuation force required to press the buttons or move the scroll wheel is enormous.
The left button more so than the right one.

I pressed it upside down on a scale, and the right button takes 80g while the left one takes 120g  :eek:
Quite a difference... I wonder why.

I took it apart, adjusted some things and put it together again.
Now they both feel like the right one used to feel.
Heavy, but usable.

The Teensy has a "feature" that presents the mouse as a tablet, so you can program it to jump to certain positions on the screen.
This means you can't play any games with it. The camera will spin like crazy.

If there will be a V2, I'm definitely going to try lubricated Cherry ML and different encoders.
I also want thumb buttons.

I've been playing with the idea to do away with the scroll wheel.
Instead, the Teensy supports capacitive touch, so a wooden magic mouse seems a possibility.
I just need to find a semiconductive surface to make the buttons out of.
« Last Edit: Sat, 05 April 2014, 02:18:38 by pepijndevos »

Offline blackbox

  • Posts: 725
Re: Dwergmuis: DIY mouse
« Reply #33 on: Mon, 07 April 2014, 15:20:53 »
Nice! Can't get it perfect the first time. It seems to me that the mouse is very long, is that correct?
Keyboards: Dell AT102W (matias standard clicky), Maltron two-hand 3D fully ergonomic keyboard (Vintage MX Black). CM QF XT (MX Grey) IBM model M

The LAN table!
http://geekhack.org/index.php?topic=62536.0

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #34 on: Wed, 09 April 2014, 12:55:55 »
Like maybe 14cm or so. At least more than 12cm, otherwise I'd have bought a mouse instead.

In the coming days I want to see if I can make the buttons a little better.
I've been using it for the past days, and it's not bad, but not perfect either.

Offline blackbox

  • Posts: 725
Re: Dwergmuis: DIY mouse
« Reply #35 on: Wed, 09 April 2014, 14:14:55 »
Like maybe 14cm or so. At least more than 12cm, otherwise I'd have bought a mouse instead.

In the coming days I want to see if I can make the buttons a little better.
I've been using it for the past days, and it's not bad, but not perfect either.

nice! Mine is 13 cm (mx510) Any spesific plans for the buttons?
Keyboards: Dell AT102W (matias standard clicky), Maltron two-hand 3D fully ergonomic keyboard (Vintage MX Black). CM QF XT (MX Grey) IBM model M

The LAN table!
http://geekhack.org/index.php?topic=62536.0

Offline clickclack123

  • Posts: 357
  • Location: Australia, Mate!
Re: Dwergmuis: DIY mouse
« Reply #36 on: Wed, 09 April 2014, 23:23:41 »
The Teensy has a "feature" that presents the mouse as a tablet, so you can program it to jump to certain positions on the screen.
This means you can't play any games with it. The camera will spin like crazy.

As per https://www.pjrc.com/teensy/usb_mouse.html are you sure it has to show up as a tablet?

Quote
usb_mouse_move(x, y, wheel)
Move the mouse or scroll wheel. Values may be -127 to +127, and of course 0 means no movement. For smooth motion, only small movements should be made.

Offline roads

  • Posts: 41
Re: Dwergmuis: DIY mouse
« Reply #37 on: Sat, 19 December 2015, 00:02:54 »
Hey, were you able to set the liftoff distance over Teensy? The standard setting is extremely high.

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: Dwergmuis: DIY mouse
« Reply #38 on: Sat, 19 December 2015, 00:42:15 »
Hey, were you able to set the liftoff distance over Teensy? The standard setting is extremely high.
I doubt you are going to get a response, bit of a necro bump, and the last time the thread starter was active was back in May.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline pepijndevos

  • Thread Starter
  • Posts: 42
  • Location: Netherlands
Re: Dwergmuis: DIY mouse
« Reply #39 on: Sat, 04 August 2018, 02:44:33 »
No, I used the default liftoff distance.