Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

What do I need to run the Atmega chip out of the arduino?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

What do I need to run the Atmega chip out of the arduino?

by pwnz32 on Fri Jun 27, 2008 6:21 pm

I'm getting an arduino soon, and after a few simple projects to get used to it I want to make a 2 liter soda bottle submarine for the lake i live near.

I want it to be able to dive, level off at a certain depth, then record temperature and the speed of the water every half hour or so. After a day I want it to be able to activate a baking soda and vinegar mixture that fills balloons with air, making it rise to the top of the water where I can (hopefully :D ) retrieve it.

So instead of having the entire arduino go with the sub, just in case it doesn't work I want to only send a preprogrammed atmega chip. So what does it take for the chip to work?

I know it needs 9 volts, and a oscillator, but I've also heard that it has it's own internal oscillator?

Microcontrollers are very new to me so I don't know a lot of this stuff, any help would be extremely useful. :P

edit: Any other ideas on what to test/measure underwater, or how to have it figure out it's depth would be good to, I'm still thinking of things for it to do.
They saw to truly know a man you need to walk a mile in his shoes.
Well screw that!!
He's a mile away and you have a free pair of shoes!
pwnz32
 
Posts: 36
Joined: Thu May 15, 2008 9:38 pm

by mtbf0 on Fri Jun 27, 2008 7:03 pm

the mega168 will run at up to 10MHz on 2.7v. above 10MHz it needs 4.5 to 5.5v.

a stock arduino board has a 16MHz resonator, so requires at least 4.5 volts. this could be had from, say 4 nimh AAs, (4.8v). if you replace the 16MHz resonator with an 8MHz clock source, it's not too hard to burn a copy of the lilypad bootloader, then you could run on 2 alkaline AAs, (3v), or 3 nimh AAs, (3.6v). you can run without a resonator, but would then need to burn the fuses to get the 8MHz internal oscillator, and load the lilypad bootloader. you only have two choices for clock speed 8MHz or 16MHz, unless you want to start modding the bootloader and the arduino libraries.

other than the meg168 and a clock source, you'll need a programming header to attach an ftdi 232-ttl cable or a an rs232-ttl converter. you'll need a reset switch and maybe the reset cap from to allow soft reset for programming. probably a couple of filtering caps.

and then there's power. you might want to think lipoly, because if your sub weighs too much, you don't get it back. on the other hand you need balast to sink the thing in the first place, so maybe you could put a soda bottle in a bucket and start dropping AAs in it 'til it starts to go down.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

by pwnz32 on Sat Jun 28, 2008 2:47 am

mtbf0 wrote:... you'll need a programming header to attach an ftdi 232-ttl cable or a an rs232-ttl converter....


What are those and what are their purpose?? :?:
They saw to truly know a man you need to walk a mile in his shoes.
Well screw that!!
He's a mile away and you have a free pair of shoes!
pwnz32
 
Posts: 36
Joined: Thu May 15, 2008 9:38 pm

by westfw on Sat Jun 28, 2008 7:43 pm

If you had in mind programming the chip in the actual arduino, and then removing it and putting it in your submarine, then you don't need the "programming" hardware from the arduino, just the bare minimum to RUN the chip. This should be the 16MHz crystal and caps (or resonator), some sort of "approximately" 5V power supply, and a resistor to hold the chip in "not reset" mode.

Were you planning on tying the bottle to some sort of anchor? If not, you'll have a hard time measuring "water speed." Another interesting and easy thing to measure would be light level, which would give you an idea of water clarity, especially if you have surface readings as well (and a clock, lest you decide that the water gets really cloudy for about 10 hours each day...)

westfw
 
Posts: 1655
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

by mtbf0 on Sat Jun 28, 2008 10:16 pm

pwnz32 wrote:
mtbf0 wrote:... you'll need a programming header to attach an ftdi 232-ttl cable or a an rs232-ttl converter....


What are those and what are their purpose?? :?:


the mega168 on an arduino comes programmed with a serial bootloader, so that it can be programmed without any specialized, (i.e. avr specific), hardware, but it does require that you have either an interface to convert the relatively high and low signal levels of the rs-232 standard to 5 volts and 0 volts or a usb to serial convertor.

the arduino comes with an ftdi usb to serial convertor on board. folks like me who use the boarduino have to use a convertor. lady ada sells a cable with a usb to serial convertor built-in, which is what i use to program my boarduinos.

as westfw says, you can always program the chip on the arduino board and then move it to your target. this does tend to physically stress the chip if you are not careful. i would almost certainly wind up with bent or broken pins on about the third debugging iteration.

and what westfw said about the pullup on the reset pin, guess i forgot that.

...and please fix the spelling in your signature.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

by pwnz32 on Sat Jun 28, 2008 11:00 pm

I plant to program the atmega first on my arduiono, then I'll transfer it to my boards.

So I need a power supply, 16 Mhz oscillator, some capacitors, and a resistor? Thats all?

Actually measuring the amount of light would be pretty simple+ I *might* be able to use the solar panels to charge the battery as well.

And I can be a very bad speller sometimes, will fix! :oops:
They saw to truly know a man you need to walk a mile in his shoes.
Well screw that!!
He's a mile away and you have a free pair of shoes!
pwnz32
 
Posts: 36
Joined: Thu May 15, 2008 9:38 pm

by Silver on Sun Jun 29, 2008 2:51 am

I'm not sure I understand what you want to do here.

You want to build a sub using a 2 liter soda bottle, put it in the lake and have it submerge to some depth from the surface or some height above the bottom? How deep is it supposed to go? 5 feet? 20 feet? 80 feet?

You will need some way to regulate the buoyancy of the sub to keep it at your desired depth or use diving planes to "fly" in the water and keep a steady depth. This means adding some sort of distance measuring sensor, motors, speed controller, servos, and buoyancy control.

The sub is supposed to drive in any random direction for 24 hours, then surface where you are supposed to find it anywhere on the lake? You want to measure the speed of the lake? Is the water in the lake moving? If the sub is moving too, how you to tell if you are moving with, across, or against the flow?

It sounds like you would be better off suspending the measuring equipment from a float on the surface and making your measurements. The depth would be regulated by the length of rope connected to your float. You would also have to add enough ballast to make your bottle sink.

If you want to measure from the bottom, you could use a rock as a ballast, a measured length of rope to set the distance above the bottom, and a very buoyant soda bottle with your measuring equipment inside. A second rope would connect to a float on the surface so you can pull the whole thing up at the end of your measuring period. If you want to measure the speed of the water moving in the lake, you will need to anchor the measuring equipment to a fixed location somehow anyway.

If my understanding of your project is wrong, please add a few more details.
Silver
 
Posts: 12
Joined: Mon Apr 21, 2008 1:39 am

Please be positive and constructive with your questions and comments.