We just received a shipment of 110, 120 and 130 Lumen 119 Nichia LEDs. I decided I wanted to try them out, so I replaced 48 of 60 of the LEDs in a Harbor Freight 60 LED solar security light. The replacement took about 30 Minutes to complete.
The Nichia 119 LEDs are available at a very low price here:
Here is a picture of the board with ten of the LEDs replaced (see red circle in picture):
The LEDs circled in red are newly replaced with 110 Lumen Nichia 119 LEDs
Here it is being tested with the first ten LEDs
Nichia 119 ten LED test
Here it is with 48 of the LEDS replaced, I had to turn the ISO way down to 64 and exposure to 1/210th of second on the camera to keep it from overloading the CCD as you can see in the next two images.
I had to turn the sensitivity of the camera way down to get this image
I can feel heat coming off of the LEDs when this is on now. Wow is it bright!!!! (camera ISO setting at 200, still pretty low, exposure was 1/70th second)
Camera overwhelmed by super bright output.
J
As an addition to my previous post Product Road Test: MSP430 Launchpad Value Line Development Kit I decided to try and interface a SHT15 Temperature and humidity sensor to the MSP430 Launchpad. This code change took about 30 minutes and the HW change took about another 30 minutes, see the code at the bottom of this post. The nice thing is I still have six IOs left, I think I might just try to add an SD card next to datalog the temperature and humidity
To see a larger image, click image then click image on the next page (some wordpress thing I have yet to figure out)
SHT15 Sensor on MSP430 Launch pad with 16×2 LCD
I used the SHT15 library for the Arduino library from the website , the library can be downloaded here
Just copy the library to where you have Energia installed, for example my install is on my desktop so here is the path to where I copied the SHT1x library: C:\Documents and Settings\me\Desktop\energia-0101E0008\hardware\msp430\libraries\SHT1x
The code (consumes 7478 Bytes) is here:
Download the code by clicking here, then click on link on the next page (once again wordpress issue): Demo_code_4
The below code will not paste into the IDE you get carriage returns and other stuff that keeps it from compiling, it is here for you to examine. Thanks to the wonderful posts at website which I had to translate to find the errors.
/*
The circuit:
=================================
LCD pin Connect to
———————————
01 – GND GND, pot
02 – VCC +5V, pot
03 – Contrast
=================================
SHT15 SENSOR Connect to
———————————
GND GND
DATA P2_5 then 4.7K to VCC
SCLK P2_4
VCC VCC (should have 0.1uF ceramic to gnd, I did not do this)
=================================
*/
// include the library code:
#include <LiquidCrystal.h>
#include <SHT1x.h>
// Specify data and clock connections and instantiate SHT1x object
#define dataPin P2_5
#define clockPin P2_4
SHT1x sht1x(dataPin, clockPin);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(P1_4, P1_3, P1_1, P1_2, P1_6, P1_7);
//used in temperature and humidity
float temp_f;
float humidity;
// used in elapsed_time
unsigned long lastSecond = 0;
int secs = 0;
int mins = 0;
int hours = 0;
//end elapsed_time vars
/// end vars
void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
//lcd.print(“F:”);
lcd.print(“F: H:”);
lcd.setCursor(0, 1); // set cursor location on LCD
lcd.print(“Elapsed:”);
}
void loop() {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// measure SHT15 temperature and humidity then display
temp_f = sht1x.readTemperatureF();
humidity = sht1x.readHumidity();
lcd.setCursor(2, 0);
lcd.print(temp_f);
lcd.setCursor(11, 0);
lcd.print(humidity);
lcd.setCursor(15, 0);
lcd.print(“%”);
/////// end temperature display
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// elapsed time to display
if(millis() – lastSecond >= 2000) ///just in-case something took more than two seconds, should not happen??
{
lastSecond += 2000;
secs++;
secs++;
}
if(millis() – lastSecond >= 1000)
{
lastSecond += 1000;
secs++;
}
if(secs > 59)
{
secs = 0;
mins++;
}
if(mins > 59)
{
mins = 0;
hours++;
}
//place hours in correct position
if( hours <= 9 )
{
lcd.setCursor( 12, 1 );
lcd.print( hours, DEC );
}
else if( hours <= 99 )
{
lcd.setCursor( 11, 1 );
lcd.print( hours, DEC );
}
else if( hours <= 999 )
{
lcd.setCursor( 10, 1 );
lcd.print( hours, DEC );
}
else if( hours <= 9999 )
{
lcd.setCursor( 9, 1 );
lcd.print( hours, DEC );
}
else if( hours <= 99999 )
{
lcd.setCursor( 8, 1 );
lcd.print( hours, DEC );
}
// do minutes
lcd.setCursor( 13, 1 );
lcd.print( “:” );
if( mins <= 9 )
{
lcd.print( “0″ );
}
lcd.print( mins, DEC );
///// end of elapsed time
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
A couple of years back I had ordered a few of the MSP430 Launchpad development kits with many ideas in my head about some of the great things I could make on a low cost micro-controller development board at only $4.30 who can complain. I took the first one out of the box and started to bang away. I was a PIC processor guy so I had to learn new stuff and there really was not much out there for demos and code examples other than blink LED code and lots of stuff I was not interested in trying out. I spent about a week at it and developed a temperature monitor that read back values from the internal temp sensor that you could read from a serial port. Using the Code Composer Studio was also a learning experience, it took a long time to figure out how the IDE worked. The memory space was limited to 2K with the MSP430G2231 and MSP430G2211 that were included in the kit. All and all the kits were a great value but I did not want to waste my time, so I shelved the other kits that I bought.
The other day Newark Element 14 asked the Mad Scientist Hut to run a product road test for a Development Kit , I agreed to try out the MSP430 Launchpad since I wanted to see if there are any improvements to the value line Launchpad. I received the new kit and opened it up, I was really excited to see that they had put a M430G2253 and M430G22452 in the kit, 16K and 8K of memory respectively and several more IO pins, they still included the 32KHz crystal for real time clock applications and they still include the USB cable.
In my opinion there has been a major development in making the Launchpad one of the best values for a micro-controller development kit than it has ever been, and that is because now there is an Arduino like IDE for the Launchpad that is mostly code interchangeable with Arduino called Energia. Energia is a fitting name since it was the name of the Russian rocket designed to carry the Russian version of its space shuttle to orbit. I downloaded the software for Energia and started to dable with it, I was really impressed. Wow! I developed the code that took me a week in just two hours using Energia, but with the addition of an LCD display and I also added a elapsed time counter. To get started with Energia click this: Getting started with Energia This link has a nice quick start guide that will have you blinking and LED on the launchpad in just a few minutes.
To get started with the Launchpad kit, you can get them from Element 14 for just $4.35 each click here: MSP430 Launchpad
Update: I added an SHT15 temperature and Humidity sensor, see this post
.
Here is the code (consumes 6804 Bytes), it uses the internal temperature sensor to measure temperature in degrees F, and calculates the elapsed time (HHHHHH:MM) since power up then displays it to the LCD:
Download the code by clicking here, then click on link on the next page (once again wordpress issue):Demo_code_3
The circuit:
=================================
LCD pin Connect to
———————————
01 – GND GND, 10K pot
02 – VCC +5V from next to the USB port, 10K pot
03 – Contrast 10K
=================================
*/
// include the library code:
#include <LiquidCrystal.h>
/// Vars used in code
long sensorValue = 0;
int Temp_Gain = 1000; /// gain error (x10*-1.0)+1000 I.E.> if error = -0.5% Temp_Gain = 1005
int Temp_Offset = 0; /// offset error /10 I.E.> if error = 2.1 degrees Temp_Offset = 21
long FValue = 0;
float FValue1000 = 0; // using float here uses a lot of flash mem, this can be converted to long and then some tricks can be done on the display output, but I have lots of flash for this demo…..
void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
lcd.print(” Temp F:”);
lcd.setCursor(1, 1); // set cursor location on LCD
lcd.print(“Elapsed:”);
////////////////////////////////////////////////////////////////////////
//// measure internal temperature and display
FValue1000 = 0;
for (int count = 0; count < Temp_Gain; count++)
{
ADC10CTL1 = INCH_10 + ADC10DIV_3; // Temp Sensor ADC10CLK/4
ADC10CTL0 = SREF_1 + ADC10SHT_3 + REFON + ADC10ON + ADC10IE;
TACCR0 = 30; // Delay to allow Ref to settle
TACCTL0 |= CCIE; // Compare-mode interrupt.
TACTL = TASSEL_2 | MC_1; // TACLK = SMCLK, Up mode.
LPM0; // Wait for delay.
TACCTL0 &= ~CCIE; // Disable timer Interrupt
ADC10CTL0 |= ENC + ADC10SC; // Sampling and conversion start
__bis_SR_register(CPUOFF + GIE); // LPM0 with interrupts enabled
sensorValue = ADC10MEM; // store the ADC10 value
FValue=(((sensorValue) – 630) * 761) / 1024; // do math on ADC10 value to convert to degrees F
FValue1000 = FValue1000 + FValue; // store value (this is how we can apply gain to the measurement)
}
FValue1000 = (FValue1000/Temp_Gain); // do gain error
FValue1000 = FValue1000 + Temp_Offset; // do offset error
// location formating
lcd.setCursor(11, 0); // set cursor location on LCD
lcd.print(” “); // clear area to write the temperature
lcd.setCursor(11, 0); // set cursor location on LCD
if (FValue<=10.0)
{
lcd.print(” “);
}
else if (FValue<=100.0)
{
lcd.print(” “);
}
lcd.print(FValue1000);
//delay(100);
/////// end temperature display
/////////////////////////////////////////////////////////////////////
///// end of elapsed time
I built a tachometer for the milling machine, as a step in giving the cnc controller full spindle control (auto-change with tool change, and sense when it’s stalling.) The first version uses an arduino and this code:
The sensor is a mouse encoder wheel LED/phototransistor pair, with a turned aluminum disc that has a hole drilled in it, as the encoder itself.
(You may ask why I’m not using an AS5040. That’s the wrong tool for the job, since it senses position rather than just rotation, and the encoder wheel I just cut fits right on the hollow mill spindle, which provides no easy place to put a magnet.)
Anyway. The arduino code works fine. The schematic, however, has a problem: if you wire it up just as this says, the phototransistor output is always at about Vcc: the analog input to the arduino measures between 1017 and 1023 no matter how carefully you block the phototransistor.
But the moment you go to measure the voltage coming off the phototransistor with respect to ground, it works perfectly: any bit of anything blocks the lightbeam and the output goes to a fraction of a volt.
The meter’s input impedance drags down the output and makes it work. It’s hard to troubleshoot something that works when you’re measuring it, and only doesn’t work when you’re not measuring it.
A 1 megohm resistor between the output and ground makes it work great.
optical tachometer schematic
Tomorrow I’ll add an LCD rather than having to keep a laptop in there to see the RPM, and a bit later I’ll turn the whole thing into a standalone board on the back of the LCD, but for the moment this will do.
Copyright © 2014 Mad Scientist Hut Blog - All Rights ReservedPowered by WordPress & the Atahualpa Theme by BytesForAll. Discuss on our WP Forum
23 queries. 0.437 seconds.