Show Posts
Pages: 1 ... 51 52 [53] 54
781  Using Arduino / Installation & Troubleshooting / How do I reset and clear the sketch in a UNO on: September 14, 2011, 02:44:07 pm
If I download a sketch onto my Uno it runs.
When I press the reset button the sketch re-initialises and starts again.
If I plug in the USB cable while holding the reset button down the sketch starts again when the button is released.

I would like to reset the Uno so that it has no program running and is just sitting waiting for a new sketch to be downloaded, how can I do this?

I would like to do it so that when I am finished with a sketch I can delete it. Otherwise if I build a new circuit when I plug the Uno in the old sketch starts running on the new circuit - which I don't like.

Also I am starting to use the Serial Monitor and, though it has not happened yet, I can see that I might write a sketch that messes up the serial link preventing me from doing a download.

Are there any built-in commands that can be sent to the Uno via the Serial Monitor e.g. to stop or delete a sketch?
782  Using Arduino / Project Guidance / Re: Water level sensor w/ nichrome wire no, now capacitive on: September 13, 2011, 01:57:00 pm
Quote
I already have an accelerometer which I've configured to tell me the position in space of the craft, which way its listing or tilting.
I have not used accelerometers or gyros. I am surprised that an accelerometer lets you know your attitude, I imagined it would not give you information if you were at rest or moving at constant speed.

Quote
I think a sit down and a new design is necessary
I hope you don't mind if I make what are intended to be constructive comments;

I have been a passenger in a home made, open, two man submarine. Its design was essentially torpedo shaped with the pilot sitting in the front and the passenger in the rear. Between the two occupants was a central ballast tank from which the submarine “hung”. In other words the submarine was a solid structure with the positive ballast central and slightly above most of the mass.

Propulsion was by electric motor driven by lead acid batteries in a sealed compartment at atmospheric pressure. Pressurising the battery compartment was avoided because there were passengers and there was concern about an explosion risk with hydrogen from the batteries. There was probably still a chance of something spectacular happening if a lot of sea water had gotten into the compartment  smiley

Quote
The water level sensors will hopefully tell me how full the tank is at each end. This way I can see which tank needs filling, and fine-tune the filling or emptying.
You seem to be intending to submerge vertically and a canal will have little current. If you make the design stable, e.g. "hanging" from a central point, then all the buoyancy needs to do is raise and lower you. If you measure pressure you will know accurately how deep you are and whether you are ascending or descending.

You don't really need to worry about how much water is in the buoyancy tank which I suggest should allow water to enter freely at its base;
  • To descend - let air out of the tank slowly. If you don't go down your design needs extra negative ballast. If you do go down then your rate of descent will start to increase as the air in the tank gets compressed and more water enters, so you may need to pump in a little air.
  • To ascend - pump air into the tank slowly. If you don't ascend you have a problem, fire the explosive bolts and release the concrete ballast  smiley. If you do start to ascend then your rate or ascent will increase as the air in the tank expands expelling more water. You need to be able to release air fast enough to control your ascent or it could be a bit dramatic

As far as the electronics are concerned some water will get into any container you try to keep at atmospheric pressure. Putting the expensive bits in a pressurised bladder, which you can put in your sealed tray, will give you a belt and braces solution.

I think it is a great project, I hope it works. Post some pictures of the final system.
783  Using Arduino / Project Guidance / Re: Serial Data interpreting/comparing on: September 12, 2011, 09:35:01 am
Quote
It seems like that from there I am basically pulling the entire serial message apart character by character, filtering, and then I will have to "reassemble it" somehow and then compare that numerical value with a predefined value.

You might want to look at functions like sprintf and sscanf to make and read data from strings.
784  Using Arduino / Project Guidance / Re: Arduino positioning on: September 12, 2011, 09:27:50 am
Could you use ultrasonics, the range is about right I think.
As there are only 3 Arduinos each could ping out a unique code.
By listening an Arduino might be able to figure out the position of the other two units.
I am not sure how far apart its "ears" would need to be.
Perhaps if you had four listening sensors that were fairly directional the volume, rather than time delay, would let you the rough location.
785  Using Arduino / Project Guidance / Re: Water level sensor with nichrome wire on: September 12, 2011, 04:58:19 am
My calculation is that your two ballast tanks will provide 76kg of buoyancy, and more will be provided by the air filled tray holding the  controls and any other sealed voids or materials that are less dense than water.

I imagine you would want to submerge with the tanks about half full so the ROV will need a mass in excess of 38kg. Will the bilge pumps be in the ROV, and what about the propulsion system?

Your wire sensors will only tell you the pitch of the ROV and will not give you that information if the tanks are empty or full, is that not correct? Might you not be better to use tilt switches or gyros http://www.sparkfun.com/search/results?term=gyro&what=products which would give you pitch and roll and could be kept in the control area?

Your target depth of 10m seems a good one, but the first 10m are the worst as the pressure will double from 1 atmosphere to 2. This means if there is a leak into your control tray it will half fill with water as the air compresses. One trick I have seen used to keep a camera dry to 20m was to put it in a bladder then pressurise the bladder with a bicycle pump. The bladder compresses on the way down, but any leakage is of air out not water in.

I am not sure how stable your catamaran design will be when submerged, I think it might roll so that you end up with one tank vertically above the other. The problem seems identical to designing a balloon to carry a payload. Balloons and airships always have the payload suspended beneath the buoyancy, there is probably a good reason for that.
 
786  Using Arduino / Project Guidance / Re: Arduino to Intercept Signal Between IP Camera and Stepper Motors on: September 08, 2011, 04:24:17 pm
I too am interested in driving some stepper motors.
However I bought a starter kit http://www.oomlout.co.uk/starter-kit-for-arduino-ardx-p-183.html with which I am pleased.
This is simple to use, has circuits, code, a couple of tiny motors (not starter) and so on.
I am going to work my way up starting with just flashing LEDs.

Once I get to steppers I will probably buy a shield like this http://www.oomlout.co.uk/index.php?main_page=product_info&products_id=207. Then once I know what I am doing I can be a bit more adventurous.
787  Using Arduino / Project Guidance / Re: arduino uno driver installation on: September 08, 2011, 01:27:33 pm
I just got my Uno the installation on XP was a quick easy 5 step process;
  • 1. Download the software : http://arduino.cc/en/Main/software
  • 2. Unzip the software : unzip arduino-00xx0win.zip into c:\Program Files\
  • 3. Shortcut icon : open c:\Program Files\arduino-00xx\  (xx is the version # ), Right Click Arduino.exe sendto->Desktop (create shortcut)
  • 4: Plug in your Arduino : Use the USB cable. Wait for pop up box
  • 5: Add new hardware :
    • Skip searching the internet - click the next box when prompted to do so
    • Install from a specific location - click "install from a list or specific location (Advanced)"
    • Chose the location - c:\Program Files\arduino-00xx\drivers
    • Finished  smiley
788  Using Arduino / Project Guidance / Re: Solar-Powered RC Helicopter With Video on: September 08, 2011, 10:23:25 am
The Japanese launched hydrogen filled paper balloons from Japan towards the USA during WWII.
Around 10% managed to complete the 5,000 mile journey in about 3 days at an altitude of around 30,000ft.
The explosive payload was about 20kg but the 10m diameter balloon had to carry about 450kg of gear, presumably a lot of this weight was the sand ballast.
The control system was based on mechanical timers linked to an altimeter.

As a weapon it was not very successful though amazingly one balloon caused a short circuit in the power lines supplying electricity to the cooling pumps
of a nuclear reactor in the Manhattan project!!!

To get a video aloft using a small balloon with solar power for control and communications is obviously possible.
You might either be able to launch, track and recover as manned hot air balloons do or head for the edge of space like
Joseph Kittinger who made it to 102,800ft in a helium balloon before jumping out and breaking the sound barrier in free-fall on the way down.

789  Using Arduino / Project Guidance / Re: Water level sensor with nichrome wire on: September 08, 2011, 09:36:36 am
Sounds like a really interesting project, twenty questions;
  • How deep do you intend to go ?
  • Will you be pressurising the compartment containing the electronics or will it be sealed it so that it remains at 1 atmosphere?
  • How many balast tanks are there?
  • You want to measure the level at both ends of the tank, does this mean the tanks are normally horizontal then, as the ROV dives,
    they tilt so the water level in one end becomes shallow and the other deep?
  • What is the maximum dive angle?
  • Is what you are really interested in the volume of water in the tank?
  • Will the ROV be autonomous and how will you communicate with it?
   
790  Using Arduino / Project Guidance / Re: Decimal to Binary Conversion Issue on: September 07, 2011, 02:29:19 pm
Bill's last post hit the nail on the head.

The code
digitalWrite(4, ((var & B00010000) ? HIGH : LOW));
complies with the API and follows a standard construction, so you can easily tell it is correct and will work.

The code
digitalWrite(4, (HIGH && (var & B00010000)));
does not comply with the API, so without further knowledge or investigation to prove (in this implementation) HIGH is defined as 1 and LOW is defined as 0 you cannot be confident the code will work. The way the code mixes logical and bit operators to arrive at a value is also harder to follow. Also do all compilers return 1 for true ?

Got my Uno, built the blinking LED circuit and was surprised when it started blinking before I even downloaded the sketch  smiley
"Serial" does provide an easy way to print out actual values of constants and also to check what expressions evaluate to.
It does look like this problem is an electronic rather than software one.
791  Using Arduino / Project Guidance / Re: Decimal to Binary Conversion Issue on: September 07, 2011, 03:22:09 am
Try your program with var equal to each of 1,2,4,8,16 do you see only one LED comming on each time and is it the right one?
If not then it could be crossed wires as suggested.

You are missing the point about the constant HIGH though.
As indicated in another post this code is correct
digitalWrite(4, ((var & B00010000) ? HIGH : LOW));

and unless you know HIGH==1 and LOW==0 it is not the same as writing
digitalWrite(4, ((var & B00010000) ? 1 : 0));

as digitalWrite might be programmed to turn on the output when it gets a parameter 5, or 255 or something else.




792  Using Arduino / Project Guidance / Re: Decimal to Binary Conversion Issue on: September 06, 2011, 03:38:42 pm
You are making an assumption that the constant HIGH has a value of 1, it might, but it might not.
It could be,for example, that HIGH has a value of 5 since the output has to go to 5V.
So I am suggesting you confirm what value HIGH is actually defined to have, then confirm that your logic correctly sends that value to the function.

I had a very quick look at the documentation to find the value of HIGH but could not find the actual value.
The boolean 'false' is 0. The boolean 'true' is any non-zero value.

I think you should be able to print values to the serial monitor using
Serial.print(val)
Serial.print(val, format)

but I have not tried these as my Arduino has not arrived yet  smiley

793  Using Arduino / Project Guidance / Re: Decimal to Binary Conversion Issue on: September 06, 2011, 03:13:08 pm
The function digitalWrite has parameters pin and value.
When value is set to the constant HIGH the output pin goes to 5V which lights your LED.
However you don't know what the constant HIGH is it may not be a 1.
Try printing out what the value of the constants HIGH and LOW are then check that you are calling digitalWrite with those values.

794  Using Arduino / Project Guidance / Re: Urgent !!: Beginner help needed with serial communication.. on: August 29, 2011, 01:17:59 pm
I think using a serial monitor is a good idea. Check you can send characters to it and receive characters from it before trying to send and receive at once on the Arduino. If you don't have a serial terminal/monitor then put the baud rate down low , 300 baud, and put an LED on the output pin (or use a serial breakout box). If you are managing to output bits you will see the LED flash and you may even be able to tell characters apart.

What does Serial.write actually do? Is it using a hardware serial UART ? If it is you will be able to send and receive because the UART will have buffers. If the Arduino processor is doing the reading and writing then you probably will not.

Take a look at this;
http://arduino.cc/en/Reference/SoftwareSerial

795  Using Arduino / Project Guidance / Re: Decoding phase shifted signal in 198kHz LW radio carrier on: August 20, 2011, 09:15:47 am
The wikipedia article suggested that VLF radio signals could be received using "a coil of insulated wire". Is that really correct?

Returning to the subject of my post, the most promising component I have found is this Si4753 based shield from Sparkfun http://www.sparkfun.com/products/10342. However reading the datasheet I don't think it provides the carrier phase change information I need (at least not in a way that is readily accessible to me). Can anybody comment/advise on this?
Pages: 1 ... 51 52 [53] 54