Would you discourage your undergrad from taking a year off to work on a self-devised project? The student is in fourth semester and wants to learn about a certain technical field on his own and try out a more complex project on that knowledge. 
The project idea is unique, but unlikely to be successfull, as similar projects in the past have not been. He would learn something, ideally.

Would you say it is injudicious to discourage him or would you actively discourage him? The project is an electronics project.
When I was an undergraduate, students in my peer group undertook serious summer research projects (up to 4 months), and worked on research part time during the year in their 3rd year, perhaps equivalent to the load of one or two courses. This seems about right, as all of coursework, graduating in a timely fashion, and research experience are important for grad school-bound students.

If the student wants to disrupt coursework for a project, it is absolutely your responsibility as an advisor to dissuade the student if you think the project will fail. You would do the same to a Ph.D. student about to delay his or her program for exactly the same reason.

If the student had a very compelling project, this would be a tougher call, and you might have to have a more complex discussion with the student about the risks and possible upshot. There's a real if not overglorified trend of students ditching college halfway through to become Silicon Valley rockstars, without their degree to prove themselves. The student might have something like this in mind, and your viewpoint based on years of experience seeing where undergrad careers go is probably useful.