Skip to content

EPL-Engineering/sleep_rig

Repository files navigation

Environment Monitor

TODO

  • Save state across serial reconnects (desolder RST ENABLE)
  • Finish chart display for log data
  • Cleanup upon application exit

Hardware Setup

  • Plug in the red/yellow/black climate sensor cables to the 3-pin molex connectors on the PCB (DHT1 and DHT2 labels on PCB)
  • Using a precision flathead, screw the wires from the LED strips into the terminal blocks of the PCB (LED1 and LED2 labels on PCB)
    • Red wire goes to '+' terminal
    • Black wire goes to '-' terminal
    • Colored wire (blue/green) goes to 'D' terminal
    • Connecting the wires in the wrong configuration will fry the entire LED strip
  • Optional: connect the positive and negative leads of the box fan to either the 24V or 12V onboard switches, depending on fan specs
  • Double check all of your connections and make sure the positive and negative terminals are always hooked up to a red and black wire, respectively
  • Plug in 24V power source to the barrel jack on the PCB (DO NOT PLUG 24V INTO THE ARDUINO BARREL JACK — ONLY USE ONBOARD JACK)
  • Plug USB-B into the Arduino and connect other end to PC where GUI is running

Connecting to Serial

  • Run EnvironmentMonitor.exe located in the main folder of this repo
  • Select the COM port that is tied to the Arduino and click connect
  • Arduino will reset all settings when the serial connection is reconnected
  • Arduino is ready when "SER_CON" event is pinged back

Auto LED Timer

  • Specify a day start and day stop time in 24HR clock format (make sure day start comes before day end chronologically, or bugs may occur)
  • Simply click start to initiate the day/night cycling (white light starts at day start time and red light at day end)
  • Click stop at any time to cancel the day/night cycling and turn of the LEDs (do this before disconnecting the serial port)

Manual Color Control

  • Select color and click send to manually control LED color; LEDs will behave according to most recent data sent (e.g. manual control will change the color even when day/night cycle is running)
  • Enter integer number between 0-255 to adjust the brightness of both LED strips; brightness setting is the same for both boxes despite two separate controls

Serial Monitor

  • Every 15 minutes or upon any command entry, the Arduino will send a packet with sensor data from both boxes
  • Data is formatted as a string and written to both a log.txt file inside the repo and the serial monitor display
  • A new log file is opened upon serial connect; disconnecting serial or closing the window will save the file
  • Log files will append an increasing integer to filename to avoid overwriting

Special Notes

  • To avoid bugs, always disconnect the serial port before closing the application
  • The Arduino will restart if it reconnects to serial, but it will continue running at disconnect (e.g. you can enable auto day/night cycles and it will continue to run if you disconnect serial port; it will reset and turn off when you reconnect to serial)
  • Boxes can be run independently, but log entries will still track both
  • Default brightness is set to 1; you will need to increase this

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published