Tag Archives: OpenSCAD

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 17: Lasercut Mechanical Design

20160228_Projekte_133

In my last two posts I have gone through my new anemometer circuit both in theory and practice. Click here for an overview over my ultrasonic anemometer project.

20160228_Projekte_110

This will be a short post. Unlike most of my other posts, this one will not cover electronics but the physical design of this wind meter. As you can see, the new design all laser cut. At the Zurich Fab Lab I have access to a 75 watts Epilog laser cutter and I recently started playing around with OpenSCAD, an open-source CAD software.

20160228_Projekte_102

I immediately liked the OpenSCAD approach of designing a 3D part in code as opposed to a graphical interface with menus and buttons and the like. Using OpenSCAD is much like writing software. If you’re more familiar with coding than you are with classic CAD tools you will instantly feel at home with OpenSCAD. But it’s pretty much love it or hate it. At least with all the people I’ve talked to.

20160228_Projekte_099

I’ve seen some quite cool boxes  that were just laser cut and then screwed together. I found it quite compelling how you can laser cut your parts, stick them together and maybe use a few screws to hold everything in place. So I decided to give it a try myself.

20160228_Projekte_132

The design is not too complicated with just 6 wooden parts. The material is 5mm in thickness so I looked around for screws and bolt that would be appropriate in size. I also thought that it would be nice to use square bolts both from an optical as well as a mechanical point of view. I learned that square bolts are specified by DIN562 and that M2.5 square bolts measures 5x5x1.6mm – exactly what I needed.

20160228_Projekte_109

So the next thing to find was M2.5 screws. I found nice ones in stainless steel and especially with a Torx (T8 size) head as specified by ISO14580 as well as some matching washers (DIN125).

20160228_Projekte_130

All the tubes are recycled from my last model. Just standard 16mm plastic pipes intended to hold electrical wiring.

20160228_Projekte_104

As you can see in the photo above, I’ve tried two different versions for the side parts. The one at the bottom takes the path usually followed: There are cuts that can later fit the screws. The one at the top doesn’t have those cuts and relies on holes being drilled by hand.

20160228_Projekte_127

Drilling those holes turned out to be really easy. After the parts are ready, just stick them together and drill the holes using a drill press. At the fab lab we have such a drill press and the holes were drilled within minutes. I never liked those cuts so for me this was the way to go.

20160228_Projekte_128

The new design gives me a lot of space to mount any PCBs and hides all the wiring between the bottom and top plate. The bottom includes a large square hole so everything inside stays accessible. There are also two small drill holes to mount a 12 volts power supply. This way I can just plug it into the wall which I think might be handy.

20160228_Projekte_135

The OpenSCAD model as well as the Adobe Illustrator (Ai) and PDF files are available as a download from the overview page. Keep in mind that this is one of my first attempts at OpenSCAD, laser cutting and solid CAD modelling alltogether. I’ve tried to keep the CAD model clean and modular but I’m not sure if I succeeded.

20160228_Projekte_100

If you have any questions, suggestions or just your experience with this kind of thing please just post them as comments below. I’m quite new to most of this so I value your feedback and I’m always glad to help if I can.

20160228_Projekte_110

Click here to continue to my next post where  I  talk about the second, analog part of the circuit.