Computer literacy, help and repair

Laser mouse with com port. mouse "secrets"

Once it was necessary to check the prehistoric (Russian still) remote control. There were no funds. After digging around on the internet, I found a few ideas. I was struck by the idea to make a simple infrared port from: a mouse! Computer, of course. We will start with this device.

1. IR port from a ball COM mouse.

Stunned by the idea, I went into the closet and dug up some ball mice, one older than the other. The older one had 6 wires coming from the computer, the newer one had four. She took it. Lines passed through four wires: RTS (Request To Send, a request to send. Used to power the mouse circuit.), Rx (the computer receives data through it), Tx (the computer transmits data through it), and of course GND, ground.

The photo shows the mouse wire plug. During the dialing, I found that the orange wire is RX, the green wire is TX, the white wire is RTS and the blue wire is ground.

Then I soldered a photodiode bridge and an infrared LED from the same mouse. I took a 4.7 kΩ resistor from my stock. The device to the resistor is not critical - you can put from 2 to 7 kOhm, but with less resistance, the radius of the receiver decreases. Here's what the parts look like (from left to right: photodiode bridge, IR LED, resistor):

Here is the schematic of the device:

After half an hour of soldering and gluing, this is what happened:

The device came out working - a confident reception radius - 5 cm, transmission - 20 cm. To check the remote control, this turned out to be enough: it does not work.

2. Advanced IR transceiver device.

Since we fled, we must also talk about a more advanced device.

The port consists of a receiver (TSOP chip and trim) and a transmitter (HL1 LED and current-limiting resistor R2).

The receiver uses a specialized TSOPHXX chip. It receives a signal with a certain frequency. This achieves high noise immunity. Since they are available in several versions - for different signal filtering frequencies, you need to choose the right one for a specific remote control. Let's take a look at the datasheet:

As you can see, there is a choice: from 30 to 56 kilohertz. The datasheet says that the maximum speed of the received signal is 2400 baud / sec, so it's hard to judge whether the micro will work with a mobile phone, for example. This is what TSOP1736 looks like:

Resistor R1 pulls the RX line to power (after all, all COM port signals are inverted), diode VD1 protects the circuit from polarity reversal during port initialization, conder C1 protects the receiver from interference. Well, the 7805 stabilizer, of course, adjusts the voltage of the IR receiver. I advise you to put in the TO-92 case - it is smaller in size.

The transmitter is not particularly advanced, it differs only in a more powerful IR diode. You can put, for example, L-34F3C, L-54F3C. Resistor R2 limits the current through the diode. IR diode looks like this:

This device receives and transmits well at a distance of up to 5 m.

If you want to experiment, then here is the pinout of the COM port, common on the Internet:

3. Programs for working with infrared ports.

Now let's talk about programs. I used the WinLirc program to check. The device showed pretty good results: the reception radius was 5 cm, the transmission radius was 20 cm maximum. It all depends on the type of photocells. For example, I will give a work example of working with the control panel from the music center.

Let's talk about setting.

We start VinLIRK. She writes: the configuration is unsuccessful, reconfigure. Type the path and name of the configuration file in the Path field and then follow these steps: (I note: these settings are only for this device):

1. In the Port field, put the port number where the device is connected

2. We leave the Speed ​​field untouched, although you can experiment - old computers do not want to think faster than 115200 bps.

4. Set TX in Transmitter settings. You can connect to DCD - your right.

Now we need to teach the stupid prog science - to recognize the commands of your remote control. Close the browser window and click Learn. And there we continue to be guided by the English language, because the prog is bourgeois.

PS: Where the program says "press the button on the remote control and hold it until I tell you", you need not hold the button, but poke it as quickly as possible - from personal experience.

After studying, click Analyze. The program will check the config and say OK. We close the window.

Look like that's it. Click OK in the main settings window. The program will be minimized to tray. We press the buttons on the remote - if the program understands the commands, then it responds - the color of the indicator changes from gray to green. For this program, you can find plugins for managing WinAMP, for working with TCP / IP.

And in general, now there are many programs for this business. I recommend searching the internet.

This program is already for controlling the computer from the sofa - you can also find plugins for WinAmp for it.

The prototype of a computer mouse - a two-dimensional analog manipulator connected to a personal computer (PC, or PC) via a serial port that complies with the RS-232 standard and equipped with a couple of buttons on a convenient and compact body - is considered a device created almost 40 years ago in Stanford Research Institute and incorporated a number of principles, the author of which is the famous inventor Douglas Engelbart. In appearance, this is a wooden box with a "tail" - a communication cable. Obeying the movements of the operator's hand, roaming the table on wheels, counting their revolutions and turns, this device seems to sniff out information that is immediately entered into the computer and controls the movement of the cursor on the screen. Indeed, than not a sneaky little mouse! ..

Modern devices for entering information into a personal computer (PC) - optomechanical, optical and other computer mice - outwardly also look like a nimble and all-successful Mickey Mouse. Obedient to the will of the owners (users), they transmit information to the system about their movement along the plane and pressing the buttons located on top, in front of the case.

Perhaps the most popular type of computer mice is optomechanical (Fig. 1a), inside which there is certainly a freely rotating and rather heavy rubberized ball. Through a hole in the center of the bottom (and in many designs - located inside a removable ring) it contacts the underlying surface (mat) and, with any of its movement, transfers rotation to two mutually perpendicular rollers with coordinate disks. Sensors - two open optocouplers (LED - photodiode). In the working gap of each of them, the coordinate disk with slots rotates during operation. Optocouplers can be either integral structures or separate elements mounted on a printed circuit board.

Focused LED beams, passing through the slots of the coordinate disk, periodically overlap when the mouse moves, and the corresponding electronic current pulses appear at the output of photodetectors (photodiodes). Everything else is done by electronics...

Bus Mouse (tire mouse) quite rightly considered a long and hopelessly outdated version of the computer manipulator. There are no optocouplers inside such a peripheral. Rotating coordinate discs interrupt here not the course of the LED beams, but the brush contacts of the simplest electromechanical sensors; signal processing is performed by a special adapter (usually an ISA board). The cable is rare, 9-wire, the connector is also specific. The main drawback is the adapter itself: it occupies a slot on the board, I / O addresses, and an interrupt request line ...

Serial Mouse refers, on the contrary, to fairly common types of computer mice with a serial interface. This peripheral device is connected to one of the 9- or 25-pin connectors of the COM port.

Inside any Serial Mouse there is a built-in microcontroller that processes signals from coordinate sensors and buttons. Each event (moving or pressing and releasing buttons) is encoded by a binary message via the RS-232 interface. To transfer information, asynchronous transmission is used, and bipolar power comes from the control lines of the interface. Disadvantage of Serial Mouse: this device occupies a COM port and requires exclusive use of its standard interrupt line (IRQ4 for COM1 and IRQ3 for COM2).

Most often you have to deal with MS-Mouse and PC-Mouse. Being varieties of computer mice with a so-called serial interface, they nevertheless use different formats for sending signals; if the installed driver does not correspond to the true one, random, jerky movement of the cursor across the screen is inevitable.

A subspecies of the serial mouse - PS / 2-Mouse is nothing more than the result of past experiments by IBM with computers of the PS / 2 series, produced for a very short time. The interface, cable connector of this peripheral device are similar to the keyboard ones.

It just so happened, but the adapter and PS / 2 connector are "definitely present" on all modern motherboards. Well, the controller of this mouse can either be part of the keyboard controller, or occupy additional I / O addresses. It's also useful to know that PS/2-Mouse uses IRQ 12.

There are a number of annoying misunderstandings associated with the PS / 2-Mouse and Serial-Mouse 1 serial interfaces, which sometimes arise among beginners who forget that ...

Firstly, the PS / 2 interface uses a unipolar signal with TTL levels (transistor-transistor logic) and strictly requires the so-called unipolar power supply: +5 V with respect to the GND bus. On the other hand, the RS-232 interface used in COM mice is characterized by an exclusively bipolar signal (with trigger levels of +3 ... + 10 V and -3 ... -10 V) and only bipolar (relative to the GND bus) power supply.

Second, the PS/2 mouse interface uses two separate signal lines, one for data transmission and the other for clock signals. In contrast, a COM mouse uses a single wire that transmits the signal in an asynchronous manner.

Even without going into other details, we can state that these types of interfaces are directly incompatible. True, sometimes one has to hear a clarification: they say, passive adapters are already being produced, designed, according to "all-knowing" sellers of computer equipment, to ensure reliable operation of a computer mouse with any method of connecting it to a PC.

However, be vigilant and careful! The above-named adapters are intended only for universal mice, the controller of which, indeed, is able to recognize by the supply voltage which interface it was connected to, and immediately set the appropriate type of its output signal. Unfortunately, such "advanced" input devices are still extremely expensive and few in number, so failures when connecting cheap computer mice to a PC through adapters are by no means uncommon. Isn't it better to immediately purchase "peripherals" with the required interface than to subsequently spend money on any additional devices and devices with little hope for the effectiveness of their work?!

Relatively recently, USB mice (USB Mouse) have appeared and have already managed to prove themselves well, but ... To connect them, it is necessary that the computer has a USB bus.

The optical mouse (Optical Mouse) also enjoys well-deserved popularity. Having no "mechanics", she briskly "runs" on a special mat, on the surface of which a network of intersecting black lines is applied. The reflected LED beams are periodically interrupted when the mouse moves, which is recorded by photodetectors (Fig. 1b). The built-in electronics do an excellent job of counting the current pulses that occur ...

Among the variety of other computer mice, one cannot fail to note the “tailless individuals”. Communication with the base blocks of the PC for such manipulators is carried out using not a cable, but a radio signal or infrared rays. There are also mice designed to control the cursor in a three-dimensional virtual space.

In a special row - trackball-type manipulators (Trakball). Although these devices resemble an inverted mouse, the rubber ball of which must be rotated with your fingers, but the rest of the design here is both motionless and more compact, which is highly appreciated, for example, in laptops. There are trackballs designed to work in computer games and other technology, mainly aimed at the younger generation. Accordingly, the external design of these manipulators is in youth or even children's style, but with the obligatory preservation of functional properties with a simultaneous increase in reliability.

However, over time, even the most persistent of computer mice and similar devices begin to mope, forced to wind up their by no means virtual kilometers every day. Like any technology, PC manipulators need cleaning, preventive care and, if there is a special need, repair.

The first thing to do when a previously obedient mouse suddenly begins to move badly in one direction or another is to check the condition ... of the underlying surface. Potholes, oiliness and dirt on it, of course, are unacceptable.

If, say, you are dealing with a filthy rug, and its coating is rag, then it is unlikely that you can fix everything by washing: the glue that manufacturers most often use is not waterproof. But you can smooth out the matter that has been crumpled or rolled during operation and lift its pile by rubbing the rug with a brush. However, do not overdo it, because the fabric layer that begins to lag behind at the edges is not long and completely torn off. But polymer rugs can be safely wiped in soapy water, removing all the evil spirits that have stuck, sunk into scratches and depressions.

1 - underlying surface (rubberized or plastic mat, and in option b - a coordinate plate marked with black lines); 2 - bottom with a working hole in the center; 3 - body; 4 - connecting cable; 5 - elastic sleeve of cable entry; 6 - key with microswitch (2 or 3 sets); 7 - coordinate disks; 8 - sources of focused light (LEDs): 9 - photodetectors (photodiode); 10 - board with an electronic circuit; 11 - pressure rollers; 12 - heavy rubberized ball; 13 - lens; 14 - periscope mirror

It is possible that dust and small fibers mixed with sweat from the palms from the mat-litter managed to get through the rubber ball into the mouse itself during the operation of the manipulator and roll onto the rollers, crowd into the attachment points of the axes of the coordinate disks, slowing down the rotation of the latter. Often, mud rags manage to get to the optocouplers, clogging the holes through which the LED beams must pass during operation.

You can often see the true state of the rollers, and even the coordinate discs with optocouplers, without disassembling the mouse or even removing the case from it. It is enough, by turning the manipulator over, to remove only the ball from the socket held in the bottom by a ring with arrows and an explanatory inscription OPEN (“open”). And then - to act, as they say, according to the circumstances.

Dirt adhering to the parts can be removed with an alcohol cotton swab clamped in tweezers (making sure that the cleaning liquid does not drip inside the case, especially if not pure alcohol is used, but an aqueous solution) or gently scraped off, gradually turning the rollers and blowing out exfoliated pieces of dirt from the hole. In a similar way, it is necessary to clean both the mounting points of the axes, and (with extreme caution) the coordinate discs with holes for the passage of LED beams. Well, it is recommended to bathe the ball in a soapy solution, then rinse it in running water under a tap and dry it with a napkin.

Avoid touching already cleaned parts with your hands, otherwise grease from your fingers can easily get on the rollers, and these are the prerequisites for a very quick sticking of new dirt with all the ensuing consequences.

It happens that both the rollers are rubbed and the ball is washed with soap, but the expected smoothness of the cursor movement on the screen when moving the mouse over the rug does not occur. In this case, look - perhaps a notch was made on the rollers, which was erased from long-term work. The necessary roughness here can be given with fine sandpaper. Just try not to lose a sense of proportion when carrying out such a responsible “recovery operation”, which is easier, of course, to carry out if you open the mouse itself, after unscrewing the screws in the bottom.

There is also a more radical "folk" way to restore a worn-out roller. The bottom line is to put on top of it two rings made of PVC tubing or cambric. This should be done in such a way that the working part of the ball, as it were, remains hanging in the air, slightly touching the sides of the ends of the rings.

In order for the rings to sit tightly, they do not need to be planted on glue. It's just that the blank tube should be smaller than the roller in diameter. In addition, it is recommended that the rings cut out of it be dipped in boiling water for a short time, and then quickly pulled onto the rollers in the places prepared for them. After cooling, the rings will be tightly seated.

Pay attention to the pressure roller (in Fig. 1a conditionally absent). Wash this part too, remembering to remove the spring from it in advance.

Although many of the users, referring to a computer mouse almost as consumables, sometimes prefer not to engage in repairs at all, but are in a hurry to purchase a new Mouse (fortunately, the prices for these manipulators, according to advertising, are “quite reasonable”), but ... One cannot but take into account that after a long work, the hand gets used to the mouse, and it can be difficult to switch to a new one. Yes, and circumstances sometimes develop in such a way that the store is far away or, say, the type of manipulators you need is already sold out. Perhaps it's better to tinker with a broken mouse a bit and try to "revive" it yourself?

Remove the manipulator board, inspect the installation - there should be no flux residues anywhere after soldering. Be aware: if the flux is not completely removed, the copper of the conductive elements will begin to gradually break down and through the oxides it will be possible to close adjacent printed tracks. The board is cleaned by wiping it with a cotton swab moistened with alcohol, preferably clean.

It is hardly advisable to disassemble and repair "rattling" buttons. However, diligent users and owners who are familiar with the soldering iron can try to replace the "moping" microswitches on their own, choosing obviously good ones from their "mouse collection".

It is worth remembering that the Serial Mouse has bipolar power: the "plus" comes from DTR and RTS, and the "minus" comes from TO. If the mouse does not work with this port, then you need to check the voltage at the output pins of the connector.

It also happens that a specific mouse being connected “refuses” to work with this port, although it has no problems with others. The reason may be low voltages under load - according to the standard, they must be at least 5 V (absolute value), and if this port only gives out this minimum, then some Mouse may not have enough such a “starvation soldering” (not enough power to power the LEDs) .

It should also be taken into account that the absence of -12 V is noticed only by devices connected to COM ports. The power supply should control this voltage (theoretically ...), but you may well come across a simplified version of the PSU, which does not pay attention to -12 V.

It happens that after many years of operation, the mouse starts to work unstable due to the LEDs (it is quite easy to recognize them - they are connected to a common wire with one output, and power is supplied to the other through a resistor), which eventually lose their former glow brightness. Look, maybe just too much dust has settled on them? Try to wipe the LEDs from the side of the built-in lenses, just do not use solvents and metal objects, so as not to introduce additional malfunctions.

If no cleaning helps, then try to adjust the resistance of the resistor named above (usually downward). It is recommended to unsolder this element of the circuit, measure its value with an ohmmeter, and instead solder a new one, which has a denomination half that of the previous one. You can even limit yourself to soldering (parallel to the standard one) an additional resistor with a resistance of about 1 kOhm.

In the case when the previous actions do not bring the expected result and the mouse still does not work, take the awl and turn the coordinate disk in both directions, touching the awl to those legs of the photo receiver of the inoperative optocoupler that go to the main microcircuit. If, when touching one of the photodiodes, the mouse reacts to the rotation of the roller, it means that the corresponding LED has “aged” so much that it needs to be replaced.

When working too vigorously, some users (especially among computer gamers) manage to break the connecting cable. The outer insulation may appear intact, and the mouse refuses to work and is not even recognized by the computer. Worst of all, if the malfunction manifests itself from time to time - in the form of chaotic jumps of the cursor across the screen.

It is difficult to search for breaks and restore conductive wires. Better look - perhaps the cable is "planted" on a standard connector, and you can simply borrow an analog from another mouse. If there is no “reserve” at hand, try cutting a piece of cable directly near the elastic bushing of the input (in this place they usually break off) and solder the stripped and tinned ends of the undamaged cores to the board (in accordance with the table and fig.).

You can also act differently. "Ring" the connecting cable, bending it in different places and gradually moving from the input sleeve to the connector. As a rule, cliffs occur where frequent bends are unavoidable. Moreover, the wire in orange insulation usually turns out to be damaged (technological oversights or negligence of the manufacturer?). The insulation at the break point is fragile, and if you pull on the damaged core, the broken end of the wire will immediately be exposed.

Further. Take a knife (or better, a scalpel) and begin to carefully cut the outer sheath of the cable along to the break point and further by about 8 mm to have access to the other end of the broken wire. Solder both ends and put the cores back into the sheath, which can be wrapped later with threads or electrical tape (although the latter is often not required at all, the cut on the restored cable is not even noticeable). If it turns out that the cores of the cable are intact, and the mouse does not work, then the quartz output (sometimes a capacitor is put in its place) is not ruled out. So, you need to replace it with a known good one.

It also happens that the mouse is simply dropped. As a result, for example, the roller attachment point on the bottom of the mouse may break. In this case, a replacement is possible - if you have mice from the same company, then simply rearrange the bottom cover with intact mounts from another copy.

There are a fairly large number of programs that can make you anxious about the "well-being" of the mouse, although it will be in perfect order. For example, this is a MouseFX software joke, "slipped" by someone into the "Startup" of the computer. To identify this, like many other "pranks" of the mouse itself, programs such as the development of Alexey Kulentsov, 2:5020/, version 1.08 from 17-10-96 16:18, distributed for free on the Internet, will help.

A. DOLININ

Noticed an error? Select it and click Ctrl+Enter to let us know.

If you have an old computer, then the problem of connecting a modern mouse to it may be familiar to you. Old-style mechanical mice wear out sooner or later - the wire is frayed, the plastic at the buttons is pressed through so that they stop being pressed, etc. And in general, dealing with a modern laser mouse, as a rule, is much more pleasant than with samples of the last century like this (of course, if the constant cleaning of the pet's wheel from dirt and coiled hair does not give you great pleasure).


The PS / 2 interface was actively used in "branded" computers starting from 286 (IBM PS / 2), but the COM port remained the standard for connecting a mouse for a long time and was actively used until the early 2000s (up to the "second Pentiums" inclusive). Because mice for COM-port have not been produced for a long time, then for computers without a PS / 2 port there are two options: to adapt a PS / 2 or USB mouse. With PS / 2, everything is much simpler - this protocol can be implemented on almost any budget microcontroller, for example, on atmega8. In the case of USB, you will have to use more serious chips with USB hardware support in host mode. Yes, sooner or later PS / 2 mice will die, but since they can still be purchased without problems, this option seems to be the most optimal.

The network came across a ready-made solution for the adapter (unfortunately, the author has already deleted it). The source code was rewritten for the AVR GCC compiler and partially redesigned, some changes were made to the circuit and firmware, and a bug in the circuit was fixed (albeit belatedly - after the manufacture of printed circuit boards), the mouse polling speed was increased and minor improvements were made.

The adapter is built on the atmega8 microcontroller and level converters for the MAX232 COM port. The microcontroller receives data from a PS / 2 mouse and transmits it through the UART.

Adapter diagram:


The board was laid out so that it could be installed on it as a DB-9 plug, which allows you to plug the adapter board into a computer instead of a mouse, and an IDC-10 connector for connecting directly to the motherboard or multicard via a cable. In the latter case, the adapter can be installed in the case and bring out the PS / 2 socket.


The adapter requires +5V power for itself and the connected mouse. Alas, it is not possible to power it from the COM port, because optical mice eat more electricity than their mechanical cousins. Yes, and the adapter itself also needs to be powered by something, and the load capacity of the COM port outputs is clearly not enough for this. I did not make a separate power connector on the board, power is supplied to the 6-pin connector of the ISP programmer, these pins are signed on the board.


In addition to the listed connectors, there are three jumpers on the board:

Mode If the jumper is not closed, the adapter emulates a regular serial mouse using the Microsoft protocol. Communication protocol 1200 baud, 7 data bits, 1 stop bit, no parity. If the jumper is closed, the adapter emulates a mouse with the EM84520 protocol. Speed ​​With this group of jumpers, you can set the mouse movement speed: 1, 2, 3 - the more, the faster. In general, this group of jumpers works like buttons and the choice is stored in the non-volatile memory of the MK (ie, after saving the speed, the jumper can be removed) PWR: DTR/RTS A regular Serial mouse is powered by a COM port. It can be powered by either DTR (Data terminal ready) or RTS (Request to send) signal. That is, to turn on the mouse, the computer puts a high level on one of these outputs. The adapter uses this pin as an enable signal, so that it starts sending data to the computer, the PWR input must be high.

The D1 LED lights up when data is received from the PS/2 mouse, i.e. when the mouse is moved, keys are pressed, or the wheel is turned.

Unfortunately, the PCB of the first version (green solder mask) has an error in connecting capacitor C3. If you solder it to the designated place, the MAX232 chip will get very hot. The problem is fixed with little blood - the capacitor is soldered to only one pad, and its second output is connected with a small jumper to the 16th output of the MAX232 (see photo above).

The bug has been fixed in v1.1 board (blue solder mask). In addition, the board had a connector for connecting an external bracket with a PS / 2 socket and a second LED (indicates that the computer turns on the mouse by supplying power to it).




Fuse configuration:

Similar posts