Close

Done?

A project log for A-Hen-Ho

Automation of the hen house. Light, door, temperature tracking. Using Raspberry PI as main unit and Wi-Fi as connection-configuration link.

vikpublicvik.public 03/05/2016 at 11:220 Comments

Ok. The project is almost done. All software changes are checked in github, hardware works stable. I've sent it to a place where it will do it's job. And it will stay there forever, if everything will be fine. The owner of the hen house promised me to send me a report about installation and functioning of the device.

Some results, notes and expectations:

Achieved goals:

1. Device exists ))

2. Device have 8 channels to manage. each channel is isolated from raspi and capable to switch in theory 220V x 10A. Which is much more than needed.

3. Each channel is compatible with an energy saving lamps

4. device can operate without monitor/console/terminal on the field. it has power-off button and a web interface. WiFi configured as AP

5. device is ignorant to main power fail-off's. by default it switches on on the power on situation. the time is tracked by RTC unit and RTC unit has independent backup power supply based on rechargeable battery.

6. device has minor dust protection

7. a door sensor, which is connected by a long wires has an optical isolation. not really proper, but can help in advice.

Notes:

I've used a Raspberry Pi B (rev 1) there. There is no reason for something else. Yes it is slow, probably rev.2 can be used. but it is not really important. Any of the Rasi's can be used there and many other single board computers. But. I definitely need USB port for WiFi. The WiFi embedded in Raspi rev 3 will not do a job because for this project was really important to have a WiFi with external and exchangeable antenna. We tried some antennas and now plan to use directed antenna with 25 dB amplification. Plus antenna must be taken out of the steel case and placed outside the hen house.

The start plan was to use NodeJS and Motor for web interface. But investigation this topic I've found that NodeJS on raspberry pi is slow, Mongodb (used by Motor) on raspberry pi is very slow. the Motor is extremely slow too. And even start Motor on the Raspberry PI is almost impossible, because it uses some native code, which is problem to compile on RPi. Using a Python + flask + AngularJS solved all these problems. I don't think that stay on the plan with NodeJS was a good idea and really like the way project done now.

Replace RPi there with some other modules, like ESP8266, STM32 etc. Probably bad idea either. ESP itself can't manage direct signal 8 channels + RTC. It will need some 74xx chips additionally, or STM32/Atmel/PIC as a main unit. The second point is a web interface. It needs a lot of memory. for a moment it uses angular.js + some custom scripts + styles + bootstrap.js and a web-server. My expectation about size of all this code is approx 1Mb, or more. this means, main unit should be really powerful. managing of the RPi is much easy than managing of the controller-based system. at least I know, how I can make updates/fixes etc. And it comes out of the box.

Expectations:

Everything should work fine. After first testing on the place I wouldn't expect any huge trouble. But there still some unpredictable factors, like ammonia, or any other chemical stuff in the air inside the hen house, where the device will be located. chemicals, humidity can spoil something in soldering, case or in wires. in any case the fuses on the entry should protect against fire and steel case should take part in the protection.

Anyway. I'm waiting for news from a filed.

Discussions