P2 Fun during Oz Lockdown
RJSM
Posts: 68
in Propeller 2
Here’s some photos of various P2-based instrumentation projects I’ve been working on in the past couple of months during Melbourne’s COVID-19 lockdown.
Currently I’m building up a P2 weather station, that will incorporate ultrasonic anemometry, a tipping bucket rain gauge, plus temperature, pressure, humidity and UV measurement. Eventually this will also build in the ESP32 for field deployment/internet access.
For the anemometry part of this project the analog capability and smart pins of the P2 really shine. A couple of pics show my test setup and draft control screen where the transducer Rx envelopes and zero crossings are reported. Hope to post more about this project as it progresses.
Currently I’m building up a P2 weather station, that will incorporate ultrasonic anemometry, a tipping bucket rain gauge, plus temperature, pressure, humidity and UV measurement. Eventually this will also build in the ESP32 for field deployment/internet access.
For the anemometry part of this project the analog capability and smart pins of the P2 really shine. A couple of pics show my test setup and draft control screen where the transducer Rx envelopes and zero crossings are reported. Hope to post more about this project as it progresses.
Comments
You have kept it under wraps all this time?
If you want to share some files, Gerbers, BOM, SPIN files, I could move this to Customer Projects forum.
We need to make a rotary jig here for testing some sensors (ToF, IR arrays, Laserping etc). Could that be of benefit to you for testing wind direction too? Thinking a platform with slip ring in the middle and small stepper motor driving the outside
yes indeed - that would be extremely useful. The arrangement with sticky tape and glasses (!!) has been sufficient for my initial testing but I need something much better for a finished application. Re wind direction I can calculate that from a vector addition from the N/S and E/W readings - but a decent mount for the transducers will be essential. There's potential issues with turbulence to think about too.
Re TOF measurements I've got some great results with a VL53L0X module BTW.
I'm really keen to get over and catch up with you, OzPropDev and Rogloh again as its been a long time. It's fantastic to see your new P2 DIL boards coming to fruition - and Roger's work on the HyperRAM/Flash driver is super amazing too - I'll certainly want to be using that for a number of things I have in mind down the track.
Just need to hope those infection numbers keep coming down before I can visit - but I'm afraid I'm not optimistic we'll hit Dan's target by Oct 19th.... But looking at things elsewhere in the world now it seems here are on the right track.
Looking forward to catching up again for sure.
Are you using the Goertzel to measure phase shift?
I hadn't thought about Goertzel - sounds interesting. Its great to see how much load the P2 can take on to remove external components. I'm still far from an expert at programming the P2 with its generous instruction set but its been a joy to work with so far.
The Goertzel would listen to the ADC bitstream for some time and return to you a sine and cosine accumulation referenced to its own sine output. You would play a sine wave at 39KHz (?) out of one transducer and listen to the other. At the end of each measurement period, you would convert the relative sine and cosine accumulations to phase and power using the QVECTOR instruction. Better yet, maybe you could just flip phase on the output transducer every time you sensed an abrupt phase change on the input. The flipping period would become the time between output and input transducers. You should be able to resolve wind speeds in millimeters per second.
@RJSM Looking back on your lock-down projects - may I ask, by what means do you communicate with your P2 from LabView? I want to exchange stereo audio LabView <--> Taqoz and wonder whether an ESP8266 or ESP32 acting as a UDP bridge is the easiest way to get higher bandwidths. I'm a long term LabViewer and have got as far as exchanging UDP with an ESP8266 running Punyforth.
Bob
I hadn't looked at this thread for a very long time and coincidentally Melbourne is back in another COVID lockdown just now. The new COVID variant here appears to spread with very fleeting contacts in those more confined settings, which is a real concern.
Now to your question - many years ago (2007 ??) FTDI provided some LabVIEW drivers for their FT232/245 USB-to-serial bridge chips. Here's a link which should help you get going - https://ftdichip.com/software-examples/code-examples/labview-examples/
This stuff was released when LabVIEW was at V7 (it is now LabVIEW 2020) but these drivers still work fine with the current LabVIEW version. You will need to load them into your version of LV to update them, of course.
All my P2 projects use either FT232 or FT231 chips so it is possible to take advantage of these drivers, which I have reliably operated at speeds of up to 3 Mbaud for Rx and Tx.
Also - since my first post I've done some more work on my weather station project. Inspired by the earlier comments from Chip I went over to using Goertzel to measure wind speeds, which greatly simplified the hardware.
The latest system also incorporates ESP8266 and ESP32 chips for remote logging. It might be of some interest. There is still more work to be done and I hope to be able to report on that in a few months time.
@RJSM
Many thanks to you for the LabVIEW driver hint and the description of the weather station - all very interesting stuff. The anemometer is a great idea - solid-state operation gives greater bandwidth and sensitivity. The pcbs look very tidy too.
I notice my P2-EVAL uses an FT231 chip, so I can give the FTDI driver a try - I'll find out what benefit it brings over the standard VISA serial vis in LabVIEW, which I've been using up to now. I use the free LabVIEW 2020 Community edition now I'm retired, although I still have LabVIEW 7 tucked away.
Myself and wife Cherryll are both '2 jabs' now and infection rates are low here in the SW of U.K., so feeling pretty confident to get out and about now. Around 75% of the population are 1jab with 47% 2jab, but there continue to be hot spots pop up here and there, which makes everyone nervous. The planned dropping of most precautions soon is in the balance, I think, as no-one wants a third wave. The great thing is that the death rate hit '0 per day' for the first time yesterday and hospitalisation remains very low, so this amazing vaccination campaign has already done it's job. I hope Melbourne calms down soon.