| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Light hide and seeker

Page history last edited by nikki 14 years, 5 months ago

"I want to hack a moving toy so that if you shine a light on it it tries to move out of the light, but then if no light is shone on it for a while I want it to move towards the brightest light source, until its hide reflex is triggered again.

Or something similar with sound, if it detects a loud noise it tries to go away from the noise, yet if its somewhere quiet it will eventually start making a noise which gets louder until it triggers itself to hide again."

 

I think Thom has worked a bit with a car that follows a laser pointer, so that's probably a good place to start for the light-seeking part of it. I'm guessing Light Dependent Resistors hooked up via the arduino to control the motors, and then some sort of max level at which point it flips into moving away from the light? - nikki

Comments (3)

'GB' Bulmer said

at 12:18 pm on Nov 6, 2009

Echo'd from parent page:

Making something light sensitive is pretty straight forward. I'll do that in the beginners workshop.
You need a light sensitive resistor (or phototransistor) e.g.: http://www.rapidonline.com/Electronic-Components/Optoelectronics/Photodetectors/Miniature-light-dependent-resistor/29399/kw/light+dependent

It connects into the analogue input of an Arduino, and it turns into programming (which is more flexible than electronics :-).

Think of a light sensor as something even simpler than an amoeba, it just reacts to the amount of light falling on it.

To make something detect direction from light (or any sense), it will either need to move around, or have more than one sensor. Imagine looking at a the dot of light coming down a thin drinking straw. That's not enough information to decide which direction might be lighter or darker without moving it around or using a second drinking straw to look elsewhere. With two straws, pointed in different directions, you could make a reasonable guess. You could also try moving a single straw and trying to remember how bright it was 'before'.

With more than one light sensor, shaded or pointed in different directions, a controller, like an Arduino can run a program to decide where the brightest or dimmest light is. It 'reads' the two sensors, and goes towards the one it prefers (lightest or darkest). It could also remember as it moves, but that is a little bit harder to make work.

Sound is a similar principle, but sound can be so quick that it is hard to detect which direction it came from. I use a little circuit which 'holds' onto the sound to make it easier to 'read', but I've not tried to figure out a direction. Could be possible though, especially if the 'ears' are a reasonable distance apart.

'GB' Bulmer said

at 1:00 pm on Nov 6, 2009

Sorry, I forgot to mention ways to make its behaviour change with time: "but then if no light is shone on it for a while I want it to move towards the brightest light source". The Arduino has an internal 'clock' so it knows how long its be 'on', and you can use that 'clock' to keep track of events.

The sketch (program) would remember how long ago it was 'frightened' by a bright light, and after a time that you decide upon, it can change behaviour. This all needs to be programmed, but I think it's very doable.

If it was light and sound sensitive, it could be programmed to behave in quite 'sentient' way :-)
GB

Helen said

at 11:20 am on Nov 17, 2009

Thanks GB, I've ordered a few of the light sensors and am off to find a suitable moving toy to hack.

You don't have permission to comment on this page.