loading
Picture of Arduino from Scratch - Digital Thermometer
DSC00240.JPG
DSC00221.JPG
DSC00222.JPG
DSC00227.JPG

I have loved making projects with Arduinos, but at $30 a piece your projects can get expensive. So I want to show you how you can make your own Arduino from scratch and save money doing it. Make your own Arduino for around $8. For this instructable I show you how to make one on a breadboard and with it make a digital thermometer.


 
Remove these adsRemove these ads by Signing Up

Step 1: Parts you need for the Arduino:

Picture of Parts you need for the Arduino:
  • Full Size Breadboard ($8 adafruit.com)
  • 22 AWG Wire or jumper wires ($6 adafruit.com)
  • 1 - 7805 Voltage Regulator ($0.18 taydaelectronics.com)
  • 2 - LEDs ($0.02 each taydaelectronics.com)
  • 2 - 220 Ohm Resistors ($0.10 each taydaelectronics.com)
  • 1 - 10k Ohm Resistor ($0.10 taydaelectronics.com)
  • 2 - 10 uF Capacitors ($0.01 each taydaelectronics.com)
  • 1 - 16 MHz Clock Crystal ($0.07 taydaelectronics.com)
  • 2 - 22 pF Capacitors ($0.10 for pack of 10 taydaelectronics.com)
  • 1 - Small Momentary Normally Open "off" Button ($0.05 taydaelectronics.com)
  • 1 - Breadboard-friendly 2.1mm DC barrel jack and 9V Wall Wort with 2.1mm Plug (2.1mm jack $0.95 adafruit.com)
  • 1 - ATMega328 with Bootloader ($6 adafruit.com or cheaper other places if you can add your own bootloader)
Many of these parts you can also buy from Radio Shack.
Assuming you have a breadboard, wire, and a way to program (see step 4) the Arduino parts cost a total of $7.71 +shipping.

Step 2: More Power Captain!

Picture of More Power Captain!
DSC00248.JPG
DSC00253.JPG
DSC00231.JPG
7805.jpg
LED pinout.gif
Connecting the power source:

Plug in the 2.1mm barrel jack on the side of the breadboard like in the picture and add jumper wires going across the middle. (instead of the barrel jack and wall wort you can use a wired up 9v battery)

Add the 7805 power regulator and the lines to power the board. It's input from the external power supply goes in on the left, ground is in the middle and the 5V output is on the right (when facing the front of the regulator). Add power OUT and ground wires that connect to the right and left rails of the breadboard.

Also, add a 10uF capacitor between the IN of the regulator and the ground (between the plug and 7805) as well as a 10uF capacitor on the right rail between power and ground. The silver strip on the capacitor signifies the ground leg.

Add power and ground wires at the bottom of your board connecting each rail. So now the bottom and top have power and ground. (see pic)

Now you are going to add the power "on" indicator. Add an LED and a 220-ohm resistor on the left side of your board behind the barrel plug. An LED attached to power like this is a great troubleshooting trick. You'll always know when your board is being powered as well as quickly know if your board is being shorted.

Plug in the power to turn it on and see if your LED lights up. If it does you are good to go for the next step. If not, check all the steps and cross reference with the pictures to find any errors.

Time for the "All Mighty Arduino!!!"

Step 3: Brainzzz!

Picture of Brainzzz!
atmega328-arduino-pinout.jpg
DSC00248.JPG
DSC00250.JPG
DSC00251.JPG
It's Arduino Time (see pictures for more details)

Take a moment to review the Pin Mapping (picture) of the Atmega. (Atmega168 and 328 have the same pin map.) When "pin" is mentioned it is in reference to the chip's pin not digital pin or analog pin.

Add the small tactile switch so that you can reset the Arduino whenever you'd like. Add the switch just above the top of the Atmega chip crossing the gap in the breadboard. Then, add a wire from the bottom left leg of the switch to the RESET pin of the Atmega chip and a wire from the top left leg of the switch to ground. Connecting a 10k ohm pullup resistor to +5V from the RESET pin

Connect to power(5v) and ground.
Pin 7 - Vcc - 5v
Pin 8 - GND
Pin 22 - GND
Pin 21 - AREF - 5v
Pin 20 - AVcc - 5v

Add a 16 MHz external clock between pin 9 and 10, and add two 22pF capacitors running to ground from each of those pins.

Now your Arduino should be all set, but lets test it. First add an LED just down from the Atmega and run wire from it's positve side to pin 19. Add a 220ohm resister from the LED's ground side to the ground rail.

Now let's make that LED Blink.

Step 4: Programing...

Picture of Programing...
DSC00246.JPG
DSC00239.JPG
DSC00238.JPG
DSC00237.JPG
There are a few ways to program this chip.

1. If you have another Adruino you can use it to program your chip by carefully swapping out the chip it came with. OR

2. You can buy a "FTDI friend' from adafruit.com $14.75 That is what I used.
If you aren't using this go the to next step.

It comes with a 6 pin row. Put this in (see pic) and connect as follows going left to right.
  1. To ground
  2. Not used
  3. To 5v
  4. To pin 2
  5. To pin 3
  6. To pin 1
Now with that connected you can plug in the FTDI friend and program it through USB from a computer with the Arduino software.
(Note: don't plug in both the FTDI friend and the external power at the same time)

Using one the these 2 methods go ahead and program the "Blink" sketch that comes with the software.
If your LED starts blinking away, you know everything is good and it's time to move on.
If you want to make the digital thermometer than you can program this sketch now.



/* This sketch is orginally from Ladyada.com.
It has been modified by Matt Jenkins 10/27/2011
*/

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);


//TMP36 Pin Variables
int tempPin = 1; //the analog pin the TMP36's Vout (sense) pin is connected to
//the resolution is 10 mV / degree centigrade with a
//500 mV offset to allow for negative temperatures
int tempReading; // the analog reading from the sensor

void setup(void) {

// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Temp-O-Mattic"); // You can change "Temp-O-Mattic" to something else like "The Temp is..."
}


void loop(void) {

tempReading = analogRead(tempPin);

// converting that reading to voltage
float voltage = tempReading * 5.0;
voltage /= 1024.0;

float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset
//to degrees ((volatge - 500mV) times 100)

// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);

// now convert to Fahrenheit
float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;
lcd.print(temperatureF); //If you want C and not F just change "temperatureF" to "temperatureC"
lcd.println(" degress F "); //You can change F to C

delay(1000);
}

Step 5: Connect the Temp Sensor

Picture of Connect the Temp Sensor
DSC00244.JPG
DSC00243.JPG
Install the TMP36 (see pic)

Plug in the TMP36 sensor so the 3 pins each have their own collum in the breadboard.
  • Wire the first pin to 5v
  • Wire the second (middle) pin to pin 24 (analog pin 1) on the Atmega
  • Wire the third pin to ground

Step 6: Add the LCD Display

Picture of Add the LCD Display
DSC00242.JPG
DSC00241.JPG
DSC00226.JPG
DSC00225.JPG
I recommend you buy your LCD from Adafruit.com. You can get the same one I show you for $10 and it comes with a necessary contrast potentiometer and a strip of header pins that need to be soldered on. They have other cool ones too.

First plug in the potentiometer. I have mine down by the power plug. There are 3 pins. The pin on one end goes to 5v and the other end goes to ground. The middle pin goes to pin 3 on the LCD.

There are 16 pins on the LCD. "1" is the upper left corner and the others go down the top toward the middle of the board. You need to wire it in like so.
Pin 1 - Ground
Pin 2 - 5v
Pin 3 - Middle pin of the potentiometer
Pin 4 - Atmega pin 13 (digital pin 7)
Pin 5 - Ground
Pin 6 - Atmega pin 14 (digital pin 8)
Pin 7 - not used
Pin 8 - not used
Pin 9 - not used
Pin 10 - not used
Pin 11 - Atmega pin 15 (digital pin 9)
Pin 12 - Atemga pin 16 (digital pin 10)
Pin 13 - Atmega pin 17 (digital pin 11)
Pin 14 - Atmega pin 18 (digital pin 12)
Pin 15 - 5v
Pin 16 - Ground

If you had already programed the chip for the "Temp-O-Mattic" then just plug in the power and it should be working. If you didn't notice you can change the words on the LCD from the program.

Step 7: Troubleshooting/More Info

Picture of Troubleshooting/More Info

If it's not working there are a few things you can try and check.
  • Is your "on" light lit? If not make sure the power it plugged in, the caps are in the right way (silver line means ground), the 7805 is in the right way, and you have the positive and ground wired right coming from the barrel jack.
  • Did the "Blink" sketch work? If not, check you have all the parts in. Compare the pictures to yours to see if anything is different.
  • Is the LCD lit? If not, your did not wire it in correctly.
  • Are you seeing a message on the LCD? If not, turn the contrast pot. If that doesn't work, check your connections, and reprogram the sketch.
  • You can leave questions in the comments below and I'll try my best to answer them.
  • Check out these awesome websites.
My YouTube Channel for more Geeky and Techie Videos http://www.youtube.com/user/GeekGuyMJ

TMP36 Tutorial http://www.ladyada.net/learn/sensors/tmp36.html

LCD Tutorial http://www.ladyada.net/learn/lcd/charlcd.html


Breadboard Arduino http://arduino.cc/en/Main/Standalone

Arduino Software Download http://arduino.cc/en/Main/Software


Buy Stuff:
www.adafruit.com
www.sparkfun.com
http://www.taydaelectronics.com
BeverlyJ110 months ago

Can anybody do this or only for those people who know some technical knowledge and stuff? I would like try to make one.

Well it depends because a lot of it is just being able to figure things out. Building electronics is like a thinking game, You don't need to be able to build a full scale computer, but you do need to know some basics. In which I have things that may Assist you in the is project. IM 14 by the way, and If I can do it and I do this stuff for fun, then you could to. Shoot me a Message on here or an email @ 298260@my.puhsd.org if you need some Information or tips and guides.

ramblreb1 year ago
Would I be able to add more temp sensors to this project and if so what would I have to add to the sketch to get it to scroll through the different sensors?
lmajer2 years ago
Can this be modified to mesure soldering iron tip temperature?
waterlubber2 years ago
How do I use a thermistor (one that has variable resistance) with this? I already have a program that returns the resistance of the thermistor, how do I make that into degress F? (or Celsuis, I know how to convert)
arabi22 years ago
is there much difference between tmp36 and tmp35 ?!!?.....
arabi22 years ago
photo of the circuit
picture000.jpg
arabi22 years ago
the LCD isn't working.... all connections are good... programmed and ( done compiling ) ......... it doesn't power on at all :(
yes........
What if I used a 16x2 character oled display from adafruit? Should I use the liquidcrystal library as written in your code or should I swap it with the library adafruit wrote specialy for the oled? Would swaping the librarys even work?

Link to the display found Here
I haven't even seen that OLED before. It looks really cool. From a simple look it might work with the LiquidCrystal.h library but it apparently has it's own library so you should give that a try instead. Let me know how it works.
Cool, I'll let you know
all connections are OK ... but for Bin 2.... isn't connected.. is there any prob. ?!!
matt.e.jenkins (author)  omar hussein2 years ago
pin 2? For the LCD? that one goes to 5v.
LCD didn't work .. what should i do !!
matt.e.jenkins (author)  omar hussein2 years ago
It must be hooked up wrong. If my instructions are confusing, you should try
http://learn.adafruit.com/character-lcds
I have a question. What kind of Board do you have to select when using a FTDI friendly when programing it?
matt.e.jenkins (author)  Maraudergal9153 years ago
You can select Uno.
But when I select Uno I am still getting a stk500_getsync(): not in sync:resp=0x00
matt.e.jenkins (author)  Maraudergal9153 years ago
That is strange. Troubleshooting errors like that is a bit beyond me. Did you get the FTDI Friend from Adafruit? They have helpful forums in which you can ask a question. I would try shuting down the PC and trying again. And maybe trying a different computer if you can. I have had issues like that before that I could not fix, but it worked on a different computer. Sorry, that's not much help.
Thank you sir and Yes I had gotten the FTDI Friend from Adafruit. We had went to go buy the Arduino bored model for the Uno just to see if we could get it to program and to see if it was just something we were doing wrong, but we had gotten it to program perfectly but every time we try to do it on the one we built it just keeps giving us the same not in sync. Thank you for your help sir.
I had this problem and was able to solving it by disconnecting reset line from the FTDIFriend (pin 1 on the arduino, pin 6/RTS on the FTDIFriend) and instead manually pressing the reset button on the breadboard right after clicking upload on my computer.

(I tried pressing the reset button while the FTDIFriend was uploading and noticed that nothing happened until it decided that the upload had failed, then the Arduino would reset.)
you could add a 0.1uf capacitor between the reset pin and the corresponding pin on the FTDI friend and it should work
I had the same problem, then I examined a schematic for the Duemilanove and noticed a couple of things missing from most tutorials.

First, add a 1k resistor inline with the rx/tx lines going to the microprocessor.

Secondly add an ac coupling capacitor (try 4.7uf or somewhere around there) in series with the DTR line going to the reset.

The bootloader works by bringing DTR low first, which should reset the device. The bootloader is always loaded after reset so after DTR is brought low it begins to try to communicate over the UART. If DTR never goes low the device will never reset and whatever sketch is running will keep running (and therefore the bootloader will not be running).

Finally, make sure you actually have the arduino hex image loaded on the device. There really is no easy way to do this - when I'm in doubt I drop it in my Duemilanove (mine is the DIP type and the chip isn't soldered in, so it's easy to take it out and replace with another) and see if I can download a sketch. If I can't download a sketch I usually plug my MkII ISP into the arduino board and download the correct hex file using winavr.
The board type should match the chip you are using (and the bootloader image). So, if you are using a 2650 you should pick the mega board. If using a 328 or 168, pick the uno. Take a look at boards.txt file to see what information is specified for each board type. These are usually maximum image size, cpu frequency, fuses, bootloader information, etc... There is nothing in there about what type of USB->Serial device you use. You specify that by choosing the correct com port. The device driver for whatever FTDI hardware you are using takes care of everything else so the device will output rs232 at ttl levels and look like any other rs232 terminal to the atmega uart.
Thank you as well. I think I understand alot better then I did.
wild. i didnt know they were so simple to build, thats interesting.
If you can live with the built in RC oscillator you can reduce the BOM even more by eliminating the crystal and capacitors. If you want a little more stability (but not as much as a crystal) use a ceramic resonator - many have built in capacitance so external capacitors are not required. Many microprocessors share similar small BOM configurations - PICs have a built in RC oscillator - same BOM (except for the chip of course).
cool!
could you use an arduino uno and use the same code for the FTDI friend and the project still work?
Yup. You can use your arduino UNO. It would work. Let me know if you have other questions.
insmac3 years ago
Hmm...any particular reason not to use the Boarduino from adafruit? At $17.50 for all the parts and PC board to mount them on...
matt.e.jenkins (author)  insmac3 years ago
I know of it and adafruit sells great things. But I think it is fun to create things from scratch. Plus it helps me and others know how it works.
I would also add that if someone wants to create a device which they plan to produce several of, knowing how to make this from scratch lets them integrate it all into one board, giving it a more unified professional design. Also in that case the savings add up.