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 vote
0 answers
84 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 ...
1 vote
1 answer
176 views

Raspberry Pi Pico not reading a button correctly

I connected a button to my Pico and would like to see if it is pressed in real-time. One end of the button is connected to GPIO 15, other one to ...
1 vote
1 answer
88 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)...
-1 votes
0 answers
15 views

How to control a LewanSoul/HiWonder 16 channel servo controller with Python? [closed]

I need to control my servos with my computer, but the software that comes with the servo-majig is too clunky and slow, so I would like to write a better program in python. Im using an LSC-16-V2.0. Im ...
2 votes
2 answers
748 views

Using more than two I2C OLED displays on a Pico

I have a Raspberry Pi Pico running CircuitPython and I use the adafruit_ssd1306 library to drive SSD1306 OLED displays. This works very well for two displays, but when adding the third it doesn't ...
0 votes
3 answers
99 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 ...
4 votes
1 answer
201 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 ...
0 votes
0 answers
51 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 ...
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,...
0 votes
0 answers
23 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 ...
0 votes
4 answers
2k views

Read negative voltage using an ADS1115

I'm currently trying to read a sine voltage between about -5 V and +5 V at 50 Hz using an ADS1115 and a Raspberry Pi. I'm writing the code in Python and using the Adafruit library for the ADC. I have ...
-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 ...
0 votes
1 answer
732 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 the Arduino IDE, but I remember flashing that bin file on the device. ...
0 votes
0 answers
19 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 ...
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.)...
0 votes
1 answer
56 views

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

...
0 votes
1 answer
97 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 ...
0 votes
0 answers
47 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 ...
0 votes
0 answers
22 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/...
3 votes
1 answer
167 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 ...
5 votes
1 answer
229 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 ...
2 votes
2 answers
269 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 ...
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 ...
2 votes
1 answer
165 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 ...
0 votes
1 answer
996 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 ...
1 vote
1 answer
124 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 ...
0 votes
4 answers
2k 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
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 ...
1 vote
1 answer
390 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 ...
21 votes
6 answers
28k views

LTspice automation

I have a battery-powered boost converter and I'm attempting to measure the maximum input (battery) voltage droop under various load conditions of high current draws (different duty-cycles/...
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 ...
2 votes
2 answers
104 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 ...
0 votes
1 answer
193 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: ...
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=...
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 ...
2 votes
2 answers
2k 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
2 answers
61 views

Getting valid input from ultrasonic range finder

I am trying to monitor the feed hopper for my pellet furnace. I had a Seed Studio Ultrasonic range finder lying about. I used an example script to get started, and set up some simple "error ...
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 ...
1 vote
1 answer
809 views

Run Ngspice in batch mode or with Python

For circuit simulations I have mostly been using LTpice, where the netlist is generated automatically with a Python script I wrote and run using the following Python command: ...
0 votes
1 answer
115 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 ...
0 votes
2 answers
445 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 &...
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 ...
2 votes
1 answer
492 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 ...
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 <...
-1 votes
2 answers
916 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
2 answers
5k 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(...
1 vote
1 answer
107 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 ...
3 votes
1 answer
364 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....
1 vote
2 answers
426 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 ...
0 votes
2 answers
213 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 ...

1
2 3 4 5