Tag Archives: standalone ultrasonic anemometer

Ultrasonic Anemometer Part 30: Downsized Hardware

In my last post of this series I’ve looked at different transducers and finally decided on a entirely waterproof 14mm model. The much lower signal level from those kind of transducers makes it  necessary to reduce the distance between the transducers in order to still receive a reasonable signal amplitude.
So I took my previous lasercut design and reduced it in size so that the distance between the transducers is only 120mm. I went to the local FabLab and and lasered two copies of the downsized design.

Since the new transducers are only 14mm in diameter but those plastic pipes are only available in 16mm I had to pad the transducers with short sections of aluminium tube with an outer and inner diameter of 16 and 14mm, respectively.
I previsously connected the wind meter to an Arduino with a LCD display to test the I2C functionality as well as to read the wind speed and direction without having to connect the anemometer to a PC. Now I have used my I2C user interface for that purpose. It is powered from the wind meter’s 3.3 volt rail and is controlled via I2C including the backlight brightness and display reset. The user interface usually also includes a rotary encoder with push-button not present in this application.

In an attempt to boost signal amplitude I’ve also changed the first stage op amp’s gain from 11 to 31 by replacing the 10k resistor with a 30k one. I’ve argued in my last post that this is probably about as far as you can safely push it.
Even with the lowered transducer distance and increased gain the signal amplitude after the first stage is less than impressive. But we knew that already. And we have a second variable-gain stage at our disposal. Setting the second stage’s gain sufficiently high we hopefully get the 3 volts peak-to-peak amplitude we are aiming for.

By the way, I’ll started from scratch with the firmware. The reason for that is mainly USB. Currently, the anemometer acts as a HID device. While working on my solar charger I started to play around with HID / MSD (human interface device / mass storage device) composite devices. They still act as HIDs with all the functionality just like before. But when you plug it into a PC it also enumerates as a mass storage device, i.e. it behaves just like a memory stick. You can read and write the files on it from any computer, irrespective of the operating system and without needing any particular softwar or driver installed. So you can put all the configuration parameters in a text file that resides on what looks like a memory stick. I guess that’s the most user friendly way of dealing with those user-specific configuration parameters. Just plug it in, open a text file, change what you need, save the file and you’re done. This is how the solar charger will operate and  I’ve decided to implement the same here.
Microchip’s Harmony library includes all that functionality so I have no doubt it’s doable. But I’ve figured that it’s likely easier to do this as a new project and then add the previously implemented functionality step-by-step.

And then there’s another USB-related feature that I had in mind right from the start but which I haven’t event started to implement so far: A USB boot loader. That would enable people to do a firmware update without needing a in-circuit programmer such as the PICKit 3. Users could just download a new HEX file and upgrade the firmware without needing any special hardware or even skills.
USB boot loaders come in various flavours. The Harmony library includes support for an HID boot loader. But that’s not really ideal if you ask me. It means that you need to run some software on your PC that communicates with the anemometer and sends the new firmware via USB. The need for software means that it matters what kind of operating system you run. And needing additional software is undesirable in the first place.

There are also MSD bootloaders which do not have all those downsides. The device acts as a memory stick to the PC. The user then just copies the HEX file to that memory stick and that’s it. Just drag-and-drop, no extra software, no matter what OS.

The problem is that the Harmony library does not support that out of the box. Indeed, Microchip doesn’t seem to have implemented that for any of their chips. That’s kind of strange because other chip manufacturers have done so long time since. There is at least one implementation for PICs out there in the web but I haven’t looked at it yet because the website it was hosted on no longer exists it seems. Probably I’ll have to implement this myself but the Harmony support for MSD will hopefully do much of the heavy lifting.

So that’s the plan. Implement a bootloader, preferably of the MSD variety. And then run the anemometer appliction as a HID/MSD composite device. You may say that I set the wrong priorities given the fact that the actual measuring is not yet as good as it needs to be. But this kind of fundamental architecture is easier to get right from the very beginning. So that’s why.
If you’re interested in this lasercut design you can find iton github.com or more precisely on https://github.com/soldernerd/AnemometerLasercut. This version is called Anemometer_03.scad and the PDF that was used for the actual laser cutting is Anemometer_03.pdf.

Ultrasonic Anemometer Part 29: Transducer Comparison

It’s been way too long since the last post in my Ultrasonic Anemometer series. But better late then never.

So far I have always used the same type of transducers. When I started this project I looked around and found the Multicomp MCUSD16A40S12RO. They were comparatively cheap and readily available so I ordered some and used nothing else for the next two or so years.

However, they are not hermetically sealed and therefore not the most suitable type to use outdoors all year around. Some of you have already experimented with other, truely watertight types and have reported that the signal level with those is dramatically lower. So I decided to see what’s available and do a more systematic comparison. That’s what this post is about.

The Contestants

  1. Multicomp MCUSD16A40S12R0 (Farnell 2362677),  16mm, not waterproof, no wires attached.
  2. Multicomp MCUSD14A40S09RS (Farnell 2362679), 14mm, waterproof, no wires attached.
  3. Multicomp MCUSD14A40S09RS-30C (Farnell 2362678), 14mm, waterproof, with attached wires.
  4. Multicomp MCUSD18A40S09RS-30C (Farnell 2362680), 18mm, waterproof, with attached wires.

You might wonder why I’m only considering Multicomp models but those 3 models are pretty much all the 40kHz watertight transducers I can get from Farnell.

So what I did is I attached all 4 models to the same anemometer so that I can switch back and forth between them. That turned out to be rather tedious and time consuming and resulted in a big mess of wires so I was happy that I only had 4 types to worry about.

I’ve measured the signal after the first (fixed gain) stage of the op-amp. So the signal reported here is already boosted up by a factor of 11.

The Benchmark

Let’s first look at the model used so far. As we already know it delivers a solid signal amplitude.

Zooming in at the burst at the center of the screen (the one with the smalles amplitude) gives us a reading of 1.9 volts peak-to-peak.

14mm waterproof transducer without wires

Let’s look at the first waterproof model. The signal amplitude us barely noticable at first.

Zooming in (both horizontally and vertically) then reveals the amplitude: 47 millivolts, a factor of 40 less than the benchmark model.

14mm waterproof with wires

Next in line is a transducer that looks virtually identical but has a pair of drilled wires at the back as opposed to just two pins. The overview looks just like before.

Zooming in shows an even smaller signal amplitude of only 37millivolts. That’s surprising because it has somewhat better specs compared to the previous model.

18mm waterproof with wires

Once again, the overview shows hardly anything for the 18mm model.

Zooming in we find an amplitude of 38 millivolts, basically the same as the last model.

Conclusion

The first fact is obvious: with hermetically sealed transducers you can only expect a small fraction of the signal at the input.  I knew that but was still surprised to find how much smaller that singal is.  In this comparison it’s a factor of 40in the very best case.

But an anemometer is useless if it cannot withstand the elements so I guess we have to live with that. I will use the 14mm without wires type going forward. Not only did it perfom best in my comparison but it is also the most affordable (waterproof) model. Apart from that I like its small 14mm form factor allowing for slim designs posing less resistance to the airflow.

The road ahead

We obviously need to make some hardware changes to deal with the low signal amplitude. The most obvious solution is more gain. We can get more gain of the first (fixed gain) stage by just changing a resistor. However, we need to be careful not to push the op amp beyond its limits. I’ve looked at the LMC6482 datasheet again and found a gain/bandwidth product of 1.5MHz. That means we can get a maximum gain of 37.5 at 40kHz. You probably don’t want to push the op amp right to its limit so something like 31 (changing the 10k resistor to 30k)  is probably about the best we can do here.  That gives us an extra factor of 2.82.

Making the physical design smaller and therefore reducing the distance between the transducers is another thing we can do.  The current desing is 245mm which is rather large. Someone has reported to me that he reduced that all the way down to 100mm. I don’t think I will go that far but will try 120mm which is about half of what I have now. That should double the signal amplitude. And the smaller transducers should make the task easier.

The two measures combined give an extra gain of factor 5.6. That leaves us with another factor 7 to be compensated elsewhere. Fortunately, we still have a second op amp stage (the one controlled by software) which hasn’t been doing much so far.  With the previous transducer model it only had to deliver something like a factor 1.5. If we boos this up to 10 we pretty much have all we need.

A software bug

During my tests I also discovered some weird software behaviour when the signal (after both stages of amplification) is not in the expected range. USB may hang, among other things. The pulse-sending sequence can also get upset. Someone had reported this to me earlier but I wasn’t able to reproduce the problem until now. I don’t expect this to be a major thing to fix but you never know. But I’ll definitely look into this.

 

 

 

Ultrasonic Anemometer Part 28: New hardware tested

20160907_standaloneanemometer_024

I last time proudly presented the new RevB board and got a lot of feedback from people who want one, too. As mentioned I have all the components here to ship up to 10 kits but I was reluctant to send anything until I had the chance to do some hardware testing. Not much had changed since the last revision but I don’t like taking chances on things like this.

20160907_standaloneanemometer_029

In the mean time I managed to do some rudimentary testing and now feel confident to take orders. These tests concern the hardware only. What I said last time about the state of the software still applies. But let me tell you what I’ve been able to test so far.

rxtx_overview

Tests performed so far

  • The PIC32 can be programmed from a PICKit3 via the ICSP header without any issues.
  • Power consumption is as expected. Like the previous version it draws 45mA@12V (programmed) and the other two rails come up with +3.310 and -3.279V, respectively. Also as expected. Regulator stays cool.
  • With the PIC controlling the AXIS, DIRECTION and SIGNAL pins, the transducers receive the 12V signal from the mosfet drivers. HOWEVER: the signals AXIS and DIRECTION are incorrectly labeled both in Eagle as well as on the silk screen. Electrically everything is fine but the names have been confused.
  • The signal from the transducers is properly received (Rec pin on the board) and amplified by a factor of 11 by the first stage of the amplifier (S1 pin on the board).
  • The PIC is able to control the digipot over the internal I2C bus and the second amplifier stage also performs as expected.
  • The zero-crossing detector (ZCD) works.
  • The input to the PIC’s ADC (ADC+ and ADC-) look fine, too. HOWEVER: the labeling on the silk screen is wrong. Eagle is correct, it’s just the silk screen. Plus should be minus and vice-versa. Again, electrically everything is fine.
  • The PIC can communicate (as a slave) with an Arduino UNO connected to the external I2C bus.
  • Communication over USB to a YAT-terminal under Win 7 works.

rxtx_north

rx_closeup

The following has not been tested so far

  • For my tests I still used the transducers already used previously. I believe the ones I ordered last week are of the same type but I haven’t tested them.
  • EEPROM. I haven’t tried the newly added memory yet. I have confirmed that it has power and is connected to the same bus as the digipot so I have no reasons to assume there are issues with it. But testing it would require some software first.
  • The external SPI bus has never been tested, neither on the Rev A board nor with the new one. I don’t expect any problems but I haven’t done any testing so far.

20160907_standaloneanemometer_028

Is there anything important that I forgot to mention? In that case just ask.  A lot still needs to be done but at this point I’m confident that the board has no major flaws and performs much like the prototype.  Want to give it a try? I have some kits left for you.

i2c1_arduino

Continue here to the next post of this series.