Skip to main content

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

Gain depending to Frequency

This script sets up a server that listens for incoming connections. It reads audio data from the client in chunks of 1024 bytes, processes it using FFT (Fast Fourier Transform) with frequency-...
Phaze Music's user avatar
0 votes
0 answers
37 views

TCA9548A I2C Python coding help

I am designing a board using 4 TCA9548As that each have 8 screw terminals so that I can connect to 32 addressable devices. I am trying to create the python code to be able to write to each of these ...
Beau Raley's user avatar
0 votes
1 answer
44 views

Using MUXs to Address Multiple Devices

I am fairly new to I2C and coding in general as I am currently majoring in electrical engineering. I needed to design a board with multiple MUXs, I am using TCA9548As, that can address interchangeable ...
Beau Raley's user avatar
0 votes
1 answer
46 views

Iterative Simulation LTspice Model using Python

I'm new to python. I have a python code to simulate my LTspice model. I need to change the on time in the pulse parameters and I need a large number of simulations for at least 100 different Ton. So I ...
New_User's user avatar
0 votes
0 answers
28 views

Differential Equation Classes for Arduino-Python Control

I am working with Python and an Arduino. I am trying to implement a control in continuous time, thus I need to create an approximation of the next step using numerical methods. I would like to ask if ...
tlahuizcalpantecuhtli's user avatar
0 votes
0 answers
38 views

Controll PD with Python

I'm applying a Proportional-Derivative controller to control my robot, but I don't understand why the robot's position doesn't reach the desired position. Can someone help me understand what the error ...
monika's user avatar
  • 11
0 votes
0 answers
79 views

Script Implementation of SN74HC165NSR

I have a PCB connected to my Raspberry Pi via its PiSound Header. It has 7 SN74HC165NSR shift registers. I'm trying to write a basic script that can read the ON / OFF state of the switches on the PCB ...
Jelani Thompson's user avatar
1 vote
2 answers
85 views

How to separate 4th order transfer function (Butterworth Approximation) into 2nd order using Python Control Library?

Previously I had the following coefficients in the program. In this program I want to create a transfer function of butterworth approximation (Digital Filter Design - Digital Signal Processing). ...
SKevinAR18's user avatar
0 votes
2 answers
206 views

STM32 Help receiving serial data sent from python's pyserial

I need some help communicating between python's pyserial and an STM32f030R8 microcontroller. This is for a 2 DOF robot which has a python base GUI. The GUI will send, via serial communication, the ...
Eric14003's user avatar
2 votes
0 answers
60 views

Bugged Clarke Park transform on three-phase signal using Python

I'm supposed to apply a Clarke-Park transformation to an electrical signal so other people at my office can study the "quality" (?) of said signal. I was given a Jupyter Notebook replicating ...
J. Maria's user avatar
  • 121
1 vote
1 answer
117 views

Interfacing with a Tektronix TBS2074B using PyVisa and SCPI commands - Timeout issue

I have a script for capturing waveform data via USB, that at one point in time was working appropriately. However, recently it stopped working and multiple things/settings were changed making it hard ...
Cemetery_Gates's user avatar
0 votes
3 answers
179 views

How do I plot the DC equivalent of an AC sinusoidal signal in Python?

I want to draw a line that bisects an AC signal as seen in the first picture below. This line should take into consideration any drifts. So essentially, I have an AC voltage signal over time for 3 ...
Jeff Kyei's user avatar
0 votes
2 answers
194 views

Establishing communication between laptop and an oscilloscope [closed]

I am trying to establish a connection between this oscilloscope and my laptop using the USB port on the oscilloscope. This is my code in Python: ...
Jonathan_the_seagull's user avatar
0 votes
0 answers
44 views

Data transfer between computer and Fieldfox N9917A using Python VXI-11 library

I accessed my Fieldfox device using the vx-11 library. But now I don't know which commands to access the data with. For example, with the CALC:FEED:MODE AVER command? I use Fieldfox programming guides ...
aycansgn's user avatar
0 votes
1 answer
61 views

Using Raspberry Pi 2 W with ADS1015, after taking analog reading and copying value to another object the value changes in original object

...
user avatar
0 votes
1 answer
186 views

What is the data sent by the python-dali library for the commands Turnoff, Turnon, stepup, stepdown, and getstatus to the DALI driver? [closed]

Here is the link to the python-dali library, python-dali library command description, The table details are taken by referring - DALI COMMANDS 1 dali2560/dali.txt DALI COMMANDS 3 Connections overview ...
Mohan Das's user avatar
0 votes
0 answers
58 views

Optimise matrix inversion in python for impedance calculation

To get the impedance profile for a circuit, I am using its admittance (G) and capacitance (C) matrices. I am using python to compute impedance profile at different frequencies but the issue is that I ...
Dev's user avatar
  • 61
1 vote
1 answer
120 views

Raspberry Pi Pico W not executing main.py when connected with ammeter

I am trying to measure the current flow of a Raspberry Pi Pico W running simple code that blinks the onboard LED saved as 'main.py'. I have verified this code runs when connected to a) my laptop and b)...
harryt's user avatar
  • 23
3 votes
1 answer
106 views

Time-varying capacitor generates higher than supply voltage? Capacitor power generators?

I was playing around with electret capacitors, supposedly time-varying capacitors with accordance with sound waves, trying to understand them deeply when I found that I need to model it mathematically,...
Shams M.Monem's user avatar
3 votes
1 answer
191 views

How does LTSpice solver know the type of the component?

I am doing automation of LTSpice using PyLTSpice library in Python. I need to know the types of the components in the netlist or in the raw file. How can I know programmatically that ...
Rémi Baudoux's user avatar
2 votes
2 answers
372 views

Undesirable dim light of LEDs on 7 segment display

I have a 7 segment display (common cathode) with 2 LEDs in each segment, powered by 12V, each segment controlled with a transistor (NPN) and Raspberry Pi 3.3V GPIO (and 4026 IC). What could be the ...
solari's user avatar
  • 21
3 votes
1 answer
133 views

JFET Id calculation mismatch in SPICE

I'm simulating the following circuit in PySpice: simulate this circuit – Schematic created using CircuitLab In this configuration, the N-JFET is always in saturation mode, as you can see by the ...
edwillys's user avatar
5 votes
1 answer
335 views

Interfacing an old spectrometer with PySerial

I asked this question on the Engineering StackExchange and someone said it might be more appropriate here. I want to interface an old Shimadzu spectrophotometer (Model UV-1601, manual here) through ...
Omnistic's user avatar
2 votes
1 answer
227 views

voltage divider using skrf

I'm trying to use Python skrf's Circuit description and started with a voltage divider but I must be mis-using the library because my attempt does not give a realistic result. The circuit I try to ...
Xababa's user avatar
  • 23
1 vote
1 answer
185 views

How to PID control a 47 Ω, 8 W resistor with a Raspberry Pi and Python?

I have a Raspberry Pi 4B, a 12 V power supply, a 12 V air pump controlled by a MOSFET, a DS18B20 for feedback and a 47 Ω, 8 W resistor that we should somehow heat. Everything up to actually heating ...
Mito's user avatar
  • 411
0 votes
1 answer
112 views

Unable to clear faults on Monoblock via RS232 command: Need help decoding serial messages with Arduino

I recently purchased an XRB160PN192 Monoblock with a known fault of high voltage (HV) for a low price to use in my graduation project. After reading the user manual, I found that the HV error, along ...
Amr Sohil's user avatar
1 vote
0 answers
190 views

HC-06 module does not receive data from Raspberry Pi Pico

So I have a project that I'm currently working on and I am also using the HC-06 module as a part of the communication process between the Raspberry Pi Pico and my application. A while ago when I was ...
David's user avatar
  • 11
0 votes
1 answer
73 views

What USB device can I use to check for voltage on or off? [closed]

I am looking for a device (ideally a USB device) which I can use to check automatically if there is some voltage (3.3 V) at an electrical connection. The idea is to automatically test (with a python ...
Alex's user avatar
  • 161
2 votes
2 answers
133 views

Calculating voltage of a circuit with changing current

I'm taking a class about batteries and circuits, and I'm trying a bunch of practice problems in Python. I'm having trouble solving for the voltage of a battery's circuit: I am given that, with a ...
John Alberto's user avatar
4 votes
1 answer
434 views

FSK Modulation in Python

I am currently writing a script that uses I/Q data to do FSK modulation. My question is about the FFT plot. I expected to have a peak at 1Hz and 2Hz which are the frequencies that represent binary 0 ...
PrematureCorn's user avatar
2 votes
2 answers
87 views

python vs matlab? [closed]

What is so special about MATLAB? Why in engineering (especially electrical engineering) hasn't pyhton replaced it? I was watching a Youtube video regarding MATLAB: https://www.youtube.com/watch?v=...
cvb's user avatar
  • 21
0 votes
1 answer
285 views

I need help understanding this Python program for reading TDS and pH sensors on a Raspberry Pi 4B

I have a Python program for reading both TDS and pH sensors on a Raspberry Pi 4 and sending the data to the Blynk app. I have a question about the code: ...
ُSpecter's user avatar
1 vote
1 answer
782 views

FlatCAM 8.994 Beta- Gerber copper layers not shown in Plot Area

I am learning to CNC mill my first PCB. As project to learn it, I have chosen the QuinLED V2.6 PCB, which should have wide enough traces and pads to work as milled board hopefully. This is what I see ...
andreas's user avatar
  • 111
0 votes
0 answers
115 views

Demodulation of IQ signals from SDRs

I am writing a Python program for an SDR in which I need to process the signal that the SDR will receive. My problem is that the SDR provides an array of complex values, which is tantamount to using ...
electronsx's user avatar
0 votes
1 answer
150 views

Wired ESP8266 Communication

I have been looking for the cheapest/easiest way to get 100 or so different i/o devices to all talk to a "Master." (Sending temp data, receiving motor information) Since i am looking for a ...
drew wood's user avatar
  • 239
0 votes
2 answers
650 views

How to read MOXA gate Modbus RTU to Modbus TCP in Python?

I have got some MOXA devices. One of them is an Mgate MB3180. I want to code in a program in Python to read the data using TCP. I don't know if I have to use a regular "TCP reading" or an &...
Developing Electronics's user avatar
0 votes
0 answers
76 views

How to determine which I2C commands to execute to arrive at a desired result?

I have successfully established bidirectional communication between a featherS2 board and a Mikroe UART to I2C bridge. I do this by instantiating the address of an I2C command from page 16 of this ...
Z-Man Jones's user avatar
2 votes
1 answer
704 views

How to properly use i2c.writeto_then_readfrom() method

See also follow-up question about i2c addresses I have this mikroe board wired up to an S2 Feather via the SDA and SCL pins. The ...
Z-Man Jones's user avatar
6 votes
3 answers
2k views

Why am I detecting two I2C addresses on the same board, and why do neither of them appear in the datasheet?

I have this MIKROE board wired up to an S2 Feather via the SDA and SCL pins. The MIKROE board is powered by the Feather via <...
Z-Man Jones's user avatar
1 vote
1 answer
150 views

DMU11 IMU data straight from port with Python

This is my first python project away from learning through textbook exercises. I have no other experience coding so sorry that the formatting is likely horrendous. I'm using DMU11 form Silicon Sensing ...
GracefulMango's user avatar
3 votes
1 answer
601 views

Interacting with SPICE netlists using PySpice

I am trying to come up with a generic Python program that I can use to simulate different simple electronic circuits. The actual idea is to programmaticaly change parameters and do Montecarlo analyses....
Guarneer's user avatar
  • 143
1 vote
2 answers
825 views

What is the size of the variables declared as macros in C Programming?

I am currently trying to receive and process serial data from an STM32F401CCU6. I am receiving binary data from the STM over USB and I would like to re-assemble the raw data into what was originally ...
Harit's user avatar
  • 83
0 votes
2 answers
317 views

Stepper motor going 1 step forward and 1 backward [closed]

I am trying to control stepper motors using Raspberry Pi 4 and I am facing an issue with it. I am using L9110 controller, and the stepper motor is made for 12v/0.4A. I have a power supply and ...
Frezo's user avatar
  • 1
1 vote
1 answer
127 views

Problem with GPS old location [closed]

I wrote a GPS driver which sends and reads AT commands. I send the AT+CGPS=1,1 command to get the GPS location and if there is no answer I send ...
aguero's user avatar
  • 21
1 vote
1 answer
7k views

PID controller implementation in Python

I'm trying to implement a PID controller for a magnetic field using Python. The magnetic field needs to be around 800µT. It is generated by two coils powered by a current source (BKprecision XLN3640.)...
louisld's user avatar
  • 149
0 votes
1 answer
499 views

SCPI for SIGLENT SDG2042X

I have been writing python automating scripts for an O-scope and an AWG. I am having issues sending Arbitrary waveforms to the AWG, the model is Siglent SDG2042X. I have the manual and it has an ...
Frank's user avatar
  • 15
0 votes
1 answer
566 views

SCPI OPC command not working

I am writing a SCPI script in Python for the Siglent SDS1104X-E. I have been banging my head for a few days trying to get this to work. Below is my main py file: ...
Frank's user avatar
  • 15
2 votes
0 answers
132 views

Logging data from High Precision AD/DA board using Raspberry Pi 3B

I have a High Precision AD/DA board from waveshare with Raspberry Pi 3B (running on Raspbian). However, I can write only 27 samples in 1s in my CSV file. I am using this Python code for writing to a ...
Varun Dhankhar's user avatar
0 votes
1 answer
395 views

Best low-cost microcontroller (that can be programmed using Python) for computer vision? [closed]

I have been researching for many days and haven't found a microcontroller that fits my needs. I want a microcontroller that: Is cheap (I want to make this into a product that can be around $20-40) ...
JoraSN's user avatar
  • 111
1 vote
1 answer
210 views

Raspberry PI4 and RS232 adapter cable: how to send serial commands

I would like to use a Raspberry Pi4 to control a syringe pump [(see datasheet here and in particular the quick start manual on page1)][1] The connector cables I used are RJ11 from the Pump to RS232 (...
Marco Bobinger's user avatar

1
2 3 4 5