Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By curiouschap
#81816 NodeMCU is a really impressive piece of device.
8-)
In the process of making a TVC+altimeter model rocket. Have been developing on Arduino Nano, although I am about to run out of programming space. So was desperately wanting to make the switch, although am confused as to which MCU is the best for this scenario.

I stumbled upon NodeMCU, I have my doubts. What best place to ask than the esp8266 forum! ;)

Hello! :D My model rocket project (TVC+Altimeter+Deployment) has far exceeded the capabilities of the ATmega328P, am looking to change my MCU. I did consider STM32, but after finding NodeMCU, I am having a hard time saying no to Node. So is the NodeMCU apt for this kind of a project?

I just want the change to be smooth. Because it has taken time to develop this code.

NodeMCU doubts:

    I guess I have to use level shifters for 5v sensors
    Do they work well with MOSFETS
    Does the flash memory decrease in size when one uses Arduino IDE (similar to STM32)
    Spiffs File System
    Less no of Pin Outs.
    Consistency

Also, what are the disadvantages? (NodeMCU) apart from the obvious ones, because I might add more stuff in the future.

Changing the MCU is a very big deal, I hope you guys can help me with that.

Also, please suggest other MCU (for eg, STM32..)

Million thanks! :D :D

Reddit
User avatar
By btidey
#81848 Yes. GPIO needs to be 3.3V compatible. Options are
Use 3.3V sensors. Many are now available in 3.3V
Use resistor dividers for inputs.
Use level shifters or mosfet/bipolar drivers for outputs

GPIO work well with MOSFETS (I use them in preference to bipolar), but they need to be low threshold devices which turn on well with 3.3V drive. I tend to use AO3400 / AO3401 (n/p). These turn on really well, can handle decent currents with low Rds resistance and are very cheap.

Using Arduino does consume quite a bit of flash but once there the app code does not grow very fast on top of that. Maximum program size is 1MB. Typical fairly complex sketch with a few libraries will run around 400K assuming you don't have huge amounts of data tables etc. Modules normally have 4MB flash which you can split between Program and SPIFFS. Typical splits will be 1M program 3 M SPiffs or 2M program 2M Spiffs. Latter one is useful if your program goes above 500K and you want to do OTA (over the air) reprogramming as program memory must be able to accommodate 2 copies for OTA.

Standard GPIO is 9. You can steal 2 more by re-using the pins normally used for serial. Beyond that you are looking at port expanders using i2c. If some of your sensors use i2c then they can share the pins.

In a small enclosure then using the base module ESP-12F could also be an option. You can use the NodeMCU for easy development but then deploy on the ESP-12 for the rocket. There is no difference in the code. The Node just makes it easier to plug into a USB port for development. If you use OTA then firmware in an ESP-12 can be updated easily.


If you are using Arduino already then porting should be pretty straightforward as many libraries are compatible or available in ESP8266 form.

The other main concern is whether you are using special hardware functions on the other MCU like analogue inputs or specific timer hardware capabilities.