How to set a GPIO pin to high? (relocate 1wire pins) (SOLVED)

Moderator: leecollings

Post Reply
Jumper3126
Posts: 105
Joined: Thursday 31 December 2015 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

How to set a GPIO pin to high? (relocate 1wire pins) (SOLVED)

Post by Jumper3126 »

Hi,

For a few years I used 1-wire temp probes connected to my raspi, following these instructions w1-gpio/w1-therm and Using DS18B20 Digital Temperature Sensors with the Raspberry Pi. As described in the second link, the 1-wire pins are connected to:
- Sensor Pin 1 connected to P1-06 (Ground)
- Sensor Pin 2 connected to P1-07 (GPIO4)
- Sensor Pin 3 connected to P1-01 (3.3V)

Because of another device, I need to relocate these 3 pins. I have a ground and IO ports available but no 3.3V. I understand that it should be possible to use an IO port as 3.3V source by putting it to high.
Any advice how to program this?

Possibly in,
sudo nano /boot/config.txt
which already has the following code:

Code: Select all

dtoverlay=w1-gpio,gpiopin=4
. Or in,
sudo nano /etc/modules
which already has the following code:

Code: Select all

w1-gpio
w1-therm
Regards, Rutger
Last edited by Jumper3126 on Wednesday 13 February 2019 21:54, edited 1 time in total.
Jumper3126
Posts: 105
Joined: Thursday 31 December 2015 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to set a GPIO pin to high? (relocate 1wire pins)

Post by Jumper3126 »

So I had to move my pins to the other side, because I installed an ebus card on my raspberry pi.

The 1-wire GND pin is moved from pin 6 to pin 39, which is also GND

The 1-wire data pin is moved from GPIO4 (pin 7) to GPIO26 (pin37).

For this I changed in "/boot/config.txt" from:

Code: Select all

dtoverlay=w1-gpio,gpiopin=4
to

Code: Select all

dtoverlay=w1-gpio,gpiopin=26
The 1-wire 3.3V pin is moved from 3.3V (pin 1) to GPIO19 (pin35).

I got this to work when I make GPIO an output at HIGH

Via SSH I gave the commands below, which worked. So then I put them into /etc/init.d/domoticz.shto make them permanent.

Code: Select all

echo 19 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio19/direction
echo 1 > /sys/class/gpio/gpio19/value
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests