Checking feasibility of a Project. Expert Opinion Needed.

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Checking feasibility of a Project. Expert Opinion Needed.

Post by Roberthh » Wed Mar 16, 2016 2:42 pm

Written above:
If the rooms are big then we might need to connect switches from 5 to 30 feet.
So if there is more than 1 switch per PyBoard, he'll have long wires.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Checking feasibility of a Project. Expert Opinion Needed.

Post by dhylands » Wed Mar 16, 2016 4:29 pm

What voltage you use for the signal to the switches really depends on how electrically noisy the environment is.

If you use 3.3v from the pyboard and your wire runs parallel to 120v power line, then changes in the 120v power line could very well induce 3.3v spikes in your signal line.

Traditional ways of dealing with are to use differential signals (so the same noise gets injected into both sides of a differential pair), and using larger voltages.

For example, the limit switches on a CNC router. You're much better off using 12v signals and voltage shifting close to the controller, rather than using say 3.3v.

You should also make sure that you use shielded wire, and ground the shield at the controller side of things.

To minimize noise, your control wires should not run parallel (and close to) high voltage signals. Try to cross at 90 degrees, and try to keep control signals at least a foot away from high voltage signals.

RS-485 (differential serial communication) can run many thousands of feet.

So there is no straight forward answer.

shahadat
Posts: 7
Joined: Tue Mar 15, 2016 10:32 am

Re: Checking feasibility of a Project. Expert Opinion Needed.

Post by shahadat » Wed Mar 16, 2016 8:19 pm

@pythoncoder long wires.

shahadat
Posts: 7
Joined: Tue Mar 15, 2016 10:32 am

Re: Checking feasibility of a Project. Expert Opinion Needed.

Post by shahadat » Wed Mar 16, 2016 8:42 pm

so I see the main challange comes from switches connected to the pyboard. What would you do in that case? Separate pyboards for each switches? Or you would use 1 pyboard with some kind of filter between pyboard and switches?

If I go for filters then can anyone give me a diagram of possible circuit or I there are already readymade filters available?

torwag
Posts: 220
Joined: Fri Dec 13, 2013 9:25 am

Re: Checking feasibility of a Project. Expert Opinion Needed.

Post by torwag » Thu Mar 17, 2016 10:06 am

Hi,

most things are said already. I would like to add that you can't possibly use normal switches as you know e.g. from your light system, since those are not debounced. That is, the switching event will not create one but several events on the pyboard I/O due to the fact that the metal contact will bounce several time up and down during the switching process. This creates, for the fraction of a second, several on off on off on off.... states. You would need to deal with this either in software on the pyboard side or in hardware by filtering. However, software does not help you with the induced spikes. The danger here is not that you might get wrong signals but that those spikes could possibly damage the pyboard.

What I would do is to create an external circuitry, e.g., based on 12 V or 24 V which you could easily be obtained by a transformer and lowers the cost, e.g. thing of ordinary door bell equipment, use this to for the switch lines and create a small circuit close to the pyboard, possibly with some optocoupler devices which "translate" the presence of 12 V resp. 24 V to the necessary 3.3 V. Those optocouplers would decouple the entire circuit from the pyboard and the more advanced versions even help with the signal quality.

jumasheff
Posts: 14
Joined: Tue Mar 01, 2016 6:00 pm

Re: RE: Re: Checking feasibility of a Project. Expert Opinion Needed.

Post by jumasheff » Sun Mar 20, 2016 4:36 am

shahadat wrote:so I see the main challange comes from switches connected to the pyboard. What would you do in that case? Separate pyboards for each switches? Or you would use 1 pyboard with some kind of filter between pyboard and switches?

If I go for filters then can anyone give me a diagram of possible circuit or I there are already readymade filters available?
I hope this little tutorial will be helpful for you: http://www.learningaboutelectronics.com ... ircuit.php

Post Reply