0
\$\begingroup\$

My mouse died recently. Specifically the cord. What ive wanted to do for a while now and have an excuse to do is to try to get the mouse to run via bluetooth. Im a first year engineering student at la tech so i know the basics of some of this. I figured if i wired this:

http://www.robotshop.com/en/usb-ble-link-bluetooth-module.html?gclid=Cj0KEQiAzNfDBRD2xKrO4pSnnOkBEiQAbzzeQXMUou6adLcVWT_23uHjTz-xdh5j--HqDySh0kdAvUkaAuLN8P8HAQ

To the usb wires that i cut and stripped that it could send data to my laptop which has bluetooth in it. The bluetooth part above has a master slave switch and i can just leave it on slave while i use it. What i need help with is connecting a battery to the mouse. How would i do this? Do i need a constant voltage regulator to keep the mouse up to the voltage it needs til the battery dies or can i just use a battery and a resistor and it will work until the battery dies? Will too much voltage or amperage kill the mouse? What batteries do you recommend? Im thinking a AAA (or 2) or a AA since i want to fit everything inside the mouse case. I have a multimeter so i can measure the voltages (and possible amperage idk yet) to see how much power the mouse draws. I figured if i just connected the data wires and power wires from the mouse to the bluetooth slave transmitter and then also connected power to the power wires on the mouse and bluetooth module thing via a battery it would run and the mouse would operate as normal because even if it does have a transformer or something like that in it ive connected power to the same place it takes it in and it wont hurt it. I can deal with the bluetooth thing getting destroyed. Help or ideas with setting this up for use with a battery. If i connect a AAA battery that is 1.5v and a normal usb port operates at 1.5v the theoretically it should power it right? Then all i would need to do is add a resistor for amperage if needed right? Thank you for the help!!

Edit

The mouse is a logitech g300s Do you think connecting the mouse via bluetooth would change the way it operates? It is still receiving the same data as if it were a usb device right? Or would i have to write a driver for it?

\$\endgroup\$
  • \$\begingroup\$ Uhhh USB is 5V... \$\endgroup\$ – Bradman175 Jan 12 '17 at 8:00
  • \$\begingroup\$ How do wireless mice get away with using one or two batteries then? Even if theyre in series its still just 3 or volts. Unless they have a transformer or something in them? \$\endgroup\$ – user25832 Jan 12 '17 at 8:01
  • \$\begingroup\$ I bought a replacement mouse yesterday that uses 2 AA batteries in parallel so its still 1.5V. How does that work? \$\endgroup\$ – user25832 Jan 12 '17 at 8:02
  • \$\begingroup\$ And since the mouse was designed to be connected via USB, most likely, it would NOT like any other voltage levels to power it, so you need some sort of voltage regulating circuit. \$\endgroup\$ – Bradman175 Jan 12 '17 at 8:03
  • 3
    \$\begingroup\$ ............... maybe it's because they have different circuitry inside it and were designed differently? A wired mouse and a wireless mouse would have different power circuitry in them. \$\endgroup\$ – Bradman175 Jan 12 '17 at 8:05
3
\$\begingroup\$

The product at your link will not work for your problem.

  • The principal issue is that it is a USB device, not a USB host. Two USB devices (this and your mouse) can't talk, unless one of them is able to switch modes and be a HOST.

  • Further your host has to have software that knows the USB mouse protocol

  • That is a BTLE device not classic Bluetooth; it may be that there's a way to do HID mouse over BTLE, but it's at minimum atypical

  • The product description is written from a user rather than technical perspective; BTLE does not have "master" and "slave" but rather "Central" and "Peripheral"

  • And yes, you still have the power problem.

If you really want to build this you could try using an MCU that can be a USB host - often there's a mouse hosting example for those. Then you'd need a classic BLE module with an HID firmware, and hopefully one that connects over UART or SPI.

Or you could use a more capable MCU or small computer and see if you can get both the mouse and bluetooth connected as USB peripherals (though I don't know if common USB bluetooth dongles can be HID devices, and you either need two USB host engines or to add a hub)

It might be better at that point to go to something running an operating system that already has the relevant drivers - an embedded Linux board, or even the PC you are sitting at as a proof of concept.

You could also consider getting a PS/2 mouse; those have a much simpler synchronous interface that you can bit-bang on any pair of GPIOs perhaps with level shifting circuitry.

Or you could buy a bluetooth mouse...

As for the power issue; a boost converter if your peripheral is low current, but don't expect long lifetime without some very careful engineering of power usage and sleep modes.

\$\endgroup\$
  • \$\begingroup\$ Would something like the intel edison work for that? It supports spi and uart and has bluetooth build in. Then all i would need is to connect the mouse to it and solve the power problem right? sparkfun.com/news/1603 \$\endgroup\$ – user25832 Jan 12 '17 at 8:30
  • \$\begingroup\$ Yes, that would work. So would something costing a fraction of that price. A low end ARM M0 or an Arduino board could do the job quite easily. You don't need any significant computing power. \$\endgroup\$ – Andrew Jan 12 '17 at 9:04
  • \$\begingroup\$ I pointed out the intel edison because it's smaller than most \$\endgroup\$ – user25832 Jan 12 '17 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.