Best hardware option for multiple CTs & WiFi

Thanks for the info. I’m mostly interested in learning the basic approach of how to address the loop blocking issue. Meaning - how to approach the problem of wanting to sample multiple inputs continuously with an Arduino.

The best I can come up with on my own is to sample each input once per loop instead of sampling one input 1480 times before moving to the next. Its the same number of samples per second, just done in a different order.

I’m curious if there’s another way I’m not thinking of.

So I pulled the trigger and bought that Feather WICED board from Adafruit. I just got a sketch running using emonlib and the board can take 1480 analogRead samples in 11ms.

That’s CRAZY fast compared to the ESP8266 and Uno.

I still have to do some testing with WiFi & MQTT to make sure it doesn’t drop the connection while sampling, which is a big problem I had with the ESP8266.

With this board (and without any fancy programming) I should be able to have 20 CT inputs and measure each of them every 400ms.

The board is a bit pricey, but I wasn’t able to find another turnkey dev board with libraries that also included an STM32 chip and wifi.

I have to say I didn’t have a clue what a “Feather WICED” was so curiosity got the better of me and I took a look

The WICED Feather is based on Cypress (formerly Broadcom) WICED (Wireless Internet Connectivity for Embedded Devices) platform, and is paired up with a powerful STM32F205 ARM Cortex M3 processor running at 120MHz, with support for TLS 1.2 to access sites and web services safely and securely.

this sounded familiar so I looked up a Particle Photon

The board itself uses a Cypress Wi-Fi chip (one that can be found in Nest Protect, LIFX, and Amazon Dash) alongside a powerful STM32 ARM Cortex M3 microcontroller. It’s like the Spark Core. But better.

That too is running a STM32F205 @ 120Mhz, I didn’t look any closer at the specs, but the price is around half that of the feather at $19 verses £35. (but I do not know about the libs available)

We’re just starting to play with some STM32F303’s at the moment which have some really crazy adc speeds as it has 4 physical adcs with up to 22 (or 40) channels (64 or 144 pin packages). at less than a tenner a pop (< £15 for 144pin) you can easily add a esp8266 to keep a webapp seperate to the monitoring FW and still cost you less than either of the Feather or the Photon.

There’s no doubt though, you can get some pretty fast and powerful little mcu’s now for not a lot of money, keep us updated with your progress :slight_smile:

That’s interesting about the photon and the feather comparison - Adafruit sells both. I wonder why they both exist - I’ll have to read up on it some more.

Are there dev boards out there with this chip that are compatible with Arduino IDE?

That was my major draw to the WICED Feather - it works with the Arduino IDE and they have libraries, examples and instructions to get you going (something a hobbyist like myself needs :wink: )

When reading the various STM32 blogs and forum posts etc, there seems to be a very common theme that the Arduino IDE and/or stm32duino only caters for the F0 and F1’s, I think that may of been the case for a long time, but more recently it seems ST are involved with stm32duino and it is now an official ST offering. All those older discussions are not doing the current efforts any favors as I too believed the Arduino IDE wouldn’t do the F3’s but it seems it does.

Once you install the STM core using the boards manager (much like the esp8266 add-on) at the bottom of the boards menu list you see this

image

it seems to do each of the Nucleo board ranges (32, 64 and 144 pin mcu’s), the Discovery boards and the more common “F1” or “Maple” (Pills?)

We have Nucleo-64 boards with a F303 fitted but it seems the Arduino caters for most if not all of them. Interesting it does seem to be missing any F2’s, no idea why that might be. I assume the WICED libs are provided by an Adafruit’s boards library or other party?

image

I cannot make any recommendation or vouch for any of this as I’m just starting out on a learning curve myself, but our resident STM guru @dBC has convinced us the way to go is to use the STM32cubeMX utility to configure the HW as there are so many registries and peripherals to play with on these mcu’s, and that gives you a base to add your code to, as yet I have not found this to be Arduino compatible as such (it may be?) but compiling and flashing is as easy as

cd myproject
make
cp build/myproject.bin /dev/ttyACM0

because all the nulceo boards have a on-board/snap-off STlink v2.1 programmer board (STM32F103C8T6 based) that presents itself as a storage device over USB that you you can drag and drop a bin file to (GUI desktop) and it just flashes itself, and for command line you just use cp.

But the ST32cubeMX and drag’n’drop flash leave a bit of a gap between them that is where you write the code, as yet I’m unsure if that can be done in the Arduino IDE or if we can only use a text editor or visual code or atom etc.

For £10 quid for a 72MHz M4 with 4x12 bit adc’s capable of 5msps each or 18msps max overall for up to 22 channels and that includes a genuine (attached) STlink v2.1 programmer/debugger and postage.

https://uk.rs-online.com/web/p/processor-microcontroller-development-kits/8644009/?sra=pmpn

The other “IDE” option is platfomio, which does appear to have extensive libs for the STM range, but I cannot say what it’s like to use, I’ve not had much luck with it in the past, but today I did happen to test it could compile for a f303 on a Pi which it did do without problem. But it isn’t stricktly an IDE like the Arduino IDE is as such, it has plugins to use Atom or MS visual code editors, these you can of course use with the simple “make” option too.

See the STM32 Development for some more reading on the f303 or just the toolchains and utilities etc. I have no doubt there will be a lot more discussions on these.

1 Like

That’s a very interesting development. I’ve not looked at it, but my guess is it would all be about mimic’ing the Arduino API’s such as analogRead() etc. No doubt a whole lot faster than the original AVR analogRead() but still miles away from the performance you can get with continuous sampling and DMA.

That reminds me… I owe that thread an update. I’ve made some progress on the multiple ADC front.

I don’t know quite how “official” it might be, ST probably still consider it a hobby platform. The author of this brief article/flyer dated July last year appears to be an ST employee and I’ve seen his name a fair bit in the stm32duino wiki and forum.

https://community.st.com/community/stm32-community/blog/2017/07/13/stm32-cores-enabled-in-arduino-ide

I also just found this

https://community.st.com/community/share-your-activities/blog/2018/02/21/platformio-stm32-devplatform-v40-offline-builder-for-arm-mbed-stm32cube-arduino

although that is a plug by the developer of Platformio (Ivan Kravets) rather than an ST announcement.

Yeah, me too, things haven’t been going to plan this week but I think I’ve got it cracked now. (famous last words)