caramoan tour package

caramoan tour package

Author Topic: LM317 and 3310 LCD  (Read 16863 times)

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
LM317 and 3310 LCD
« on: October 05, 2008, 04:57:50 PM »
  disclaimer: simulation only; not yet tested in actual; NOT 100% accurate!


circuit description:
  • typical LM317 adjustable power supply (220Vac input; 1.2V to 20V output);
  • output voltage monitor uses a microcontroler (pic16F876A) & a Nokia 3310 LCD

Code: [Select]
#include <16f876a.h>
#device adc=8
#FUSES NOWDT, HS, PUT, NOPROTECT, NODEBUG, NOBROWNOUT, NOLVP, NOCPD, NOWRT
#use delay(clock=4M)

#define nok_sclk  pin_c4
#define nok_sda   pin_c3
#define nok_dc    pin_c2
#define nok_cs    pin_c1
#define nok_res   pin_c0

#include "N3310LCD.c"

void init() {
   setup_adc_ports(AN0_AN1_AN3);
   setup_adc(ADC_CLOCK_DIV_64);;
   nokia_init();
}
void main()
{
   unsigned long value;
   init();   
   nokia_gotoxy(0,5);
   printf(nokia_printchar,"ElectronicsLAB");
   nokia_gotoxy(0,0);
   printf(nokia_printchar,"LM317 &3310LCD");   
   //decimal point
   nokia_gotoxy(25,3);
   nokia_write_data(0x70);
   nokia_write_data(0x70);
   nokia_write_data(0x70);
   //unit
   nokia_gotoxy(50,3);
   printf(nokia_printchar,"VOLTS");   
   set_adc_channel(0);
   while(true)
   {
      //for 5V ref: factor= 100*(R2+R1)/(51*R2) = 8.007 = ~8
      //value = ((unsigned long)read_adc())*8.007;
      value = ((unsigned long)read_adc())<<3;
     
      if(value/1000 >0) display_digit(3,5,value/1000);   //tens digit
      else  // 'wag ng i-display ko zero lang naman
      {  nokia_clear_xy(5,2); nokia_clear_xy(5,3);
         nokia_clear_xy(10,2); nokia_clear_xy(10,3);
      }
      display_digit(3,15,(value/100)%10);                //ones digit
      display_digit(3,30,(value/10)%10);                 //tenths
      display_digit(3,40,value%10);                      //hundredths     
      delay_ms(200);     
   }     
}

download locations:
Proteus ISIS simulation & CCS C source code (with hex file for pic16f876a)
   www.filefactory.com
   http://rapidshare.com/
   http://megaupload.com/
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Philippine Electronics Forum

LM317 and 3310 LCD
« on: October 05, 2008, 04:57:50 PM »

Offline beginner wan

  • Diesel Generator
  • *
  • Posts: 1451
  • Pogi/Ganda Points: 46
  • Gender: Male
  • Think Positive! Matutupad yang dream mo!
    • [im]Duino
Re: LM317 and 3310 LCD
« Reply #1 on: October 05, 2008, 05:14:34 PM »
ang galing talaga ni sir yus.. popogi ka na naman nyan..  :D
i;0.?QrEpM?4DEZZ]bkH{w@F<38.Jq@92Ds3KPQj60?EA7U\3M<A84J|AI.H
R@>&?Ej,@;5H)o::7KE/:?QcXf?gX'39=,Z_Q[eYXc

Philippine Electronics Forum

Re: LM317 and 3310 LCD
« Reply #1 on: October 05, 2008, 05:14:34 PM »

Offline marcelino

  • Moderator
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: LM317 and 3310 LCD
« Reply #2 on: October 05, 2008, 06:26:44 PM »
yus, love na kita talga!

napakagandang experiment... though walang practical application ka na nilagay, makikita nang malinaw kung papano iintegrate ang mga components na ginamit mo.

nga pala, bakit di mo sinagad sa 10bits?
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Philippine Electronics Forum

Re: LM317 and 3310 LCD
« Reply #2 on: October 05, 2008, 06:26:44 PM »

Offline hanakimi

  • Size AAA Battery
  • ***
  • Posts: 61
  • Pogi/Ganda Points: 15
Re: LM317 and 3310 LCD
« Reply #3 on: October 05, 2008, 06:54:32 PM »
Nakakabilib ka talaga sir Yus  ;). Thanks for sharing..... ;D

Philippine Electronics Forum

Re: LM317 and 3310 LCD
« Reply #3 on: October 05, 2008, 06:54:32 PM »

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: LM317 and 3310 LCD
« Reply #4 on: October 05, 2008, 07:57:22 PM »
^welcome  :D

yus, love na kita talga!
ay, tita, 'di tayo talo.. ahehe  :D

Quote
nga pala, bakit di mo sinagad sa 10bits?
bakit nga ba? hehe  :D 'di kasi lahat ng pic ay 8-bit ang adc..
ok na rin ang 8-bit kung di naman ganun ka-critical ang resolution..

ito naman ang code/computation for 10-bit adc:
Code: [Select]
#include <16f876a.h>
#device adc=10
#FUSES NOWDT, HS, PUT, NOPROTECT, NODEBUG, NOBROWNOUT, NOLVP, NOCPD, NOWRT
#use delay(clock=4M)

#define nok_sclk  pin_c4
#define nok_sda   pin_c3
#define nok_dc    pin_c2
#define nok_cs    pin_c1
#define nok_res   pin_c0

#include "N3310LCD.c"

void init() {
   setup_adc_ports(AN0_AN1_AN3);
   setup_adc(ADC_CLOCK_DIV_64);;
   nokia_init();
}
void main()
{
   unsigned long value;
   init();   
   nokia_gotoxy(0,5);
   printf(nokia_printchar,"ElectronicsLAB");
   nokia_gotoxy(0,0);
   printf(nokia_printchar,"LM317 &3310LCD");   
   //decimal point
   nokia_gotoxy(25,3);
   nokia_write_data(0x70);
   nokia_write_data(0x70);
   nokia_write_data(0x70);
   //unit
   nokia_gotoxy(50,3);
   printf(nokia_printchar,"VOLTS");   
   set_adc_channel(0);
   while(true)
   {
      //for 5V ref, 10-bit: factor= 100*(R2+R1)/(1023/5*R2) = 1.996 = ~2
      //value = ((unsigned long)read_adc())*1.996;
      value = ((unsigned long)read_adc())<<1;
     
      if(value/1000 >0) display_digit(3,5,value/1000);   //tens digit
      else  // 'wag ng i-display kung zero lang naman
      {  nokia_clear_xy(5,2); nokia_clear_xy(5,3);
         nokia_clear_xy(10,2); nokia_clear_xy(10,3);
      }
      display_digit(3,15,(value/100)%10);                //ones digit
      display_digit(3,30,(value/10)%10);                 //tenths
      display_digit(3,40,value%10);                      //hundredths     
      delay_ms(200);     
   }     
}
na-simulate ko na rin yan, mas maganda nga pag 10-bit (mas acccurate)..
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Philippine Electronics Forum

Re: LM317 and 3310 LCD
« Reply #4 on: October 05, 2008, 07:57:22 PM »

Offline RaffT

  • Technical People
  • Hydroelectric
  • *****
  • Posts: 3440
  • Pogi/Ganda Points: 103
  • Gender: Male
  • more on R-n-D
    • MY Bots
Re: LM317 and 3310 LCD
« Reply #5 on: October 05, 2008, 08:30:32 PM »
^another quality PICcode by master yus  :D

 we salute you!  ;)

pogi gwapo ka part  ;D
Learning is CooL! BEAM robotics/DIY UCD180/PSP/AC wtmtr/digiESRmtr/PICkit™2 clone/SGTC/SSTC/DR-SSTC

Never argue with an idiot... They'll take you down to their level and beat you with experience

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: LM317 and 3310 LCD
« Reply #6 on: October 05, 2008, 09:27:33 PM »
@wan & rafft, thanks sa points! :D

question: kaya bang controlin ng DAC IC ang LM317? ???
(wala akong digital potentiometer eh..  :'( )
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Offline paranz

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4525
  • Pogi/Ganda Points: 177
  • Gender: Male
  • 1/4W resistor specialist
    • RapidSignal Electronics
Re: LM317 and 3310 LCD
« Reply #7 on: October 05, 2008, 10:28:21 PM »

question: kaya bang controlin ng DAC IC ang LM317? ???
(wala akong digital potentiometer eh..  :'( )

yup pwede yan.

My students made a similar project once, a pc-controlled LM317 power supply  :D

though hindi DAC IC yung ginamit ng students ko dati, ordinary r-2r dac lang using resistors and opamps.
PIC16 Programming Tutorial using MPLAB and Hi-Tech C
www.rapidsignalph.com/tutorials/pic16-tutorials

Arduino & gizDuino Tutorials
www.rapidsignalph.com/tutorials/arduino-tutorials

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: LM317 and 3310 LCD
« Reply #8 on: October 06, 2008, 07:58:19 AM »
^wala akong makita sa net na ganyang circuit.. pa'no nga ba? ???

ito sana ang mga magandang gawin power supply: OPA541, OPA549, OPA548
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Offline maldihtah13

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4669
  • Pogi/Ganda Points: 120
  • Gender: Female
  • Everyday is a learning process so try to learn ;D
    • Blogspot
Re: LM317 and 3310 LCD
« Reply #9 on: October 06, 2008, 09:23:16 AM »
Sir yus asan po ung N3310LCD.c.

modified

Sory andun na pla sa files Thanks

Offline graSS

  • Lead Acid Battery
  • *******
  • Posts: 691
  • Pogi/Ganda Points: 26
  • "High"
Re: LM317 and 3310 LCD
« Reply #10 on: October 06, 2008, 09:31:23 AM »
sir yus may Hi Tech C codes ka nyan?? gus2 ko kc yang project na gnyan..
sana may maka post din dito ng Hi Tech C version...

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: LM317 and 3310 LCD
« Reply #11 on: October 06, 2008, 09:54:06 AM »
^ wala akong naka-install ng hi tech C eh..
saka CCS C lang ang kabisado ko.. hehe
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Offline graSS

  • Lead Acid Battery
  • *******
  • Posts: 691
  • Pogi/Ganda Points: 26
  • "High"
Re: LM317 and 3310 LCD
« Reply #12 on: October 06, 2008, 10:29:37 AM »
^ wala akong naka-install ng hi tech C eh..
saka CCS C lang ang kabisado ko.. hehe



san pwde madownload yang ccs c compiler?? sa MPLAB po kc may CCS C kaso parang d gumagana ang sa akin, baka may nakaligtaan lng ako d2.. sino po may idea d2 about sa CCS C compiler ng MPLAB...  ;D

Offline macky

  • Diesel Generator
  • *
  • Posts: 1087
  • Pogi/Ganda Points: 51
Re: LM317 and 3310 LCD
« Reply #13 on: October 06, 2008, 01:07:36 PM »
ang tindi mo sir YUS!!!!!!!!!!!!!

kaka-tackle lang natin yang big-font sa 3310-LCD sa kabilang thread e andito na agad ang solusyon and application mo!

ang pogi-pogi mo!

pogi points for you!!!

ang dami ko talaga matututunan dito sa elab!
john 3:16 | oil of gladness

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: LM317 and 3310 LCD
« Reply #14 on: October 06, 2008, 05:56:32 PM »
^ sainyo lang din kasi ako kumukuha ng mga "concepts",  :D
then gagawin ko sya sa actual (or simulation)..
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Offline macky

  • Diesel Generator
  • *
  • Posts: 1087
  • Pogi/Ganda Points: 51
Re: LM317 and 3310 LCD
« Reply #15 on: October 06, 2008, 08:13:54 PM »
ayos! at least kahit man lang sa "concept" ay makasali ako sa project developments mo sir yus! ;D
john 3:16 | oil of gladness

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: LM317 and 3310 LCD
« Reply #16 on: October 07, 2008, 12:59:13 PM »
Quote
question: kaya bang controlin ng DAC IC ang LM317?
may idea na ako kung pa'no ko-controlling ng pic ang LM317 thru DAC..

gumagana sya simulation, sana gumana din sa actual  :D
ayos to, no-need na for potentiometer..  ;D
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Offline RaffT

  • Technical People
  • Hydroelectric
  • *****
  • Posts: 3440
  • Pogi/Ganda Points: 103
  • Gender: Male
  • more on R-n-D
    • MY Bots
Re: LM317 and 3310 LCD
« Reply #17 on: October 07, 2008, 01:25:16 PM »


^nice... pero mahirap yata hanapin ang DAC... how about resistor ladder+741?  ;)
Learning is CooL! BEAM robotics/DIY UCD180/PSP/AC wtmtr/digiESRmtr/PICkit™2 clone/SGTC/SSTC/DR-SSTC

Never argue with an idiot... They'll take you down to their level and beat you with experience

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: LM317 and 3310 LCD
« Reply #18 on: October 07, 2008, 01:28:26 PM »
^ may mga samples ako ng DACs galing TI.. hehe  :D
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Offline maldihtah13

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4669
  • Pogi/Ganda Points: 120
  • Gender: Female
  • Everyday is a learning process so try to learn ;D
    • Blogspot
Re: LM317 and 3310 LCD
« Reply #19 on: October 07, 2008, 03:51:45 PM »
^ may mga samples ako ng DACs galing TI.. hehe  :D

ako rin dual pa kya pwede voltage at current

Philippine Electronics Forum

Re: LM317 and 3310 LCD
« Reply #19 on: October 07, 2008, 03:51:45 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com