Author Topic: Chicken coop automation  (Read 890 times)

0 Members and 2 Guests are viewing this topic.

Offline ChickenguyTopic starter

  • Newbie
  • Posts: 1
  • Country: us
Chicken coop automation
« on: July 12, 2021, 10:26:25 pm »
I want to create a hub that can control small dc motors, fans, lights, water valves etc. I hope to use as few devices as possible and as few languages as possible in the hardware hub. I plan to have a cloud based web server that will serve as the client so the microcontroller powered hub will just need WiFi and a mechanism for the remote web app to issue commands to the microcontroller and receive information back to present to the user.

I understand that arduino and rasberry devices cannot handle voltage high enough for small motors so I will need an intermediary device hooked up to a battery (which I plan to charge with a solar kit). I assume all devices will be DC. I am hoping for 8-12 input outputs that can control these external devices and all external devices can be simply on/off devices. Any guidance on the hardware stack that could accomplish this would be helpful, I just don’t even know where to start. Thank you!!
 

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 2966
  • Country: gb
Re: Chicken coop automation
« Reply #1 on: July 12, 2021, 10:58:01 pm »
How much current do the outputs devices  need and what sort of voltage ? something like the uln2003 d arlington array is  good for 500ma and 50v and has 7 outputs,or the  ULN2803A which has 8 outputs
 

Offline Microdoser

  • Frequent Contributor
  • **
  • Posts: 423
  • Country: gb
Re: Chicken coop automation
« Reply #2 on: July 12, 2021, 11:04:01 pm »
Depending on the current needed by the motors you want to use, you could use transistor-mosfet pairs to drive them from the logic outputs on either the Arduino or Pi.

In the case below, the mosfet(M4) is a XR46000ESETR, the transistor(H5) is a MMBT3904-TP. I use this to PWM control a 12V computer fan for cooling my Pi, although be aware it inverts the logic, so a high signal stops the fan, I have it fed via a 6 channel logic inverter(SN74AHCT04DR), so the code makes more sense to write. If you want to control beefier motors, you could happily power a 12V coil in a relay using that circuit. Include a flyback diode if you do though.

 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 910
  • Country: ca
Re: Chicken coop automation
« Reply #3 on: July 13, 2021, 12:20:21 am »
Be careful how you wire the output drivers.  Make sure that motors/solenoids default to off during MCU [re]boot.

eg. On the atmega328, before program control starts, MCU pins default to input so the pullup on the MOSFET gate (Microdoser's schematic) will pulse the output briefly until the program initializes it to an output and sets it to high.

The pulse can be avoided by a 10K resistor on the base of the NPN to MCU Vcc; turning on the transistor during powerup or while the reset button is held down;  keeping the MOSFET off.
« Last Edit: July 13, 2021, 12:26:50 am by pqass »
 

Offline Microdoser

  • Frequent Contributor
  • **
  • Posts: 423
  • Country: gb
Re: Chicken coop automation
« Reply #4 on: July 13, 2021, 11:11:14 am »
Be careful how you wire the output drivers.  Make sure that motors/solenoids default to off during MCU [re]boot.

eg. On the atmega328, before program control starts, MCU pins default to input so the pullup on the MOSFET gate (Microdoser's schematic) will pulse the output briefly until the program initializes it to an output and sets it to high.

The pulse can be avoided by a 10K resistor on the base of the NPN to MCU Vcc; turning on the transistor during powerup or while the reset button is held down;  keeping the MOSFET off.

Ah yes, I didn't show that on the schematic, before the logic inverter, there is a 10K pull down resistor that keeps the signal at ground unless pulled up by the Pi. That keeps pin 1 on H4 high by default, grounding pin 1 on the mosfet and so keeping the fan off.

Well caught.
(Trap for Young Players)
« Last Edit: July 13, 2021, 11:13:47 am by Microdoser »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf