There are many external factors that brought about the collapse of the Tokugawa Shogunate.
Late in the 1700s, western countries started to challenge the Tokugawa policy of limiting trade and the Russians were the first to do so. The Russians made probes into the northern island Ezo late in the 1790s in hope that they could open up trade. With increasing frequency, more western ships started to show up in Japanese harbors. Even though the Shogunate issued orders to rebuff any attempt by the ships to the land, Japanese defenders, with their outdated weapons and organisation, could offer little resistance to the modern warships. The power from the western places showed a real danger to Japan’s power. The arrival of US commodore Matthew Perry in 1853 threw Japan’s leadership in great disturbance. The US had started to become interested in opening up Japan to normal trading and diplomatic relationships in the 1840’s . This was in order to secure the US good treatment.
Matthew Perry implied threat of his modern warships to pressure the shogunate into signing a treaty of friendship with the US. In 1854, the shogunate unwillingly signed this treaty.