My project is Vehicle Tracking System, One of my module is GPS module (Neo GY-GPSMV2). I can successfully see the GPS coordinates via Software Serial. But what I want is that my Arduino should not be connected to my laptop. So I should use Hardware Serial (correct me if I'm wrong). But I read some blogs that I should use resistors to avoid damage to m GPS module if I will use Hardware Serial. I searched for the wiring of it then I see this. (Please remind that I'm using Mega so please just focus on the wiring). So I bought a 10k and 4.7k resistors. My question is how can I appl this on an actual wiring? should I split the wire? or what?
Most importantly, I want to point out that a Mega has 4
Serial3. There is no reason to use an inefficient software serial port library. Software serial libraries use the processor to handle each bit transition, so they use much more CPU time.
SoftwareSerial is particularly inefficient, because it disables interrupts for the entire time that a character is being sent or received, and it can't do both at the same time. This will interfere with your sketch or other libraries. This answer lists the various serial port choices.
To answer your question:
... how can I apply this on an actual wiring? should I split the wire? or what?
Yes, 3 things get connected together at two places. Most people use breadboards for prototyping. Stick two wire ends (a "split" wire) and one end of a resistor into a common row of the breadboard, connecting them electrically.
But for a permanent solution, you should solder two separate wires and one end of the resistor together. A small piece of perfboard can help secure the wires and discrete components. It's a little kludgey, but you can strip the insulation from the middle of one piece of wire (don't split the wire) and solder one end of the resistor to it.
BTW, I always recommend real level-shifter modules that use FETs. They're fast, so you can also use them for SPI interfaces, like an SD card, and they're bi-directional (5V to or from 3.3V). And they're cheap. You would just solder individual wires from the Arduino and the GPS device to various through holes in the module PCB.
The picture in your post shows a direct connection between the GPS transmit pin and the Arduino receive pin. While this will not damage either pin, the GPS transmit voltage is not quite within the range specified for the Arduino receive pin.
Note the use of the word "specified". If you read the specifications for the two devices, you will see that a logic 1 out of the GPS pin (called VOH) is slightly under the minimum acceptable voltage for the logic 1 input to an Arduino pin (called VIH).
You can also use discrete components to "step-up" the GPS TX voltage up a little. You can google for many different solutions. Hackaday has a nice summary. MicroChip AppNote DS41285A has many suggestions. Again, I would strongly suggest using a level-shifting module.
Many people report using a direct connection without problems. It is possible that:
- the actual devices have a higher VOH and/or lower VIH, or
- the data is received with various amounts of errors, and the GPS parsing library (or sketch) ignores the errors. Take a look at my NeoGPS library. It is the fastest, smallest, most accurate and most reliable GPS library. It can help you detect (and reject) bad data.