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
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/...
Joel B's user avatar
  • 3,487
21 votes
1 answer
11k views

ESP8266 eLUA (NodeMCU) vs MicroPython

I am searching for an unbiased, up-to-date comparison of the eLUA (NodeMCU) and MicroPython on ESP8266. I can only find very superficial reports/blogs of users trying out one or the other. - All of ...
ARF's user avatar
  • 5,199
8 votes
2 answers
11k views

Is there a spice directive to export waveform data in LTspice?

http://www.linear.com/solutions/1815 The above web-page explains how to export the waveform data to a text file. You basically run the LTspice simulation, clicking on the waveform window, go to ...
Shashank Sawant's user avatar
7 votes
4 answers
5k views

Wheatstone bridge sensitivity and accuracy

From my earlier question I was able to wire up 2 SEN-10245 weight sensors (each forming one half of a wheatstone bridge) with an AD620 InAmp & 47 Ohm resistor (to set the gain to ~1000). I then ...
Anconia's user avatar
  • 183
7 votes
0 answers
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 ...
Tropical_Peach'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
5 votes
3 answers
3k views

ESP8266-12E MicroPython Unable to access REPL (Python prompt)

I am trying to install MIcroPython Firmware on my ESP8266-12E chip. I am using esptool.py to flash the firmware. I have successfully uploaded the firmware ...
Karan S. Sisodia's user avatar
5 votes
1 answer
295 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
5 votes
1 answer
6k 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 ...
user avatar
4 votes
1 answer
681 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 \$...
uhoh's user avatar
  • 3,419
4 votes
1 answer
317 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
4 votes
5 answers
19k views

Python serial between Arduino and Raspberry Pi: Data is modified upon reception

I'm using an Arduino for sensor readings and sending them to a Raspberry Pi via USB, using PySerial for data reception. It works great, except for the fact received data is awkwardly modified (And ...
Ahmed Farid's user avatar
3 votes
4 answers
2k views

How to calculate resistance from points using linear regression?

I have a lists of current and voltage of one device and I would like to calculate the resistance. There are some errors with the ...
Jerzy's user avatar
  • 41
3 votes
2 answers
5k views

Passing data from Python to Arduino over ethernet

I have an Arduino with Ethernet shield handshaking with my machine over Ethernet, and now I want to send data between them. My problem seems to be correctly parsing the different data types. For ...
MechEngineer's user avatar
3 votes
1 answer
180 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
3 votes
1 answer
486 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
3 votes
1 answer
126 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
3 votes
1 answer
3k views

Test automation framework/software for hardware applications

I am an Electrical engineer so my background on software testing is limited. My application is not a software testing issue. I need to develop a software package in python to interact with a RF ...
doubleE's user avatar
  • 719
3 votes
1 answer
1k views

HX711 with RaspberryPi and python

I have been working to create a digital scale for IOT project, using HX711 ADC. The problem Since it is crucial to have wifi connection, I use Raspberry Pi, to control the scale. Everything works well,...
Andri Busch's user avatar
3 votes
2 answers
225 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/...
jrive's user avatar
  • 639
3 votes
1 answer
12k views

Digital Potentiometer (MCP4131) with Raspberry Pi

I'm very new in electronic stuff. I'm used to develop for desktop and mobile applications not for hardware products. I try to wire up my Raspberry Pi board with an MCP4131 digital potentiometer. But ...
dannyyy's user avatar
  • 139
3 votes
1 answer
100 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
2 answers
2k views

Can't Get Raspberry Pi and Xbee to Work Together

I am having the hardest time trying to get my XBEE's to work with my Raspberry pi (RP). I have one on a USB breakout board into my computer and the other XBEE connected to a RP. The one on the RP is ...
Ryan F's user avatar
  • 75
2 votes
3 answers
699 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 ...
Supremum's user avatar
2 votes
2 answers
5k 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 ...
IBP's user avatar
  • 21
2 votes
3 answers
12k views

How to hook Raspberry Pi with Electret Microphone to detect sound levels in dB?

I have to detect sounds levels in an enclosed area, so I thought this could be the right choice. /*EDIT I wish to collect sounds levels of about 30-60dB, normally human conversations or just ...
Ming Jin's user avatar
2 votes
1 answer
445 views

Bipolar stepper motor spins very slowly and makes a loud noise

I got a custom PCB. I am using DRV8428P driver (here is the datasheet) for a stepper motor. The problem I am facing is not being able to have the stepper rotate ...
mr-ma's user avatar
  • 35
2 votes
2 answers
868 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 ...
Baxorr's user avatar
  • 153
2 votes
2 answers
4k 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 ...
Vadim's user avatar
  • 155
2 votes
1 answer
403 views

Magic number in ADC Pi code

Im trying to measure temperature using PT100. Im using ADC Pi board for that. ADC Pi uses MCP3424(pdf datasheet) A/D converters, and in datasheet I found how to calculate voltage - it is pretty simple ...
Milan Halada's user avatar
2 votes
1 answer
195 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
2 votes
1 answer
605 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
2 votes
2 answers
938 views

Analyzing sniffed data from pins of LCD 2*16 using Atmega32

I sniffed DB4..7 of an 2*16 LCD using the below circuit : (Atmega32.PORTA1..3 is connected to GND) As you see above I connected En pin of LCD to INT0 of Atmega32 (That is configured for Falling Edge ...
TheGoodUser'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
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 ...
pau Fer's user avatar
  • 83
2 votes
2 answers
337 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
2 votes
2 answers
126 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
2 votes
1 answer
296 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
2 votes
1 answer
166 views

Dotstar Light Strip Low Update Frequency

I've built the start of a persistence of vision display. The rotation platform itself is built and I have just mounted the LEDs. After doing some testing, I can only get very slow update speeds of the ...
Billathekilla's user avatar
2 votes
1 answer
356 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 ...
Thomas CONNELL's user avatar
2 votes
1 answer
198 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 ...
Davide Dal Bosco's user avatar
2 votes
2 answers
740 views

GPIO Input fluctuating between high and low when no input is received

I posted this on the Raspberry Pi StackExchange but I feel as though it might be better suited for here, as the SE is pretty inactive anyway. I've got a fairly simple circuit that I've made where a ...
globby's user avatar
  • 121
2 votes
1 answer
5k 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 ...
Luxii's user avatar
  • 193
2 votes
2 answers
110 views

How to customize the 'write' to instrument?

I'm communicating with Power Supply RIGOL DP832A via Ethernet. ...
pyL's user avatar
  • 23
2 votes
1 answer
562 views

Communications issues between Ardupilot and Computer

The Issue and Project: I have been at a standstill with my autopilot because I cannot communicate with it using my high powered transmitter: the Ubiquity Rocket M5. But the whole communications issue ...
jakebird451's user avatar
2 votes
0 answers
51 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
2 votes
2 answers
84 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
2 votes
0 answers
128 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
2 votes
0 answers
107 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
2 votes
0 answers
116 views

How do I control the speed of a simple DC motor based on the output of a machine learning algorithm using a Raspberry Pi?

Let's suppose there is a simple machine learning algorithm for detecting speed limit signs using image recognition and it detects a 30 km/hr sign. Is there any way to send instructions to my motor ...
Shaun Jacob's user avatar

1
2 3 4 5