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.
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....
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.
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 .