Dear all,
I am an amateur who tries to do things with Arduinos and breadboards, without any background in electronics.
I apologize for a question that shows my incompetence as well as my arrogance - I engage in projects that I deem easy but obviously are not in my grasp.
To make things worse, my English leaves much to desire...
I'm using Arduino with three 4017 IC to scan sequentially three packages of 4-bit DIP switches.
The small program running on Arduino is aimed at understanding which switches are in the "ON" position and which are in the "OFF" position. To that purpose, I use a common "output" line for all the DIP packages (that engage the bottom blue line of the breadboard). By closing the switches according to my needs, then applying power to one switch at a time thanks to the 4017, I should read a zero voltage every time I "poll" an open switch, and a non-zero voltage for every switch closed.
Attached please find the circuit.
The circuit works almost as expected, but two things puzzle me.
1) As soon as I close switch 4 in the first (leftmost) or in the last (rightmost) 4-switches DIP package, I begin to get random readings in all the values (the reading of every switch, also those driven by the other 4017's - including the open ones! - is different from zero and apparently randomic).
But this undesirable effect does not show when I close switch 4 on bank 2 (see photo of the board and a screenshot of correct serial output, showing the sequential readings from left to right that I get with the configuration shown in the picture).
It's not a matter of a defect in the DIP switch package, I substituted the DIP switches with as many dupont cables, and the error persists. I'm almost sure that there is something very obvious that escapes me, please accept my apologies for asking you to state the obvious.
2) (Very obviously), even though I power each 4017 individually, the more switches I close (ON position), the lower voltage I read. This tension drop is a consequence of the number of "rivulets" that I open by closing each switch. I wonder which is the easiest way to get an higher tension that would make open/close discrimination safer (currently I think that a threshold of "above 10/1024th" may be taken as "switch closed" and any analog reading below 10 as "switch open"). By "the easiest way" I mean the simplest breadboardable circuit, with the fewest components.
Thanks for your help and again, excuse my clumsiness.
Cesare Brizio
(Email address removed by moderator per current policy.)
I am an amateur who tries to do things with Arduinos and breadboards, without any background in electronics.
I apologize for a question that shows my incompetence as well as my arrogance - I engage in projects that I deem easy but obviously are not in my grasp.
To make things worse, my English leaves much to desire...
I'm using Arduino with three 4017 IC to scan sequentially three packages of 4-bit DIP switches.
The small program running on Arduino is aimed at understanding which switches are in the "ON" position and which are in the "OFF" position. To that purpose, I use a common "output" line for all the DIP packages (that engage the bottom blue line of the breadboard). By closing the switches according to my needs, then applying power to one switch at a time thanks to the 4017, I should read a zero voltage every time I "poll" an open switch, and a non-zero voltage for every switch closed.
Attached please find the circuit.
The circuit works almost as expected, but two things puzzle me.
1) As soon as I close switch 4 in the first (leftmost) or in the last (rightmost) 4-switches DIP package, I begin to get random readings in all the values (the reading of every switch, also those driven by the other 4017's - including the open ones! - is different from zero and apparently randomic).
But this undesirable effect does not show when I close switch 4 on bank 2 (see photo of the board and a screenshot of correct serial output, showing the sequential readings from left to right that I get with the configuration shown in the picture).
It's not a matter of a defect in the DIP switch package, I substituted the DIP switches with as many dupont cables, and the error persists. I'm almost sure that there is something very obvious that escapes me, please accept my apologies for asking you to state the obvious.
2) (Very obviously), even though I power each 4017 individually, the more switches I close (ON position), the lower voltage I read. This tension drop is a consequence of the number of "rivulets" that I open by closing each switch. I wonder which is the easiest way to get an higher tension that would make open/close discrimination safer (currently I think that a threshold of "above 10/1024th" may be taken as "switch closed" and any analog reading below 10 as "switch open"). By "the easiest way" I mean the simplest breadboardable circuit, with the fewest components.
Thanks for your help and again, excuse my clumsiness.
Cesare Brizio
(Email address removed by moderator per current policy.)
Attachments
-
275.7 KB Views: 11
-
337.5 KB Views: 14
-
400.1 KB Views: 11
-
3.4 KB Views: 4
Last edited by a moderator: