This isn't just one gap -- there's two or three gaps over the past decade and a half.
These gaps aren't an issue as long as:
- you were employed for the majority of this time
- you didn't leave any jobs prematurely: you spent at least 2 years in every job before leaving a gap
- the jobs still show career progression: if it's all entry-level work that may complicate your search and limit your opportunities
Based on your description you're just someone that enjoys taking an occasional sabbatical. This is typically known as taking a career break. While taking (several) career breaks is not typical in Western society, in most industries it won't be frowned upon. Taking career breaks should not be a limiting factor for your resume.
As such, there is no need to fill in the blanks by making something up. If you list yourself as being self-employed for those gaps, people will assume that you were working as a self-employed contractor in a similar position to the other experience you describe. It is never a good idea to have people assume things about your resume that aren't true. When they find out they'll often think you were lying or inflating your experience. In your case they'd be right.
The personal projects you describe simply don't hold up as substantial experience, especially when you have nothing to show for it. If you spent that time actively and significantly contributing to an open-source project or a proof-of-concept for a start-up then that would be actual experience you could list.
So to summarise: No, it would not be ethical to list self-employment during these gaps, but you also don't need to.
As those career breaks stand out, you'd usually explain them in your cover letter if they were recent. You'll also need to explain them well during interviews and make it clear that you're not seeking to take a break in the next few years. Since you apparently didn't have a problem finding new employment after earlier breaks, I assume you don't need help with that. If you do, have a look at the related questions in the employment-gaps tag.