Mad Scientist Hut Blog
The Forums The Blog Lyons Cam About us Contact Products
  • Product Pipeline
  • Daily Blog
    • MISC
      • Basic Circuits
  • Joule Thief
  • 3-Axis G Sensor
  • Geiger counter
  • Ion Chamber (Radiation Detector)
  • MSP430
 
  Older Entries »

A Very Nice Steam Engine Powered Carousel Project That Uses The Joule Thief

By Kirk, on September 26th, 2012




Jerry built this great little home made steam engine and the carousel that is powered from the steam engine.  He posted a video of it in operation on you tube. He runs the Carousel and a little generator from the steam engine, the generator is putting out ~900mV that is then boosted using a Mad Scientist Hut Joule Thief board that lights some LEDs that are around the Carousel.

Jerry repairs old vacuum tube radios. If you are in need of getting an old vacuum tube radio back in functioning condition just send me an e-mail at madscientist@madscientisthut.com I will be sure to forward your request to Jerry.

Here are some of the still shots of the carousel in development: ( To see a large format picture, click the picture on this page then on the next page click the image there and the next page will open a full size picture)

Jerry's Carousel pic1

 Jerry's Carousel pic

Jerry's Carousel pic3

Jerry's Carousel pic4

Jerry’s Steam Powered Carousel with Generator and Joule Thief Boost


2 comments - (Comments are closed)   Daily Blog, Joule Thief   energy harvest, energy harvesting, energy harvestor, Joule Thief, Joule Thief Circuit, Joule Thief Kit, Joule Thief PCB, joules thief  

MSP430 Launchpad using a SHT15 and a 16×2 LCD Display

By Kirk, on August 26th, 2012

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 16x2 LCD

SHT15 Sensor on MSP430 Launch pad with 16×2 LCD

 

 

 

 

 

 

 

 

 

 

I used the SHT15 library for the Arduino library from the website http://www.practicalarduino.com , the library can be downloaded here https://github.com/practicalarduino/SHT1x

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

To see a larger image, click image then click image on the next page (some wordpress thing I have yet to figure out)

SHT1X library location in Energia

 

 

 

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 www.hobbielektronika.hu 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        Pot wiper
04 – RS              Pin8 (P1.4)
05 – R/W             GND
06 – EN              Pin9 (P1.3)
07 – DB0             GND
08 – DB1             GND
09 – DB2             GND
10 – DB3             GND
11 – DB4             Pin10 (P1.1)
12 – DB5             Pin11 (P1.2)
13 – DB6             Pin12 (P1.6)
14 – DB7             Pin13 (P1.7)
15 – BL+             +5V
16 – BL-             GND
=================================

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
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

}

 

Comments are closed   Daily Blog, MSP430   Energia LCD Temperature, Energia MSP430, Energia SHT15, Launchpad SHT15, Launchpad Temperature and Humidity, MSP430, MSP430 SHT15  

Product Road Test: MSP430 Launchpad Value Line Development Kit

By Kirk, on August 26th, 2012

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 http://madscientisthut.com/wordpress/?p=1430

To see a larger image, click image then click image on the next page (some wordpress thing I have yet to figure out)

MSP430 Launchpad displaying internal temperature and elapsed time

.

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 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 www.hobbielektronika.hu website which I had to translate to find the errors.

/*

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  Pot wiper
04 – RS              Pin8 (P1.4)
05 – R/W             GND
06 – EN              Pin9 (P1.3)
07 – DB0             GND
08 – DB1             GND
09 – DB2             GND
10 – DB3             GND
11 – DB4             Pin10 (P1.1)
12 – DB5             Pin11 (P1.2)
13 – DB6             Pin12 (P1.6)
14 – DB7             Pin13 (P1.7)
15 – BL+             +5V
16 – BL-             GND
=================================

*/

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(P1_4, P1_3, P1_1, P1_2, P1_6, P1_7);

/// 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…..

// 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(“  Temp F:”);
lcd.setCursor(1, 1);  // set cursor location on LCD
lcd.print(“Elapsed:”);

}

void loop() {

////////////////////////////////////////////////////////////////////////
//// 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
/////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// 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

}

Comments are closed   Daily Blog, MSP430   Energia, Energia LCD Temperature, Energia MSP430, Internal temperature sensor M430G2553, MSP430  

Lessons in measurement error

By john, on March 24th, 2012

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: http://arduino.cc/playground/Learning/Tachometer

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

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.

 

Comments are closed   Daily Blog, MISC   Arduino tachometer  

usb sniffing using wireshark

By john, on March 24th, 2012

A while back Kirk gave me a webcam that has pan and tilt control. It works well under Windows. But I’m a masochist — and I already have a weather station + insolation + multiple temperature measurement setup for an old linux laptop, and I thought it’d be nice to add a pan&tilt webcam to the mix.
The webcam is a Creative Live! Motion cam. It uses a standard ccd for which drivers are included in the mainline kernel so camorama et al can get video from it natively. But that doesn’t handle motion.
Soooo I fired up wireshark, preparing to copy these guys:

http://techblog.vsza.hu/posts/Reverse_engineering_chinese_scope_with_USB.html

who reverse-engineered the screendump program for an oscilloscope (and found that the scope actually dumps a nice full-color high-resolution screencap that the stock software degrades to a small monochrome picture.)

So I installed XP in virtualbox, installed the cam drivers in XP, and fired up the camera.
Problem 1: no USB. I solved this by running virtualbox as root.
Problem 2: XP crashed the moment I tried to do anything with the camera. I solved this by starting virtualbox as root, and doing the whole XP install from that — just copying over a VM made as a user didn’t do it.
At this point the camera is stable in XP.
Problem 3: wireshark crashed the camera connection. As soon as wireshark came up, the USB stream got broken.
My friend Brian pointed out that other people have had problems with old versions of libpcap, upon which wireshark relies. Turns out even recent versions of Ubuntu and Mint have wireshark packages from 2007.
Independent repositories to the rescue: ppa:jelmer/daily will provide you with (as of right now) wireshark 1.4.2 rather than the stock 0.9 and that has a libpcap that works beautifully.
So now I can drive the video camera around, taking pictures, and logging usb commands. I can look through the packets — ignoring the 64kbyte ones, that are just chatter between the computer and the camera and analyzing the packets that are larger than that — and start figuring out how I can copy them.

That’s as far as I’ve gotten so far, because now I’m learning how to use wireshark’s filters so I can have it show only the differences between sequential packets.

Comments are closed   Daily Blog, MISC   USB Sniffing, wireshark usb  

Expanded Scale Analog Meter Circuit

By Kirk, on February 25th, 2012

I am putting in a small scale solar system with a 24VDC flooded lead acid battery bank for back up power. I want to make a low power consumption expanded scale analog meter circuit to monitor the battery bank voltage of my system. The expanded scale allows me see the voltage range that I am most concerned about between 21V to 30V and that gives me about three times the resolution on the meter face.

 

While searching for circuit ideas I found this website “The Back Shed” and I liked the simplicity of the circuit that they presented on their site (this is the circuit from their site). I tried to make the circuit but found that the response was not very linear.

 

 

 

 

 

The problem with this circuit is that the current going through the Zener diode changes as the voltage input to the circuit changes (I=V/R) because it uses a simple resistor current limit.

Zener diode voltages are specified at a set current in the datasheet. In this Zener diode curve, Izt is the current where the Zener voltage Vz is specified, if you change the current through the Zener diode the voltage changes.

Zener Diode Curve

Zener Diode Curve

 

 

 

 

 

 

 

 

 

 

 

I wanted an expanded meter with a fairly linear response. So after thinking about the linearity issue with the Back Shed circuit and how it was related to the current changing in the circuit, I decided to revisit our old friend the current limit circuit I blogged about previously.

I modified the current limit to pull about 1.5mA through the circuit and added Zener diodes in place of the LEDs.

Expanded Meter Circuit

Expanded Meter Circuit

(To get a larger image, click image, then click image on the following page) So here is how this circuit works: For voltages below 21V the Zener diodes are off and there is no current flowing in the meter path of the circuit. Somewhere around 21V the Zener diodes crack over their knee voltage then current starts flowing in the circuit. The current limit circuit turns on and starts to drop voltage across the 2N7000 NMOS FET. As the voltage going into the circuit rises the current limit circuit causes the NMOS to drop any voltage not going through the Zener and current sense resistor. The Zener diodes drop a fairly constant voltage in this circuit because the current limit circuit is holding the current at a fairly constant rate. Since the 10VDC panel meter is measuring the Voltage across the NMOS it displays any voltage over ~21VDC on the meter face. The battery bank voltage should not go over 30VDC , unless there is something wrong with the charge controller, so hopefully we never see the meter at 32V.

(Note: instead of the 400 Ohm resistor in the schematic I used a 1K trim pot in series with 200 Ohms) (Also for the meter I bought a cheap 10VDC panel meter from E-bay, $5.99 including shipping)

This circuit still has the drawback of the temperature coefficient (TC) of the Zener and also the temperature effect of the VBE on the transistor that will have an over all effect on the accuracy with temperature. The temperature error is a very small (around 0.08%/degree C, for a change in room temperature of 65F to 75F you would see an error of less than 0.1V) and that small of an error really does not matter to me. If you are concerned with having a more accurate meter over a large temperature range, you can use a combination of Zener diodes with a positive and negative TC. An example would be to use four 1N5222B (TC=-0.085%/C) and a 1N5242B (TC=+0.077%/C) .

I took the 10VDC panel meter apart and scanned the face in on a flat bed scanner at 600DPI then modified the the scan with GNU Image Manipulation Program (GIMP) and reprinted it at 600 DPI onto a shipping label sticker. Placed the sticker onto the meter face cut the edges of the sticker off then put the meter back together. The following picture was the first pass:

Expanded Meter Face Rev1

Expanded Meter Face Rev1

 

 

 

 

 

 

 

After I put the circuit to the meter I found it was a little off ( this is was really no surprise, since Zener diodes are +/-5%, but it was a lot closer than I expected) so I had to calibrate the meter with one more graphic spin in GIMP. To calibrate the meter face with the actual DC voltage reading. I put the expanded scale meter in parallel with a digital multimeter, made little tick marks on the meter face for the voltages.

Meter Face Calibration

Meter Face Calibration

 

 

 

 

 

 

 

 

I ended up with a graphic like this.  ( Note: I highlighted the 28.8V mark since this is where my charge controller will push the battery bank to at the bulk charge phase) ( the 30VDC mark is also important for when I equalize the battery bank)

Final Expanded Scale Meter Face

Final Expanded Scale Meter Face

 

 

 

 

 

 

 

 

And here is picture of the meter hooked up with a power supply and a DMM to verify operation.

Expanded Meter in Operation

Expanded Meter in Operation

Comments are closed   Basic Circuits, Daily Blog   24V solar meter, analog expanded scale meter, expanded scale meter, expanded scale panel meter, green energy, low power 24VDC solar meter, solar battery bank meter, solar system meter  
 
  Older Entries »

Blog Search

Blogroll

  • EEweb Forum
  • Subscribe to the Mad Scientist Hut RSS feed

Archives

Copyright © 2013 Mad Scientist Hut Blog - All Rights Reserved
Powered by WordPress & the Atahualpa Theme by BytesForAll. Discuss on our WP Forum

23 queries. 0.317 seconds.