"Brain scans of insects appear to indicate that they have the capacity to be conscious and show egocentrico, apparently indicating that they have such a thing as subjective experience." That's the finding of study written by Andrew B Barron and Colin Klein, and published in the Proceedings of National Academy of Sciences.
From the Independent:
They found that in both, consciousness appeared to be associated with the "midbrain". That part of the brain is the ancient core of the brain, which supports awareness for us and apparently for insects, too.
Though insects have tiny brains, they appear to serve the same function that the midbrain does for humans. They are able to tie together memory, perception and other key parts of consciousness, and use it to decide what to do – which is the same function that human's brains do.