Friday, 16 October 2015

How to upload the Bootloader Hex into the Atmega328p (Arduino Uno)

NSK Electronics have developed AVR 28 Pin Board which is useful in uploading the Bootloader Hex (Bootloader Hex for Arduino Uno is available in my previous post) into the Atmega328p (Arduino Uno). For buying the "AVR 28 Pin Board" visit: http://www.nskelectronics.com/avr-28p_brd_.html.     
The following diagram shows the image of the NSK Electronic's AVR 28 Pin Board:
  
With this board you can develop and prototype with any of Atmel's 28 pin AVR microcontrollers also. The board has User button and status LED. The bridge rectifier allows this board to be powered with both AC and DC power supply adapters.

The following diagram shows the circuit diagram of the above board:


http://www.nskelectronics.com/files/avr-p28-sch.gif 
The above board is to be used as a target board in which your new Atmega328p-PU, IC meant for Arduino Uno is to be inserted for the purpose of uploading the bootloader into the chip. Now you require one more board called "AVRDUDE" The same board is available with Extremelectronics at http://store.extremeelectronics.co.in/images/D/USBAVRProg21Main.jpg You can buy that board and use that to connect with NSK Electronic's AVR 28 Pin Board through 10 Pin FRC cum Ribbon wires. Then you have to download the driver software also for the AVRDUDE board bought from Extremelectronics.  


The SinaProg is a Hex downloader application software with AVR Dude and Fuse Bit Calculator. This is used to download code/program and to set fuse bits of all AVR based microcontrollers. The same Hex downloader software can be downloaded from http://www.ablab.in/?wpdmdl=9018
After downloading the software, do the following:

1) Install the SinaProg Hex downloader software in your computer.
2) Install the driver for the AVRDUDE board in your computer.
3) Connect the AVRDUDE board with AVR 28 Pin Board through 10 Pin FRC.
4) Insert the Atmega328p-PU chip into the AVR 28 Pin Board.
5) Copy the Arduino Uno bootloader Hex from my previous post and save as a notepad file or text file.
6) Open the SinaProg Hex downloader software and select the chip as Atmega328p.
7) Browse for Arduino Uno bootloader Hex.
8) Set the correct Fuse bits for 16MHz operation of Atmega328p-PU. Caution: don't disturb lock bits.
9) Press the Program button in the SinaProg. The bootloader hex will be loaded into the new chip.   
10) If you have any doubt please call me at +919842992780.           

Friday, 12 June 2015

BOOTLOADER HEX FILE FOR ARDUINO UNO

BOOTLOADER HEX FILE FOR ARDUINO UNO

I have given here the Bootloader Hex File for Arduino Uno R3 board. If the original hex file is corrupted at any time then you can use this file.

Hex:  

:107E0000112485E08093810082E08093C00088E1A6
:107E10008093C10086E08093C20080E18093C4001B
:107E200084B714BE81FFD0D08DE0C8D0259A86E0FB
:107E300020E33CEF91E0309385002093840096BBD3
:107E4000B09BFECF1D9AA8958150A9F7DD24D3944D
:107E5000A5E0EA2EF1E1FF2EA4D0813421F481E0E7
:107E6000BED083E024C0823411F484E103C08534A1
:107E700019F485E0B4D08AC08535A1F492D0082FDA
:107E800010E010930102009300028BD090E0982F35
:107E90008827802B912B880F991F90930102809344
:107EA000000273C0863529F484E099D080E071D057
:107EB0006DC0843609F043C07CD0E0910002F0919F
:107EC000010283E080935700E895C0E0D1E069D0DB
:107ED0008993809102028150809302028823B9F72E
:107EE00078D007B600FCFDCF40910002509101020E
:107EF000A0E0B1E02C9130E011968C91119790E0C8
:107F0000982F8827822B932B1296FA010C01D0927E
:107F10005700E89511244E5F5F4FF1E0A038BF078E
:107F200049F7E0910002F0910102E0925700E895D4
:107F300007B600FCFDCFF0925700E89527C08437C4
:107F4000B9F437D046D0E0910002F09101023196A9
:107F5000F0930102E09300023197E4918E2F19D043
:107F600080910202815080930202882361F70EC043
:107F7000853739F42ED08EE10CD085E90AD08FE018
:107F800096CF813511F488E019D023D080E101D05B
:107F900063CF982F8091C00085FFFCCF9093C600DF
:107FA0000895A8958091C00087FFFCCF8091C600FE
:107FB0000895F7DFF6DF80930202F3CFE0E6F0E00A
:107FC00098E190838083089580E0F8DFEE27FF2713
:107FD0000994E7DF803209F0F7DF84E1DACF1F93FD
:0E7FE000182FDFDF1150E9F7F4DF1F9108952D
:0400000300007E007B
:00000001FF

The above dumped hex can be copied into a text file and loaded that file into your new Atmega328P chip. To load the hex into your chip, there lot of methods are being used by the people. You can refer that in the web. In the next post, i will describe the complete way to load bootloader into the Atmega328P.    

A simple and minimal Atmega328P Target Board

A simple and minimal Atmega328P Target Board

The following circuit will definitely be helpful for any electronic hobbyists who seek a simple circuit useful for small small embedded applications such as domestic timers, PIR base lights on/off circuits, remote switches, burglary alarms, measuring instruments such as voltmeters, ammeters, LED Displays etc... The circuit is designed with minimum components so that the cost of fabrication of PCBs will be less and also for assembling the circuit, the expenditure will be less.  


  

Thursday, 11 June 2015

HOW TO USE TILT SENSOR WITH ARDUINO UNO

HOW TO USE TILT SENSOR WITH ARDUINO UNO

In this example, let us see how a tilt sensor can be interfaced with an Arduino Uno. Through this article you can imagine some applications where you can use these type of sensors. Through this tilt sensor, you can sense a tilt by means of any movement of normal and abnormal in nature.

What is a tilt Sensor?
Tilt Sensor allow you to detect orientation or inclination. They are small, inexpensive, low-power and easy-to-use. If used properly, they will not wear out. Their simplicity makes them popular for toys, gadgets and appliances. Sometimes they are refered to as " mercury switches", "tilt switches" or "rolling ball sensors" for obvious reasons. 

In construction, they are usually made by a cavity of some sort(Cylindrical is popular, although not always) and a conductive free mass inside, such as a blob of mercury or rolling ball. One end of the cavity has two conductive elements (Poles). When the sensor is oriented so that the end is downwards, the mass rolls onto the poles and shorts them, acting as a switch throw.

The diagram shows such sensor.


The following wiring diagram shows the Tilt sensor to be connected to the Arduino Uno.


The following diagram also shows the 3D view of connections of Arduino Uno with Tilt sensor at Pin no.2 and Led at Pin no.3

 
  
                    The following shows the Arduino sketch. Load the sketch into the Arduino IDE and run it, now shake the tilt sensor, the led connected to the Pin no.3 will become on and off depending upon your tilt.

int SensorPin = 2;
int LEDPin = 3;
int LEDstate = HIGH;
int reading;
int previous = LOW;
long time = 0;
long debounce = 50;


void setup()
{
pinMode(SensorPin, INPUT);
digitalWrite(SensorPin, HIGH);
pinMode(LEDPin, OUTPUT);
}

void loop()
{
int switchstate;
reading = digitalRead(SensorPin);
if (reading != previous)
{
time = millis();

if ((millis() - time) > debounce)
{
switchstate = reading;
if (switchstate == HIGH)
LEDstate = LOW;
else
LEDstate = HIGH;
}
digitalWrite(LEDPin, LEDstate);
previous = reading;
}

After loading the above sketch, incline the tilt sensor and the LED connected on pin 3 will turn on. If you have any problem please send feedback.