Hey guys I want to build a larger input output module to relay via mqtt to home assistant.
i was looking at doing this with a pi but it turns out the mega has a lot more inputs and outputs. Please be gentle as I am just going down this road but here are my questions:
If I use an ethernet shield do I reduce the number of inputs / outputs?
Can I use analog inputs (eg reed switches) as an input end point?
An Ethernet shield merely deprives you of using the five pins it uses for other purposes. This is not normally a problem with a Mega.
Your other question is unintelligible. I would not expect a reed switch to be an analogue device. Just in case you are not aware of it, the Mega's analogue pins may also be used as digital.
A reed switch that is a physical switch isn't considered analog? I would imagine an analog input would measure a momentary button press? Is that correct?
Thanks for the clarification on the ethernet shield. It sounds like it wouldn't reduce the number of inputs at all.
heffneil:
A reed switch that is a physical switch isn't considered analog? I would imagine an analog input would measure a momentary button press? Is that correct?
Analog inputs are used to measure a variable voltage, like from a potentiometer or many sensors.
Digital inputs are used for things that are either HIGH/LOW or ON/OFF i.e. have only two positions of interest. Reed switches, buttons and most other switches fall into this input type.