Pages: [1]   Go Down
Author Topic: How to use ATMEGA 328 out of the Arduino Board for some Project ?  (Read 1505 times)
0 Members and 1 Guest are viewing this topic.
HK
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
Micro
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello I need help about how i can use Atmega 328 Chip out of the arduino uno board for some project ? also i have tried that Blinking LED example with Proteus ISIS but the rate of Blinking led is very slow and actual blinking rate is very high on arduino board why this is happens ? please tell me.
for example i am using LDR based Relay control using Arduino UNO, 10k Resistor, LDR  and Realy Board. it is working perfectly with arduino but not in Proteus simulation i am using following code.

Code:
void setup() {
//pinMode(4, OUTPUT);
pinMode(12, OUTPUT);
//Serial.begin(9600);
}

void loop(){
//digitalWrite(4, HIGH);
if(analogRead(0) < 590){
digitalWrite(12, LOW);
delay (10000);
} else{
digitalWrite(12, HIGH);
delay (100);
//Serial.println(analogRead(0));
}
}

Please look into attached image for Circuit.


* error.png (189.29 KB, 1366x768 - viewed 86 times.)
Logged

Peter.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27425
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There are lots of examples of standalone designs posted.
All require that VCC and AVCC be connected to 5V, with 100nF caps to Gnd, that Aref have a 100nF cap to Gnd, that Reset have a 10K resistor to +5.
If using Uno as bootloader, that 16 MHz xtal and two 22pF caps be connected.

I don't see a lot of that addressed in your simulation.  Also no current limit resistor with your LED.
I don't know how your simulation addresses fuse settings either - internal 8 MHz oscillator? divide by 8 prescaler? these defaults on  a blank chip would make your program appear  to run 1/16th of the normal speed.

The code would only seem to hold the LED off almost all the time with that 10 second delay.
It is only turned on for 1/10th of a second, I imagine the Analog reading would have to change pretty quick for  it have any kind of flashing appearance as once on it stays on until the analog reading changes.

So, all things for you to think about.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

HK
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
Micro
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for reply .. I got your point. i am going to try you said.
Logged

Peter.

Pages: [1]   Go Up
Jump to: