Forum

Light sensor

Anyone ever used a light sensor with vvvv, i got a project where i need to change differet parameters depending on the light levels in the building. Fist of all has anyone used one befor, and whats the best way of getting a conventional snesor into vvvv, and also, anyone know any quick fixes as the deadline is Tiiight!!!

a very quick way to get a sensor into your computer is to use the gameport. if your computer is not antique enough to contain one, you could use an usb-adapter. it might be sufficient for sensing the light situation inside a building (it sounds like there are no rapid changes you’d have to sense). i mention this because you would have to filter any irregularities (noise etc.) from the sensor inside vvvv, which is sometimes less responsive / accurate than filtering the value in hardware, for example:

using an arduino, which connects (mostly) via usb, you could write a small piece of code which polls the sensor around 2500 times a second and sends the average to vvvv. this results in very smooth values that can still be responsive (e.g. if you send vvvv the average of 40 polls 60 times a second). you could also perform any other computing task on the arduino board and invoke vvvv at a much later stage.

a tight deadline favors the gameport, since arduinos can take some time to ship (if you don’t already own one). if this is a long-term-installation (buildings and architecture tend to be), you will want to thoroughly test any of these solutions for quirks concerning the usb connection. sometimes a device likes to change his id every other time the computer starts, leaving vvvv to look in the wrong place and not receive any data. you will want to know about such a situation in time.

Hi, Thanks for that diki, yeah this is going to be in an achetectual instalation so is pretty mission critical. Its one of thos last minute things which the client has asked for and im trying to make it possible. I’ve found a few kits etc availabe but not too sure we’ll have enough tinkering time to get it stable.
Just a thought which never occured to me untill now, do you think in your oppinion it is possible to get a reasonable light reading from a webcam, i.e lock off the cam settings, and take an avercag of the HSL values it is getting from the image? Thinking about it this may be a good work arround!

A Webcam with all settings locked will probably not have enough dynamic range for the varying light situations in a building. That might also be a pitfall if you use a simple optoresistor as diki describes it.

You may be able to get a Luxmeter with an RS232 port like this one (sorry, german webpage. Haven’t used it yet, but wanted to try it sometime soon.) I’d still not recommend it for a long-term installation - simply because it has too many buttons and you’d probably have to hack it to make sure it’s always on, never changes modes, etc. But it would suffice for a fast proof-of-concept, and it might be easy to get.

If you don’t intend to learn your way around with arduinos, phidgets have a nice “high precision light sensor”.

if you are fine with some on/off thing, you could use something like a twilight switch which is used in electrical installations in buildings.
so you already have a proper case, wire connectors etc.
set the relevant lighting levels, and the switch will go on and off - use a joystick usb adapter to connect it to vvvv.

The Phidgets light sensor reference manual states 3.3 or 5V level readings, a very easy job to poll with any Arduino and very much affordable if you’d still have to buy the Arduino. If only for the next development stage ;)

im using card from interface-z. works great .

they have also with RJ45 output

ok that is in french, but a google translation may real ly make it readable… ;-)

Thanks for the replies, the interface-z looks very interesting. Due to noone involved int he project having any spare time its may be something we’ll have to implement at a later date.

thanks again

D

hi digipic. interface z are true Midi generating, so , no implementation to do ;-)