Below is a pic that hopefully will help. Not my engine bay (rain here has prevented pics) so credit goes to 5speedMX 'cause it's from his cardomain page. Your car has 3 forward positioned D-sensors. LH, RH, and Center. I suspect you might be seeing both ends of the center sensor/wiring harness hanging loose in your engine bay? Here's why.
The installed center D-sensor (S-03) and its wire harness are accessible, in plain sight in the engine bay. The LH (S-02) and RH (S-04) sensors are
not mounted in the engine bay but are mounted (out of sight) covered by the front bumper, behind each turn sig, under the headlight. Their wiring harness routes back completely inside the fender to a connection point near the firewall but still inside the fender so I'm doubting that you are seeing these loose in the engine bay. Unless of course, if the LH sensor was previously unbolted from the body behind the sig light and somehow left misrouted, hanging through the fender into the engine bay. If that is the case, post back and I'll try to get pdf scans from my Body Elec Manual that gives specific diags for LH sensor reinstall. Mazda shows that removal of the mudflap and plastic wheelwell liner is the method for reaching both the 2-3 bolts that attach the LH sensor and to reach the harness connector near the firewall inside the fender.
Now for the center S-03 sensor. I tried to highlight in yellow the S-03 wiring harness. Hope it is clear enough. The top arrow points to the S-03 harness connection just behind the strut tower, that orange and blue connector. Does that look like one of the loose ends in your bay?
At the other end, the sensor itself is not clearly visible in the pic but is located below the lower righthand arrow, on the underside of that black horizontal protector plate with the two visible mounting bolts. The harness is visible just to the right of that point. I believe the protector plate is just to prevent accidental shock to the sensor since it would otherwise be completely exposed and some curious fool might smack it with a hammer to see what would happen lol. The harness drops down below the protector plate and bends toward the hood latch(pic is cutting off view). The smaller lefthand arrow points to the black mounting arm that is actually part of the sensor. That arm positions the sensor sorta from the side, holding the sensor in position under the adjacent protector plate. I'm thinking that is the "second loose end part" that you have hanging in the bay. Like I said, post back if you still think one of the loose ends you're seeing is in fact, the normally concealed LH S-02 sensor.
