Thursday 16 April 2020

RFL 505 Gaussmeter Notes

I have a RFL505 Gaussmeter.  The calibrate mode wasn't working initially but this was just due to dirty switches.

I checked the calibration by building a small Helmholtz coil running at 1A and generating around 40 Gauss.  I discovered that my probe was a x10 probe, meaning the most sensitive range on this meter is 500 Gauss.

Here are some notes in case anyone else is working on one of these:-

Tuesday 12 November 2019

Akai Midimix - How to get the lights working in Cubase

Background

The Akai Midimix is a MIDI controller with some sliders and buttons for use with DAW software.

It comes with a mapping for Cubase as described here:

https://www.akaipro.com/kb/akai-pro-midimix-setup-with-steinberg-cubase/

This works OK, but as it says on that page, the various lights don't work.

This page describes how you can get the lights to work.

I've tried it with Cubase LE AI Elements 10, but assume similar setup will work with other versions

Transport Buttons

I have actually re-purposed 8 of the buttons to use as a transport control, as I don't actually do a lot of multi-channel mixing.  Here's a photo of my labelled buttons:-

CH5: MUTE-> Home; REC-> Loop
CH6: MUTE->Last marker; REC->Stop
CH7: MUTE->Next marker; REC-> Play
CH8: MUTE->End; REC-> Record

The instructions below will set it up like this.  If you don't want that, you'll need to modify the file so CH5-6 are set up just like 1-4.

Instructions

  1. Follow the instructions in the above link and check you can get the thing to work in Cubase as described there.
  2. Repeat the "Installing the mapping file" step but instead of the Akai provided XML file, use this one I saved: link here
  3. Set both input AND output to MIDIMIX on the Generic Remote form

Limitations

  • I did not implement the other banks.  If you press bank right/left, the lights will no longer light.

Details

  • The LEDs are controlled by the same command as the received messages for the buttons, but with NOTE ON rather than NOTE OFF.
  • Cubase doesn't allow this type of 2-way control - it always sends the control back using the same message type
  • To work around this, I created an additional NOTE ON control for the LED, and mapped this to the same function.  Seems to work.
  • If anyone has time, the bank left/right functions could be made to select either the MUTE/REC ARM function OR the transport controls.  The bank light could be made to light to tell you which mode is selected.  Or you could buy a nice transport controller!

Sunday 1 September 2019

Coffee Machine Water Level Gauge


Coffee Machine Water Level Gauge

Specification

This design uses a standard 0->190 ohm fuel/water level gauge and lights some RGB LEDs in a sequence depending on the level.
The design was fitted to our coffee machine, with the level gauge in the water tank, and the LEDs mounted underneath.  When it starts glowing red, it’s time to top up.  We did this because the machine is on a timer which comes on every morning.  It takes 15 minutes or so to warm up, so it’s really annoying if it has run out of water.
Power
12V 10W max
LEDs
1W RGB LEDs, 2 in series
LED current
0 – 200mA PWM, 100Hz
Colours
8 bit RGB, gamma corrected
Level look up table
8 steps (to match the 8 steps of the level gauge)


Circuit


Technical Description

LED driver

The LEDs are driven with a simple NPN transistor and 30 ohm series resistor from 12V.  Assuming 3V LED Vf, this gives around 200mA LED current.  The 30 ohm series resistor was made from 2 off 15 ohm  1W resistors in series, but you can use whatever you have available with suitable power rating.  This isn’t very efficient but a lot simpler than using a switch-mode LED controller.  If you have suitable LED controllers available, you can input the PWM signal into them instead.

Level Gauge

The level gauge is based on a sliding magnet in the liquid, and reed switches within the rod.  The type I used has 8 steps of 0 to 190 ohm.  0 ohm when empty, 190 ohm when full.  This is connected in a potential divider running from 12V to obtain a range of 0.5 to 2V, which is input to the microcontroller comparator.
There is a microswitch under our water tank, so we made sure it goes red well before this switch activates.  This was done by checking the gauge reading at the point the switch activates.

You can order such gauges on Amazon from China in around 30 days..


Level Gauge ADC

The level gauge voltage is input to the positive side of the comparator of the microcontroller.  The negative side is connected to a DAC.  By adjusting the DAC until the comparator toggles, we form an ADC which can read the level gauge voltage.
The DAC is formed by low pass filtering a PWM signal from pin RB5.  This runs at 100Hz, using the same software routines that generate the PWM signals for the LEDs.  This PWM DAC has an 8 bit control range.
The software has a loop which increments the PWM DAC when the comparator is high, and decrements when low.  This loop runs every approx. 100ms, so it takes around 26 seconds for the level gauge ADC to ramp from one end to the other.  This is fast enough for the level gauge, which only changes slowly.

LED PWM

The LED driver is driven by the RB1, 3 and 4 pins at 100Hz.  An interrupt routine runs every 10ms to generate this PWM.  The internal microcontroller PWM generators are not used as they cannot generate the 4 independent PWM signals required by this application.   Note an initial design at 50Hz was too flickery.
The level gauge ADC reading is looked up in a table of RGB values, and applied to the LED PWM settings.  The window for each step is chosen to match the steps of the level gauge to avoid the design flickering between two colours.

Serial Port

The circuit shows a serial port input.  This is not used in this application, but is there for debug purposes or other applications.  The software would need modifying to use this, as currently the level  gauge overrides the serial port values.

Software

Software was written for PIC 16F627 using MPLAB X 5.25.  You can use other PICs/microcontrollers and build tools.  I used 16F627 as I had some spare.  Other microcontrollers might make the implementation easier if they include enough PWM generators and an ADC.

The software can be found here as a zip file.

It is based on previous software, with code added to implement the 8 colour steps as per below.
The PWM frequency was increased to 100Hz as I found 50Hz far too flickery.
With the serial port code removed, the memory usage is as follows.
Memory Summary:
    Program space        used   308h (   776) of   400h words   ( 75.8%)
    Data space           used    23h (    35) of    E0h bytes   ( 15.6%)
    EEPROM space         used     0h (     0) of    80h bytes   (  0.0%)
    Data stack space     used     0h (     0) of    50h bytes   (  0.0%)
    Configuration bits   used     1h (     1) of     1h word    (100.0%)
    ID Location space    used     0h (     0) of     4h bytes   (  0.0%)

The microcontroller is mounted in a socket and removed to program it.  I used a Vellaman K8048 programmer with PicProg2009 running on my PC.  There are more modern programmers available!

Level Gauge Steps


Level gauge configured as potential divider.
Resistance is 0-190 ohms with 8 steps as measured below.
Top resistor 1k2 to 12V.  Bottom resistor 51 ohm to give offset of 0.5V to ensure comparator works.
Vpwm is 2.5V as I use a potential divider of factor 2 (two 10k resistors) to better match the range of the voltages from the gauge.


Rlevel
Rtop
Rbot
I
V
PWM
PWM decimal
PWM low
PWM high
LED Colour
0
1200
51
9.6E-3
0.489209
19.57%
50
0
73
RED
51
1200
51
9.2E-3
0.940092
37.60%
96
73
104
RED
71
1200
51
9.1E-3
1.107413
44.30%
113
104
121
BLUE
90
1200
51
8.9E-3
1.261745
50.47%
129
121
137
GREEN
110
1200
51
8.8E-3
1.419544
56.78%
145
137
153
GREEN
130
1200
51
8.7E-3
1.572773
62.91%
160
153
172
GREEN
160
1200
51
8.5E-3
1.794472
71.78%
183
172
194
WHITE
190
1200
51
8.3E-3
2.00694
80.28%
205
194
255
WHITE

The PWM high and low values show the window to avoid sitting on a step.

The following table implements the above steps in the program.

//Table of colours for each level step.  There are 8 steps.
const unsigned char pwmdac_max[]={73,104,121,137,153,172,194,255};
const unsigned char led1_steps[]={200,200,0  ,0  ,0  ,0  ,180,180};  //red
const unsigned char led2_steps[]={0  ,0  ,0  ,200,200,200,180,180};  //green
const unsigned char led3_steps[]={0  ,0  ,200,0  ,0  ,0  ,180,180};  //blue

You can change these tables to match different level gauges with different steps, or to change what colours are used.

Construction

I built this on matrix board and bolted it under the drip tray of our coffee machine.
The LEDs are mounted on standard metalback PCBs which you can buy online.  These were mounted on some matrix board.  Here’s a couple of photos of the part finished matrix board:-





Here it is mounted under the drip tray:-
The 12V is provided by an external power adaptor via a 2.1mm barrel socket.  The other wire goes to the level gauge.  LEDs are on the bottom.

It’s a bit messy, but hidden underneath:-


If you want to do a proper job, design a PCB!
The level gauge is mounted by cutting an extra hole in the reservoir:-





Saturday 31 January 2015

Canon S100 Screen Replacement


I broke the screen on my S100 by sitting on it while having lunch on my Spanish climbing holiday.  Two sharp stones had pressed into the screen through the case, leaving it with vertical lines and blacked out parts.  I ordered a replacement display from http://www.cameraspareparts.co.uk/.  Note this is a different display from the S95, so make sure you get the right one.  It cost around £45.  You can get cheaper ones on Alibaba but it might take a long time to arrive.

It's dead easy and there are some YouTube videos around that reassure you're taking the right screws out.

Here's the broken screen...



Here is some indication of what screws you should remove...





Take the back off...


Remove the screw holding the L shaped clip and take it out...



Remove the other screw holding the button flexi PCB...


The screen and button board are now loose...


The screen has two connections.  One is very small and plugs into the button board.  I used a microscope to carefully inspect this and remove it with tweezers gripping the edges...


The other flexi connection is threaded through to the main PCB at the front of the camera.  You need to take the front off (again very straightforward but take great care not to snap the flexi connection to the ring control)...


Now if your eyes are like mine you will need a microscope to help.

You need to remove the flexi that goes to the button board by flipping up the connector catch and pulling it out.  Take great care and make sure you can see what you are doing!  Now undo the catch of the display connector and undo that.

You can now unthread the display connector and remove and replace the display.

Refitting is the reverse of the above!

And it works!...




Yay!


Wednesday 21 January 2015

Friday 8 August 2014

B&Q Everflourish EMT757 Timer Schematic Notes

I was considering modifying this timer to accept a control signal from an external source to override the relay, switching it on.  I concluded this was too fiddly due to the power supply not being isolated.

The schematic is recorded here in case anyone else finds it useful in their experiments or fault finding. 


https://drive.google.com/file/d/0B43XXiSt0MIdem9TcjBDNUNhcnM/edit?usp=sharing