Jump to content
Electronics-Lab.com Community


  • Posts

  • Joined

  • Last visited


The_YongGrand's Achievements


Newbie (1/14)



  1. Hey there, I'm building an electronic circuit which contains a 7805 voltage regulator, rated at 1A output. However, my AC Adapter has a rating of 1.5A output which will be connecting to the input of the 7805. Could that burn the regulator, or the circuit? ::)
  2. I finally found out the problem - the Vref is isn't really 5V, and that's why it affects and deviates the ADC's results severely. I dunked that sensor one more last time into an ice bucket and it's really 2.73V, without no doubts. I even checked my workshop's digital thermometer in my work, which the temperature feels similar to my home - yes, and the room temperature is around 28 degrees too. And all I ever found out now is the Vref isn't 5V. It's hovering around 4.64V, and not even my 78L05 is even exactly 5V! In the end, I changed and tweaked a bit of the algorithm in the microprocessor since I have to make do with these components. Perhaps later, I'll buy a better voltage regulator to replace my 78L05 which only costs a few cents in my place. Anyway thanks for the guidances! I learned a lot of ADC operations from doing this home-made experiment! :D
  3. Oh I see - well according to the microcontroller, I've set the reference voltage as the supply voltage, hence the 5V on it. I'm going to check whether is the microcontroller is faulty or not. I'll hook that sensor up to another microcontroller and see whether the values show up correctly or not. :D
  4. Yes - I've now got that voltmeter replaced. The DVM is broken, I bought it in 2007 and it's only $13 which was bought from Jusco. Now, the another new problem is, it's the ADC in my microcontroller. From the DVM, I measured : 3.01V and from the ADC, checking the contents of the ADRESH in the debug (left-justified) which is : A8H or 16810 when I connected the wire from the sensor to the AD pin. It is supposed to be 15510 or 9BH in the ADRESH. I've double-checked the conversion time, and even the oscillator speed inside. Here's the code, I might have missed one tiny thing there or something else: #pragma config OSC = HS #pragma config PWRT = OFF, BOR = OFF #pragma config WDT = OFF #pragma config DEBUG = OFF, LVP = OFF, MCLRE = OFF #include <P18F4221.h> //void TX_ISR(void); void Send_TX(unsigned char); /*#pragma interrupt chk_isr void chk_isr(void) { if (PIR1bits.TXIF == 1) TX_ISR(); } #pragma code HiPrioInt = 0x0008 void HiPrioInt(void) { _asm GOTO chk_isr _endasm } #pragma code*/ unsigned char hundreds, tens, ones, value,temp; void main(void) { TRISB = 0x0; PORTB = 0x0; TRISAbits.TRISA0 = 1; TRISAbits.TRISA1 = 1; TRISCbits.TRISC6 = 0; TXSTA = 0x20; SPBRG = 15; RCSTAbits.SPEN = 1; TXSTAbits.TXEN = 1; //PIE1bits.TXIE = 1; ADCON0 = 0b00000101; ADCON1 = 0b00001001; ADCON2 = 0b00101101; INTCONbits.PEIE = 1; INTCONbits.GIE = 1; // test for digits to be sent to computer thru serial port // hundreds = 'A'; // tens = 'B'; // ones = 'C'; // y = 0.51x + 140 while (1) { ADCON0bits.GO = 1; while (ADCON0bits.DONE == 1); // Raw ADC results // hundreds = (ADRESH / 100) + 0x30; // tens = ((ADRESH % 100) / 10) + 0x30; // ones = ((ADRESH % 10) % 10) + 0x30; // Send_TX(hundreds); // Send_TX(tens); // Send_TX(ones); // Send_TX(0x0D); // Converted ADC results /* temp = ADRESH; value = (temp - 140) / 0.51; tens = (value / 10) + 0x30; ones = (value % 10) + 0x30; Send_TX(tens); Send_TX(ones); Send_TX(0x0D);*/ } } /*void TX_ISR(void) { TXREG = temp; PIR1bits.TXIF = 0; }*/ void Send_TX(unsigned char input) { while(PIR1bits.TXIF==0); TXREG = input; }
  5. I changed to another voltmeter - this time it shows 3.03V and no more fluctuations which almost tally with my room thermometer. However, I still need to double check the sensor with the ice-bath. In the meantime, my ADC inside the microcontroller showing weird results, guess I have to fix the routine in the system. :D
  6. Oh it's around 26 degrees. I've checked it using my old alcohol-based room thermometer. I've tested it with the thing dunked into a small ice-bucket and the voltmeter showed up 2.99V, not even 2.73V as stated in the datasheet. Edit: Ok, dunked it in the ice bucket again, this time showing a 2.80V which is 0.07V a little bit more. I ripped it out from the ice bucket and put it back into the circuit and let it warm up back to the room temperature for a while, this time showing 3.01-3.03V constantly, but it's a bit jittery and could jump and fluctuate to 3.14V.
  7. I haven't warmed up the sensor or whatever it is, perhaps I would start with a small ice bucket first. Even on my ADC it showed up the same thing, as I hooked the system to the computer and read the results in the Hyperterminal. Unfortunately on the other LM335Z I have, it gives me the same thing as well. ???
  8. Oh, sorry for the inconvenience. Here's the image: I'm still working a way out to get this thing to give a proper room temperature. :D
  9. Hey there, I've been making an el-cheapo room thermometer myself, and stumbled into a problem: the LM335Z I bought is showing up temperature which is not even the room temperature. Here's the rough schematic: V- ------------------------| GND V+ ---(1)--/\/\/\/\-------------| +5V 2k resistor (2x 1k resistors in series) ADJ ---- (floating) (1) - Connected to voltmeter Unfortunately it gives me 3.14V instead of anything around 2.99V. Even tried another LM335Z, but still giving the same thing. Btw, the LM335Z converts 1K to 10mV. Any ideas? ??? ::)
  • Create New...