Skip to content
Shao-Qian Mah edited this page Jan 2, 2017 · 8 revisions

The main steps to set up the Arduino related parts are as of below:

Setting up the software

Setting up the Arduino IDE

  1. Download the Arduino IDE here: https://www.arduino.cc/en/Main/Software
  2. If using a Mac, install the driver here (Mac OS X 10.9+): http://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v2_3.dmg
  3. Restart your computer
  4. Install the Time, TimeAlarm and AltSoftSerial libraries using the Arduino IDE in Sketch > Include Library > Manage Libraries and download the necessary libraries

Setting up the HM-10 Bluetooth Module

Download the repository as a zip here: https://github.com/Hydropal/Hydropal-Arduino/archive/master.zip

  1. Solder the HM-10 module to the Arduino Pro Mini according to the circuitry diagram below
  2. Using the FTDI adapter connect the computer to the Arduino Pro Mini
  3. Use the file at Bluetooth module setup > _9600_baud > _9600_baud.ino and upload the file to the Arduino and make sure the correct port and Arduino model is selected. Open the serial monitor (top right) make sure baud rate is 9600 and the NL & CR option is selected
  4. In the serial type AT and wait for the OK response
  5. In the serial type AT+NAMEHydropalXXXX, with XXXX being the 4 digit serial number (name is max eight characters)
  6. In the serial type AT+BAUD4, which will set the baud rate to 115200
  7. If serial messages fail to send or software is unable to upload, make sure the FTDI adapter's contacts are in good contact with the Arduino Pro Mini
  8. Close the programme and open the file at Bluetooth module setup > _115200_baud > _115200_baud.ino and upload to the board. Make sure in the serial monitor baud rate is set to 115200 and the option NL & CR is selected
  9. In the serial monitor type AT and wait for the OK response, if the module responds with OK, the module is set up

Final setup

  1. Open the file at Hydropal > Hydropal.ino
  2. Upload it to the Arduino Pro Mini
  3. Set some dummy values in the waterConsumption array, to see if the correct values are synced over to the mobile device
  4. ???
  5. Profit

Setting up the hardware

To reduce power usage, follow the procedure to disallow the LED from receiving current and to remove the voltage regulator here: http://www.home-automation-community.com/arduino-low-power-how-to-run-atmega328p-for-a-year-on-coin-cell-battery/

Wiring

Power to Arduino must go to GND and VCC (ACC), not on the programming horizontal at the back.

To wire the Hydropal together, follow the wire diagram as shown below to see what connects to which, or look at the alternate wire diagram to see a more accurate physical interpretation of the final product.

Suggested Steps to Soldering:

  1. Solder wires for RXD and TXD on bluetooth chip to digital pin 9 and 8 on the Arduino respectively and accordingly.
  2. Solder yellow flow rate sensor wire to terminal 2 on the Arduino Chip.
  3. Solder individual wires to GND and VNC/ACC on the bluetooth chip and Arduino board (do not connect them to anything yet).
  4. Solder individual wires to R1 and R3 on the USB/battery charger board.
  5. Solder all positive wires together (should be red).
  6. Solder all negative wires together (should be black).
  7. After going through installing, as shown above, solder battery to USB/battery charger board.

General Notes on Wiring:

  • Make sure to put some solder on the wires first to prevent them from fraying
  • Install software first, then solder battery, as the battery does not activate until u charge it for the first time.
  • Different shades of the colour are used to visually distinguish between individual wires, there are no grey wires.
  • At the most efficient rate, there only needs to be 17 solders total, and 8 fresh wires (excluding ones which come with the piece, e.g. battery)
  • Wire colour doesn't matter most of the time, but should be kept accordingly for easier QC, and avoids confusion especially when distinguishing between negative and positive terminals.
  • On the Arduino board, VCC as shown on the diagram is written as ACC.
  • Solders are conductive, do not allow it to bridge across metal rings, this can cause failures.