Difference between revisions of "Electrical Control Unit"

From Woodland Harvest Wiki
Jump to navigation Jump to search
Line 1: Line 1:
The electrical control unit is a wireless communication system that monitors the battery voltage and broadcasts other information. Please refer to the [GitHub Repository "WoodlandHarvestControlSystem"](https://github.com/LSanten/WoodlandHarvestControlSystem) for the code for all Arduinos.</br></br>
+
The electrical control unit is a wireless communication system that monitors the battery voltage and broadcasts other information. Please refer to the [GitHub Repository "WoodlandHarvestControlSystem"](https://github.com/LSanten/WoodlandHarvestControlSystem) for the code for all Arduinos. If you feel lost regarding working with any sensors or boards used in the system, check Useful Guides section at the bottom of this page.</br></br>
 
__Feel free to change the code on the Arduinos and platforms. Visitors and students can get editing access to the repository from Leon Santen or Odalys Benitez.__
 
__Feel free to change the code on the Arduinos and platforms. Visitors and students can get editing access to the repository from Leon Santen or Odalys Benitez.__
  
# Wireless communication codes
 
 
The wireless system uses the [[LoRa research|LoRa protocol]] to communicate at 915 Mhz. For detailed information on what LoRa is and how it works, please refer to the [[LoRa research]] page.
 
 
The diagram for states and communication codes is on [Whimsical](https://whimsical.com/rf-states-and-communication-codes-TEZgio2TPLtG5tm47541Hq). The prior link redirects you to the diagram.
 
  
 
# Repository Sections
 
# Repository Sections
Line 12: Line 7:
 
## master-arduino
 
## master-arduino
  
The master Arduino measures the battery voltage with a voltage divider circuit. For precise voltage measurements, it is recommended to use `(analogRead(pin) + 0.5) * 5.0 / 1024.0` [^preciseVoltage].
+
The master Arduino, also called a server, measures the battery voltage with the [Adafruit INA260](https://www.adafruit.com/product/4226?gclid=Cj0KCQiA4feBBhC9ARIsABp_nbUfI0ajLIOyZSA2bku_JZfo73gYy_W1wFGoZthBykCbWl1sPe3xmiYaAnboEALw_wcB) and broadcasts information wirelessly to the other Arduinos. The wireless system uses the [[LoRa research|LoRa protocol]] to communicate at 915 Mhz. For detailed information on what LoRa is and how it works, please refer to the [[LoRa research]] page. The diagram for states and communication codes is on [Whimsical](https://whimsical.com/rf-states-and-communication-codes-TEZgio2TPLtG5tm47541Hq). The prior link redirects you to the diagram.
 +
 
 +
## client
  
## backporch-arduino
 
  
 
## anemometer
 
## anemometer
Line 55: Line 51:
  
 
https://www.digikey.com/en/maker/blogs/introduction-to-lora-technology
 
https://www.digikey.com/en/maker/blogs/introduction-to-lora-technology
 +
 +
__Voltage measuring with voltage divider circuit__
 +
 +
For precise voltage measurements, it is recommended to use `(analogRead(pin) + 0.5) * 5.0 / 1024.0` [^preciseVoltage].
 +
  
 
### References
 
### References
  
 
[^preciseVoltage]: http://www.skillbank.co.uk/arduino/measure.htm#:~:text=Precise%20voltage%20measurement%20with%20the,number%20between%200%20and%201023.
 
[^preciseVoltage]: http://www.skillbank.co.uk/arduino/measure.htm#:~:text=Precise%20voltage%20measurement%20with%20the,number%20between%200%20and%201023.

Revision as of 17:32, 2 March 2021

The electrical control unit is a wireless communication system that monitors the battery voltage and broadcasts other information. Please refer to the GitHub Repository "WoodlandHarvestControlSystem" for the code for all Arduinos. If you feel lost regarding working with any sensors or boards used in the system, check Useful Guides section at the bottom of this page.

Feel free to change the code on the Arduinos and platforms. Visitors and students can get editing access to the repository from Leon Santen or Odalys Benitez.

Repository Sections

master-arduino

The master Arduino, also called a server, measures the battery voltage with the Adafruit INA260 and broadcasts information wirelessly to the other Arduinos. The wireless system uses the LoRa protocol to communicate at 915 Mhz. For detailed information on what LoRa is and how it works, please refer to the LoRa research page. The diagram for states and communication codes is on Whimsical. The prior link redirects you to the diagram.

client

anemometer

Anemometer data logger prototype on porch

We are using a Vortex wind sensor. One revolution per second equals 2.5 mph. Since our anemometer has a relay (a mechanical switch), it creates a switch bounce. Therefore, we need a debounce circuit.

WindSpeed Porch Oct14.jpg

_A bug with the current code seems to be related to saving the dateTime string. The dateTime string is saved incorrectly when there should be a trailing 0 in front of the minute reading. I believe that the current code does not include an additional 0 to save minute readings below 10.

Opportunities to improve the system

  • We are currently supplying power to the Arduinos via USB. If we used DC converters from the batteries to the Arduinos, we might save some electricity.

Useful Guides

Real Time Clock Setup for SD3231

Tutorial on arduino.com

Download DS3231 library on GitHub

Data logging on SD-card

this randomnerdtutorial.com leads you through SD-card usage with an arduino.

Wireless communication with NRF24L01

We have long-run antennas for wireless communication (NRF24L01 Tutorial).
You should solder a 10uf electrolytic capacitor between the power leads.

How to connect several SPI devices to Arduino.

Non-invasive AC Current Sensor ANSANE SCT-013-030

Outputs approximately 1 V for every 30 A.

LoRa Overview on Digikey

https://www.digikey.com/en/maker/blogs/introduction-to-lora-technology

Voltage measuring with voltage divider circuit

For precise voltage measurements, it is recommended to use (analogRead(pin) + 0.5) * 5.0 / 1024.0 1.

References