Part One: [Prior to first presentation]
This project is intended as a test of a wearable light sensor system that can detect and make use of ambient light data around the wearer.
Currently this will light a 3D sphere in processing using the serial communications library.
The code is designed in a modular way so that further wearable sensors can be used in tandem with this one and allow for a combined analysis of ambient data.
The initial prototype uses photoresistors and gathers data from left, right and back sides of the body. In the next version I intend to use light to frequency converters as they will provide far more accurate data.
The integration of the light to frequency converters was quite challenging. The data they provide required the use of an Arduino frequency library in order to create an understandable set of data that doesn’t overload serial communication.
The way these converters work is by sending a signal at a different frequency back to the arduino based on the level of light. If the light detected by the sensor is high, the frequency is high. If the level of light is low, the frequency is low. That sounds pretty basic at first, and I was considering this as a plug and play sensor when I purchased it.
Quite a bit of work needed to be done before the sensor could actually become usable, due to the incredibly high frequencies that it went up to. Sending that data via serial required it to be cached and converted via another library. Unfortunately the best one was hard coded [Quite heavily] to digital pin 5 on the Arduino for input. I left a question for the developer of the frequency library but unfortunately I didn’t get a chance to get a decent answer before I finished this project. And it was finished with a rather impractical solution!
Yup, three Arduinos. This is where I became very happy for starting with serial communication from the beginning. Adapting my code from the very first part became nearly as simple as running it thrice, once for each sensor. And have the processing sketch just look at the serial output based on an ID that preceded each tweet.
The output of the processing sketch did not change at all, save for it being far more precise when reflecting the ambient light coming from each of the sensors. The frequency readings had an incredible range [From millions to double digits!], and the library converted them into usable values and at constant intervals.
I had to run another wire as the cable only provided enough for the three standard Photoresistors. There is some soldering for a resistor, but I am not sure how necessary it was.
Overall I am really surprised at the quality of the data, I am really upset about having to use three Arduinos. And will be looking into the library itself in order to make it more dynamic for other pin possibilities.
Some notes during the process: Windows is a pain with UNO and serial. It seems that ether the driver or windows internals end up failing after a while. And require a complete system restart. What I mean by that is the Arduino stops being recognized, even if unplugged and plugged in again after a prolonged serial session, although sometimes just at random. It makes it really hard to develop as I am in constant fear of having to restart, and end up having to test after major changes only. Luckily, it ether doesn’t happen with the Leonardo [After I figured out how to get it to talk to serial at all!] or I was just lucky.
The light to frequency converter has a TINY form factor, it is smaller than a decent photo resistor. I am looking forward to integrating them into my future work. Particularly for the wearable work in my upcoming thesis project.
Big thanks to Erin Lewis for helping me with the Leonardo Serial changes!
The nice thing about having friends who can read your blog is that they can point out what is missing. And say vital things like “So what does this actually do”!
To give a better overview of what this is for:
The set of sensors, situated on the neck and shoulders, constantly collect the ambient light data from the back and sides of the body. The concept is to create a device that is fairly accurate, and to demo the output of the device on a 3D sphere on a monitor.
The sphere is lit by using three spot lights in Processing, and the lights react directly to each sensor. Sensor data is mapped to a range between 0 and 255 which is then used for the RGB color values.
The output can be later adapted into any task that requires ambient light data from around you. Maybe a full body rendering, or proper lighting correction when being filmed, it is designed to be adaptable.
-Sphere picture incoming ASAP-