New answers tagged

0

@Ghanima: a final question: if I duplicate the workable circuit to drive multiple relays, is it allowed to share Ground (X1-1) and 5V (X1-2) as depicted in my drawing. Or should it be different separate circuits ?, however Ground and 5V will be shared via the PSU connectors then... PS. what is OP stands for?


2

Unfortunately there are many different relay boards out there using this particular relay but that might feature different driving electronics. So it's difficult to give a definitive answer. There are however some indications that this excellent arcticle /1/ covers this board and the problems the OP describes. (Image source: /1/) I leave it to the OP to ...


1

From the rather unclear photos you have posted the device does not have an opto-isolator but a transistor. It is unclear why it doesn't work, however there is another type of poor module, triggered by a low level, with a PNP transistor which is not controllable from 3.3V. (This saved the manufacturer some fraction of a cent.) Without a circuit it is not ...


2

You've made a mistake, I'm afraid. You seem to be attempting to switch the relay coil with a GPIO pin. Unless your relay module is designed to use a 3.3V input you are at risk of breaking another RPi. GPIO pins are for 3.3V - and ONLY 3.3V In addition, the GPIO pins are delicate little flowers; they won't source (or sink) much current, and they don't ...


0

I just tried hotplugging the Adafruit 128x64 OLED Bonnet into a Raspberry Pi 4B, and the Pi locked up hard (had to be power cycled). Edit: I have no idea why this answer is being downvoted. I put this to the test to answer the question (at the risk of destroying my hardware, I later found out in the comments) -- and the answer was clearly no, hotplugging ...


0

Go in raspi config through terminal. Then in performance analysis. There you will get a option of cooling fan. Just enable it and connect the yellow wire to GPIO 14 (pin 8). Pi will automatically control it's speed according to temperature.


0

I thought, there is an internal pull up resistor that I could use but I read it wrong. Now it works following this sketch from https://www.elektronik-kompendium.de/sites/raspberry-pi/2006051.htm (it's german) Schalter=Button Eingang=Input


1

Question How to shift down a 12V DC signal for 3V3 Rpi GPIO pin in input mode? Answer There are a couple of ways as described below: (1) Using NPN BJT such as 2N2222 (2) Using Optocoupler such as EL817C Discussion, Recommendation, and Warning (1) 2N2222 is usually used to shift up a low level signal eg 3V3 to 5V0. However, it can also be used to shift ...


2

simulate this circuit – Schematic created using CircuitLab Vout = [ R2 ÷ (R1 + R2) ] × Vin For Vin = 12V : Vout = 20K ÷ (100K + 20K) × 12 = (20 ∕ 120) × 12 = 2.0 Volts When Vin = 0V Vout = 0V As an intuitive aid, consider this equation says, "The voltage across a resistor is divided in the same ratio as the value of that resistor to the total ...


0

One thing you could do, sorta building off of @Milliways answer, is use a python library like popen or another similar tool to run lsusb and parse the output, looking for whether your port or your device shows up. This would allow you to react to different devices being plugged in as well as port because lsusb gives a lot of info. I think there are other ...


1

You can typically simply connect the PWM input to a GPIO providing a 25kHz PWM signal. I don't agree with the other answers, which all mention to keep Vcc within the logic level of the Pi, which from my experience is not neccessary! Fan controllers in 4-pin fans have an open collector input for PWM control and thus are made to be controlled by typical logic ...


3

The stated question is regarding contact bounce. However, the data presented in the question does not reflect contact bounce - contact bounce does not repeat over the 100msec & 300msec durations presented in the text of the question. Let me try to be clear: The data provided does not rule out contact bounce, but the issue described by the data is not due ...


2

Your Question is misleading. Debounce settings work for their intended purpose (short term contact bounce), but this is not really your problem. Incidentally if you wanted to test bounce you couldn't have found a better "switch" to generate it - proper switches are designed to minimise bounce, although relay contacts are notorious for bounce. What ...


0

Servos move to a commanded position when given a valid pulse width. A pulse width of 0 is used to tell pigpio to stop sending servo pulses. The get_servo_pulsewidth() function tells you the last commanded position. It tells you nothing about the current servo position. Most hobby servos provide no method of discovering the position. You need a special ...


2

I have written several GPIO Python modules. They each implement a "proper" debounce. pigpio set_glitch_filter lgpio gpio_set_debounce_micros rgpio gpio_set_debounce_micros


0

Here is a script I call waitswitch, which runs the command specified in its argument every time a mechanical switch is pressed. It is based on the example from RasPi.TV. Ideally it should be rewritten so that the pin number to listen on is specified via a command-line option, as well as the "on" value and the pull-up direction. There are also some ...


2

Yes, if you find a fan which supports 3.3V levels on speed control pin, there is no reason it wouldn't work from a GPIO. I'd expect 5V fans also work in this way if you power them with 3.3V, albeit with a reduced max speed. Personally, I invested some time into finding a simple 2-pin fan which is really quiet, and simply keep it running all the time. Pi 4 ...


0

Thanks for your driver, that I need this example for pwm. "volatile" will help you to solve the problem: volatile struct S_PWM_CTL { ... } *pwm_ctl; volatile struct S_PWM_STA { ... } *pwm_sta;


2

Erm,... Yes you can, but you shouldn't. There are a few 3V fans that fit that description, even one by some Chinese firm that could be powered by the GPIO pin. Do not expect it to create a significant airflow though. If you're afraid of soldering, there is a PWM controlled fan hat. Or you can use female jumper wires. ---EDIT--- There are a number of four ...


3

Since there are only output from the Raspberry Pi that should drive the 4026 7-Segment Counter there are only need for a driver circuit. This can be done with transistors, MOSFETs or a driver IC. A simpler way is to change the voltage for the 4026 from 9 volt to 3,3volt its within the IC's working parameter (3-15v). And then replace the current limiting ...


1

If you are trying to access the Pi Header from the bottom the short answer is that this is IMPOSSIBLE Technically it is not strictly impossible but you would either have to:- Make a gender-changing board or use a header on the bottom of whatever you are trying to connect. (I did something like this to connect a gertboard via a cable) - but this requires ...


2

In addition to the risk of putting 5V on a GPIO pin which is quite likely to damage the Pi you are connecting a large inductive load. This will generate a back EMF of several hundred volts which will probably destroy the SOC. It is not difficult to reduce a 5V input to ~2.2V (which is recommended reliably detect an input on GPIO) but you would need ...


2

There are a few ways you could go depending on how much space / weight you have spare and what skills you want to learn as part of your project. I have assumed you want to keep the USB port for something else. First thing is to look at the voltages required by the Pi and compare them to the device - the last thing you want to do is fry the Pi or have ...


2

The Pi gpio pins are not 5v tolerant and operate at 3.3v logic levels so this set up would likely damage your pi. Additionally the maximum recommended current draw from the 5 V pin is the USB input current (usually 1 A) minus any current draw from the rest of the board. Model A: 1000 mA – 500 mA -> max current draw: 500 mA Model B: 1000 mA – 700 mA -> ...


2

All the Pi's GPIO are digital, i.e. on or off. For the Pi to detect a voltage like 0.2 V the simplest solution would probably be to add an ADC (Analogue to Digital Converter). Search for a popular ADC such as the MCP3008 for examples.


1

You will need to use additional analog circuitry. A current is generally measured by running it through a shunt - a (low resistance) resistor of known value and applying Ohm's law to the detected voltage. Since you already say 0.2V, rather than some Amperage, I believe you have that part covered. The next part is to convert it to a digital value. This can ...


1

The code you have posted is not valid. The following works for me using python 3.7.3. You do get a warning about pin re-use but that is normal. import RPi.GPIO as GPIO import time import threading GPIO.setmode(GPIO.BOARD) GPIO.setup(11,GPIO.OUT) def fun1(a,b,c): print(a,b,c) mycount = 0 while mycount < c: GPIO.output(a, True) ...


0

my Grounding Pin was faulty, it only worked when i touched it, sorry for making you guys put your useful help here :(


Top 50 recent answers are included