logo elektroda
logo elektroda
X
logo elektroda

Control of a 2 module relay via Raspberry Pi 3 B+ and Domoticz

jakubnowakowski030 768 3
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19759296
    jakubnowakowski030
    Level 1  
    Posts: 1
    Board Language: polish
    Hello I have a problem with a relay I have connected it to a raspberry and when I enter the command ,,gpio mode 3 out" the relay switches on, and when I enter the command ,,gpio mode 3 in" it does not bounce, do you have a solution for this because in general I want to connect the relay to domoticz so that I can remotely control the lights and I have a 2 module relay.
  • ADVERTISEMENT
  • #2 19760280
    elktrod
    Level 41  
    Posts: 5088
    Help: 750
    Rate: 1315
    Board Language: polish
    Advice impossible to give. We don't know what you have and how it's done and if it's done correctly, we don't know the.ide file with the program.... No schematics, no project, no links to the project, no pictures etc etc etc....
  • ADVERTISEMENT
  • #3 19760554
    starob
    Level 29  
    Posts: 1088
    Help: 128
    Rate: 137
    Board Language: polish
    elktrod wrote:
    Advice impossible to give. We don't know what you have and how it's done and if it's done correctly, we don't know the.ide file with the program.... No schematics, no project, no links to the project, no pictures etc...
    .

    Why impossible? The answer is at an elementary level and no additional documentation is needed.

    jakubnowakowski030 wrote:
    and when I type the command ,,gpio mode 3 out" the relay switches on
    .
    It switches on by accident. What you typed does nothing more than define gpio3 as an output - full stop.

    Now set the expected state and execute :gpio write 3 1 or gpio write 3 0

    jakubnowakowski030 wrote:
    and after typing the command ,,gpio mode 3 in" it does not reflect
    .
    So basically because you have set gpio as input - to read the status.

    http://wiringpi.com/the-gpio-utility/
  • #4 19768253
    xury
    Automation specialist
    Posts: 7068
    Help: 876
    Rate: 1486
    Board Language: polish
    In addition, it is not clear which relay. What state it is controlled by. High or low and whether it can be controlled from 3.3V. Some five-volt relays do not work well at 3.3V. e.g. a relay without coil protection with a diode can burn the gpio.
    As for the rest it all agrees with what a colleague wrote starob .
ADVERTISEMENT