Peter Conoboy, 48, pleaded guilty to placing the device in the foyer of the tower block where he lived in Motherwell, North Lanarkshire, near a community centre to be used as a polling station.
The High Court in Glasgow heard bomb disposal experts believed the device was viable, but after it was disabled through a controlled explosion, it was found to be a hoax.
No motive has been identified.
Advocate depute Isla Davie QC told the court the device was spotted at 12:50am on 12 December last year by a resident making a phone call.
He initially thought the Adidas shoe box contained old tools, but when he looked closer he found liquid in a box connected to a mobile via cables and alerted police, who contacted an explosives specialist.
Ms Davie said: "He believed from the description given at the time that the device could be viable.
"As a result, the ground, first and second floor of the tower block were evacuated."
A robot was used to carry out a controlled explosion and examination of the components found the substance it contained was not hazardous.
Ms Davie said: "This caused significant disruption to the public, the evacuation of a number of homes and the reallocation of a polling station on election day."
People registered to vote at Glen Tower were told to attend an alternative polling station at Knowetop Primary School in the town.
The court heard CCTV showed Conoboy planting the device in the foyer of the tower block.
Ms Davie said a police search of Conoboy's phone and laptop found no evidence of any "particular political affiliation, radical affiliation or hard or soft targets".
No how-to guides on explosives were found on the devices but five videos of terror attacks were discovered, including those on London Bridge and in Christchurch, New Zealand.
Ms Davie said: "There was nothing to indicate Peter Conoboy was a supporter of these incidents."
His flatmate told police politics was not something Conoboy spoke about, Ms Davie added, saying: "The motive behind this incident remains unclear."
William Lavelle, representing Conoboy, said his client had voted only once, aged 18, and "shown no interest in politics thereafter".
He said a psychiatric report had been carried out to ascertain Conoboy's state of mind at the time of the incident.
"It addresses various issues but doesn't help at all in terms of motivation," he said.
The court heard Conoboy has previous convictions for theft, assault and threatening or abusive behaviour.
Judge Lord Matthews deferred sentence until 4 August for background reports.