element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Noobie to arduino need help with incubator project
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 10 replies
  • Answers 1 answer
  • Subscribers 395 subscribers
  • Views 936 views
  • Users 0 members are here
  • incubator
  • arduino
Related

Noobie to arduino need help with incubator project

mk1manno
mk1manno over 10 years ago

Hey all im new to the site and to arduinos any help would be appreciated. Im building a incubator for incubating chicken egg just for the experience of setting up and programing. So far I have arduino uno with a dht22 temp/humidity I am planning on using a 55watt car bulb for heater (maybe two if I need them) a servo motor to tilt the bed every six hours (egg need to be turned every six hours to develop correctly). I have designed and printed a egg bed to hold 9 eggs and fittings to attach bed to servo motor. I have pc power supply converted to power bulb. Now im going to try to control 55 watt bulb with pwm from arduino to hold temp at 32 degrees c or some temp close depending on eggs im incubating. I have got mosfet (fqp30n06l) to control bulb.

 

My questions at this point are:

1. Is this the best way to approach this project (I do want to learn to use pwm from input from temp sensor).

2. What wiring circuit is correct for mosfet (Can I just use it direct).

3. I have put the 12volt pc power supply ground into arduino ground is this ok(correct way of doing it).

4. For timer to turn bed every six hours will I need something like a real time clock.

5. How do I use all the code together on arduino can I write them on different tabs

6. Any help with code would be a big help but please explain what is happening with comments as I do want to learn wats happening please.

 

Thanks in advance for any input.

  • Sign in to reply
  • Cancel

Top Replies

  • clem57
    clem57 over 10 years ago +2 suggested
    1. See https://learn.adafruit.com/dht/connecting-to-a-dhtxx-sensor 2/3. Follow this bildr » High-Power Control: Arduino + N-Channel MOSFET 4. A way to get time for your Arduino https://learn.adafruit.com…
Parents
  • mk1manno
    0 mk1manno over 10 years ago

    Hey all

     

    trying to get pid working in this using dht22 but cant get it to work any input heres my code

     

    // Example testing sketch for various DHT humidity/temperature sensors
    // Written by ladyada, public domain

    #include "DHT.h"
    #include <PID_v1.h>

    #define DHTPIN 12     // what pin we're connected to

    // Uncomment whatever type you're using!
    //#define DHTTYPE DHT11   // DHT 11
    #define DHTTYPE DHT22   // DHT 22  (AM2302)
    //#define DHTTYPE DHT21   // DHT 21 (AM2301)

    // Connect pin 1 (on the left) of the sensor to +5V
    // NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
    // to 3.3V instead of 5V!
    // Connect pin 2 of the sensor to whatever your DHTPIN is
    // Connect pin 4 (on the right) of the sensor to GROUND
    // Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor

    // Initialize DHT sensor for normal 16mhz Arduino
    DHT dht(DHTPIN, DHTTYPE);
    // NOTE: For working with a faster chip, like an Arduino Due or Teensy, you
    // might need to increase the threshold for cycle counts considered a 1 or 0.
    // You can do this by passing a 3rd parameter for this threshold.  It's a bit
    // of fiddling to find the right value, but in general the faster the CPU the
    // higher the value.  The default for a 16mhz AVR is a value of 6.  For an
    // Arduino Due that runs at 84mhz a value of 30 works.
    // Example to initialize DHT sensor for Arduino Due:
    //DHT dht(DHTPIN, DHTTYPE, 30);


    int heater = 3;

    //Define Variables we'll be connecting to
    double Setpoint, Input, Output,t;

    //Specify the links and initial tuning parameters
    PID myPID(&Input, &Output, &Setpoint,2,3,0, DIRECT);


    void setup() {
      Serial.begin(9600);
      Serial.println("DHTxx test!");

      dht.begin();
    // from here is heater control.
       pinMode (heater, OUTPUT);
      
        //initialize the variables we're linked to
      Input = t;
      Setpoint = 24.0;

      //turn the PID on
      myPID.SetMode(AUTOMATIC);

      
    }

    void loop() {
     
    // Wait a few seconds between measurements.
      delay(2000);

      // Reading temperature or humidity takes about 250 milliseconds!
      // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
      float h = dht.readHumidity();
      // Read temperature as Celsius
      float t = dht.readTemperature();
      // Read temperature as Fahrenheit
      float f = dht.readTemperature(true);
     
      // Check if any reads failed and exit early (to try again).
      if (isnan(h) || isnan(t) || isnan(f)) {
        Serial.println("Failed to read from DHT sensor!");
        return;
      }

      // Compute heat index
      // Must send in temp in Fahrenheit!
      float hi = dht.computeHeatIndex(f, h);

      Serial.print("Humidity: ");
      Serial.print(h);
      Serial.print(" %\t");
      Serial.print("Temperature: ");
      Serial.print(t);
      Serial.print(" *C ");
      Serial.print(f);
      Serial.print(" *F\t");
      Serial.print("Heat index: ");
      Serial.print(hi);
      Serial.println(" *F");
     
    //from here is heater control.
    //analogWrite(heater, 100);

    //if (t <= 31)
    //     {analogWrite(heater, 254);}
         
    //else if (t >= 33)
             // {analogWrite(heater, 20);}
             
    //else {analogWrite(heater, 100);}
         
       
      myPID.Compute();
      analogWrite(heater,Output); 
     
    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • khorshidalam
    0 khorshidalam over 8 years ago in reply to mk1manno

    But there is no egg tray turning option.......................electric motor rocks the eggs 4 times a day (24h) backwards and forwards..................any code?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • khorshidalam
    0 khorshidalam over 8 years ago in reply to mk1manno

    But there is no egg tray turning option.......................electric motor rocks the eggs 4 times a day (24h) backwards and forwards..................any code?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube