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.
shahadat
Posts: 7
Joined: Tue Mar 15, 2016 10:32 am

Checking feasibility of a Project. Expert Opinion Needed.

Post by shahadat » Tue Mar 15, 2016 10:48 am

Hi everyone, I am planning to develop a system using Micropython and Pyboard. Just wanted to know whether the project can be done using these technologies. What I want to do is..

1- I want to put switches in different rooms. Each of these switches would be connected to a single Pyboard.
2- So each Pyboard should be able to handle at least 10 switches. If Pyboards can't handle 10 switches then can anybody tell me how many switches it can handle? By using the word handle I mean pyboard would collect a signal from a switch.
3- Whenever a person would push a switch the electronic signal would go to the micro-controller and the pyboard would send a token to the central computer. Different tokens for different switches.
4- Whenever the central computer would get the signal from pyboard it would call associated functions to read associated data from a database.

So lets say switch 1 has token 1, switch 2 has token 2. Whenever someone would press switch one pyboard would call specific function for switch 1 in central computer. Whenever the function will be called it would read data from database and display on screen.

Please let me know whether it is possible or not. Any help would be highly appreciated.

best regards... :)

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

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

Post by platforma » Tue Mar 15, 2016 1:41 pm

Sounds quite feasible, perhaps even with MQTT protocol. What technology do the switches use communicate to the pyboard? And do you mean that switches are also pyboards or some other form of modules? For such a small task as a simple switch, esp8266 might do a good job, if WiFi is a possibility in your setup.

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 6:41 am

Well as this system is mainly for emergency patients so I think Wifi would not be the ideal choice. There might be sensitive devices which might interfere with wifi signals.

Can we use normal switches which we use to turn on and off lights? Or you can recommend even smarter options?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

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

Post by pythoncoder » Wed Mar 16, 2016 7:31 am

@shahadat Handling ten switches is no problem, but how do you intend to link the Pyboards to the computer - wirelessly or with a physical link? A physical link could be achieved with a UART and a three core cable.
Peter Hinch
Index to my micropython libraries.

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:31 am

@pythoncoder Ok here is my plan... http://prnt.sc/afvpml

I am not willing to use Wifi as it might interfere with some other hospital equipment.

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 8:53 am

Hello Shahadat. As pythoncoder said, handling 10 switches is no problem with PyBoard. It's just limited by the number of ports minus the ones you need for communication. I would forsee a bigger challenge in electrical set-up. You have to filter the input's to Pyboard to prevent form voltage spikes, discharges, and other noise, which would kill the input circuitry of PyBoard even with cables of moderate length.

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 9:23 am

@Roberthh ok I get it. But will not these switches use pyboard's power? I thought the switches would get power from pyboard itself. If they are getting power from pyboard then there would not be any spike, noise etc.

And what is the recommended cable length for the switches? If the rooms are big then we might need to connect switches from 5 to 30 feet.

If this is not possible then we can use 1 pyboard for one switch too. But actually this would be waste of resources. Though we are stubborn to develop the system.

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 10:01 am

Hello shahadat,
a switch does not need power. In the simple set-up you would use a pull-up at the pyboard and just connect the switch to GND. The spikes come from the fact, that the cable to the switch acts as an antenna for all kind of electromagnetic signals (aka noise), like small sparks from people, strong sparks of nearby thunderstorms, smart phones, other electrical equipment, and so on. So you have to do a nice analog filtering on the wire coming from the switch. I would place a separate circuit in between the wire and PyBoard, like an Schmitt-Trigger gate in combination with an analog low pass filter and protection diodes. Speed should not be an issue, if your PyBoard software uses polling to determine the state of the switch.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

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

Post by stijn » Wed Mar 16, 2016 10:07 am

For connecting everything together you could go with a UART <-> TCP/IP bridge. You can get these with power over ethernet as well, so if you also get a POE enabled router you'd have the advantage that you only need to a single cable which does both connection and powering of the PyBoard.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

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

Post by pythoncoder » Wed Mar 16, 2016 2:01 pm

@shahadat Are the switches in the same enclosure as the Pyboard or are long wires used?
Peter Hinch
Index to my micropython libraries.

Post Reply