question

s-exley avatar image
s-exley asked

RPi Digital inputs without analogue?

Hi,

I'm trying to get my pi to accept digital inputs, however, I don't have the ADC chip. I've managed to get the relay to work, however, I can seem to get an I/O menu item on the GUI. I also don't have /sys/bus/iio directory, however, I'm not sure if this is just for the analogue inputs. I've installed dbus-adc to see if that made a difference, but to no avail. Any thoughts or ideas?

I'm running v2.60-22

Cheers

Simon

Raspberry Pi
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

1 Answer
jeroend avatar image
jeroend answered ·

Hi Simon,

You don't need the ADC chip to have digital inputs. The RPI's GPIO pins can essentially all be configured as digital inputs.

What does your config file gpio_list say?

Below an example:

# This is a list of gpio pins, set by the script /etc/rcS.d/S90gpio_pins.sh

# They are documented at: https://github.com/victronenergy/venus/wiki/bbb-gpio

# Format: <pin_number> <direction: in/out> <name>

#

# The <name> part is used to create an symlink in /dev/gpio.

# Relay 1 Pin 40 / GPIO 21

21 out relay_1

# Relay 2 Pin 38 / GPIO 20

20 out relay_2

# Relay 3 Pin 36 / GPIO 16

16 out relay_3

# Relay 4 Pin 32 / GPIO 12

12 out relay_4


# Digital input 1 Pin 29 / GPIO 05

5 in digital_input_1

# Digital input 2 Pin 31 / GPIO 06

6 in digital_input_2

# Digital input 3 Pin 33 / GPIO 13

13 in digital_input_3

# Digital input 4 Pin 35 / GPIO 19

19 in digital_input_4

# Digital input 5 Pin 37 / GPIO 26

26 in digital_input_5

Regards,

JeroenD

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

s-exley avatar image s-exley commented ·

Thanks, I'd a typo in the gpio_list file.

0 Likes 0 ·