This was a little project I'd been wanting to do for a little while, just hadn't got round to it until recently. It started back ages ago when i got stuck in a park for 2 hours waiting for a lift. So I found a little shield beetle and started to watch how it behaved (as you do) and i observed that it's behaviour broke down into a set of relatively simple rules. Later I decided this could be replicated using relatively basic circuitry and a little bit of cleaver wiring. So a few weeks ago, I sat down and started fiddling around with my old favourites, relays, to see if i could come up with anything interesting. after a few hours of soldering and re-soldering, I had built this:
The circuit diagram below is set up to show how it's wired up, and the position of the wires:
Basically if it hits an object, it turns away from it (top right hand pictures). If it can't do that, then it reverses then turns away (bottom left). It will also reverse and turn away if it gets stuck and a feeler gets pushed hard (bottom right). For 4 relays and a few capacitors, that's not too bad.