Create a mask with UV sensor
Posted: Tue Aug 11, 2015 8:29 am
I thought I'd start a new topic to make this easier to find. Plus it's a bit long winded. This will be a bit of hardware and a bit of software. It will be a few posts and I recommend you read through them all before charging in.
First off the hardware used:
Arduino Duemilanove or Uno, you could use another Arduino or Raspberry PI but the code I'll upload will work straight away with the Duemilanove or Uno or a knock-off of your choice.
SainSmart 16x2 LCD with Keypad shield, once again there are other ways to go about this but this is what I had so it if you want the easy plug and play this is the go. Also very cheap. Make sure you get one you can solder headers on to.
ML8511 UV sensor breakout board. Mine is a sparkfun but cheaper versions can be found if you can wait for it to come from china.
If you buy name brand you're looking at around $45 for these 3 pieces. If you go ebay knock off you can easily be waiting for your mail for under $20
On top of this you'll need some headers to solder on to the LCD shield and the ML8511 breakout and some jumper wires. There is on slightly (very) tricky bit of soldering the way I did it but this could be avoided with a small breadboard.
First step is to do a little bit of soldering. Solder the headers on to the breakout board. On the LCD shield you will need to solder a header on to the holes that correspond to pins A1, A2, the 3.3v source pin and a ground pin. I chose to solder 3 header pins on to the 3.3v output as you need to connect 3.3 volts to three things. If this seems a bit tricky for you, you can solder one then run a jumper to a breadboard then run the 3 wires from the bread board.
Now it's time to wire it up. You will run jumpers from the 3.3v pin on the LCD shield to pin A2, the 3.3v pin on the ML8511 and the EN pin on the ML8511. A jumper from ground on the LCD shield to ground on the ML8511 and finally a jumper from A1 to the OUT on the ML8511.
Next its time to load the sketch in to the Arduino. Open up the UV_Sensor sketch and plug you Arduino in to your computer. Make sure you have the right type of board and processor selected and the proper COM port under the tools and hit up load.
You should be ready to go. The Screen should read "Position 1 Press R to read" If you want to check that it works you can open the serial monitor in the Arduino IDE and press the "Right" (mine actually says "Rigth") button on the shield. The serial monitor should read 192,180,"Some reading" where some reading is the reading from the sensor. If you press the button again it should read 384,180,"Some reading" and on and on.
Attached code as Codebenders is shutting down
First off the hardware used:
Arduino Duemilanove or Uno, you could use another Arduino or Raspberry PI but the code I'll upload will work straight away with the Duemilanove or Uno or a knock-off of your choice.
SainSmart 16x2 LCD with Keypad shield, once again there are other ways to go about this but this is what I had so it if you want the easy plug and play this is the go. Also very cheap. Make sure you get one you can solder headers on to.
ML8511 UV sensor breakout board. Mine is a sparkfun but cheaper versions can be found if you can wait for it to come from china.
If you buy name brand you're looking at around $45 for these 3 pieces. If you go ebay knock off you can easily be waiting for your mail for under $20
On top of this you'll need some headers to solder on to the LCD shield and the ML8511 breakout and some jumper wires. There is on slightly (very) tricky bit of soldering the way I did it but this could be avoided with a small breadboard.
First step is to do a little bit of soldering. Solder the headers on to the breakout board. On the LCD shield you will need to solder a header on to the holes that correspond to pins A1, A2, the 3.3v source pin and a ground pin. I chose to solder 3 header pins on to the 3.3v output as you need to connect 3.3 volts to three things. If this seems a bit tricky for you, you can solder one then run a jumper to a breadboard then run the 3 wires from the bread board.
Now it's time to wire it up. You will run jumpers from the 3.3v pin on the LCD shield to pin A2, the 3.3v pin on the ML8511 and the EN pin on the ML8511. A jumper from ground on the LCD shield to ground on the ML8511 and finally a jumper from A1 to the OUT on the ML8511.
Next its time to load the sketch in to the Arduino. Open up the UV_Sensor sketch and plug you Arduino in to your computer. Make sure you have the right type of board and processor selected and the proper COM port under the tools and hit up load.
You should be ready to go. The Screen should read "Position 1 Press R to read" If you want to check that it works you can open the serial monitor in the Arduino IDE and press the "Right" (mine actually says "Rigth") button on the shield. The serial monitor should read 192,180,"Some reading" where some reading is the reading from the sensor. If you press the button again it should read 384,180,"Some reading" and on and on.
Attached code as Codebenders is shutting down