What's new

Superidor and wihygro - DONE!

Rating - 100%
20   0   0
Joined
Feb 23, 2009
Messages
700
After a tremendously long build spanning almost a year, the Superidor is now finished!

Build thread for the cabinet can be found here: [ame="http://www.botl.org/community/forums/showthread.php?t=29302"]Got me a new project! - BOTL Cigar Forums - Brothers of the Leaf[/ame]

Build thread for the wifi enabled, tweeting hygrometer which I call the wihygro is here: [ame="http://www.botl.org/community/forums/showthread.php?t=38603"]Wifi hygrometer build - BOTL Cigar Forums - Brothers of the Leaf[/ame]. My final code is at the bottom of this post.
Temp and humidity readings are published on Twitter here, www.twitter.com/myhumidor every 90 minutes. Eventually I'll add a warning email function to message when the humidity drops below a predetermined point.

A huge thanks to Mike for the absolutely stunning drawers and GregEigsti at the Aynclabs.com forums for helping me with the wihygro code. Without both of these gents this project wouldn't have been possible.


And now, the finished photos.

In the top right above the shelf is the temp and humidity sensor, just below that is the micro-controller (http://www.sparkfun.com/commerce/product_info.php?products_id=666), on the bottom is Cigar Oasis XL Plus which I've modified and gutted to be controlled by the much more accurate wihygro. Also controlled by the wihygro is a fan in the upper left to circulate air up. Both the external fan and Cigar Oasis switch on when humidity drops below 65%. Temp and humidity are checked ever 30 seconds. In conjunction with the Cigar Oasis I'm using 1lbs of 65% Heartfelt beads.


A potent little 12v fan


I opted to have the wihygro control the humidifier because I found the hygrometer built into the Cigar Oasis to be terribly inaccurate at about +10%. The twisted pair goes to the fan and the barrel jack and black signal wire go to the wihygro.


I replaced the Cigar Oasis controller with a very simple transistor switch circuit.


Here's the wihygro which comprises of an arduino and a wifi shield featuring an external antenna (http://asynclabs.com/store?page=shop.product_details&flypage=flypage.tpl&product_id=29&category_id=6)


I located the temp and humidity sensor (http://www.sparkfun.com/commerce/product_info.php?products_id=8257) a bit removed from the arduino because I found the unit got a bit warm regulating my unregulated 9v power supply down to 5v.


Now I need some more cigars to fill her up... :)













For anyone interested in building their own wihygro, here is the code I used:
Code:
/*
 * A simple sketch that uses WiServer to send a tweet with the current system time every 90 minutes
 */

#include <WiServer.h>
#include <SHT1x.h>

#define WIRELESS_MODE_INFRA	1
#define WIRELESS_MODE_ADHOC	2

#define transistorPin 5
#define dataPin  7
#define clockPin 6
SHT1x sht1x(dataPin,clockPin); //data and clock pins for SHT1x

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,1,2};	// IP address of WiShield
unsigned char gateway_ip[] = {192,168,1,1};	// router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0};	// subnet mask for the local network
const prog_char ssid[] PROGMEM = {"2WIRE187"};		// max 32 bytes

unsigned char security_type = 2;	// 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2

// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"XXXXXXXXXX"};	// max 64 characters

// WEP 128-bit keys
// sample HEX keys  30F7XXXXXXXXXXXXXXDF
prog_uchar wep_keys[] PROGMEM = { 0x30, 0xF7, 0x13, 0xCD, 0x4F, 0x15, 0x43, 0xA7, 0xAF, 0x63, 0xB4, 0xE0, 0xDF,	// Key 0
				  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	// Key 1
				  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	// Key 2
				  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	// Key 3
				};

// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;

unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------


// Auth string for the Twitter account
char* auth = "aXXXXXXXXXXXXXXXXXXmI="; // Base64 encoded USERNAME:PASSWORD
long intervalHum = 30000; //set the interval for temp and humidity to be checked
long intervalTweet = 5400000; // Set the interval for tweets - 1.5 Hrs
float humidity; // Init humidty variable
float temp_f; // Init temp variable
int tweet = 0; /*Used to tweet once on initial startup. Otherwise 
                 would have to wait until <intervalTweet> expires */
long previousMillis = 0;
long previousMillisTweet = 0;
long tweetTime = 0; // Time (in millis) when the next tweet should be sent
int OnFan = 65;  // If the humidity drops below this value (expressed in $%) turn on fans

// This function generates a message with the current system time
void currentTemp() {
   WiServer.print("["); 
   WiServer.printTime(millis()); // Append time Arduino has been running - gets around duplicate tweet filtering
   WiServer.print("] ");
   WiServer.print("Humidor temp and humidity is: ");
   WiServer.print(temp_f);
   WiServer.print("° F and ");
   WiServer.print(humidity);
   WiServer.print("%");
}

// A request that sends a Tweet using the currentTime function
TWEETrequest sentMyTweet(auth, currentTemp);


void setup()
{
    // Initialize WiServer (we'll pass NULL for the page serving function since we don't need to serve web pages) 
  WiServer.init(NULL);
  
  // Enable Serial output and ask WiServer to generate log messages (optional)
  Serial.begin(9600);
  WiServer.enableVerboseMode(true);

  // set  the transistor pin as output:
  pinMode(transistorPin, OUTPUT);
}

void loop()
{ 
  if (tweet == 0) // Tweets once at inital startup.  Next tweet won't happen for <intervalTweet>
  {
    ++tweet; // Increment initial tweet count
    Serial.println("Tweeting...");
    sentMyTweet.submit();
  }
    
// Set the temp and humidity to be checked every 30 seconds (defined by <intervalHum> global variable
// If you don't set this to a reasonable number the arduino seems to get so busy running the
// temp check functions it doesn't have time to run the WiShield TCP/IP stack - ergo all IP comms break
  if (millis() - previousMillis > intervalHum) 
  {                                                              
    previousMillis = millis();                         
    temp_f = sht1x.readTemperatureF();
    humidity = sht1x.readHumidity();
  }   
  
// Set a tweet to occur every two hours (defined by <intervalTweet> global variable)
  if (millis() - previousMillisTweet > intervalTweet) 
  {
     previousMillisTweet = millis();
     Serial.println("Tweeting");
     sentMyTweet.submit();
  }
  
  if (humidity < OnFan)
  {
    digitalWrite(transistorPin, HIGH);
  }
  else
  {
    digitalWrite(transistorPin, LOW);
  }
  
WiServer.server_task(); 

}
Thanks for looking.
 
Last edited:
Rating - 100%
94   0   0
Joined
Apr 16, 2010
Messages
556
Location
marmot zonda
i love when people get all geeky on here...thanks for contributing the most amazing antique / modern humidor these eyes have seen
 

SkinsFanLarry

Craft Beer Addict!
Rating - 100%
78   0   0
Joined
Oct 14, 2008
Messages
14,355
Glad to hear it is finally completed Jacob, you did an outstanding job and devoted alot of time, effort and sweat into that baby! :thumbsup:
 
Top