Experiments towards a differential air pressure based wind speed sensors

On a sunny day (Tue, 02 Jun 2015 16:34:29 +0100) it happened Pomegranate Bastard wrote in :

Ah, yes, I see. That altimeter.c code looks a lot like what I hacked together this morn #define BMP180_SHIFT_BIT_POSITION_BY_16_BITS (12) #define BMP180_SHIFT_BIT_POSITION_BY_08_BITS (8) #define BMP180_PRESSURE_LSB_DATA (1) #define BMP180_PRESSURE_XLSB_DATA (2) etc etc

and then: v_data_u8[BMP180_PRESSURE_MSB_DATA] (BMP180_CALCULATE_TRUE_PRESSURE - p_bmp180->oversamp_setting)); LOL

Must have been some ....

Yes, so preset, there probably is some factory command or register to write those bytes,. It would have helped if the datasheet explained what those calibration variables did, there are many.

I downloaded the free version, I only have wine windows emulator working on an other PC in Linux, and will try it on there. The floating point would be cool for the 18F14, I do everything in 32 bit signed now. And sine and cosine lookup tables.

Yesterday I got fed up with it, and make my own NMEA proprietary protocol, starts with 'P' NMEA, for wind data starts with (direction in degrees and speed in km/h ,serial all at 4800 Bd. $WIMWV,a.a,R,s.s,N,A*hhhh for the wind meter data So now I also parse for sscanf(wind_buffer, "P %d %d %d %d", &hx71_front, &hx711_rear, &hx711_right, &hx711_left); for the HX711 sensors, and do the vector math in C on the PC (=Raspberry), avoiding any math on the PIC.

I will have to add a number to the P, how about $PPP,1, Panteltje's Proprietary Protocol, number 1

A new standard... And then number 2 for the BMP180 sensors That way I can plug in normal commercial wind sensors, my HX711 types, and the BMP180 types without having to change anything, as the software will use the right processing automatically.

I hacked this together this morning,

formatting link
it probably won't work as I could not test it yet: that should run on the Raspberry Pi with the BMP180 connected to GPIO pin 7 for clock, pin 12 for SDA in and pin 8 as SDA pulldown via a 1N4148 I did not do the altimeter calculation as the boat is not likely to ..

The probability that code I wrote actually works the first time is in the same order of probability as the big comet coming, the Dinos disappearing, so do not use that code. But at least when the s^Hchips come in I have something to test, and debug.

Hey thanks for the help, I will be going through your altimeter.c C code to see what I missed. I am glad to see somebody writing normal C.

Reply to
Jan Panteltje
Loading thread data ...

Yes, I thought the same!

I agree, it is a bit obscure. Perhaps they need all that calibration stuff to achieve such good performance.

I think you'll like CC8E (and CC5X for PIC16F). It generates very tight code. If you look at the ASM it generates you'll be hard pressed to improve on it. It also integrates well with MPLAB.

These days, with the PIC18F devices, code space, RAM space and execution speed are less of an issue so I tend to use floats more than I used to.

The MATH32LB.H library has sine, cosine, log etc. so might be worth a look instead of lookup tables.

You're welcome.

Reply to
Pomegranate Bastard

On a sunny day (Wed, 03 Jun 2015 10:05:57 +0100) it happened Pomegranate Bastard wrote in :

Yes, I already had a good look.

I was wondering if I could read the whole calibration data for 4 sensors (I use 4) connected to 1 18F14K22) into RAM like this;

#define CALIBRATION_DATA_START 0x120 #define cal_ac1_front_h CALIBRATION_DATA_START+0 #define cal_ac1_front_l CALIBRATION_DATA_START+1 #define cal_ac2_front_h CALIBRATION_DATA_START+2 #define cal_ac2_front_l CALIBRATION_DATA_START+3 ... ... #define cal_md_left_h CALIBRATION_DATA_START+86 #define cal_md_left_l CALIBRATION_DATA_START+87

etc etc for right, rear, and left sensor.

bmp180_read_calibration_data: movlw BMP100_IIC_ADDRESS movwf iic_device_address

; number of bytes movlw D'1' movwf iic_byte_cnt

; pointer data lfsr FSR0, IIC_COMMAND_START

; send calibration register address start movlw 0xaa movwf POSTINC0 call iicsnd ; iic_device_address, iic_byte_cnt, data at address FSR0 in RAM

; read result movlw BMP100_IIC_ADDRESS+1 movwf iic_device_address

; number of bytes, 4 x 22 calibration bytes, high byte, then low byte movlw D'88' movwf iic_byte_cnt

; point to data area lfsr FSR0, CALIBRATION_DATA_START call iicrcv ; iic_device_address, iic_byte_cnt, address FSR0 in RAM

return

They say burst read is not mandatory, but do not say if more than 2 bytes actually works ... :-)

The other thing that they screwed up on, is, that although they do have some free pins on the package, they did not use those to specify an i2c sub address (like say a PCF8574 has). So that defies the iic bus idea, as now you need 2 wires for each chip. There is not even a chip select! I have _just_ enough I/O pins...

Reply to
Jan Panteltje

I can't see why that wouldn't work.

It's not quite as bad as that, you can use a single SCK line for all BMP180s but you still need a separate SDA for each one. I did this on my 4-cylinder carb balancer project. Incidentally, with the SCK line, I drive it both high and low, and don't rely on the pull-up for the high level. Seems to work faster.

Reply to
Pomegranate Bastard

This works as long as the slaves do not need to slow down the transfer by clamping the clock low.

--

-TV
Reply to
Tauno Voipio

On a sunny day (Wed, 03 Jun 2015 19:22:06 +0100) it happened Pomegranate Bastard wrote in :

I wrote teh code, wil lsee when thsoe things arrive.

Cool idea. :-)

Yes that is what I am doing in a lot of other projects. Not every micro has an open drain output. As long as it is not multi-master that should be no problem.

Reply to
Jan Panteltje

On a sunny day (Wed, 03 Jun 2015 10:05:57 +0100) it happened Pomegranate Bastard wrote in :

The BMP180 boards arrived just now. A quick look showed this:

formatting link

Now that says BMP180 on the board, but on the chips it says all sort of things... That number does not register.

The seller shows this:

formatting link
yet an other number.

And different from this:

formatting link

Confidential 2013...:

formatting link
2014 lecture notes/Bosch chip data sheets/BST-BMP180-HS000-04/view

Whats the marking on your BMP180 chips?

Hopefully I will get around to it this week and read the chip ID, although one could re-program that too I think.

Reply to
Jan Panteltje

On a sunny day (Tue, 16 Jun 2015 12:29:26 GMT) it happened Jan Panteltje wrote in :

OK, hooked it up to a raspi, can read chip ID and calibration data: # ./test_bmp180 BMP180 chip_id=85 (0x55) cal_ac1=2514 cal_ac2=-11786 cal_ac3=-32768 cal_ac4=49 cal_ac5=6515 cal_ac6=15646 cal_b1=25503 cal_b2=-31319 cal_mb=-14650 cal_mc=-1211 cal_md=7607

chip ID is correct (0x55).

calijugations later

Reply to
Jan Panteltje

The BMP180 module I have is marked ||244 U421 019

I assume the last two numbers are some kind of manufacturers code.

Reply to
Pomegranate Bastard

That looks about right. Good luck with it!

Reply to
Pomegranate Bastard

On a sunny day (Wed, 17 Jun 2015 12:16:00 +0100) it happened Pomegranate Bastard wrote in :

According to that pdf from

formatting link

the first line is the part number, the second line teh date code as LYWW teh thris line is the lot code.

As to the part number, I have an old, from 5/17/2012 BMP085 based module marked: || 244 U141 089

So 'oart number' is always 244 i tseems

IMNSHO it is posisble the Chinese just make their own...

I got test_bmp180 100% working on Raspi with temperature and pressure.

formatting link

test run:

Trying to get it working on PIC, but very strange errors right now. It is OK on test vectors, but i2c gets confused. Wrote it in asm BTW.

No idea, very strange. Will try again tomorrow...

Reply to
Jan Panteltje

come to sink of it....

its probabblely capacitance

formatting link

I use the PIC programmer (yes that board on the right has programmed all those projects) to directly drive many feet (!metric) flat cable with still various sensors attached, so that saves time (building proto boards).. However as the PIC supply is switched by a simple BC558 or something trans-sister and its supply is noD decoupled, and I do notice it skipping parts of code on occasion, especially after sending signals via those i2c flat cables, it is probably a supply decoupling question. Also because same i2c routines work everywhere else, been used for years.

Of course if somebody did not decouple the supply of a PIC and used meters (metric) of wires I would say loco, but this is just to prove that point, (What point? ) well, not sure I am up to building a proto board today, already found one actually but that was for other sensors, some wires May-bee

I will pub-blish the asm when / if / or / and / xor / it wurks.

When designing a better programming language, the following statements would come in handy:

Before

example:

c = a + b before add 2 to a

But first

...

You know, once my job was to write manuals from lab reports etc for users, in English you guessed it. Just one of the many things I did. People thought I was good at it,

This

defusing instruction for large undetonated bomb (red wire cut blue wire etc)

Over radio to technician:

1) slowly unscrew big bolt on bottom by turning it half a turn clockwise

klonk klonk sound

2) Before you do that, push pin into hole at top.

Oops

loss of commi-nukaton.

Its still early, expecting a hard day.

formatting link

its only 64 MHz internal clock.

Maybe I shoot just put a capacitator across the pins and see if it changes anything.

Was too early for expresso?

Keywords electronics seriously

Reply to
Jan Panteltje

come to sink of it....

its probabblely capacitance

formatting link

It was not, could not even read the chip ID, program behaves unpredictable... WHAT COULD IT BE?

Went back to code from an other project I wrote years ago, to test it I had to change the #defines for the data area to what I called these this time: changed #define IIC_COMMAND_ADDRESS 0x100 to #define IIC_COMMAND_START 0x100

same result: no go

So, the only difference was _START versus _ADDRESS!

I said to myself : that cannot be it changed it to IIC_COMMAND_ADDRESS and guess what? chip ID correct first time.

BTW that was after I made sockets for all them BMP180 modules and tested those on the Raspi so I knew the modules were right. I did notice the temperatre is off by 3 degrees on some of the modules, the pressure is about right (did not look close).

So, it seems START is perhaps a reserved word, even if part of a #define in gpasm (old version beta). that is good to know, but took a while to find.

After I recover from this mind boggling thing I will reactivate my old code with the new defines and it should wUrk.

Them BMP180 sockets are really nice. made from IC sockets... :-)

Reply to
Jan Panteltje

No, room temperature went up, amazing, not even any sun.

Reply to
Jan Panteltje

So, is 'dirt' a euphemism for those bug-in-a-blanket things that insects call winter housing?

Reply to
whit3rd

formatting link

wasp nest in the pitot tube

-Lasse

Reply to
Lasse Langwadt Christensen

Aircraft pitot tubes have a large "pressure chamber" (and heater) which are rather tempting to bugs and small critters. While aircraft are required to have pitot tube covers when on the ground, no such cover is possible for a weather station. Yes, a weather station with pitot tubes is likely to become a bug hotel and dust/dirt/filth collector:

I have a few Davis and Peet Bros weather stations that I help maintain. Roughly once per year, someone has to climb the tower and clean the bugs out of the screens and moving parts. At one point, I removed and promptly lost the fine wire screen at the bottom of the rain gauge. It was replaced about a week later. I had to clean out all kinds of interesting bug nests from the inside of the rain gauge. I can only imagine what will be found inside open pitot tubes.

Incidentally, there are schemes for rain gauges that do not require moving rockers and internal water flow, which require cleaning. Here's one example the evolved from an automotive rain sensor:

The ideal weather station has no moving parts, no maintenance, and no sensitivity to extreme weather conditions. Those are all possible, but they cost money and introduce complexity. The one's I've seen use ultrasonics for wind speed and direction. None use a pitot tube.

--
Jeff Liebermann     jeffl@cruzio.com 
150 Felker St #D    http://www.LearnByDestroying.com 
Santa Cruz CA 95060 http://802.11junk.com 
Skype: JeffLiebermann     AE6KS    831-336-2558
Reply to
Jeff Liebermann
[snip]
[snip]

The rain sensor on my Q45 is amazing... seems to work on _density_ of drops. I never turn off the wipers (except at the car wash :-), just let 'em run automatically. ...Jim Thompson

--
| James E.Thompson                                 |    mens     | 
| Analog Innovations                               |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| San Tan Valley, AZ 85142     Skype: skypeanalog  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

I couldn't determine exactly how Inifiniti does it, but these look like probable explanations:

However, there's a big difference between an automotive rain detector and a weather station rain gauge. The automotive detector just looks for a threshold level at which to enable/disable the wipers. The weather station variety needs to produce rainfall rate, usually in inches per hour. There are a fairly large number of ways to measure rainfall rate, each with their limitations and inaccuracies. As soon as California gets some rain, which may be a long time, I'll probably try the total internal reflection sensor for a weather station.

--
Jeff Liebermann     jeffl@cruzio.com 
150 Felker St #D    http://www.LearnByDestroying.com 
Santa Cruz CA 95060 http://802.11junk.com 
Skype: JeffLiebermann     AE6KS    831-336-2558
Reply to
Jeff Liebermann

Have a look at:

--

-TV
Reply to
Tauno Voipio

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.