Step 1: Design Your Sensor
Step 2: Getting the Parts for Your Sensor
1. Detector: for a sunphotometer ($0.5), you can simply use a green LED which measures the solar intensity at about 0.5um. You can also get a UVA sensor for about $5 which is what I got from some web site. I also tested the device using thermisters which are pretty cheap for measuring body temperatures. The sensor choice is only limited by your imagination and price.
2. Microcontroller ($1): I choose Attiny45 because it is cheap, small, and does the job. It has ADC channels. It lacks a serial interface but I was able to manage to do it with software implementation so it can send data to the Bluetooth. I can make the .hex file available for those who are interested.
3. Voltage regulator ($0.5): I choose 78L33 which provides 3.3v for the Bluetooth module and the Attiny45 is also happy.
4. Battery: Any battery with voltage above 5v should be ok but I choose a 9V common type for easy handling.
5. Breadboard ($8) or PCB ($4): Initially you probably want to use a breadboard to save you a lot of headaches from soldering etc. A small PCB works fine of course if you are good as soldering. Both are RadioShack parts.
6. A plastic box: I choose a plastic light switch box from Homedepot for about one dollar.
7. Bluetooth module: I choose HC-06 or HC-07, which costs about $8 each at dealextreme.
7. The android App "Sensor View" which costs $0.99.
8. Some wire (Free): I just use the old phone wire. Who need the analog phone now a days.
So the total cost is about $16. Of course your actual cost will vary depending on what you choose.
Now plug everything into your breadboard and it's ready.
Step 3: Connecting Your Cell Phone to the Sensor.
After installation, you start the App and need to configure it as follows:
1) Press the menu button on your android phone (button on the left side) to go to the "Settings". There you can input the calibration coefficients to convert the digital numbers it receives from the sensor to physical units. The calibration uses the following equation:
Y = offset slope* X Quadratic*X^2
Where Y is the physical quantity to be displayed; X is the digital number received from the sensor; Offset, slope, and Quadratic are the coefficients that you need to either estimate or determine based on a calibration. For example, for temperature, you can calibrate it against your body temperature. When you set offset and quadratic to zeros, and slope to 1, you can see what the sensor is producing (as a 16 bit digital number).
After entering these coefficients, you hit return to go back to the display screen.
2) Bluetooth connection: inside the "Sensor View" App, you click the bluetooth connection icon on the top, find the bluetooth module by its ID or name and connect to it. After it's connected. You should start seeing numbers displayed on the screen. The measurements are updated every half a second.