A basic battery powered Mysensors node
Based on: the documentation by MySensors and a 3.3V 8MHz Arduino (clone) Pro Mini from the usual sources (Banggood, AliExpress).
Handy pinout guide
Perform the hardware mods from above link:
- Disable power LED (either remove it or the resistor next to it).
- Remove voltage regulator (in this case I linked the in & out pins to be able to power through the
Make an Arduino ISP programmer
In order to reflash the bootloader, we need an In-System Programmer (ISP). It is possible to use another Arduino as the ISP, and I like to use another Pro Mini.
I follow the following schematic:
And in reality on a breadboard, it looks like this (with a LED added to pin 9):
Flash the ISP firmware
- Start the Arduino IDE
ArduinoISPsketch from the repository
- Connect the ISP using a USB-serial connection
- Select board
Arduino Pro or Pro Mini
- Flash the sketch.
Install boot loader:
In order to get a lower Brown Out voltage, we need to flash a new bootloader. Actually that's not strictly required, but it's the easiest way. I am using Optiboot bootloaders compiled by Gert Sanders, so many thanks to him.
- Unpack rar in
- Move folder
Arduino.app/Contents/Java/hardware(this is the OS X location)
- Select Tools->Board->
atmega328p based - 32 pin TQFP
8MHz - crystal - 38K4 - D13
Brown out detection - 1V8
- Select correct USB port
Programmer: "Arduino as ISP"
- Connect the board to the USB serial adapter (disconnect the ISP)
- Upload example Blink
- Upload Blink with modified timings
- I also like to try the
- Quit the Arduino IDE
Upload the real script
I use platformio to run my projects, so uploading is pretty easy:
- Switch to the project folder
- Edit baud rates in the
platformio.ini. I use
38400for upload and
pio run -t uploador if you want a debug monitor:
pio run -t upload -t monitor