Hello,
I am pretty new in the world of hardware. it seems from the opta user guide that you dont need pull up and pull down resistors on the buttons. can someone confirm? how do you guys wire buttons on the opta?
Hello,
I am pretty new in the world of hardware. it seems from the opta user guide that you dont need pull up and pull down resistors on the buttons. can someone confirm? how do you guys wire buttons on the opta?
Vcc - button - input
That works for me, i have 6 buttons connected like that, there is no need to name them as PULLUP in Arduino IDE
Also this can be useful:
//inputPins{A0, A1, A2, A3, A4, A5, A6, A7}
//outputPins{D0, D1, D2, D3}
//LED_Pins{LED_D0, LED_D1, LED_D2, LED_D3}
for (int i = 0; i < 8; i++) {
pinMode(inputPins[i], INPUT);
}
for (int i = 0; i < 4; i++) {
pinMode(outputPins[i], OUTPUT);
pinMode(LED_Pins[i], OUTPUT);
digitalWrite(outputPins[i], LOW);
digitalWrite(LED_Pins[i], LOW);
}
Pull-up or pull-down resistors are mandatory to provide quality signal on input pins and avoid undetermined states. Also, depending of application, a capacitor avoid pushbutton rebounds to provide reliable pulse counting. PU/PD are simple to implement offboard hardware. 2K2 or more is fine.
Would you have any suggestion of industrial-grade resistors which I can have inside a certified electrical box? i.e. ready-to-use devices with no soldering or so..
Hi alb-6, generally speaking, resistors are discrete devices designed to be assembled (PTH/SMD) on PCBs, not as a stand-alone part.
Functionally, the most easy way for testing is to take a PTH resistor and screw its terminations to input pin I(n) and positive voltage (take into account max voltage input range for inputs on Opta) for PU, or to GND for PD.
If you need a more profesional finish, the resistor can be welded inside Opta (ouch! I said professional) or embed it into the pushbutton (i its size allows it)
MCUs on arduino boards features PU/PD resistors enabling, but this option seems not to be available -for now- on Opta. I have a question open in forum about this.
Hope to be useful.