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
3 answers
95 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
0 answers
50 views

Real-Time Audio Processing

this is my first post on here so I hope I am in the right directory to ask this or if there's another channel I should sent this in, let me know. Basically, what I am trying to do is use a sound ...
Cole Sheyka's user avatar
0 votes
0 answers
21 views

LSM6DS33 IMU data not behaving as expected

This is my first project using an IMU and I don't know what I am doing wrong. I am using an LSM6DS33 connected to a Raspberry Pi via I2C. When it is sitting still I would expect the gyro values to not ...
ThatAintWorking's user avatar
-5 votes
0 answers
39 views

Can any one help me in writing a code for just out put VCC = 5 V for 120 sec only when there is a trigger signal thee go off all the day? [duplicate]

The red and black colors in the USB Cable all time out put VCC = 5 V and Ground = 0 V , Can any one help me in writing a code for just out put VCC = 5 V for 120 sec only when there is a trigger signal ...
Osama Ghandour Geris's user avatar
0 votes
0 answers
18 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
55 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
96 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
45 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
  • 51
1 vote
1 answer
75 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
0 votes
0 answers
21 views

How to perform image windowing on the OV5647 CMOS sensor?

I have an Arducam 5MP OV5647 Motorized Focus CMOS camera module (which is the same as a regular 5MP Raspberry Pi Camera, but with a motorized lens for manual focusing). https://www.arducam.com/...
F16Falcon's user avatar
  • 292
3 votes
1 answer
93 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
166 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
257 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
117 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
221 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
161 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
123 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
99 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
0 votes
0 answers
73 views

HC-06 module does not receive data RP Pico

So I have a project that I currenty working on and I am also using the HC-06 module as a part of the communication proccess between the ...
David's user avatar
  • 1
0 votes
1 answer
61 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
  • 151
2 votes
2 answers
103 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
189 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
77 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
185 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
376 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
76 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
112 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
  • 231
0 votes
2 answers
432 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
65 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
484 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
106 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
357 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
411 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
  • 73
0 votes
2 answers
207 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
100 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
6k 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
351 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
389 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
118 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
242 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
171 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
2 votes
2 answers
2k views

Solving electrical network in Python

I have a complicated electrical network. I would like to calculate voltage drop across across the network i.e. nodes 2-15, given V1=10 V and V16=0 V. The values of the resistances are known. Is there ...
Wiz123's user avatar
  • 121
2 votes
1 answer
237 views

Scaling Waveform from LeCroy 4104HD using Python/IEEE488.2

I am automating control of a LeCroy oscilloscope using IEEE488.2 and Python/PyVisa. It seems like it should be relatively straightforward. I use the WF? command to get the waveform + header, I use the ...
Bobby's user avatar
  • 31
1 vote
1 answer
205 views

SPI transaction weird behavior

Im completely new to this topic so excuse any mistakes I make. I have a MMC5983MA sensor which works well with I2C. However Im having trouble with the SPI protocol. I have all wired up and im trying ...
FlipFlop's user avatar
-4 votes
1 answer
97 views

Raspberry Pi 3 motor code gives gpio error

I am trying to code a motor using the GPIO pins on a raspberry pi 3 and for some reason, when I run the code, it gives me this error: GPIO.setup(enable_pin, GPIO.OUT) NameError: name 'enable_pin' is ...
Sean772's user avatar
  • 19
1 vote
0 answers
182 views

Stepper motor has own encoder, can I connect encoder pins to microcontroller and see feedback?

I am using closed loop stepper motor with motor driver. Here is my driver CS-D808. I am using this with microcontroller. I want to stop this motor always certain location after 5 to 10 turns. I wrote ...
Tryingtogetsome's user avatar
0 votes
1 answer
75 views

Restore Image File from an Embedded Linux

I am working a project and I am running python on my SOM module( Variscite DART-6UL ). The libraries installation take too much time that I need. Because of that I want to take an image file after ...
Muhammed_Shn's user avatar
2 votes
0 answers
100 views

Get alpha-beta plot of Clarke Transform in Python

For a project I'm working on, I want to use the Clarke Transform to detect faults in a power system. To do this, I already wrote a script in Python which returns the sine wave behavior of the Alpha, ...
Juan Pablo Naranjo's user avatar
0 votes
1 answer
980 views

SPI communication problem between Raspberry Pi and STM32

I've spent a couple of days to find answer to my problem. Currently I'm working on a project where an STM32L432KC microcontroller board and a Raspberry Pi 3B need to communicate over SPI. The OS on ...
Nightek's user avatar
  • 11

1
2 3 4 5