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
0
votes
0answers
7 views

Underflow error in matrix parameter computation

I'm facing an underflow problem in the following code, which computes matrices related to nodal admittance of a buried transmission line, that snippet is part of a class that calculates all the ...
0
votes
0answers
55 views

Tracking location with GSM tower triangulation

I want to track location with GSM tower triangulation. I searched and I found this API for GSM positioning. ...
0
votes
0answers
64 views

Unable to read output of a joystick on a Raspberry Pi

I connected my joystick with this tutorial: link However, it does not work. The code runs fine (after changing print "---" to ...
0
votes
0answers
32 views

Segments not totally off when multiplexing 7 segments display with CD4051BE

I'm trying to make a display with several 7 segment displays so I decided to use multiplexing to make it work. I use CD4051BE to do that. The circuit is as follow: Circuit of the multiplexing The ...
2
votes
0answers
47 views

How to calculate the Samples per second possible of a ADC (MAXIM 11605) using i2c with raspberry pi?

I would like to find out how many samples per second this ADC im using is capable of with a raspberry pi using i2c and python SMBUS2 library, but i dont know where to start. As far as i know this ...
0
votes
1answer
29 views

ESP32 WROOM switching back from MicroPython to Arduino framework

I have recently switched my ESP32's firmware to work with python (using Thonny IDE) and I want to switch back to work with C++ and Arduino IDE, but I remmember flashing that bin file on the device. Is ...
0
votes
1answer
46 views

Is there a way to set different sampling frequencies to channels in ADS1256?

In order to acquire 3 analog signals with a Raspberry Pi 4, I want to use Waveshare's ADS1256 AD expansion board (8 channels single-ended, 24 bit.) I was wondering if there's a way to set a different ...
0
votes
0answers
26 views

NFC communication - CR95HF over 15693 and 14443-A

CR95HF datasheet: https://www.st.com/resource/en/datasheet/cr95hf.pdf Demo board: https://docs.rs-online.com/562c/0900766b811c6bc2.pdf C/C++ library and guide for demo board: https://www.st.com/...
1
vote
1answer
39 views

Problem communicating with UART1 with Python on Beaglebone Black

I am having issues communicatong to UART1 of my Beaglebone Black with python My code on Python3 is as follows: import Adafruit_BBIO.ADC as ADC import Adafruit_BBIO.GPIO as GPIO from time import sleep ...
0
votes
1answer
40 views

problem in parsing LTspice data

I am using the ltspice python package to extract the data from the .raw file as seen in this link. However, when I try to apply it to my raw file I get the following error: ...
0
votes
1answer
57 views

Run Ltspice netlist using python

I would like to know please if there is a way I can run a LTspice simulation using only python. In other words, I need a python alternative to this command: subprocess.run(['scad3.exe','-b','netlist....
0
votes
1answer
33 views

Cause of delay in CAN

I am dealing with a differential drive robot that interacts with several motors and actuators, all through a powerful NVIDIA Jetson Xavier. The Jetson runs Ubuntu and I use Python3 for programming all ...
1
vote
2answers
59 views

How can I adequately recreate a signal with a biphase line code after band-pass filter in python?

I want to create a python model of a transmitter. The transmitter uses a biphase line code, which looks like this (from a datasheet): Additionally, the datasheet states that the signal is "...
0
votes
3answers
88 views

Digital filtering after analog to digital conversion (ADC)

I am making a PCB that receives a signal with a frequency band of 3-50 Hz and peaks of up to 10's of uV. I have implemented proper analog LP and HP (band-pass) filters and am using a 16-bit isolated ...
0
votes
0answers
29 views

Are my charging equations being used correctly in my lithium ion battery Python simulation?

This is a continuation of a previous question I asked (Are my equations correct for a simple lithium ion battery model in Python?). My issue now is I do not believe I am using the charge equations ...
0
votes
1answer
22 views

Is it possible to specify a script that should be executed as soon as synthesis starts in Synopsys Synplify?

The Synopsys Synplify Pro is used internally to carry out synthesis in Libero and probably other places. Is there a method to assign a tcl or python script to be executed just before or just after ...
2
votes
0answers
26 views

Trinket M0 PWM ValueError: duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)

I'm trying to control a servo motor from a Trinket M0. My circuitpython code is: ...
0
votes
1answer
60 views

Response time of RTS and DTS pins of the chip FT232RL (USB to Serial)

I'm controlling the values ("High" or "Low") of RTS and DTR pins in FT232RL using python package serial. My question is what's the maximum time between executing the command ser....
2
votes
3answers
186 views

How can I model an optical filter using python?

Say I have an RGB LED which transmit intensity modulated signals, at one symbol transmission I want to send a symbol with all three chips.. Can I just model three bandpass optical filters like RF ...
0
votes
1answer
112 views

Controlling a digital switch using Python through USB

I have an RF digital switch that takes two digital inputs (AB) in order to decide from which antenna port to take the input. Is their a simple way to use Python to send the AB values through the USB ...
2
votes
1answer
838 views

Using Python to simulate an LTspice netlist

I am new to Python, and I want to simulate LTspice circuits automatically using Python. I added the library ltspice and scripted a fair amount in order for Python to automatically generate an ...
0
votes
0answers
251 views

Are my equations correct for a simple lithium ion battery model in Python?

I am trying to create a simple battery model in Python based on the RC circuit from, http://firsttimeprogrammer.blogspot.com/2015/07/electric-circuits-101-rc-and-rl-circuits.html. I have attached ...
2
votes
1answer
45 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 ...
0
votes
2answers
127 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 ...
0
votes
0answers
70 views

How do I set up serial communication between two Holybro Telemetry Radios?

I have two USB Holybro 915 MHz Telemetry Radios. These are usually used with Mavlink for communication between drones and ground stations, but I would like to use them to send small amounts of data - ...
1
vote
1answer
151 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
54 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
321 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 ...
0
votes
0answers
51 views

Gamecube controller hack with raspberry pi

Electrical noob here. I am trying to control a gamecube controller from a raspberry pi. Meaning: I want to have wires from the pi soldered onto the board of the gamecube contoller and emulate button ...
0
votes
0answers
25 views

How to store data in Keithley2400 buffer during measurements and retrieve through rs232?

I am trying to do an IV measurement (source current, sense voltage) store into the Keithley2400 buffer and retrieve the measured data (voltage and current) into my python program variable 'data'. <...
3
votes
2answers
104 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
237 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
30 views

Simulating Railroad ECode track circuit from a Raspberry Pi

I'm looking to simulate a track circuit by sending out digital voltages of 2.5 volts from the raspberry pi at varying intervals of time (see image below). My question before I go too far into coding ...
0
votes
0answers
191 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. ...
0
votes
2answers
254 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 ...
1
vote
0answers
16 views

Discrete Cosine Transform (DCT) Coefficient Distribution

I have two images : Original Image Binarized Image I have applied Discrete Cosine Transform to the two images by dividing the 256x256 image into 8x8 blocks. After, I want to compare their DCT ...
0
votes
2answers
289 views

How to free up memory in a CircuitPython board?

I'm using a Feather M0 Express from Adafruit with a DS3231 Precision RTC FeatherWing for a custom clock project that displays time with LEDs. The clock works as follows: When the clock gets plugged ...
0
votes
0answers
40 views

M5Stick turns off randomly

I recently got an M5StickC, and I'm programming it using UIFlow. I wrote some code for it, and it works fine for about 45 minutes (not plugged in, not on Wifi), then it just turns off for no reason. I ...
1
vote
1answer
40 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
4answers
216 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 ...
0
votes
0answers
32 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
182 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
143 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
1k 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
51 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
255 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
122 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
44 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
175 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 ...