Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using PWM on a 18F13K22

Status
Not open for further replies.
There's no mystery here - you're not saving the original with enough resolution. You need more pixels.

These images are for an 11" x 8.5" schematic. The first image is 374 x 265 pixels and each following picture is twice the resolution. The forum software takes care of limiting size but you can save the image and it's big enough to see.

TAP-28 Rev A - 374 x 265.jpg
TAP-28 Rev A - 748 x 530.jpg
TAP-28 Rev A - 1495 x 1060.jpg
TAP-28 Rev A - 2990 x 2120.jpg
 

Attachments

  • TAP-28 Rev A - 5980 x 4240.jpg
    2.1 MB · Views: 271
Jon the pic I posted is only 15 kb and is clearly readable the problem is the user of diptrace is not saving the file as the hole page and it is just like you scaled a jpg
this is saved as a page jpg its not readable
test2.jpg

Same thing save as bitmap image the resaved as a png
test.png

And this one is saved at the max setting of 600 and a jpg
test3.jpg
 
Last edited:
Well I did PRIVIEW PRINT then compressed the file and hopefully this is what be80be did/
 

Attachments

  • candle 4.zip
    12.7 KB · Views: 243
If you post a zip file, it will save many the trouble to look at it. You're asking people for help. Why make it difficult to view your schematic?

Start by exporting a large enough image. Look at what I posted. If you don't start with enough pixels, nothing anyone can do will make the image clear. I don't have DipsTrace – I think there's an option for how much to magnify when you export.

Then save it in a compressed format. Burt likes png. Irfanview will do that. I use jpg with good results – just set to at least 80% quality. Do not save it as a bmp – this format has no compression and the resulting file will be huge.

People post hundreds of schematics a day in forums. It really can't be that difficult.
 
Well I did PRIVIEW PRINT then compressed the file and hopefully this is what be80be did/
I still looks exactly the same. No difference? You should save it in the program (As "X" RESOLUTION) not in Print Preview, Print Preview does nothing.

Edit: Print Preview does exactly what it is designed to do (ON YOUR COMPUTER) NOT TO USE ELSEWHERE, PASSING IT ON TO SOMEONE ELSE, WON'T WORK.

It's not an EDITING PROGRAM, be80be said to save it in the "PROGRAM" then zip it, but you won't have to zip it, if you save it at the highest resolution .png (JUST UPLOAD IT)
 
Last edited:
Killivolt is on to something. This was actually explained to you a year and a half ago in one of your epic sagas.

image.jpg


I don't use DipsTrace, so I didn't realize you were generating the image file the wrong way. However, I have said numerous times that you need more resolution. More pixels. So perhaps you should check how big the image is that you're starting with? Seems reasonable rather than trying things like pressing the SAVE button HARDER in the hopes that it will make the image bigger don't you think?

In Irfranview, the image editing and conversion program you use, you can click IMAGE on the main tool bar and then click IMAGE INFORMATION. In the first few lines of the box that pops up, it will tell you the image size. As Mr. Pumpkin explained a year and a half ago, an image width of around 2000 pixels is a good starting point.

If your image is SMALLER than ~2000 pixels across, go back to DipsTrace and do something different. Don't get the idea that your smarter than everybody here and decide you can just rescale the image in Irfranview. You'll just get a bigger blurry image if you do that. You can't put back detail that wasn't included in the original image.
 
He is using is using diptrace you can only. Save it in print preview but if you set it for full page then scale to 600 it gives you a nice readable picture I like changing that to a png in paint cause it's a smaller readable picture.
 
After reading Jons post I see what step I was missing. I needed to scale AFTER I open the PRINT PRIVIEW then set the SCALE to more than 2000
I was making the resolution increase after I saved the PRINT PRIVIEW
NOw its readable.
candle6.jpg
 
Yes. Finally!

Please write this down and tape it to your monitor for next time.
 
I will THANKS
now to my small other problem that I already have solved but perhaps someone can see perhaps how to remedy the problem.
I received the new LEDs and 2n3904 transistors
I failed to realize the LEDs are common cathode not anode. So to remedy I just connected the NPN transistors as an emitter follower. Doesn't seem to make any real difference except I see my RED is to bright. It over blends with the yellow.
Before inserting the pic I wanted to verify current draws etc so I connected 5v and enabled the base of the transistor which has a 1k resistor. Measured the voltage on the COLLECTOR AT 5V AND THE EMITTER AT 4.6V. With the LED on (LED is connected to the emitter then has a 150 ohm resistor to ground) I measure 15ma current draw on the LED. The transistor base current measures 2ma. The single LED could use more light so contemplating adding more LEDs as suggested.
Also want to measure with pic in circuit just for safety sake.
Will post schematic later.
 
I'm not sure what your question is.

Supply voltage = 4.6 (per your measurement)

LED forward voltage = 2.5 (from data sheet)

R-LED = 150 ohms (per your statement)

Vs – V-LED = 4.6 – 2.5 = 2.1 volts

Ohm's Law

V = IR ==> I = V/R = 2.1/150 = 0.014 amps = 14 mA.

This is within your measurement error. There really isn't any need to breadboard and verify LED current levels if the supply voltage, forward voltage and series resistance are known. Ohm's law is a fact.


As far as brightness is concerned, this LED is a low-brightness LED designed to be a status indicator. You can increase brightness somewhat by increasing the current to 20 mA by decreasing the series resistor but it's not going to make a substantial difference.
 
Last edited:
I have no question, just presenting what I had to do to be able to use the components I have due to my oversight on LED selection. I had already soldered it all together so breadboard was not utilized for measurements. Measurements were taken to assure everything was as planned and no magic smoke escaping. I contemplated using LEDs with a higher MCD (non diffused) but the viewing angle was 20 degrees instead of 60 as the diffused leds are.
My next move is to increase the red led resistance to desired level and maybe decrease the Yellow resistance slightly.
 
...now to my small other problem that I already have solved but perhaps someone can see perhaps how to remedy the problem....

Silly me. I read this sentence and took it as some sort of question. No big deal, just the waste of half-an-hour.

Wow. Your LEDs are common cathode and dim? Imagine that.

So more parts into the junk box, boards on the scrap pile and schematics in the trash? Too bad.

And now you are adding, changing, ordering more parts? But you still don't know how the code LittleGhostman is creating for you will be configured so you won't know if the parts you order will go with his code. We haven't heard from him in a while. Either he's concentrating on solving your problem for you over his Christmas break...or perhaps he's become discouraged with the whole affair because you're still flailing about with random bits of hardware instead of giving him a chance to finish the project and show you what you need to accomplish it. I'm sure it's incredibly frustrating to someone with methodical approach to problem solving he presented in post 15 watch you bounce around from one approach to another without thinking anything through.

Well, at least 253 messages haven't been posted in this topic for nothing. You have learned how to follow the steps that were explained a year and a half ago to produce a legible schematic. That seems to be a major milestone.
 
I am waiting for a response from Littleghost as well. Not planning on ordering any new parts unless littleghost has a better setup.
WHY would common cathode LEDs be dimmer than common anode as you suggest??
I could add more voltage but then its a vicious circle that would perhaps have no better results as per ohms law.
No boards to the trash, no schematics to the trash etc. The set up I constructed is on a perfboard. Maybe adding more LEDs as suggested would brighten up the effect.
 
I am waiting for a response from Littleghost as well. Not planning on ordering any new parts unless littleghost has a better setup.
WHY would common cathode LEDs be dimmer than common anode as you suggest??
I could add more voltage but then its a vicious circle that would perhaps have no better results as per ohms law.
No boards to the trash, no schematics to the trash etc. The set up I constructed is on a perfboard. Maybe adding more LEDs as suggested would brighten up the effect.

Pardon me WHAT?

"WHY would common cathode LEDs be dimmer than common anode as you suggest??"

Your LEDs are dim because they are built that way; this is what the data sheet says and these LEDs are designed to be indicator LEDs....LEDs you look at to see the status of something. I pointed this out in post #227. I did not state a common cathode would be dimmer than a common anode. Geez oh grief.

"I could add more voltage but then its a vicious circle that would perhaps have no better results as per ohms law."

What the hell are you talking about? LED brightness is a function of current. Period. And Ohm's LAW is a LAW. Not a rule of thumb. Not an approximation.

Vsupply = Vled + Vresistor

Vsupply = Vled + IR <---- I controls the brightness of the LED. R controls the current.

rearranging (yes, algebra - should have paid attention in math class)

Vsupply - Vled = IR

Maximum current in the LED is 20 mA, so rearrange and solve for R to achieve that current.

(Vsupply - Vled) / I = R, where R is in Ohms and I is in AMPS

Desired current is 20 mA = 0.02 amps

Vsupply ACROSS THE LED AND RESISTOR = 4.6 volts as you measured, which is because of the voltage drop across the transistor.

Vled = 2.5 from the data sheet

So

R = (4.6 -2.5)/0.02 = 105 Ohms. 105 Ohms is a standard value in the 1% resistor series. Or use the next greater value in the 5% series, 110 Ohms.


This will provide the maximum brightness for this LED. but it will still be dim.

"Maybe adding more LEDs as suggested would brighten up the effect."

MAYBE more LEDs will brighten the effect? MAYBE? What else could possibly happen??????

For sure using a brighter LED will....

My new rule is limiting the theater of the absurd to 15 minutes per day and answering your posts to 15 minutes. The time allowed for posting answers has been exceeded by a factor of 4 today.
 
Last edited:
Once again;

Especially true since most bi-color LEDs are red and green with a sort of " not red" color with both elements on.

Red & yellow bi-color LEDs are pretty scarce as evidenced by the selection at Mouser.
 
An LED's brightness varies with the current through the LED. As I explained above, the current is (usually) set by a series resistor; the value of the series resistor depends on the supply voltage, LED forward voltage and of course the desired current. The value may be calculated from the above equations or using numerous online calculators.

Brightness, or perhaps more correctly, intensity, isn't a linear function of current. The data sheet will show a curve similar to the one below, for a random LED. The x-axis is current, the y-axis is intensity, in this case normalized to 100% at the rated current.

The intensity is normalized to 100% (or 1 x) at the rated current of 20 mA. For this particular model of LED, if the current is 15 mA instead of 20 mA, the intensity will fall to about 80% of the rated intensity. The LEDs MrDEB has probably follow a similar curve (but check to be sure). If the current is increased from 15 mA to 20 mA, the intensity will increase by about 25%. Not a huge increase but somewhat brighter. Do note that the battery life will drop accordingly.

Best bet would be to get different LEDs designed to be brighter at the same current draw. Direct comparison of intensity levels is difficult because it depends on the output angle, so you have to evaluate that parameter too.

image.jpg
 
Merry Christmas to all and have a safe holiday. Hope Santa was brought you all the things you wanted.
Now back to the LEDs, YES I am researching for brighter LEDs. Been experimenting with code w/o using the PWM but it just dosen't look right. Still waiting to see what Littleghostman comes up with.
I really enjoy Jonseas graphs etc. Very educational.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top