How to use IR leds that is not working on Pi camera - raspberry-pi

For a night vision camera, I bought NoIR Pi camera and IR leds(Can be attached to both sides of the camera).
But I found that my Pi camera doesn't have metal part on the attaching part. So I cannot use my IR leds with pi camera. Can I use it with pi's gpio? Actually I only need to turn on the leds, so I wonder if I can supply power to leds with raspberry pi or arduino's pins.
Additionally If I connect the leds with jumper cable or something, should I solder it or is it okay just tying it.

You can connect your leds to any DC power source, just be sure to limit the current by using a suitable series resistor to avoid destroying your leds. And don't look into them to prevent eye damage, as your eyes will not accomodate to invisible light.
In good approximation:
I = U / R
with:
I is maximum allowed current trough LED (ampere)
U is power supply voltage (volt)
R is value of resistor (ohm)
Or more exact:
https://www.sparkfun.com/tutorials/219

Related

Adding a DC Motor to a Simscape Model

I want simulate an inverted pendulum via Simcape. For this, i created a Model with SolidWorks and tranformed it to Simscape. So far so good. Everything worked and my Simulation shows the predicted physical Behavior.
But now i want to add a dc motor to my simulation, which is hooked to the sledge via belt.
I tried to connect the dc motor block with the revolute joint of the pulley, but it seems Matlab has some issues with it. It shows the error shown below.
Further you can see my simscape modell of my inverted pendulum and how i connectet the Dc motor block to the revolute jo
Has anybody an idea how to connect the dc motor correctly or is there somthing wrong with my simscape model?
I´m kind of running out of ideas and I´m gratefull for any help I can get.
enter image description here
It says one of your componenet that needs to rotate, is strictly connected to the world. I believe you need yo change that.

Control 4 wheeled raspberry robot with Simulink

I am going to control 4 wh raspberry robot in Simulink. I found this one to control DC motor with simulink: https://www.mathworks.com/matlabcentral/fileexchange/41528-raspberry-pi-dc-motor-h-bridge-driver-block-sfunction?s_tid=srchtitle It is just for a one motor. My question: is it possible to build a simulink model for 4wheeled robot car by this model? I understood that, by changing to - or + value of block constant motor will drive anticlockwise or clockwise. How to be to turn left or right? It doesn't like Python or C programming, so it's stopped project. Especially for Simulink, any idea or suggestions would be greatly approtiated! Thank you so much in adwance!
I added images which i meant in comment. I am a newbie, so please, don't judge me quality)
enter image description here
enter image description here

Why is 'GPIO.setup(6, GPIO.IN)' throwing an error?

I'm trying to read the state of the input pin (BOARD pin 6, which is a ground pin) and I receive the error "ValueError: The channel sent is invalid on a Raspberry Pi".
Am I misunderstanding the definition of an input pin? My understanding was that it is simply the ground/negative pin, connecting back 'in' to the pi?
I'm trying to read the state purely for tinkering purposes, to see the value change when it's floating (not using a pull-down).
The Ground pin is connected, literally, to ground. It is impossible to read or write values to ground or power, as these are the circuit components. You have to connect to a GPIO pin (the green(ish? I'm colorblind) dots at http://pinout.xyz).
It is possible for the input of a GPIO pin to be set to HIGH or LOW, depending on the circuit you wish to use. If you expect the GPIO to be normally LOW and HIGH when your input is triggered (such as with a pushbutton switch), then you have to set the state to pulldown.
I would recommend you read some of the background on microcontrollers: https://embeddedartistry.com/blog/2018/06/04/demystifying-microcontroller-gpio-settings/

Stm32 spi write on rising edge and read on falling edge, possible?

i have application ic which needs to write on rising egde and read on falling edge . Write now i get both on rising egde?
I am using bidirectional mode so only 3 wires
Thanks
needs to write on rising egde and read on falling edge
Look at the SPI timing diagram in the Reference Manual. (This is for the F4 series, but AFAIK other series have compatible SPI controllers)
It does what you want when CPHA == 1 and CPOL == 0. Data lines are written at the rising edge, and captured at the falling edge of SCK.

RC Filter at the ADC input pins of beagle bone black

I am trying to read a thermistor with the beagle bone black.
I have a voltage divider circuit that feeds a unity gain Opamp. The O/P of the opamp is connected to a simple RC Low pass filter that feeds voltage to the ADC pin.
The problem I have noticed is that the voltage sensed by the beagle bone is always 0.02V higher than the actual voltage at the opamp output.
At first I thought this was a software issue, but on further investigation I found out that the voltage at the ADC pin is actually raised by 0.02V. If I feed the ADC pin directly from the opamp, without the RC filter I do not have this issue.
Has anyone else experienced anything similar?
Thanks in advance!
The resistance in the RC filter is too high which is causing a voltage drop because of the internal impedance of the ADC pin. You can use an active low pass filter to resolve this problem:
http://en.wikipedia.org/wiki/Low-pass_filter#Active_electronic_realization