LPC1768 – Sending a Byte output to a port

Just  a Simple code snippet that allows you to send a byte over a 8-bit wide parallel bus when using 32 bit devices such as those based on the ARM architecture.

While programming AVRs this usually would suffice to send a BYTE over a parallel 8-bit wide port.Here’s an avr-gcc example

[sourcecode language=”cpp”]

PORTC = data;

[/sourcecode]

But with the a 32-bit microcontroller For example the LPC1768 from NXP.

Each port is 32 bits wide and in order to send  a byte over an 8-bit section of the 32 bit wide ports

a write to the PIN register of the respective port doesnt work.The Arm cortex-m3 has registers called SET,CLR,MASK and PIN for each of the ports.The purpose of the registers is pretty obvious and for more info refer to the datasheet of the LPC1768 .

now in order to send an 8 bit data over a section of the port beginning at byte number 19

[sourcecode]

LPC_GPIO2->FIOSET |= (data << 19);

data ^= 0xFF;

LPC_GPIO2->FIOCLR |= (data << 19);

[/sourcecode]

sends the data over the 8 bit section of port 2 beginning from pin 19 to pin 26 of the LPC1768.

1.First the pins corresponding to all the ones present in the 8-bit data are set.

2.The data is exored with FF.This sets all the zeroes in the data to ones and all the ones to zeroes

3.Then the data containing the ones in place where the original data had zeroes is used to clear the port.Hence only those pins corresponding to the Zeroes in the data are cleared.

 

 

Steps to include Indian Rupee Symbol Font in MS word applications

Recently the indian rupee joined the elite league of currencies that have their own unique symbol. The symbol is a combination of the devanagri ‘ra’ and also symbolises the roman letter R. the two stokes signifies the tricolour and the progress of the nation. here’s how u can use it in your emails and word documents.

Given below are the steps to use the new Indian Rupee Symbol as a Font in your word applications:

1.       Download the attached font Rupee.ttf or Rupee_Foradian.ttf
2.       Copy the font and paste it in “Fonts” folder in Control Panel.
3.       Open any Microsoft Office application (For E.g., Microsoft Office Word). (See Figure 1.a)
4.       Select the font type as Rupee or Rupee Foradian.
5.       Click on ` (Grave accent) symbol. This key is just above “tab” button in your keyboard. (See figure 2)
6.       You can see the new Rupee symbol in your office application.

Figure 1.a. Rupee Symbol in MS word

Figure 1.b. Rupee Symbol in Gmail application

Figure2. Grave Accent Symbol

Limitations:

The “Rupee.ttf” font is necessary to view the currency symbol. So as long as the new symbol is not encoded in to Unicode font by default,

we cant use the symbol universally.

Thanks to Foradian Technologies for giving these fonts as a free download to public

make a PCB yourself

Making  a printed circuit board (PCB).

  • First cut the copper clad board to size required.
  • Sand the surface of the board to remove the layer of copper oxide that is formed due to the reaction of the copper with the oxygen in the air.
  • Once the copper surface is shiny and clean avoid touching the surface of the copper.
  • Eaglecad or ORCad may be used to design the schematic and the pcb design .
  • Take a mirror image of the pcb design while using the CAM processor to generate the Gerber files .
  • The gerber files maybe viewed online at www.circuitpeople.com or the .eps file maybe viewed offline using the .eps viewer  take a lazer printout of the pcb layout using. this printout will be the mirror image of the actual pcb layout .
  • Since during the transfer process the mirror image of the actual image will be transferred.
  • Now cutout the actual PCB layout on the transperency. this will be the toner transfer
  • .
  • Lightly wipe the toner layer of the toner transfer with a peice of cloth and the surface of the cleaned copper clad. This will ensure that there is no dust or grime between the toner surface and the copper.
  • Place the transfer on top of the cleaned copper clad board.
  • Secure the layout in place with the help of a peice of tape or some glue.
  • Using a hot clothes iron heat the toner transfer so that the toner layer from the tranfer is transferred onto the copper.(set the iron to the highest temperature possible…usually the cotton settings)
  • Iron the transperency gently.
  • Don’t put too much pressure on the clothes iron else the toner will smudge. too little pressure and the toner wont be transferred at all.
  • Once you think the toner is stuck to the copper turn off the iron. let it cool down to the ambient temperature.
  • Peel off the transperency if you got it right then you will see that almost all the toner has been transferred to the copper surface.
  • The toner layer will form the etch resist.
  • Now the copper clad can be put into the etching tank. ferric chloride maybe used as the etchant. although muriatic acid maybe used too.
  • Gently ‘move’ the copper clad board through the FeCl3 solution.
  • Once all the unwanted copper has been removed clean the PCB under running water.
  • Remove the layer of the toner with some sand paper or a solvent such as acetone.
  • If the PCB is meant for surface mount components then the PCB might require drilling.
  • After the drilling is over. tin the copper surface to protect and increase the conductivity of the copper tracks.

References:

http://www.riccibitti.com/pcb/pcb.htm

http://www.qsl.net/vk5cu/

http://www.fullnet.com/~tomg/gooteepc.htm

http://www.youritronics.com/diy-printed-circuit-board-using-photo-etching-method/

http://hackaday.com/2008/07/28/how-to-etch-a-single-sided-pcb/

DIWALI PROJECT – LED luminaire

Happy diwali to all!!!

Last week i was alone at home since my parents had gone out to attend a marriage in mangalore.I was alone at home for about 10 days and had no college since there was our college ‘techfest’.i dont like attending ‘techfests’ on a shoestring budget,like the one in our college!!.there only a few things which fit into my definition of tech there!

So I was alone & bored and to get rid of my boredom and loneliness i wanted to do some fun project.i had a few hundred bucks with me,and i had an old luminaire (called jhoomer in hindi)-it had those bayonet mounted so called ‘zero watt’ incandescent bulbs. I consider incandescents a thing of the past as they are very inefficient and are energy guzzlers-they waste a lot of energy as heat.Infact they generate much more heat than they produce light!!!So i thought that replacing the incandescents with power LEDs which consume lower power and produce much more light.Also the light is much more soothing to the eye.

I went to the electronics heaven of mumbai-lamington road.with my friend Vijay to get some 1 watt LEDs.In my previous posts i have written about these LEDs and how to drive them.I got six 1 watt LEDs since my luminiare had six ‘arm’s.i could simply hook these leds to a wall wart of about 12 volts and a current rating of about 600 ma.hook it up in two parallel rows of three series LEDs .each LED requires a voltage drop of about 3.4v and a current of 300ma.that totals to about 10.2 volts and 600ma total power required. simple eh?? but that’s not the case these led are much more complicated devices as mentioned in the past posts.They require a constant regulated supply for stable and reliable operation. With the correct type of supply a long life can be expected of these LEDs.Usually these LEDs are rated for about 10,000 to 100,000 hours of operation.Thats miles ahead of the current fluorescent and incandescent technologies.

So i had to make the power supply for these LEDs so as to ensure reliable operation.I had a few LM3404 samples i had received from National semiconductor lying around.Its a buck converter based constant current source LED driver.It has an internal MOSFET capable to switch up an amp of current. requires very few external components for operation.Hence is ideal for my project.Also since it’s switching based device it has very high efficiency.So my objective of going green is fulfilled too.The rest of the components used have been salvaged from old electronics-old PC SMPS,old nokia charger,cordless phones,TV video games,FM radio,DVD writer etc.I firmly beleive in recycling!!.

Now i checked out the datasheet of the LM3404,there were a lot of formulae and stuff on how to calculate the values of the various components used in the circuit.I found it difficult to get the accurate values of these components .I was also not too sure about the values being accurate. so i tried out the webench tools from National Semiconductor.These are great free tools from national which help in designing circuits based on their ICs.registration is required to use these tools which is also free. now on the webench designer page for LM3404 there were fields for the forward voltage of the LEDs,forward current,etc.I had no exact values for my LEDs since the guy whom i brought it from just referred to the as chinese made 1w led.So i assumed that it would be having a forward voltage of 3.4v and a current of 350ma.To confirm my assumption i had to check these specs with my multimeter.the volatge across the LED was 3.18v @133ma and 3.32v @210ma.I used a constant current supply mentioned in my provious post on power LEDs to check the voltage across the led.These values also help in determining the Rdyanmic-the dynamic resistance of the LED also known as ESR(equivalent series resistance).usually it is 1-2 ohms for power LEDs. In my case it was 1.81 ohms.The ESR can be calculated by measuring the increase in forward voltage drop dividedby the increase in current. For example, if the forward voltage drop increases by from 3.5V to 3.55V (a 50mV increase) when the forward current goes from 10mA to 20mA (a 10mA increase), the ESR will be 50 mV/10mA=5 ohms.I’ll be using a 12volt-1amp Wall wart from a deceased cordless phone as power souce for the LED driver cicuit.Take a printout of the circuit designed by the webench designer,as you’ll be needing it for further reference.here’s mine. there are 2 strings of three LEDs in parallel at the output block.

let’s start building the circuit now.The LM3404 chip was in a PSOP-8(power small outline package-8 pins)package.The SMD package is very tiny and i had to refer some sites to learn how to solder SMDs at home.The whole chip is just a couple of mm in width and in length!!I had to handle these using tweezers.First I placed the chip on a bare pcb coated with the ink from a permenent marker.

then i drew a few lines between the leads of the chip using the pointed end of one leg of the tweezer as shown.this exposes the copper of the pcb.Here the chip acts as the stencil.the chip can be held in place using an end of a toothpick.

extend the lines further and widen these lines if possible,to allow for use of thru hole components.now prepare the etching solution.I prefer ferric chloride. hold the pcb by means of a ‘holder’ i hav made one out of thick laminated copper wire.dip it into the etching soln.keep stirring continously.sometimes heating may also be required for speeding up the process.after the etching is done and all the bare copper is removed, remove the marker ink using acetone(sold as nail paint remover). your pcb is ready. check for any short circuits between the various parts of the pcb usin multimeter.i kept a small patch of copper shorted with the ground under the pcb to act as a heatsink since this chip has a powerpad at the bottom which is grounded.this power pad help dissipate heat as well as increase the sink/source capability of the chip.

first of all hold the chip in place using a tootpick on the prepared PCB. solder just the pin no.1.this helps to keep the chip in place.now now solder the pin no.8. now the rest of the pin are soldered by placing a blob of solder on all the four pins on one side .then the blob maybe sucked out using desoldering braid which leaves only the required quantity of solder on the pad.the process is repeated on the other side as well. check for the continuity between the pads and the pins by a multimeter,once confirmed.proceed to soldering the other components.


slightly bend the legs of the thru hole components then tin them.then solder these components over the

now try applying a thin layer of solder over the pcb.this helps in increasing the current carrying capacity of the pcb as well as to prevent oxidation of the copper.solder the components on the pcb as shown.a thin sticky layer of slag was formed on the pcb while soldering.this can be easily removed by rubbing a peice of cotton soaked in acetone.

i use this technique to ‘surface mount’ thru hole devices.this technique is great for prototyping.this method can also be used for ‘permanentizing’ the circuit. heres the completed circuit. before testing the circuit do remember to remove the slag as i can form a capacitor between the pins.this stray capacitance can damage the circuit and lead to malfunction and i learnt this the hard way.I had to sacrifice a IC to this stray capacitance :(.

the led driver circuit is ready now.


Now these LEDs cary a huge amount of power for their size.They generate some heat so heat sinking is required to prevent any damage due to overheating.I got some small heatsinks that could fit in the bulbholders themselves so there’s no need to reengineer the LED mount.the LEDs were ‘stuck’ to the heatsinks by means of heats ink compound.a small container of this thermal compound would suffice and the cost just 10 bucks.i would suggest polishing the surface of the heatsink before applying the thermal paste.It is not necessary though.Just to be on the safer side i polished the surface of the heatsink with some sand paper.a very small amount of thermal paste is applied on the heatsink.so as to form a very thin layer. the LED is the placed on the heatsink and a small amount of force may be applied so as to place the LED firmly in place.this step is repated for all the leds.

i managed to squeeze the LEDs fitted with the heatsink into the bayonet mountings of the incandescent bulb.this made my job of mounting the LEDs a bit easy.a lot of improvisation might be needed here.i also rewired the whole Luminaire. since the wire was old and was oxidised. i connected the each set of 3 LEDs in series. this gave me 2 strings of 3 series LEDs. i connected these two strings in parallel. i first tested the circuit with the 12v out from an computer SMPS.the yellow wire from the SMPS is the +12v while the black wire is the ground. the test was sucessfull so i proceeded to mounting the circuit.i attached a barrel plug connector to driver circuit so as to allow the connection of a standard wall wart supply. i used a 12v-1amp adapter that was used as a supply for a cordless phone. i mounted the circuit on the wallwart itself with some insulation tape.the supply for the adapter is given from the mains .after testing the circuit for another hour to check the stability i reassembled the luminaire and hung it back up on the ceiling.

Note:i was unable to upload the photos of soldering the through hole components on the SMD pcb due to some technical glitches.sorry for the incompleteness.will upload the pics as soon as possible.Also thanks to mandar for staying up late until the wee hours of morning and for that can of redbull which helped me stay up that late 😉


philips she-9500 reviews

I was desperately in need of a good pair of in-ear earphones for a long time since my JVC FX-33 marshmallows went kaput a few months ago.So I got myself a new philips she-9500 from the tech haven of mumbai aka lamington road for about 750 INR a couple of days ago. I had done quite a bit of research before buying these earphones.Here’s the review.
First of all i’m no hardcore audiophile,but the audio quality is a top priority to me and i can’t bear to hear the bassless music from the silly nokia earphones bundled with my nokia n78.I a huge linkin park fan and i can hear linkin park all day long!!. The philips earphones are very good VFM earphones. The transperent blister package it came in contains the following.
  1. the earphones themselves(length-60cm)
  2. a 60 cm long extender cable
  3. a carrying pouch
  4. a small earphones box
  5. a couple of extra pairs of rubber tips of different sizes(small,medium,large).
For 750 bucks thats more than enough i think.I was contempalting maybe a creative or maybe a sony before finally settling on the philips one. There are various models in the 500-1000Rs. range from creative,sony and panasonic.But the best thing i found about these earphones during my pre-purcahse reasearch was that these earphones have great bass.This is very much evident from the bass vents present at the back of the earphones.I had also found many good comments on these earphones on various forums.Although there were even comments that suggested that these earphones lacked the ‘meatiness’ in the bass range.




Now about the construction of these earphones.The earphones are built solidly enough but can’t say the same about the cord though. The wire has a slight rubbery texture and is very thin a looks flimsy. Although the wire feels much stronger than it looks.The plugs are all 24k gold plated. Even the extender cable has the connectors gold plated. My experience suggests that this gold plating tends to wear off with use.The rubber cups provided have a soft feel to them and are of good quality.The manage to have the right balance between providing good isolation and providing comfort.I can wear these earbuds for hours without feeling any discomfort,or any itchy feeling,the earbuds are so comfortable that i tend to forget that i have even worn them.This was not my case with the JVC marshmallows. The memory foam insulation provided with those earbuds was good at providin isolation,but comfort was not one of its strong points.I have read many comments on various forums such head-fi.org,iaudiophile,etc that the assymetric cable length of these earphones as being ‘clumsy’. I consider this feature as a plus point. this makes wearing these earphones even more comfortable.
Now,for the audio quality department.these earphones have a very decent audio quality. Altough i had expected more. But i guess that the comfort does come at a price.The isolation is not what i would get from my marshmallows.I think the isolation provided by the jvc was unbeatable.The complete sealing of this earphones is compromised due to the bass vents present at the rear i think.The bass is more pronounced due to this.Hence it’s like a necessary evil!!The bass and treble felt rich. The midrange was so-so. One major drawback of these earbuds is that the sound crackles when the eq settings are fiddled with,especially the bass booster setting. I had to change the default nokia bass booster settings reducing the bass range pointer to a level slightly above default.But one thing that i noticed was that the sound at the default settings itself was good enough and no bass booster setting were needed,even a bassophile like me could do away with the bass booster settings.This was not the case with the jvc marshmallows. There was no severe distortion even when all the eq settings were kept very high.So go for the SHE9500 earphones only if are willing to do away with the eq settings altogether.This was one major dissapointment i had with these earbuds.I’m very much fond of fiddling with the eq settings and i always keep the bass at a very high level.


to sum it all up
PROS
  1. great vfm,cant beat the performance at this price point,even the creative ep630 costs 800 bucks and has much inferior bass(very boomy and hollow) altough it can handle high eq settings.
  2. The asymmetric cable length.
  3. Extremly comfortable.
  4. Comes with great carrying box,pouch.
  5. Ideal for use with mobile phones,since the cable is of short length without the extender,can be directly connected to the handsfree port of your mobile.can be used with mp3 player with the extender cable.(a nifty feature indeed).
  6. Good bass for the price.
CONS
  1. The cord is very thin,could have been of much better quality(one thing i liked very much about my jvc FX-33 was that the cable was very solidly built and was very thick and storng,certainly not a strong point of the SHE9500).
  2. The sound quality could have been much better,the midrange is a weak point.But the price is a much stronger point here which influences me.
  3. The chrome tends to attract a lot of attention. but thats pro right?But i think that the earphones should blend in which this earphones certainly dont.certainly could have been better without the chrome!

Isolation not very good.That might sometimes be a lifesaver,while walking on the streets listening to music it is necessary that you hear outside sounds and thus might prevent accidents.

These earphones are ideal if you are on a shoestring budget and are looking for a good pair of earbuds. for the price the sound and comfort is great.The cable with the extender is great for use with mobile phones having the remote for music player. If you have a flexible budget go for the sennheiser cx180,or maybe philips SHE9501,or the sonys they have much better sound quality but the price too is greater

High efficiency portable gadget charger

In my earlier post i had made a gadget charger which could charge your mobile phone,ipod,or other gadgets.It was based on a rather simple chip -the humble 7805. Now lets move a step further and make a more efficient emergency charger. this charger is based on the lt1302 from linear technology. I had got as samples from linear.com samples service two lt1302 ics .the datasheet provided very promising numbers efficiency reaching nearly 87%!! wow!!!!that’s great.That means more charge gets into your gadget.
The IC is a boost converter IC .As the name suggests it boosts the input voltage.It forms a very simple switching mode power supply. From the datasheet i found that it can operate down to voltages as low as 2v.That means we will can use two 1.5v alkaline or 1.2v ni-mh rechargeablesas the power source(as the cells discharge their voltage falls below the rated volatge,Ni-mhs usually discharge down to 1.0 v per cell before they need a recharge).Now what exactly is a boost converter??? . A boost converter is a form of a smps.It’s basic circuit is as follows.
Basic boost converter
source:wikipedia
To understand better try wikipedia.what it basically does is it employs an inductor to store energy from supply as the switch switches on and off rapidly.This switching on-off happens at a very high frequency upto 310 khz in this case.The switch in the SMPS of your PC is usually a MOSFET or an IGBT.These devices can handle a huge amount of power i.e. upto 50A constant current and 200A transients!!.These devices have very low on state resistances usually 0.015-0.018Ω hence the power losses across these devices are less.A simple BC547 NPN transistor can handle upto a few hundred mA hence in comparison these devices have very high power rating.These switches are turned on-off by means of an oscillator connected to a comparator which takes feedback and adjusts the frequency accordingly.Thus modifying the pulse width depending upon the power requirement. This is called pulse width modulation.
Enough basics.Back to our project now.All the switches,pwm comparators, etc are built right into the lt1302. a few external components are required such as a schotthy diode(warning do not use 1N400 series diodes they are designed to work at low frequencies and hence will not work.),power inductor(I salvaged mine from an old printer), a few caps and resistors,Oh and a perf board or pcb to mount them all.
Here’s the schematic.
schematic for gadget charger using Lt1302.
The input capacitors are present for the noise suppresion. now when the circuit is given the supply the switch is off which charges the inductor through the sw pin now the switch turns on then the energey stored in the inductor along with the energy from the supply are fed to the output. the 220uf o/p smoothing capacitor is present for smoothing the output. the capacitor iaverages the output. a gives a good consistent output. The inductor should usually have very low dc resistance to reduce copper losses. The inductor should have a rated current of at least 2A. checkout the ones from coiltronics and coil craft.The output maybe connected to a usb female jack to charge your usb device such as a mp3 player or in my case it’s the nokia 2.5mm male charging connector.
This charger has higher efficiency also the output of this circuit is 600ma max. so this can charge your device pretty quickly. my nokia n78 charges from near empty to full in about 2 hrs.compare that to a standard wall charger which takes 1.5 hrs for a full charge.Thats pretty good for a portable charger i think. I use 2100mAh Ni-Mh rechargeables as the power source.they last me for more than one full charge..the batteries and the inductors do get very hot when in use.you can leave the batteries in the circuit itsel when not in use since the quienscent or “housekeeping” currrent of this circuit is about a few hundred microAmps but this will drain the batteries eventually ,or better still you may include an on/off switch with the battery holder .i wrapped the whole circuit in insulation tape to protect it and increase the ruggedness.i did not find the inductor the correct value so i tied two inductors in parallel to get the desired value.Inductors in parallel are very much like reistance in parallel they follow similiar formula for calculation.


diy emergency gadget charger

I have a nokia n78.I often use the gps onboard to find my way through the urban jungle of mumbai.The gps is surely a very useful tool for navigation but it tends to suck the battery juice pretty quickly. My phone can give only about 3-4 hrs of continous gps use on a full recharge.I’m a urban explorer kind of a guy so i like getting lost and found in the concrete jungle but that sometimes takes a lot of time.so much time that my battery runs out before my adventure is over!!. and so i decided to make myself a portable mobile charger.
Lets get to the basics of how the Li-ion/Li-po battery inside the mobile phone/gadget is charged. The wall adapter charger supplied with you mobile/gadget is basically a 5-7 volt regulated voltage supply.It may also be an smps providing a constant volatage.this volatge is not given directly to the battery but fed through a charge controller. the charge controller basically is another regulator that charges the battery at the precise voltage it requires.

This charge regulator is present in the phone itself. The charger we are going to design is going to supply regulated 5 volts to this charge regulator which will then charge your battery.
The simplest way would be to use a 7805 with a 9v battery. As shown in the schematic below.
charger using 7805
This is obviously a simple circuit and also the components are cheap. Well i found out that the the 7805 is a very inefficient device .It dissipates a lot of heat.I recon it might have an efficiency of about 60% or so and also the amount of charge that gets into your mobile is also very less.Also the capacity of an average 9 v battery is around 600mAh.To charge my mobile i connected the 2.5 mm charging connector i salvaged from an broken ca44 cable.The smaller end is the 2.5 mm male plug connector.The outer terminal of the barrel jack is the negative. while the inner terminal is the positive. this charger really works but the amount of charge that this circuit will provide is relatively small as compared to a boost regulator based charging circuit which will be my next post.

1 watt High Efficiency Power LED lamp



These Days power leds are available very cheap.I had seen a lot of stuff on the net about the “1 watt led” and i fell instantly in love with these beauties!!These babies have a very high lumen per watt output as compared to either incandescent or the flourescent technologies.For the layman this means very high efficiency-you get more bang for your buck.But driving these things may be a bit difficult .
I did some reasearch and found that the humble resistor we all connect to the leds while driving the usual 5mm leds does not work very efficiently for the power leds and hence complicated driver circuits are required.to understand how the driver works we need to first understand the basic principle on which the leds work. LEDs are current driven devices i.e one can increase the brightness of the LEDs by increasing the current through them. Sounds simple right!!.But it is much complicated than that the LEDs require a particular forward voltage known asforward breakover voltage. This is the voltage required to ‘turn on’ the LED.For white LEDs this is usually 3.2-3.4 v. Red and green LEDs usually have a much lower forward breakover voltage.Once the forward breakover is reached the leds literally act as a short circuit hence the current limiting resistor.These resistors cannot be used because of aforementioned reasons.Hence we use a constant current source. SMPS(switched mode power supply)s are usually used as a source for power LEDs. They usually switch on and off at a very high frequency.And that too at a very high efficiency of about 85-95%. The only drawback of such a power supply is the prohibitive cost,especially when the supply current is in a couple of amperes



All said and done i decided to make my own 1watt led lamp. I’m using a 1w LED with nothing but a 6N printed on it as you can see(i think this might be some cheap chinese made replica of the philips lumileds luxeon I). An lm317 adjustable volatage regulator and a 3.9 ohm 1 watt resistor. A heatsink i salvaged from an old TV receiver box.I’m using a nokia mobile charger model ACP-12E has a rated output of 5.7v@800ma.But my multiimeter gave me an output of 7v!! maybe because it was the open circuit voltage.

I chose the lm317 because it has a constant current mode (see the application notes) and also its damn cheap.The lm317 can handle currents upto 1.5A .I suggest attaching a heatsink to the Lm317 as well as theLED. Altough the LM317 has thermal protection buit in the led may heat up and an overheated LED is as good as dead .The LM317 regulator gives out a constant voltage of 1,25 volts between ADJ and Vout, so by adding a resistor between these two outputs, you’ll get a constant current.to find the resistance value use ohms law V=IR.Here the V=1.25v and required I is .350A hence we get R as 3.5714ohms. the nearest standard value is 3.3ohm .But we will use the 3.9ohm as a safe measure. The constant current source has a voltage drop of 3 v. And since the voltage drop across the LED is 3.2 v we would require around 6v as vcc.Avoid using higher volatge power supplies than required since excess voltage is wasted as heat. I suggest using a supply of 6 to 9 volt.Also the wattage of the resistors may be high enough to handle the heat generated.
The finished product is shown below.This might not be the most efficient way to power these 1w LEDs but it’s the simplest and the most cost effective. The efficiency may be increased by using the right supply voltage to reduce the power wastage.




My first Post

This is my first post on this blog.In this blog i plan to record my jouney in the fascinating world of elctronics and microcontrollers.Electronics is my passion and whenever i find spare time i indulge in either making electronics or breaking them. So far i have made as well as opened up a lot of electronics stuffs. From these i have gained a lot of knowledge.I would be recording all the knowledge i learn on electronics on this blog.