Pages: 1 [2] 3 4   Go Down
Author Topic: n00b SPI problem  (Read 13058 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino is not rocking my socks today :(
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What is SLAVESELECT  from the SCP1000. I'm using Sparkfun breadk out, and got only CSB / DRDY.
How should I connect SLAVESELECT  ?

CSB should be connected to SLAVESELECT.
« Last Edit: April 09, 2009, 10:33:00 am by cullen » Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 276
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Does someone have the Sparkfun break out version working?

I got values like this:
PRESSURE [1073741760]
TEMP C [38]

PS: My room temp is no more then 23C

Thx
Geko
« Last Edit: April 23, 2009, 12:12:20 am by GekoCH » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 44
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everybody,

(Excuse my english, I'm french)

I have tried your code with a "Seeduino", and it works very fine.
But I need a smaller board for my project .

I 'm trying despairingly  this code on a "Stickduino" or a "Pro mini" (5V with a regulator, but I have tried also with the supply of the Pro mini 3V)
Impossible to obtain correct values (it's always '0')

I have verified all the solders, all the wires....Nothing  !!

Please anay idea or suggestion...?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I just thought I'd add something to this old thread. It seems some people have been having trouble getting the code to work. I too had my fair share of problems and have posted them below in an effort to help others in the future who may have similar problems. I'm not sure if the problems of the previous 2 poster are related to mine, but perhaps they have found a solution at this stage.

Anyway, I bought the SCP1000 breakout board from sparkfun and tried to interface it to an arduino duemilnova. The first problem was the 5V I/O pins on the arduino and the 3.3V pins on the SCP1000. To overcome this I got the logic level converters also from sparkfun and wired them up. Still the code did not work. The details provided by sparkfun for the logic level converters are a little misleading if not read carefully, on the low voltage side you will get half of the voltage on the high side, and not the actual low voltage. The problem I had was that I was driving 2.5V to the SCP1000 I/O pins and had the SCP1000 powered of a 3.3V supply. There is mention in the datasheet for the SCP1000 that Vcc cannot differ from the I/O voltages by more than a certain amount. (I don't have to hand the exact values). So the solution was to power the SCP1000 of 2.5V. This actually produces less error comapared to a higher voltage according to the datasheet also, which is a bonus. I have been getting what seem to be acuarate readings of pressure and temperature ever since.

Anyway hopfully this post will save somebody some time in getting their sensor to work.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

High all,

I'm new to Arduino, this Forum and how to use them, but you have to start somewhere.

I bought the Arduino Duemilanove and SCP1000 (pressure sensor from Sparkfun.) I've been reading this thread, but what I need is also a schematic how to connect the SCP1000 to the Arduino

Can anyone help me with a schematic and code for the Duemilanove.

Many thanks, DOSER.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For those who are reading this Post. This is about my Arduino Duemilanove working with a Sparkfun SPC1000 Pressure Sensor.

The code listed beneath in this Post is working OK. Except that the temp in C is a bit high. If you devide by 30 instead of 20 it is more realistic.

  temp_in = read_register16(TEMP);
  temp_in = temp_in / 30;
  // temp_in = ((1.smiley-cool *temp_in) + 32;  Add this to measure in Fahrenheit.
  Serial.print("TEMP C [");     // Change C in F if above is applied.
  Serial.print(temp_in , DEC);
  Serial.println("]");

As a remark on the 3.3V. It has to be added to the Sensor.
But if you use a LD1117V33 voltage regulator you can support this with the 5V from the Arduino board and has 3.3V available for the SPC1000.

connect the following SPC1000 ports to the Arduino Duemilanove
DRDY   - not connected
CSB     - I/O port 10
MISO   - I/O port 12
MOSI   - I/O port 11
SCK     - I/O port 13
3.3V     - Vout of the LD1117V33
GND     - Groud


I've had it running in 15 min. Great.  smiley-grin smiley-grin


Greatings from the Netherlands.

DOSER.
« Last Edit: September 13, 2009, 05:18:59 pm by C.Zwanenburg » Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 471
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Just one question.... I obtain something like this for the pressure:
PRESSURE [1073741760]
in what units? 1073,741760 mbar? or...
Thanks!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there,

normally the world pressure will be between 980 hPa and 1040 hPa. A value of 1073 hPa or the older value of mBar is way to high. Maybe with a the addition of a constant like 1073 x 0.95 = 1020 to get a realistic value.

In my setup I got the exact pressure in Pascal and had to convert it to hPa, by adding a constant of 0,01.

Temperature was a bigger problem, I got something of 30 degrees C on a 20 degrees C day, so there I had to adjust this value.

Normally is works OK.

Good luck.
Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 471
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Doser,

However, Why 0.95? why not 0.8 or 0.9? What i mean is is there an specification on the datasheet. I didn´t see that.... is 0.95 a tested value?

Thanks for your help and comments!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there,

0.95 is not a tested value. If you got a series of readings every 2 or 5 or 10 seconds, what you might require, you need to correct it to your local value. At this point in the Netherlands it's about 1031 hPa. If you got values around 1073 I suggest you take 0.9608.

Although you could be better looking for the reason why you have 1073, because if you use a Sparkfun SPC1000 Pressure Sensor is should be calibrated anyway, and no adjustment is needed.

Good luck.
Logged

Offline Offline
Sr. Member
****
Karma: 0
Posts: 471
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using the same code that was proposed here, and also the different improvements. So,idon´t know why i have this result...

By the way, is there any  library for SCP1000 to made more simple the code?
And, could somebody post here a running code? Here there are proposed different modifications, and now i am lost.

Thanks
« Last Edit: October 18, 2009, 01:34:29 pm by madepablo » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello I am new at arduino, and I'm trying to use the scp1000, with the code of that topic my arduino send me this information:

TEMP F [104]

PRESSURE [1073738714]

TEMP F [104]

PRESSURE [1073738699]

TEMP F [104]

PRESSURE [1073738747]

TEMP F [104]

PRESSURE [1073738722]

TEMP F [104]

PRESSURE [1073738747]

TEMP F [104]

PRESSURE [1073738740]


It's correct values in here?, the pressure is a very large number, isn't it?

I think that could be wrong, please help me and sorry for my bad english
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have my Arduino MEGA plugged with a SCP1000 P01. the 3.3V are from the Arduino. I have already tried  the codes present here in this post and nothing happens it just writes what is in the Serial.println() instruction of the setup and does nothing more! I've already read the code about 100 times and didn't find anything wrong!

Could Someone help me!  :'(

Regards
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Andre, You may have already figured it out as you posted the question a while ago. The Arduino Mega uses different pins than the other Arduinos. So you have to change the conections and pin definitions in the code to reflect that. In fact, if you want to use the SPI library you will have to change the pin definitions in the .h file that comes with that as it doesn't support the Mega yet. Here are the pins you need on the Mega.

#define SCK_PIN   52
#define MISO_PIN  50
#define MOSI_PIN  51
#define SS_PIN    53
Logged

Oakland California
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi folks,
The posted code works fine except that you want to change the type of return value for the read_register16 from a float to an unsigned long, same as the variable it's acting on. I had some funny business until I changed this.

unsigned long read_register16(char register_name)

Also, if you want to run this on a 5V board, check out this page on Spark Fun for how to do it. I used the resistor method and everything is working fine.

whoops, how about a link?  smiley-wink

http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=65
« Last Edit: December 27, 2009, 12:30:24 pm by glasspusher » Logged

Pages: 1 [2] 3 4   Go Up
Jump to: