Questions tagged [python]

On-topic questions related to Python would include embedded programming, using it as a tool for circuit analysis, or how Python interacts with computational hardware. Questions about libraries, algorithms, syntax, or code optimization should be directed to stackoverflow.com.

Filter by
Sorted by
Tagged with
2
votes
1answer
46 views

Compute electric field in complex 3D geometry

I have a CAD file with a pretty complex geometry. I would like to compute the electric field generated by this geometry when a specific charge density is defined. I guess I will have to go through ...
2
votes
2answers
4k views

Laplace transform on simple low pass filter in Python

Looking at the first picture in the link, showing a simple graph of an with- and without bypass filter circuit voltage difference. I wanted to recreate this chart: I have coded the noise and ...
0
votes
2answers
206 views

20kg digital servo not working, probably because my frequency calculations are very wrong (raspberry pi)

summary I changed my servos for a more powerful one and cannot get it to work, I believe it is because I can't get the right duty cycle calculation in the code explanation I have a robotic arm that I ...
1
vote
1answer
157 views

How to find out the used code?

I have a data stream that looks like x\xdam\xdd]\xc4\xeemZ\xc7q)2\xcc\xd6cL\x1a1\x8c\xc9hc\x0c)\xeb^\xaf\xd7Z (...) How can I find out what I do see here? At the ...
1
vote
4answers
57 views

with a L298N controller I need to “warm up” the motor to get it to run without stopping, why and how to do it with python

I understand that this will be a very trivial question but I cannot find an explanation online, probably because in my ignorance I'm asking the wrong question, to support my explanation I'm leaving ...
1
vote
2answers
664 views

I fried my Raspberry Pi while using L298N but I don't understand why

Everything seems to indicate that I fried my raspberry pi: the green light wouldn't turn on, I changed the SD card for a new one but it still didn't work. That is a shame because I was having a lot ...
2
votes
2answers
3k views

start a LTSpice simulation using code in MacOS

Help me please, I'm looking for the solution how to automate spice simulation with python on MacOS, currently, I'm thinking to use LTspice. However, I'm open to any proposal. I want to make ...
3
votes
2answers
115 views

Error correctly identifying Ls and Rs from measured Vin and Vo in LTSpice

As an exercise (using Python to process LTSpice exported data), I am trying to determine the values of Rs and Ls that were used in a circuit, from the the measurements of Vin, Vout, and the phase lead/...
0
votes
1answer
337 views

Which Raspberry Pi 3B+ GPIO pin is connected to which module in Adeept Motor Hat v2.0?

I need to find out which GPIO pin on the raspberry pi will be connected to which module when I fit the Adeept Motor Hat v2.0 on the 40 GPIO pins. I am attaching the image and the schematic of the ...
0
votes
0answers
284 views

Precise sampling rate for data acquisition with Arduino and Python

I built a simple data logger with Arduino and Python (Accelerometer --SPI--> ESP32 --USBSerial--> RPi). I used the timer interrupt to control the output data rate, which is set to 300Hz. But I noticed ...
1
vote
0answers
27 views

Finding the impedance of a distribution line from R,X,C values [closed]

I have real industry data of distribution feeder with line data consisting of r ,x and c values as shown in the attached figure. ...
-1
votes
2answers
379 views

Python to trigger USB square wave pulse for camera

I'm sorry if this was posted somewhere, but I'm trying to trigger a FLIR camera for acquisition using a USB port. I already purchased a USB split cable, and have queried the ports, so I know exactly ...
0
votes
4answers
347 views

FFT of a square wave

I'm generating a square wave as PWM whose frequency is set to 25 Hz. On the oscilloscope, I've got: The data referred to the image above was stored and maniputed, then I plot it using jupyter ...
1
vote
1answer
45 views

PCA9456A i2c switch channel 1 not showing up

I am using an PCA9456A i2c switch to help me toggle between i2c devices with the same address, but i am having problems opening channel 1 (second channel out of 4) and i ran out of ideas what is ...
0
votes
0answers
43 views

Raspberry pi not getting any data from hx711

I'm trying to combine two boards into one: SparkFun Load Sensor Combinator(basically just a wheatstone bridge) and SparkFun Load Cell Amplifier. The data will be transmitted to a Raspberry Pi 3 so ...
0
votes
1answer
230 views

Help with understanding the Memory Map of MLX90393

(Using a Raspberry Pi 3 Model B+ and python) I needed some assistance in understanding the memory map of MLX90393 I've attached the memory map here and you could also find it in the datasheet. I'm a ...
0
votes
1answer
182 views

ESC control with Raspberry Pi

I'm trying to control some ESC and brushless motors using a raspberry pi. I used the pigpio library to control them using servo pulses. But it seems that my motors wont increase rpm after a limit ...
0
votes
1answer
2k views

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed

I'm writing a simple code in Python to remotely send commands from PC to RSHameg HM8134-3, using USB. I'm using visa to do so. Something to note, when I write to it, it doesn't give me any errors(...
0
votes
0answers
58 views

need help deciphering accel/gyro datasheet for i2c communication using python RPi

I have barely any knowledge in this area, the most I have done is used my RPi3 with pre-built python libraries for sensors such as ADS1115 so I didn't have to go through the process of understanding ...
1
vote
2answers
300 views

Writing commands to a microcontroller with a STM32f chip from python

Manual to the micro controller: https://drive.google.com/file/d/0B8PmY6nhQadKSVc5OE04c3ZJaFU/view?usp=sharing , where page 18-19 introduces the serial communication protocol. The micro controller on ...
1
vote
1answer
139 views

Lighting up LEDS via I2C Bus of a NeoTrellis 4x4 RGB Led Matrix

Many attempts to write to an i2c slave to make rgb leds light up have failed. The hardware in question is found at: https://learn.adafruit.com/adafruit-neotrellis There is an arduino library and a ...
0
votes
0answers
46 views

Implementation of complementary filter and output of sensor while stationary

The code for a complementary filtered angle is not outputting the expected angle. I can get close to 90° using arctan formula from the accelerometer sensor data. Whereas, the complementary filter ...
0
votes
1answer
219 views

What's a better way to integrate an ODE for one time-step than the Euler method?

I'm simulating a simple cart-pendulum system for purposes of testing different control strategies and data-driven approaches. I need to simulate the dynamical system one time-step at a time. I'm ...
0
votes
2answers
56 views

Voltage drop after writing to slave register with I2C protocol

I'm trying to control this bipolar stepper motor with an Adafruit Huzzah32 (ESP32) board and a stepper driver shield. Power sources: ESP32: 5V USB port Shield: 4 AA-batteries in series I ...
-2
votes
3answers
173 views

Need Help with Python Script - ' 4 Dollar Programmer'

I am working on an embedded project and have made my first PCB with a processor mounted on board. The trouble seems to be actually getting my code onto that processor! I was sort of banking on being ...
2
votes
0answers
618 views

PV cells (photovoltaic) I-V curve plot simulation

I am trying to plot the I-V curve using python because that helps me in understanding PV cells / solar panels (and diodes as a general thing). I know the formulas ...
0
votes
0answers
61 views

Serial communication between raspberry and laptop not giving right values

I want to communicate between a Raspberry Pi 3 model B and a laptop using a USB to RS-232 cable and this RS-232 to 3.3V TTL converter via the serial module in Python: GND is connected to board pin #6 ...
0
votes
2answers
770 views

AttributeError: 'NoneType' object has no attribute 'send' pigpiod

So I create an another program that can run stepper motor clockwise and counter clockwise with a ramp up and ramp down in there and adding limiter switch on GPIO 16 and 26 to stop the ...
0
votes
0answers
83 views

Converting the output of a Proportional Control System to a meaningful drive of a Peltier

Trying to create a PID controller for temperature control using a Peltier element, I decided to take it step by step and create first the Proportional and then the Integral and the Derivative ...
0
votes
2answers
407 views

Increase the ramp up stepper motor performance

I'm driving a NEMA34 bipolar stepper motor with the following specifications: Holding torque 5.9 Nm Step angle 1.8° Resistance / phase 0.33±10% Ω Inductance / phase 3.00±20% mH Max load axial 65 N ...
0
votes
1answer
43 views

Getting valid input from Ultrasonic range finder

(I am posting this question here since I feel that the issue is a part of my lacking understanding of the electronics, and not a ) I am trying to monitor the feed hopper for my pellet furnace. I had ...
0
votes
0answers
74 views

Checking for signals above strength threshold over SDR on VHF

So I have a small NooElec Software Defined Radio and I've got it working well with my Raspberry Pi using GQRX as a controller and to visualize the SDR output. My goal though is to use a python script ...
1
vote
0answers
313 views

Dac over raspberry pi spi troubleshooting

I am trying to output a signal with dac124s085 from python code on a raspberry pi 3b, running Raspbian Stretch (kernel 4.14.30-v7+ #1102). I am sure the spi master driver is enabled - dtparam=spi=on ...
0
votes
0answers
33 views

Calculating cell resistance in dependence from cell temperature from CAN bus logs

I'm part of a formula student team. When we go testing we are logging the CAN bus data the car produces to further understand what the car is doing. We log all the battery cell temperatures/voltages ...
2
votes
1answer
4k views

Parsing .s2p data through an automation script to plot graphs of the various s-parameters

Need to find a way to quickly decipher and plot s-parameters for tons of .s2p files in a short period of time. In specific, I need to plot the angle of the s-parameters versus frequency and then the ...
1
vote
1answer
183 views

Current flow between 2 circuits without common ground

I made a clock circuit with a 555 timer ic, then I measured the wavelength of the square wave generated using my Raspberry Pi. At first I connected the ground of the RPi to the ground of the circuit. ...
0
votes
3answers
179 views

using an ADC under Linux for automated current monitoring setup

I'm a slightly overchallenged undergrad ee student. I'm working on a project where I'm supposed to build an automated setup to measure hard disk currents over time. I want to use a Current Shunt ...
4
votes
1answer
451 views

Am I using Shannon-Hartley Theorem and thermal noise correctly here?

I'm trying to learn about noise, sensitivity, and the Shannon-Hartley theorem, and I'm using some specs for a LoRa node IC to try it out. The Shannon-Hartley theorem says that the maximum data rate \$...
7
votes
0answers
4k views

Automate LT-SPICE? [duplicate]

I'm running a lot of simulations in LT-Spice, and I need someway to run them all either sequentially or at the same time. I was going to use Python, but I'm not entirely clear on how I would get ...
0
votes
4answers
3k views

RPi GPIO relay interference with input

I'm trying to use a RPi3 to output/control a lamp using this relay module. I also want to be able to read from a push button and a switch. The problem I'm having is that it looks like switching the ...
0
votes
0answers
1k views

Most accurate, available way to control a stepper motor with python

I am doing a project where I am controlling a nema 17 stepper motor with a raspberry pi 3b. The raspberry pi is controlling the motor through a pyqt5 gui (python 3 is the language). I am using tb6600 ...
1
vote
1answer
156 views

Device for toggling power to another device via raspberry pi GPIO?

So I have a PTZ camera and a siren. What I'm trying to do is trigger the siren when the camera detects motion. The camera hooks up via PoE, but the siren just has a 12 volt connection, so it has to ...
0
votes
1answer
2k views

Data acquisition with Python on a Beaglebone Black - Increasing sample speed

This is my first foray into programming and using a BeagleBone Black. I have some limited experience in Python, and have used this within the provided Cloud9 IDE in order to capture data and write ...
1
vote
0answers
323 views

Solve \$n \times n\$ rectangular grid of resistors for mesh currents

I am modeling a mechanical process by using an electrical analogue. I need to calculate the loop (mesh) currents, then I can see if any mesh current is greater than a predetermined value \$\lambda\$. ...
1
vote
0answers
245 views

Problem with Pyserial read time

I'm building a RS485 network with rpi3 as master and a bunch of c51 mcu as slaves. After sending an address, the master waits for the slave to respond and then starts to send data. I'm using Pyserial ...
0
votes
0answers
457 views

Internet access to LoPy (ESP32) using its GPIO pins

LoPy is a LoRa module which uses ESP32 chipset. It has WiFi and Bluetooth connectivity for Internet. In my setup, I have certain interference issues, so I can't use WiFi nor Bluetooth to connect my ...
1
vote
0answers
195 views

What are the materials needed for boiling milk alarm sensor?

I have recently bought raspberry pi to start working on it. I have never ever used it before. I am thinking of doing very basic task of led bulb on/off for getting into it. I am curious on developing ...
1
vote
2answers
1k views

Serial communication between embedded system and PC with only USB ports available.

I am working on an application where I have part of an embedded linux system transferring some data to a PC utilizing PySerial (a Python module). My question is: is there an alternative to finding a ...
-1
votes
1answer
489 views

How to talk with RTC hardware by Python?

I am using DT6 custom board from Variscite . This board is connect with DART MX6 board. DT6 in below link http://www.variscite.com/products/single-board-computers/dt6customboard I need to handle the ...
1
vote
1answer
79 views

Issue reading pressure transducers and getting floating value

So I'm trying to read a Honeywell pressure transducer off an Arduino Mega and I'm just getting floating values. I've tried ground the line straight to the Gnd and then I get a consistent 0 but ...