Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Sensors / HC-SR04 Ultrasonic data spikes on: August 17, 2014, 08:26:41 pm
I'm working on something that involves a lot of ultrasonic sensors.  I had a few HC-SR04s but a few were defective and so I ordered a few more.  The new ones appear to be a slight revision, but they still act exactly the same way and are plenty accurate... except when something is out of range.

Note, my code is only meant to read up to 3m - beyond that doesn't really matter to me.

When I either cover up the trigger transducer, or, if something is very far away, the value spikes between 3m and somewhere between 0-90cm.  This does not happen with my old sensors, but ALL of my new ones appear to be doing this.  It's difficult to correct this because what if something really does jump in front of the sensor and is actually less than 100cm away?

To ensure it wasn't my code, I tried using pulseIn with the default timeout, which is pretty long.  This does the same thing.  I don't think the sensors are defective, because they do actually accurately read when something is in range.

Any idea why this is happening and what I can do to prevent it?

Sorry if this has been asked before.  I'm not really sure how to search for this problem.
2  Using Arduino / Sensors / Re: Waterproofing HC-SR04 Ultrasonic on: June 29, 2014, 08:11:29 pm
I'm going to see if someone with more skill than me can try the de-soldering.  If you haven't figured it out, I'm kind of a noob when it comes to electronics, so I don't feel too confident in being able to follow that link you provided.  Thanks for pointing it out though.
3  Using Arduino / Sensors / Waterproofing HC-SR04 Ultrasonic on: June 29, 2014, 11:56:09 am
I'm looking for a way to weather-proof the HC-SR04 ultrasonic range finder.  There are probably times where it might end up underwater, but generally I just want it to handle splashes of water and some dirt, and not completely screw up because of those.

I bought some 40KHz waterproof transducers, but unfortunately I can't figure out how to de-solder the old transducers.  The solder goes in too deep for the wick to pick it up.

I like the price point and operation of these units, so I was wondering if anyone knows of a variation of this board that either doesn't come with transducers, or, comes with waterproof ones.

On another note, I know that part of the challenge in terms of designing these sensors is amplifying the voltage and interpreting the signal.  Based on the fundamentals of how US works, it doesn't seem that difficult.  I get the impression that what makes the schematics so complex is the fact that it has to amplify 5v to 12v while still giving 8 pulses of a clean 40KHz square wave, and then the circuitry to read the signal and transmit it to the arduino in a way that's easy to use.
I have a 12v power source, some transistors, H-bridges, and op-amps to my disposal.  Assuming I get the arduino to do most of the work (including creating a 40KHz square wave and interpreting the signal), does anybody know of a basic design I could use?
4  Using Arduino / Networking, Protocols, and Devices / Re: Seeeduino GPRS + Prepaid phone service on: March 28, 2014, 12:49:51 pm
Awesome thanks for the info, I really appreciate it.  T-Mobile should work just fine for me I think - I intend to use a lot more data than you, but I don't expect to use up all the credits.
5  Products / Arduino Due / Re: Problems with Negative Floats *solved* on: March 26, 2014, 08:22:26 pm
Have you tried using short?  I don't know for sure if that works with floats.  Also, have you checked out stuff like
6  Products / Arduino Due / Re: Weird communication issue on: March 25, 2014, 10:31:16 pm
So, I was apparently right - by adding a delay(50) to the Due code, the duemilanove received the data just fine.  This is a little irritating that I have to actually slow the code down in order for it to catch up, but I guess that's a separate issue I can attempt to solve on my own.

I tried using 57600bps and that didn't fix the problem either (not without a delay anyway).
7  Products / Arduino Due / Re: Weird communication issue on: March 25, 2014, 09:46:40 am
I don't have the code in front of me at the moment, but shouldn't be anything special about it at all.  But, as a thought, maybe the major difference is the fact that the Due is streaming data.  The Due is much faster than the Duemilanove.  Perhaps the Duemilanove can't keep up; it's probably receiving data, but maybe it's receiving it as just a single blob of a string and doesn't know what to make of it.  I can double check that when I get home.

I also have a bluetooth adapter connected to RX1/TX1 on the Due, which also streams in both directions.  That seems to work just fine.
8  Products / Arduino Due / Weird communication issue *solved* on: March 23, 2014, 01:30:08 pm
I'm trying to send serial data from the TX2 of my Due to the RX of a Duemilanove at 115200bps.  I have a 3.3v to 5v logic level converter in between, so nothing gets fried.  However, for some reason it doesn't seem to work, and I'm not sure what to do about it at this point.

Using a USB serial adapter, I am able to confirm the following:
* The TX2 on the Due correctly transmits data when connected directly to the USB adapter.
* The TX2 on the Due converted to 5v (through the logic level converter) also correctly transmits data to the USB adapter.
* The RX on the Duemilanove correctly receives data directly from the USB adapter.
* The RX on the Duemilanove correctly receives data when the USB adapter is on the 3.3v end and the Duemilanove is on the 5v end.

So, this concludes that all pieces of hardware work fine, individually.  Neither of the built-in USB ports have been connected for any of these tests.  The supplied power source for both arduinos is 5v 1.5A.
9  Using Arduino / Networking, Protocols, and Devices / Seeeduino GPRS + Prepaid phone service on: March 22, 2014, 07:22:01 pm
So I recently received the Seeeduino GPRS/GSM v1.0 board, and I haven't yet purchased a plan for it yet.  I own a prepaid phone with the Tracfone service, but unfortunately the SIM card only works on a phone registered to it and nothing else - not even other tracfone phones, so needless to say, it doesn't work on this board.

I was wondering if anyone knew of any US based prepaid phone services where it is proven to work with this.  I'm sure AT&T and Verizon work fine, but I'm not interested in having full plans like that.
10  Products / Arduino Due / Re: Arduino Due and Arduino GSM - Any Experiences? on: March 16, 2014, 05:33:21 pm
I too am interested in this (funny how I encountered  this problem exactly 1 year after the OP).

What I don't get is why exactly is this so hard to port to the Due?  From what I gather, it's just a software serial connection and a reset pin.  Assuming all the GSM library does is send a series of commands to configure and operate the shield, couldn't we just use establish the RX1/TX1 serial connection and send commands manually?  How complicated could it really be to tell it to send a text message, pick up an incoming phone call, or get the PIN?  I don't have any documentation on it so I don't really know where to begin.  Skimming through the source code to the GSM library, I can understand why nobody has bothered to support the Due - it's pretty big.  On the other hand, if this really is as simple as just sending serial messages with some sort of header, that library seems very over-complicated.

While this is a different board, wouldn't something like this be possible:
11  Products / Arduino Due / Re: Problems with Negative Floats *solved* on: February 11, 2014, 09:31:40 am
That makes sense, thanks for the explanation.  Last night I did a little research on level shifting and how exactly the code I have works.  As with many example codes, the author doesn't tend to do a very good job at explaining anything.  I tend to do a lot of coding in python, where stuff like this exists but is rarely ever needed, so a lot of it doesn't make much sense.

I might try messing around with your suggestion though, instead of using short.  short might give me the result I'm looking for and might actually be a better choice since it uses less memory, but I prefer to fully understand how things work.
12  Products / Arduino Due / Re: Problems with Negative Floats on: February 10, 2014, 05:14:33 pm
I'm aware the Due is 32 bit, but why exactly does that mean the number jumps to 65537 instead of -1?  I want to get to the negatives, which it will do on the Mega.

I found the solution - I used "short" instead of float and that seemed to fix the problem.  But out of curiosity, what would I have to change if I wanted to keep it as float?
13  Products / Arduino Due / Problems with Negative Floats *solved* on: February 09, 2014, 11:12:30 pm
I have an ADXL345 I2C accelerometer where I read the X, Y, and Z values into float variables.  On an arduino mega 1280, this works fine and will even show the negative numbers.  On the Due, it works fine but only in the positive spectrum.  If I tilt the accelerometer so the axes become negative, it starts counting down from 65537, or at least some number close to that.

The really strange thing is I can still use negative floating point numbers, so why is this so different?  Here's the part of the code where the variables are defined:

Wire.beginTransmission(acceldev); Wire.write(0x32); Wire.endTransmission();
byte acceldata[6];
for (int i=0;i<6 && Wire.available();i++) {acceldata[i];}
float ay1=acceldata[0] | (((int)acceldata[1])<<8);
float ax1=acceldata[2] | (((int)acceldata[3])<<8);
float az1=acceldata[4] | (((int)acceldata[5])<<8);
14  Products / Arduino Due / I2C Issues on: February 01, 2014, 09:52:20 pm
I'm sorry if this has been asked before but after a couple hours of searches I haven't found any useful answers.

Anyway, I own an UDOO, which is half Arduino Due and half an i.MX6 armhf platform.  Most things seem to work just fine on it, but one that explicitly doesn't work is I2C.

I can load the library, I can set up an I2C device (such as an accelerometer), I can read data from it, and I can assign that data to variables.  But that's as much as I can do.  If I do anything else, such as analogWrite or Serial.println, the code freezes.  That being said, I don't even know if its actually reading the accel properly because I have no way of representing the data.

The code works fine on an Arduino Mega 1280, as well as the same accelerometer.

I read that apparently the Due has had issues in the past with I2C, but I'm not exactly sure how or why, and I'm not sure if the problems have been resolved since.
15  Using Arduino / Installation & Troubleshooting / Re: Confusing Due Compilation Issue on: December 22, 2013, 10:34:57 pm
Ah the error became a lot more easily distinguished when I created a new sketch that just involves "int y1;" - in my complete sketch I got a long list of other unhelpful errors that were a chain reaction of this y1 issue, making the source issue a lot harder to find.  Also note that I mainly code in python, where errors are listed in a reverse order, compared to C.

I suppose I could just rename y1 - it is just a name after all and it isn't likely anybody else is going to be looking at it. But it is a variable that I personally would see being relatively common.  I can't imagine how many projects out there that use multiple sets of axes, so in my personal opinion, using such a typical name for a variable in something as common as math.h could cause some serious headaches.  So for example, what if I really wanted to do a double?  I doubt an error would occur, but it could potentially give really wonky results.  Personally, I think math.h should rename it to y_0 and y_1, which are a lot less likely to be used.  But, instead, I guess I'll be using that pattern.

Thanks for the clarification anyway.
Pages: [1] 2 3 ... 5