Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
stefaanvS

stefaanv

@stefaanv
About
Posts
62
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Internet of Poultry - Fully automated chicken shed
    stefaanvS stefaanv

    The goal of this project is to automate our chicken shed to such a level that the chickens can survive our summer vacation without outside help.

    0_1469173555598_IoP cover.JPG
    The project is based on Domoticz(rPi) and MySensors (Sparkfun Redboard)
    Sensors in the shed :

    • Temperature + humidity
    • Ambient light sensor
    • Current/voltage on the solar panels and on the motor
    • PIR sensor
    • End-of-run switches
    • Two buttons for local activation of the door

    Actuators :

    • DC motor for opening/closing the door
    • Relais for switching the inside light
    • Relais for switching the webcam

    The board arduino shield for connecting all the wiring
    0_1469174937923_Shield.jpg

    The complete installation
    From left to right : (temporary) router for remote USB connection for uploading sketches, Arduino with shields, DC motor, Solar charging controller.
    ,
    0_1469174994808_Complete installation.jpg

    The shed in the making
    0_1469175138149_Shed in the making.jpg

    The door mechanism & one of the end-of-run sensors
    0_1469175532912_Door machanism.jpg

    Overview photo with solar panels
    0_1469175609860_Overview.jpg

    My Project

  • PlatformIO subcategory
    stefaanvS stefaanv

    Can I suggest adding an "IDE" subcategory under the Development category ?
    I'm investigationg PlatformIO as an alternative for the Arduino IDE and Visual Micro for writing MySensors programs and was surprised not to find much info on the forum.
    Maybe having and IDE subcategory could spark some discussion about this - interesting - subject

    Development

  • Internet of Poultry - Fully automated chicken shed
    stefaanvS stefaanv

    @tbowmo Both food and water are "gravitationally supplied". There is a 15liter food and 1l water supply indoor and 12l water supply outdoor. These last for weeks.
    0_1469257021106_Food_water.jpg

    Wifi webcam is connected to Synology NAS camera app for recording. The aim is to enable the camera 5min before and after the closing of the door. Outdoor camera is on the wish list. Camera's can be enabled both automatically and remotely (like the door). Good news is that the chickens are smart enough to move out of harms way when the door closes. I noticed that the chickens go indoor very punctually on the internet provided sun-down, so the lux sensors may not be needed after all.

    Remaining isuues are collecting of eggs and droppings. Both are less urgent and much more difficult to accomplish.

    My Project

  • Setting parameters in nodes
    stefaanvS stefaanv

    I'd like to have some way to set parameters/settings in nodes.
    For example, my chicken shed is one Mysensors node that combines multiple sensors and actuators. I'd like to be able to update settings like sunset, sunrise, lux treshold, light (de-)activation time, etc without having to recompile the arduino sketch.
    I prefer to have the basic logic in the sensor node, not in the controller so that the shed continues to function even when the controller is down.
    I'm building my own micro-services based controller that will be able to handle settings/parameters but need some mechanism to tranverse the MySensors radio path.

    Feature Requests

  • Internet of Poultry - Fully automated chicken shed
    stefaanvS stefaanv

    Yes, we have foxes (and rats) in the neighbourhood. Chicks get eaten if not locked up at night. The fence is only 1m high, but won't keep a fox away from the chickens.
    I thought about RfId, but question is if one reader will detect tags anywhere in the shed.
    Voice recognition is another option to account for all chickens. Maybe when I find the time. Pool automation must be taken care of first :-)
    Anyway, it works as it is. Just need to set the light level in between chicken bed time and fox lunch time.

    My Project

  • Sensebender Micro Mechanical design
    stefaanvS stefaanv

    Hi,

    I love the sensebender micro, having about five of them around the house measuring all kinds of things. Being able to buy the assembled PCB from the internet is great !

    The compactness of the design is nice for building really small sensors, but in my humble opinion has one mayor drawback. There is no easy way to mechanically fix the PCB into a housing. Not suprisingly, I haven't seen a compelling case designs for the sensebender micro yet. Most designs have the board and the batteries floating inside.

    I always end up fixing the naked PCB with two-sided tape to a wall or a to a piece of furniture, usually fixing the batteries right next to the sensor PCB in the same manner. The net effect being that my wife is becoming increasingly unsupportive of my MySensors hobby !

    May I suggest that for future designs the wife factor is taken into account ? Two diagonal holes to fit screws and some free PCB space underneath for supports would be very helpfull.

    Stefaan

    Hardware

  • Parameters and settings
    stefaanvS stefaanv

    Hi,

    I'd like to write settings/parameters to my chicken shed sensor/actuator node. For instance lux level settings, sunset and sundown time, light activation time, etc.
    Has anyone done something similar ? If so, what MySensors mechanism did you use ?
    Do you think there is a need for a specific mechanism to send settings to nodes ?

    Stefaan

    Development

  • Sleep support in Gateway
    stefaanvS stefaanv

    Sorry for the typo above.

    I've created a sensor node that could sleep most of the time but needs to receive messages occasionally. I'm eager to reduce the power draw since it is solar/battery powered. The controller is Domoticz.
    Sleep mode doesn't work for incoming messages (to the sensor) because Domoticz doesn't support message delaying.

    My question : is it feasible to create a gateway that buffers messages from the controller to the sensor until the sensor node wakes up ? That way sleep mode can be supported without any changes to the controller software.

    General Discussion

  • Selecting a motor
    stefaanvS stefaanv

    @breimann , all of that will take a few posts to explain. Bear with me.

    The door mechanism took a lot of trial and error. My biggest advise is to estimate the torque needed to open the door before ordering any components.

    Due to lack of a dynamometer, here is how I tackled the problem :

    1. Attach an elastic band to the door at some position where you know the distance to the hinges (15cm in my case)

    2. Pulls the elastic band towards you in a right angle to the door until the door starts to move. Measure or estimate how much the elastic band is stretched (in my case, I measured +/-30cm). Be careful the door doesn't smach into your face :-)

    3. Disconnect the elastic band from the door and suspend some adjustable weight to it until it is stretched the same amount as before. I used a small bottle, an iron wire and changed the amount of water in the bottle. 0_1472748734920_bottle.jpg

    4. Measure the weight
      0_1472748775095_bottle on scale.jpg

    5. The torque is distance (to the hinges) x the weight, in my case 15cm x 0.285kg = 4.275 kg.cm

    I selected a Modelcraft RB350600-0A101R Transmissiemotor 12 V 1:600 (25€ at Conrad).
    According to the datasheet, at 3.44kg.cm (closest in the list), the motor should run at 9,46 rpm and consume 0,14A (12V).
    In reality, the motor takes about 3,5s to make half a turn, which amounts to 8,6 rpm and pulls between 150 and 200mA with a startup current of +/- 350mA. Pretty close to what the data sheet says !

    For the actuation of the motor, I use two relays of a Seeeduino relay shield of which I connected the NO to 0V, the NC to 12V and each motor wire to one of the COM. The resulting behavior is
    R1 open, R2 open ==> motor stops
    R1 closed, R2 open ==> motor turns CW
    R1 open, R2 closed ==> motor turns CCW
    R1 closed, R2 closed==> motor stops

    Some more advise,
    Don't try to open the door with a stepper motor. i tried it and I got bad oscillations.
    A servo motor could also work, but you'll have to find one that can deliver the torque.

    My Project

  • Parameters and settings
    stefaanvS stefaanv

    @sundberg84, @pjr
    I prefer to have basic automation in the sensor/actuator combination itself. then if the controller is off-line, the chickens still survive.
    Since my controller is a mix of test/production environment it is nog uncommon for it fail. One common thing is that USB ports change names after reboot in which can both the MySensors and the RfxCom devices stop communicating.

    Development

  • Meetup in the Netherlands - Saturday July 30th, in Breda!
    stefaanvS stefaanv

    Thanks also from my side. Learned a lot of new things during the meeting. It will take some time to try everything out.
    My son caught a lot of Pokémon in Breda (untill the phone battery went flat) and my wife did a lot of shopping, so everybody was happy !

    General Discussion

  • Internet of Poultry - Fully automated chicken shed
    stefaanvS stefaanv

    @breimann , door mechanism and end-of-run contacts

    I did a few attempt to make the door arm out of wood, but wasn't happy with any of them. The biggest problem was to connect the arm to the motor. I usually use the below cable connectors to fasten something to a shaft, but the shaft of the motor is 6mm diam while the biggest connector I can find can only take a 5mm shaft.
    0_1472752999390_Suikertjes.jpg
    In the end I bought two steel corner pieces in the closest DIY shop and adapted them with a drill and a grinder.
    In the same DIY shop I found a cheap router which was fastened to a 6mm drill with a small inbus screw, the router is the black piece in the below photos.
    After some attempts to glue to router to the corner piece, I decided to solder them together with plumbing solder. If you attempt this, be carefull not to burn your fingers. I takes a few minutes to cool down.
    0_1472753490616_soldering overview.jpg
    0_1472753501407_soldering close.jpg

    The end result, when mounted in the shed looks like this
    0_1472753916648_Door mechanism indoor.jpg
    0_1472753926388_Door mechanism outside.jpg

    Here is a video of the door in action
    0_1472754055923_Video deurtje.mp4

    In the pictures and the video you can see the end-of-run magnetic switches which I use to detect the open and close position of the door. These are connected to Arduino input pins.

    My Project

  • Setting parameters in nodes
    stefaanvS stefaanv

    I got this one solved for openHab2, but I guess the same trick can also work with other controllers.
    In openhab, activate the mqtt-eventbus bridge that copies all events on the eventbus to an mqtt broker of your choice.

    The mqtt.cfg configuration file (example)

    mosquitto.url=tcp://localhost:1883
    mosquitto.clientId=openhab
    mosquitto.retain=true
    mosquitto.async=false
    

    The mqtt-eventbus.cfg configuration file (example)

    broker=mosquitto
    statePublishTopic=openHAB/out/${item}/state
    stateSubscribeTopic=openHAB/in/${item}/state
    commandSubscribeTopic=openHAB/in/${item}/command
    

    In the openhab .things configuration file, add a text element elements for the node

    ...
    text         test_text   [ nodeId="4", childId="200"] 
    customSensor gasMeter    [ nodeId="4", childId="1"]
    ...
    

    In the .items configuration file, add the text element as well

    String test_text           "text"         <text> {channel="mysensors:text:gateway:test_text:text"}
    Number gasMeter_teller     "Counter"      <var1> {channel="mysensors:customSensor:gateway:gasMeter:var1"}
    Number gasMeter_pulsLengte "Pulse Lengte" <var2> {channel="mysensors:customSensor:gateway:gasMeter:var2"}
    

    On the node, define an extra S_INFO/V_TEXT child sensor. The below code example parses incoming instructions (in the receive() function).

    #define CHILD_ID_TEXT 200 
    MyMessage textMsg(CHILD_ID_TEXT, V_TEXT);
    
    void presentation()
    {
    	...
    	present(CHILD_ID_TEXT, S_INFO);
    	...
    }
    
    ...
    void receive(const MyMessage &message)
    {
    	if (message.type == V_VAR1)
    	{
    		pulseCounter = message.getLong(); // Update the main counter value at node startup or when updating the value in openhab UI
    	}
    
    	if (message.type == V_TEXT)
    	{
    		//this code could be more professional, just doing it quick and dirty for now
    		String all = message.data;
    		int equalSignPosition = all.indexOf('=');
    		if (equalSignPosition < 0) return;
    		String key = all.substring(0, equalSignPosition);
    		String value = all.substring(equalSignPosition +1, all.length());
    
    		if (key == "debouncePeriod")
    		{
    			int dbPvalue = value.toInt();
    			if (dbPvalue > 5 && dbPvalue < 5000) {
    				debouncePeriod = dbPvalue;
    				SendParameter("Debounce period",debouncePeriod);
    			}
    		}
    		if (key == "timeBeforeSleep")
    		{
    			long tBFSvalue = value.toInt();
    
    			if (tBFSvalue > 1000 && tBFSvalue < 300000) {
    				timeBeforeSleep = tBFSvalue;
    				SendParameter("Time before sleep", timeBeforeSleep);
    			}
    		}
    		if (key == "info")
    		{
    			Serial.print("Sending information");
    			SendParameter("debouncePeriod", debouncePeriod);
    			SendParameter("timeBeforeSleep", timeBeforeSleep);
    			SendParameter("pulseCounter", pulseCounter);
    		}
    	}
    }
    
    void SendParameter(char* parameterName, unsigned long variable)
    {
    	char buffer[30];
    	sprintf(buffer, "%s->%lu", parameterName, variable);
    	Serial.println(buffer);
    	send(textMsg.set(buffer));
    }
    ...
    

    Now parameters can be changed by sending mqtt messages to openhab which will forward the instructions to the node. Feedback is provided in the reverse way for every parameter change.
    For example, to change the debounce period, send an MQTT message with topic= openHAB/in/test_text/command and data=debouncePeriod=<value>. The feedback is provided on topic=openHAB/out/test_text/command with data=debouncePeriod-><value>.
    To get an overview of the parameters, send info=. One message is returned for every parameter and one for the current meter counter value.

    Feature Requests

  • [solved] Problem with ioBroker and MySensors 2.0
    stefaanvS stefaanv

    @hek
    According to the ioBroker people, it's definitely because of 2.0. Here is the link to the forum. http://forum.iobroker.net/viewtopic.php?f=12&t=3577
    Looking at the logs, it seems the adapter has a problem to find the beginning of the MySensors messages. Did something change wrt end-of-line charcters ?

    IOBroker

  • Are folks here happy with Domoticz?
    stefaanvS stefaanv

    I've used domoticz for a few years but got more-and-more stuck on it's limitations. I'm not a great fan of lua either. I'm more a c# and javascript person.
    I have invested my time in OpenHAB2 lately and I'm very happy with it. Much more solid in terms of software design imho. Very large hardware support. Seems to be a larger community as well.
    Setup is not as easy as with Domoticz, takes more reading and getting used to, but in the end I'm happy that I switched to OpenHAB.
    HabPanel is a nice extension to OpenHAB for building UI's.

    Domoticz

  • Internet of Poultry - Fully automated chicken shed
    stefaanvS stefaanv

    @Nathan-Overley
    Hi Nathan, it's not nice code, been written too quickly. I have to rewrite it some day. Still, here it is, it may give you idea's. Let me know if you improve it.
    0_1477377889434_Kippenhok_3.ino

    My Project

  • [solved] Problem with ioBroker and MySensors 2.0
    stefaanvS stefaanv

    @hek
    Hadn't done any of the decoupling. Will do so next.
    However, by moving the controller closer to the shed, The problem is solved !!
    0_1476001429124_upload-ffaeb96a-bf60-48e0-a44e-e5bca67cb6d4
    Thanks a million for the support !

    IOBroker
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular