Recently in Electronics / Controllers Category

Here's some simple code for the Seeeduino Stalker that can optionally reset the RTC and then prints the current time. It's not well-speced but the Stalker uses the standard DS-1307 real-time clock (RTC) so all the routines that use that library should just work plug-n-play:

 

#include <Wire.h>

#include "Time.h"

#include "DS1307RTC.h"

void setup() {

Serial.begin(9600);

// the next two lines can be removed if the RTC has been set

// setTime(6,51,0,6,8,10);

// set time to 17:05:00 1 Mar 2010 (see below)

// RTC.set(now()); // set the RTC to the current time (set in the previous line)

// format for setting time - setTime(hr,min,sec,day,month,yr);

setSyncProvider(RTC.get); // the function to get the time from the RTC

}

void loop() {

Serial.print( "The time is ");

 

Serial.print( year() );

Serial.write('/');

 

Serial.print( month() );

Serial.write('/');

Serial.print( day() );

Serial.write(' ');

 

Serial.print( hour() );

Serial.write(':');

Serial.print( minute() );

Serial.write(':');

Serial.println( second() );

}

Just a note to myself: the power connector on the Seeeduino (Arduino clones) is a JST XHP-2 connector.  It's not indicated on the specs.

seeeduino2123.jpg

This is connector #5 on the photo above.

I wanted to hook up a HD44780 LCD panel to my computer to use as a display via the LCD Smartie program.   The HD44780 displays are quite cheap on ebay (~$10) but the dedicated LCD displays that are sold for use with LCD Smartie are quite expensive (~$30).

In the spirit of hacking, I wanted to make my own hookup since I have plenty of HD44780 displays lying around because of my Arduino work.

The LCD Smartie site has a page showing the hookup from the DB25 parallel port on the rear of your computer to an HD44780.

 

lcd44780.gif

However, my cheapo Biostar motherboard doesn't have a rear DB25, only a 25 pin JPRNT1  header (a 2x13 male pin header) on the motherboard itself.  And surprisingly, there isn't any information on the web what the pinout on the JPRNT1 header is.  After much scrounging, I finally found a cached version of a single moribund  site that had the info:

 

ParallelPortHeader.png

Comparing with the DB25 layout, it looks like there is a 1:1 correspondence with the pins on the header and the pins on the cable, with the exception that the JPRNT1 header is 2x13 and not 13+12.  If you look at the header above, the numbers go:

2 4 6 8 10 12 14 16 18 20 22 24 nc
1 3 5 7 9 11 13 15 17 19 21 23 25

 

ParallelPort.gif

Just so that this info doesn't disappear from the ether, I'm keeping things cached here.

An anonymous poster criticized my use of LM317 chips as current regulators for high-power LEDs. While I think they are great for 350 mA single LEDs, they are clearly inappropriate for the 12 watt LED that I was playing with.

My LED was taking around 800 mA @ 12 volts. A little searching around reveals that a good alternative is the AP8803 which is a LED buck driver which can handle 1 amps @ 8-30 volts. The nice thing (aside from its 92% efficiency) is that you can set up a dimmer circuit on it using minimal parts -- or PWM control from a microcontroller.

This is entirely for my own archival purposes but it seems that the old Ipod with Video has different pinouts on its headphone (+AV) jack than other PMPs. Here's a useful diagram from http://www.anythingbutipod.com/

av-pinouts.jpg

Anderson Connector Meltdown

| | Comments (0)

I had hooked up one of my larger SLA batteries to a winch to move some logs around. I thought that the 30 amp PowerPole connectors on the battery leads were maybe a bit undersized for the winch, but was lazy and went with them anyway.

P1050256.jpg


I originally thought one of the PowerPoles wasn't properly seated and it melted down. That's perhaps one of the problems with the small PowerPoles, there isn't a clean "click" confirmation of seating.


P1050257.jpg

Closer examination of one of the melted PowerPoles showed however that the tongue that grips the connector had arcing on it; obviously it had shorted and overheated, causing a melting of the connector. Very strange.

P1050258.jpg


Closer examination of the crimped connector showed that the connector itself was bent upwards. What I now think happened was that the main body of the plug was bent and not seated in the plastic case, and this caused the mating connector's plug to wedge itself between the tongue and the plug (instead of on top of the plug), causing sparking and overheating.


Well, my favorite discrete component of the week has to be the lowly LM317 voltage/current regulator. As one of my previous posts showed, I'm using it to current regulate some high power LEDs and I also use it as a voltage regulator.

Here's the quick and easy way to wire up an LM317 as a voltage regulator:

lm317-diagram.jpg

where the values of R2 and R1 are calculated as follows to give Vout:

lm317-eq.jpg


R2 is usually set to 240 ohms and you can ignore Iadj to a point. Rearranging the equation gives you:

R2 = 192 * V - 240

So if you want a 5 volt output, then R2 = 720 ohm (and R1 = 240 ohm). The TO-220 form factor of the LM317 that I'm using can provide up to 1.5 amps of output current and can be paralleled if I need more.

Late update: or you can just use an online calculator: http://www.jlab.org/~hansknec/index.html

DealExtreme is one of my favorite online stores. It's a distributor of inexpensive electronic gadgets based in China. I'm always finding something new there. The latest treasure is this little-but-very-bright bare LED: 10WattLEDsku_5876_1.jpg

DealExtreme lists it as a 10 watt LED (SKU 5876). Unbelievably it's just under $12 with shipping included!

Looking at the die shows that it is 9 discrete high-powered white LEDs in a single package. DealExtreme is bad about specs, but the comments in the DX forum seem to suggest that 700 mA at 12 volts is a reasonable spec for this LED. This would yield 8.4 watts.

(I'm wondering though if it isn't 3 x 350 mA @ 3.5 serial LEDs in a 3 parallel strings, which would be 1050 mA @ 10.5 volts. But for now, I'll run it at 700 mA).

DealExtreme lists it as 500-600 lumens @ 6500K color temperature.

As with most LEDs, you need a good current regulated driver circuit since you can't just run these things off a resistor. I decided that the easiest and simplest driver would be one based off the amazingly versatile LM317 chip.

As before, these sites have good javascript based circuit diagrams for calculating LED driver circuitry:

Plugging my values (700 mA) into them yielded the need for a 1.8 ohm resistor with my LM317. Here's the schematic that I designed around those figures (courtesy of ExpressPCH):

Schematic

Bodged together and plugged into a li-ion pack from my model helicopter and voila, an amazing amount of light. I'm thinking of using it on the headlight of my Piaggio (which currently uses a 3-watt LED) or to replace the bulb on my old 15-watt Niterider headlight, which has seen happier days.

10WattLEDsku_5876_1.jpg

(More photos and photometric testing after the jump)

Here are some of the magazines that I've been reading recently in my quest to beef up my robotics / electronics skills (disclaimer: Amazon referral codes embedded):

Amazon is also offering $5 off eligible subscriptions until Jan 31st, so now is a good time to bite!

Happy new year! A new decade!
WhiteLED-5mm.jpg
I've been playing with LEDs for my EV and robotics projects. It doesn't seem to make sense to use incandescent bulbs in an EV build -- it'd ruin the whole concept of going green.

LEDs are tricky to deal with though, especially the high-output "star" type LEDs that are emerging. Rather than voltage regulation, you have to regulate the amount of current that goes through them. This isn't fixed, because as an LED heats up, its resistance goes down (unlike an incandescent filament whose resistance goes up as it heats up, thus self-regulating). If it gets too hot, it goes into thermal runaway and you soon have what ledophiles call a Dark Emitting Diode (DED) -- dead, get it?.

So, you need some form of a current regulating system. For small 3mm or 5mm LEDs, people just use a fixed resistor since the current demand is rather small, around 20 ma. This limits the maximum current that can go through -- but it also limits the max brightness because you have to put in a safety factor and you can't easily adjust for fluctuating voltage.

Here's a good javascript calculator for series/parallel LED resistors:

http://led.linear1.org/led.wiz

The problem with 5mm LEDs is that the clear plastic casing limits the amount of heat that the LED can output (and yes, LEDs do produce waste heat, although not as much as incandescent lights). Heat control is one of the main factors affecting the output of LEDs and the reason why manufacturers went to the star configuration, which allows you to directly back the LED with a heatsink -- which lets the LED current jump from 20 mA to 350 mA with a concomitant light output.


WhiteLED-Cree.gifNow, if you want to use a high output Luxeon or Cree star, you also have to current regulate as mentioned before. The typical white high-output LED takes 350 ma with a forward voltage drop of 3.5 volts. With a light output of 120 lumens, this is good enough for a moped, scooter or bicycle headlight.

Cree even has a high-power star that consists of four of their 120 lumen LEDs mounted on a single die. This produces 480 lumens, although you'll need to regulate four x 350 ma. There are other stars that bundle 2 x 120 or 3 x 120 lumen LEDs. More than enough to blind you -- or for a car or motorbike headlamp.

For high power LEDs, the LM317 seems a good choice for current regulating at a low cost. Here's a good javascript calculator for that:

http://diyaudioprojects.com/Technical/Voltage-Regulator/

and some more info on why current regulation is necessary:

http://users.telenet.be/davshomepage/current-source.htm

About this Archive

This page is a archive of recent entries in the Electronics / Controllers category.

Electric Vehicles is the previous category.

Lighting is the next category.

Find recent content on the main index or look in the archives to find all content.

Recent Assets

  • av-pinouts.jpg