Effect of Resistor in Parallel with Pot

Following on from the post on the capacitor bleed circuit, a comparison in the behaviour of the pot with and without the resistor bypass.

The diagram below shows the voltage out from a potentiometer as it is turned..and the effect of a resistor in parallel with one end of the pot and the wiper.

For example at half rotation, rather than the output being at 50% its around 64%.

And a reminder, these are showing comparisons against a linear taper pot.

If you want to know more about modelling pots and changing the taper see http://qucs.sourceforge.net/docs/report/potentiometer.pdf and an example of qucs with modelling a potentiometer here. For more general “how to use sweep parameters see https://steemit.com/utopian-io/@thinkingmind/qucs-circuit-simulator-or-how-to-use-parameter-sweep-in-simulation

Posted in coding, computing, education, guitar, music, qucs, simulation | Tagged , | Leave a comment

Guitar Bleed Capacitor Vs RC Network

Many guitars have a “bleed” capacitor across the volume potentiometer so that as the volume is reduced the high frequencies are not as attentuated as much.Companies such as Fender also use an RC network to give more bass as the volume is reduced.

Typical combination are explained in this article https://www.fender.com/articles/tech-talk/how-a-treble-bleed-circuit-can-affect-your-tone So just out of interest (and as I wanted a demo circuit to use with qucs The Quite Universal Circuit Simulator ) I did some circuit simulation.

I did some frequency plots comparing the single capacitor configuration vs the new Fender network. I’ve shown plots for 3 settings of volume. These are settings of the pot from the point of view of resistance from the wiper to ground. So 5 is the pot at halfway FROM an electrical point of view, 9 at 90%, 1 at 10%

It should be remembered that volume/tone control pots are likely to be audio or logarithmic taper rather than linear. So halfway through the rotation wont be 50% signal level.

If you need an explantion of log/linear pots have a look at http://www.resistorguide.com/potentiometer-taper/

As you would (probably) expect the difference are most obvious when the volume pot is at the lower setting showing a significant amount of high frequency signal getting through.

The overal signal level is higher for a given pot position (other than at max) on the Fender network due to the effect of the top of the pot and the wiper being in parallel with the resistors in the bleed circuit (a total of 170K). So when the pot is at 10% between wiper and ground ie 25K the remaining 225K is in parallel with that 170K yielding about 96K so that effective pot position is nearer 20% (ish)…and yes I could have accounted for that in the circuit but didnt, but if you want to there is a link to the qucs file below.

Anyway long and short of all this, is yes the new Fender combination will seem less toppy….But we knew that at the start 🙂

The qucs file can be downloaded here

The circuits in Qucs

Posted in coding, computing, guitar, music, Uncategorized | Tagged , | Leave a comment

Bike Lidar and Social Distancing Alarm.

Time is strange at the moment, but weekends are still a good time for project building. So over a few weekends this project evolved and turned into two projects.

The main project came about as I wanted to a) try a VL53l1X time of flight/Lidar device b)write some  Bluetooth LE code.

The result was this board (breadboard prototype shown in pictures) and an mobile application.

As a standalone board the “Ninelocks Bike Lidar” (all projects need a name ) can sound an alarm when an object is within a certain distance. But to make it more adjustable I gave it an Bluetooth LE GATT profile so it can be configured from a phone or other Bluetooth LE device. That meant writing an phone application as well.

The phone app shown here the phone gets updates from the Lidar board and logs the current distance along with timestamp and GPS location data and for eye candy shows the most recent reading on a graph.

The phone can also sound an alarm if anything gets closer than the distance set as the trigger threshold. There is a ‘video’ below showing the device and application at work with some suggested uses.

In its bike guise it could potentially warn you of vehicles behind you (ok only up to 4 meters away and its still being tested but….) as a social distance alarm it can live on your desk to warn of approaching colleagues/ potential infection vectors.

You could maybe use it to check if you wheel have wobble or any other lidar/distance/graph  type things you can think of. Code will eventually make it to github.

The Application

There is a video (aka vid-ay-oh as they say in stoneybridge)

Video of Lidar Board

Posted in arduino, coding, computing, cycling, music | Tagged , , , | Leave a comment

Midi System Exclusive Control of Arduino Application

Most recent project has been an midi foot controller based around an Arduino/PJRC Teensy and a companion windows application to configure it.

Details and source over at github

The configuration tool in Windows(Works in wine on Linux)

Sysex Format

The sysex format is in this format.
====================================================
   System Exclusive Configuration Messages
=====================================================

Configuration of the project is by Midi System Exclusive MEssages, the format of which are now described

The midi header counting from byte 0

0 0xF0 Start of sysex
1 0x7D indicating research/school/not  a manufacturer
2 0xNN 4 Character key , the same in the arduino application
3 0xNN
4 0xNN
5 0xNN
6 0xMM A device ID, you choose identify your arduino project
7 0xMM A Command 
.
. Variable number of bytes depending on message
.
. 0xF7 End of SysEx marker

The 4 character code is set in the arduino source and can be configured in the windows pedal manager (see its documentaion )

=====================================================
  Request arduino send out its current configuration
=====================================================

0 0xF0 Start of sysex
1 0x7D indicating research/school/not  a manufacturer
2 0xNN 4 Character key , the same in the arduino application
3 0xNN
4 0xNN
5 0xNN
6 0xMM A device ID, you choose identify your arduino project
7 0x02 Command 0x01 is send config
8 0xf0 End of SysEx marker


On receipt of correctly formatted message the Arduino should reply

 0 0xF0 Start of sysex
 1 0x7D indicating research/school/not  a manufacturer
 2 0xNN 4 Character key , the same as in the arduino application
 3 0xNN
 4 0xNN
 5 0xNN
 6 0xMM A device ID, you choose to identify your arduino project
 7 0x02 indicates this is response to a "give me your configuration" request 
	
Posted in arduino, coding, computing, midi, teensy, Uncategorized | Leave a comment

SQL and secure_file_priv

Reminder of how to export from mysql when you run into the secure_file_priv message!

to find what its set at currently from within sql


SELECT @@global.secure_file_priv;

to export stuff to csv

SELECT * INTO OUTFILE '/var/lib/mysql-files/somefile.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n' FROM sometable;

Posted in coding, computing, mysql | Leave a comment

Logitech C270 and Linux hangups

Problems on a debian install that each time I plugged in a C270 the usb hung.

A look at logs showed two symptoms. lots of
usb 3-6: 3:1: cannot get freq at ep 0x86
and multiple instances of udevd also lsusb would hang.

Reason is the audio, quick fix is to unload usb audio module
rmmod snd_usb_audio so later today I may get round to writing a udev rule,

Posted in coding, opencv, Uncategorized | Tagged , , , | Leave a comment

OpenCV 3 and ffmpeg fun

Had a few hours of  ‘fun’ getting OpenCV3 to build… I will expand on that sometime, meantime some reminders

Some reminders mainly to me…

The main problem was configure for OpenCV would not find ffmpeg, in spite of all the solutions to the problem posted around the web, none worked. In the end I reinstalled OpenCV from source.

Note below the configure needs some specific flags or open CV will get grumpy.

opencv

clear build folder with rm -r


#before doing the

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local</pre>
<pre>

or
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D BUILD_EXAMPLES=ON ..

ffmpeg

ffmpeg build required


./configure --enable-nonfree --enable-pic --enable-shared

You may find ffmpeg complains when it is run of missing libraries, its the usual solution apt-get….

OpenCV
A couple of functions I use from older version has different args, for thos a quick fix os

#contours returns more values so…
(_,contours,_) = cv2.findContours(
#or
contours, hierarchy = cv2.findContours(…)[-2:]
[/sourcecode ]

ps for the java libs it doesnt find thing unless

export JAVA_HOME=/usr/local/jdk1.8.0_20

 

Posted in computing, opencv, python | Tagged , , | Leave a comment