LONDON—The English company that churns out one of the world’s cheapest computers, the $5 Raspberry Pi, is selling itself to a Swiss competitor for about $870 million.

Swiss components supplier Daetwyler Holding AG said Tuesday that it agreed to acquire U.K.-based electronics distributor Premier Farnell PLC for £615 million, or 165 pence a share.

The...