Programming the sensor board - sharst/OpenHumidor GitHub Wiki

If you have built the sensor board yourself or you want to update the firmware, you need a programming device. Luckily, you can easily build one yourself using an Arduino Nano, two capacitors and six pieces of jumper wire with female connectors:

Step 1: Hardware

1.) Solder one end of the jumper wires to arduino pins 5V, GND, D10, D11, D12, D13, leaving the female connectors on the other side.

2.) Plug the jumper wires on the ICSP socket of one of your sensors. Pay attention to the sketch and table relating to which wires go where. Wrap some adhesive tape around to fix the connectors in place even if you remove the cable. Now you can easily attach your programmer to any of the sensor PCBs.

Closeup of ICSP pins

Arduino Pin ICSP Pin
+5V +5V
GND GND
D10 RESET
D11 MOSI
D12 MISO
D13 SCK

3.) Additionally solder two capacitors to the Arduino (I've used 100uF Elkos because I had them lying around): GND |- +| 5V RST |- +| 5V

The finished programmer

Step 2: Prepare the programmer

1.) Download and install the Arduino IDE, if you haven't done so.

2.) Open the IDE, choose in Tools -> Board --> "Arduino Nano w/ ATMega328"

3.) In Tools --> Programmer choose "AVR ISP"

4.) Choose File --> Examples --> ArduinoISP

5.) Upload the file by pressing the right arrow or by choosing File --> Upload

6.) Congratulations, your programmer is ready to flash firmware to your sensor boards!

Step 3: Get your software set up

1.) Download the arduino-tiny files

2.) In your arduino sketchbook directory (see File --> Preferences if unsure), create a new folder called "hardware" if it doesn't exist yet

3.) From the downloaded archive extract the folder "tiny" into the newly created folder "hardware"

4.) Close and reopen the Arduino IDE. Under Tools --> Board, there should now be an entry for Attiny84 @ 8MHz (internal oscillator). Select it.

5.) Connect your programmer via USB to your computer. Connect the programmer to the sensor board.

6.) If this is the first time that this sensor is programmed, select Tools --> Burn Bootloader. Watch for any errors in the console.

7.) You're now ready to flash firmware to your sensor boards.

Step 3: Get the arduino source files and program the board.

1.) Clone the repository "OpenHumidor-Arduino" or download the contents as a zip. Place the folders within the repository into your sketchbook folder.

2.) Restart the arduino IDE

3.) Load one of the sketches and with programmer and sensor board connected, start the upload process.

4.) Congratulations! You have successfully updated the firmware on your sensor.