Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
research:automated_chicken_door [2017/06/13 22:34] – florent | research:automated_chicken_door [2019/02/14 19:09] (current) – [Automated Chicken Door] aimeejulia | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======= Automated Chicken Door ======= | + | ======= Automated Chicken Door - Research |
Line 46: | Line 46: | ||
The total cost will only be around 5€ for the electronics. The drawback to this is the time demanding construction work. | The total cost will only be around 5€ for the electronics. The drawback to this is the time demanding construction work. | ||
- | |||
- | ===== Mechanical Analysis ===== | ||
===== Electrical Analysis ===== | ===== Electrical Analysis ===== | ||
- | {{ :research:electronics.png?800 |}} | + | {{ :research:electronics_shema7.png?700 |}} |
+ | |||
+ | === Photo-resistor === | ||
+ | |||
+ | The photo-resistor is a component which resistance depends on the quantity of light illuminating its sensitive area. During the day, its resistance drop to below 100ohms, while during the night, it is higher than 100Kohms. | ||
+ | |||
+ | The photo-resistor is placed in series with a fix-value resistor. The tension between both components (V1 on the schema) is higher during the day, and lower during the night. | ||
+ | |||
+ | === Comparator === | ||
+ | |||
+ | The tension V1 is compared to two fix tensions V2 and V3. If V1 > V2, we consider the state to be " | ||
+ | |||
+ | | | V2 < V1 | V3 < V1 < V2 | V1 < V3 | | ||
+ | | | day | undefined | night | | ||
+ | | V4 | 6V | 0V | 0V | | ||
+ | | V5 | 0V | 0V | 6V | | ||
+ | |||
+ | === Limit switches === | ||
+ | |||
+ | When the state becomes " | ||
+ | |||
+ | === H-bridge === | ||
+ | |||
+ | The H-bridge is composed of 4 BC547 transistors. It allows the rotations of the motor in both directions. When V4 = 6V, and S1 = closed, the upper left and the lower right transistors are activated, a current is flowing through the motor from the left to the right, thus making the motor turning in one direction. The two other transistors activate the other direction. | ||
===== Energy Analysis ===== | ===== Energy Analysis ===== | ||
Line 82: | Line 103: | ||
=== Energy used by the electronics === | === Energy used by the electronics === | ||
- | The electronic | + | We try to use resistors having high values to reduce the power they use (0.07mW in total). As a result, the component consuming most of the energy is the comparator. This is why we use the an ultra low power comparator draining as little as 0.05mA. More information can be found in the [[http:// |
- | Below is a graph from its [[http:// | + | | P_comparator = U_comparator * I_comparator = 6V * 0.05mA = 0.3mW | |
- | {{ : | + | | P_electronics = P_comparator + P_resistors = 0.3mW + 0.07mW = 0.37mW | |
- | Power consumed | + | Energy used by the electronics per day: |
- | | P_oa = V_oa * I_oa = 6V * 1.2mA = 7.4mW | | + | | E_electronics |
- | Energy used by the Op-Amp per day: | + | We can see that it is the same order than the energy used by the motor. While the motor consumes |
- | + | ||
- | | E_oa_per_day = P_oa * 24h = 7.4mW * 24h = 0.177W.h | | + | |
- | + | ||
- | We can see that it is much more than the energy used by the motor. While the motor consumes | + | |
=== Energy available per day === | === Energy available per day === | ||
Line 117: | Line 134: | ||
| E_motor_per_day | 3.2mW.h | | | E_motor_per_day | 3.2mW.h | | ||
- | | E_oa_per_day | + | | E_electronics_per_day |
- | | E_used_per_day | 180mW.h | | + | | E_used_per_day | 12.1mW.h | |
| E_available_per_day | 720mW.h | | | E_available_per_day | 720mW.h | | ||
- | We are happy to see that more energy is available than used. The security margin tells us that after one normal sunny day, the system can work without additional energy for 3 more days. | + | We are happy to see that more energy is available than used. The security margin tells us that after one normal sunny day, the system can work without additional energy for 59 more days, which is very good. |
+ | |||
+ | | Security_margin = E_available_per_day / E_used_per_day = 720mW.h / 12.1mW.h = 60 | | ||
+ | |||
+ | ===== Chicken Door: Redux ===== | ||
+ | |||
+ | Due to difficulties in debugging and maintaining the old chicken door, a new version has been built utilising an Arduino Nano. The operation of the system is much the same - The door is actuated by a 12V DC motor when the voltage of a photoresister hits a specific value, and the turning of the motor (thus the opening/ | ||
+ | |||
+ | === Components === | ||
+ | |||
+ | The design consists of the following components: | ||
+ | |||
+ | * 1x Arduino Nano | ||
+ | * 1x Photoresistor | ||
+ | * 1x 15K Ohm resistor | ||
+ | * 2x Hartmann MBB1 micro switches | ||
+ | * 1x TI L293D (for driving the DC motor) | ||
+ | * 1x 12V DC motor with gearbox for torque | ||
+ | |||
+ | === Design === | ||
+ | |||
+ | A sketch of the design can be found below: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | === Code === | ||
+ | |||
+ | The Arduino code can be found [[https:// | ||
+ | |||
+ | Once PlatformIO is installed, clone the repository. | ||
+ | |||
+ | '' | ||
+ | |||
+ | To build the code without uploading it to the Arduino (which is useful for testing the correctness of your code), use the following command | ||
+ | |||
+ | '' | ||
+ | |||
+ | If this runs without any errors, it can be uploaded to the device in the following way: '' | ||
+ | |||
+ | === Power === | ||
+ | |||
+ | The DC motor is powered by a 12v power adapter, and the Arduino by a USB cable plugged in to a mains adapter. The entire ensemble sits inside the chicken coop to protect it from the rain. In theory, the powering of the entire thing could be switched to a solar solution - We are in possession of a solar charger/ | ||
+ | |||
+ | === Construction === | ||
+ | |||
+ | Generally, the construction is simple - The DC motor is part of a gearbox assembly that is connected to a winch. The winch is connected to the door via some fishing line/ | ||
+ | |||
+ | There are two important aspects of constructing and installing the chicken door. Firstly, the position of the motor must be such that there is as little friction when raising the door as possible - failure to do so could end up with the door beingjammed and potentially burning out the motor. Secondarily, | ||
+ | |||
+ | Other than that, the construction is fairly simple - make sure to guide cables away from the floor as much as possible - chickens and ducks are curious and like to chew on/piss on/mess with your hard work. | ||
+ | |||
+ | === Troubleshooting === | ||
+ | |||
+ | * Door opens/ | ||
+ | * This can be resolved by altering the LIGHT_THRESHOLD and DARK_THRESHOLD values, respectively. LIGHT_THRESHOLD is the value to determine when it is ' | ||
+ | * Door continues to wind up/down | ||
+ | * This is most likely caused by the limit switches not being hit successfully. I have had some success by adding tabs to the door in order to ensure a successful hit. | ||
+ | * The cable connecting the door to the winch tends to stray to the sides, causing the motor to jam | ||
+ | * I have fixed this using two nails placed just below the winch in order to guide the monofilament, | ||
- | | Security_margin | + | === Suggested Improvements === |
- | For improved performance, we need to use a low power Op-Amp (such as TLC3702CP) | + | While the chicken door offers basic functionality, it could be iterated on and improved in a couple of ways. |
- | ===== Construction plan ===== | + | *. Display current brightness. Using a small LCD display it should be possible to display the current brightness received by the photoresistor, |
+ | *. Manual control. It would be useful to be able to manually control the door in some circumstances - debugging and when one might want to lock the chickens in/out regardless of the time of day. Using two buttons it should be simple to be able to toggle auto/manual control and toggle the position of the door. | ||
+ | ===== Interested in joining this team? ===== | ||
+ | Join our # | ||