Electrical – AAA battery to power a usb device

batteriesbluetoothmousewiring

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?

Best Answer

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.