Hot answers tagged

4

12V pump will require 12V PSU. 20LPM is a pretty reasonable flow rate for a small pump so your pump PSU will need to have enough power to drive the pump - check the max current draw on startup (which will be higher than the running power draw) and size the PSU accordingly. Check the contact handling voltage/current for your relays. "5V" relays (as ...


3

Most relays are Active LOW - the relay is ON when the input is LOW and OFF when the input is HIGH. The specification for your relay board should state this.


3

Move the code that reads the log into your while True: loop. Don't start a new while True: for each LED as it will never terminate. Now that I'm home and have had a chance to look at this deeper (with a Raspberry Pi to test it on) I've re-written it to use RPi.GPIO (which works). #!/usr/bin/python3 import RPi.GPIO as g from time import sleep g.setmode(g....


3

No. All the Pi GPIO are 3V3 (and can only supply about 20 milliamps).


2

You need to use an interposing relay. This is simply a mechanical or solid state relay that has a 12Vdc coil and at least one contact (typically a form C contact, aka single pole double throw). Wire 3.3Vdc from your Pi to one side of the contact and the other to a GPIO input. Ensure you use a pull down resistor with the relay contact and a current ...


2

Only GPIO the sysfs has been asked to control will be listed in /sys/class/gpio. The GPIO not mentioned (i.e. other GPIO in the range 0-27) are not being controlled by sysfs. Without knowing details of the operation of the OnOffShim we can't say if the absence of GPIO 4/17 is significant or not.


2

On the first RPi : In a first terminal : (create FIFO) mkfifo /tmp/audio.fifo.pi1 In a second terminal : (Write datas into FIFO) arecord /tmp/audio.fifo.pi1 readfifo-writeUART.py : pyserial short-intro #!/usr/bin/python # readfifo-writeUART.py import serial def do_work(data): with serial.Serial() as ser: ser.baudrate = 19200 ser....


2

All the advice I have seen says no. Use the Pi's power supply via the microUSB or use your own power supply via the 5V and ground pins. If you use both they will "fight" with each other and cause problems. Why not power your external kit with the external 5V supply? You can still share the grounds if the external kit has logic which needs controlling ...


2

Yes, as long as the signal is 3V3 compatible. You could use the Pi's UART RX pin (pin 10, GPIO 15) and the standard Linux serial software. That will handle standard baud rates (say up to 1 Mbps). Alternatively you can use a general GPIO (any other GPIO on the extension header) and software serial. That should be good up to 19k2 bps or so.


2

On all Pis with the 40 pin expansion header pin 29 is connected to GPIO 5. GPIO 5 defaults to a pull-up at power up. The pulls are quite weak (about 50k ohms) so they can easily be overridden by an external voltage. The table you linked shows GPIO 5 as defaulting to pull-up. GPIO 28/29 are not brought out to the 40-pin expansion header.


2

Pin 1 is 3.3V power, and can supply up to 800mA (although it is inadvisable to connect a pump to the supply - particularly without any protection). Pin 3 is a GPIO - if programmed as an output it can supply a maximum of 16mA. By default it will supply ~2mA (because it has a 1.8kΩ pullup) - neither is capable of running any kind of motor. Also connecting any ...


1

DO NOT connect a "variable power supply" to the Pi! Most (laboratory grade supplies excepted) are poorly regulated. DEFINITELY DO NOT connect any power supply to the 5V rail of a powered Pi. (It is acceptable to power the Pi through the Header pins - provided the power supply meets the Foundation recommendations.) Your confusion between series/parallel is a ...


1

Should control this with wiringPi instead of ? sudo apt-get install wiringPi gpio readall


1

pigpio will probably let you do what you want using waves. The following command line example uses pigs to set GPIO 4 high for 7 seconds. pigs m 4 w # set GPIO 4 to mode output pigs wvag 16 0 7000000 0 16 0 # wave to switch GPIO 4 high for 7 seconds, then off pigs wvcre # create wave (should return wave 0) pigs wvtx 0 ...


1

In the second section of code: gpioConfig=[19] so i=19 j=1 and never increments newState=statuses['gpio1'] which gives 1 As newState == 1, GPIO 19 is only every set to HIGH


1

If unconfigured GPIO pins are Inputs, so safe for a logic input 0 - 3.3V If Output and opposite voltage is applied they can be damaged - which is why you should use a series resistor to limit current to a safe level.


1

If you only connect to header pins with the power off and/or use insulated dupont connectors there is no problem. If you aren't using the power pins just put an insulated connector on the power pins. There is little risk using the actual GPIO pins (you have to connect 2 outputs of different levels), but even there connect with the power off. Most people ...


1

The Pi's 3V3 (pins 1/17) and 5V (pins 2/4) pins are NOT GPIO, they are part of the power supply rails. If you connect the 5V power supply rail to the 3V3 power supply rail you will destroy the Pi. There is no protection.


1

I simply used 7 0 * * * gpio write 0 0 as my crontab "command"


1

Although WiringPi is discontinued there is an unofficial patch: https://github.com/neuralassembly/raspi/blob/master/wp-pi4.patch It worked great on my RaspberryPi4 after that.


1

make sure you enable Remote gpio from Application Menu > Preferences > Raspberry Pi Configuration > Interfaces > Enable Remote GPIO


1

I was having the same issue using python, Executing shell script in PHP etc so the solution is Enable python scripts on apache 2 using this guide: https://www.server-world.info/en/note?os=Debian_9&p=httpd&f=5 then go to: Application Menu > Preferences > Raspberry Pi Configuration > Interfaces > Enable Remote GPIO And then type the address to the ...


Only top voted, non community-wiki answers of a minimum length are eligible