Translate

Showing posts with label Battery. Show all posts
Showing posts with label Battery. Show all posts

Sunday, 27 March 2022

Solar lighthouse garden ornament - A design that could never work.

About 12 months ago, the long and suffering Mrs Doz bought me a solar powered garden ornament, in the shape of a lighthouse. 


It's got a white 5mm LED, which is situated inside a rotating silver reflector. Quite a nice touch, and more effective than just a simple flashing LED... except it never worked properly. 

There's a push button switch on the lamp housing, which switches the unit on. After dark, the LED illuminates. Once. 

The following day nothing happened. 

It's not worked since. 

So I disassembled the lamp house to see what the fault was. It consists of two parts, the top part consisting of the solar panels, a charging circuit and LED driver, and a lower part with the motor and it's gearbox, and a 600mAH, AA NiMH cell. 

I popped the cover off the motor unit in an attempt to find out what the problem is.... and spot it straight away. The motor is connected via the push button switch, straight across the battery. As soon as it's switched on it will start turning, and eventually discharge the battery. The solar cells aren't big enough to keep the battery charged up enough. What a silly design. 

I was hoping that the LED driver in the top would be able to provide a suitable switched supply to the motor in a similar way to the LED, but alas no, it's got a small flyback converter to provide ~2.1V to drive the LED. 

So, a plan is hatched... 

A separate solar cell, and battery connected by a wire to the motor unit. 

Recently we had to replace another solar light in the garden, after it was damaged over winter. This has yielded a nice solar panel and it's fitted with a single AA NiMH cell, excellent. The battery is tested, and looks to be in reasonable condition. The control electronics in this enclosure are removed (again, it's a flyback converter)

So we need a circuit to charge the battery during the day, and switch on the motor at night. 


The solar cell charges the battery via D1, a BAT43 small signal Schottky diode (a strange choice, but it's rated to 200mA, which is more than the charging current capable of being delivered by the solar cell, and it'll have lower forward voltage drop than a normal silicon diode), which prevents the battery discharging into the solar cell at night. When the cell goes dark, Q1 loses it's base bias via R1 &R2, and switches off, which causes the voltage at it's collector to rise. This in turn switches on the base of Q2, which causes it to conduct and switches on the motor. 

After a bit of experimentation on some breadboard to get the values of R1 & R2 right (this effects the threshold where the unit switches the motor on), it's built up on a bit of perfboard, and fitted inside the enclosure.
After sealing everything up with some liquid rubber, it's taken outside ...





Now just to wait for nightfall...




Tuesday, 27 July 2021

Dash-cam irritation avoidance circuit (How to use a sledgehammer to crack a nut). A guaranteed supply.

My dash-cam has a irritating issue. If I stop at the traffic lights, and switch the engine off in the car to save a little fuel, and hopefully reduce my environmental impact, when I restart the engine, sometimes (most times) the camera hangs up and stops recording. It's powered from a 12V to 5V USB adaptor plugged into the accessory socket. What's probably happening is the supply is momentarily dipping and the micro inside the camera is "browning" out, despite having an internal battery. No messing about with the camera's settings or firmware have solved this issue. 

What we need to do is make a little circuit that ensures the power supplied is OK. 

My idea is, if the main supply dips or even switches off completely, the supply is temporarily held up by a small LiPo cell for 3 minutes. After the that, power is removed, unless the 12V is restored within that time. This should be long enough if I'm sat in traffic, even if I've switched the accessory socket off. 

Here's the schematic:
12V arrives to one of those small buck converters (from eBay/Aliexpress etc) .. and is used to provide a 5.7V regulated supply via one half of D1 to supply the 5V for our camera and the ATTiny85 microcontroller. It's also feeding one of those small PSU boards for charging a LiPo cell & boosting it's output that I used in the Geiger counter project (albeit modified). This board is unmodified, and is adjusted to provide 5.2V output. 
Once the microcontroller has started up, it takes PB0 High, biases on Q1 via R2, and energises the relay. This connects the LiPo cell to the charger/boost controller. The 5.2V output is then connected to the other half of D1, which is currently reversed biased, and does nothing. The output from the 5.7V converter is monitored by the microcontroller PB1, via D2.
In the event of the 12V supply failing, PB1 will be pulled low by R3, as the 5.7V supply is removed, and a timer is started. 5V supply is now maintained, as the output from our 5.2V Lipo boost converter now feeds the 5V supply, as the second schottky diode in D1 is now forward biased. Once the 3 minute timer has elapsed, PB0 is taken low, which kills the LiPo supply by opening the relay, and, as there's no power supply anymore everything stays off, until the 12V supply is restored. 
R1, D4 and C3 form a reset delay circuit. C1& C2 provide some power supply filtration & decoupling. D3 prevents the back-EMF from the relay coil destroying Q1. 
The principal is the same as the circuit I used to write the mileage to the EEPROM on the Mini speedo project.

The code is simplicity itself, and is uploaded to an ATTINY85, set for a 1MHz internal clock.

# define OUTPUT_PIN 0
# define SUPPLY_OK 1
unsigned long timer;

void setup() {
  pinMode (OUTPUT_PIN, OUTPUT);
  pinMode (SUPPLY_OK, INPUT);
  digitalWrite (OUTPUT_PIN, HIGH);
}

void loop() {
  if (digitalRead (SUPPLY_OK)) {
    timer = millis ();
  }
  if (millis() > timer + 180000) {
    digitalWrite (OUTPUT_PIN, LOW);
  }
}

Possibly (!) far too complicated. I could simply use a high side drive FET circuit to drive the output, and use a simple RC time constant to drive the FET, but I suspect the actual parts cost would be about the same, and I don't have a suitable FET in the junque box!

Right, down to construction...

Having got a bunch of parts from the junque box, the circuit is constructed on a bit of perf-board.  

I added an LED across the 5V output, just so I could see what was going on during testing.


All mounted up in a *slightly* too big box, and I could have used a smaller relay (had the junque box provided one) . Input lead is connected to an accessory plug, and output via a USB socket. 





And finally put into the clutter box in the car, and connected up. It performs faultlessly ...









Which is a good job, because this is the state of the wiring on the old USB supply I'd just removed ðŸ˜¬

Sunday, 19 July 2020

(Not a) Triple Tube Geiger Counter



A not inconsiderable number of years ago, I bought a box of parts at a car boot sale for not a lot of money.

In amongst the wire-wound resistors, bits of tag strip, valves and other delights, was this small assembly....


I took it into college (it was that long ago) to see if it could be identified...
Most of the lecturers were a little puzzled at first ... "Pencil vacuum tubes?" , "Some sort of neon?" ... then one lecturer (whose real name escapes me at present, but we used to call him "Toke") identified them as geiger-muller tubes "Russian, by the looks". Top man... I wonder where he is today?
There are three tubes in total, designed to detect different energies of radiation.
This side is fitted with a DOB-50 tube. There's scant information on the internet about this tube, except it seems to have been made in poland, and used extensively by the polish army.

It needs between 390-490 volts to operate, and the left electrode shown here electrode is positive.
The top tube here is a DOB-80, again a polish tube, and there's more info about this on the web...

Operating voltage 490-590, and sensitive to Gamma, Beta and X-rays

The bottom metal tube is a CTC-5 (STS-5) and has CCCP on it, it's a hard beta tube, and has the date code for 1969 on it. It wants between  380V-480V.
After a bit more googling about, it seems I have the internals from a DP-66M dosimeter probe , as used by the Polish Army. Apparently, these have only become available on the market relatively recently, so I don't know what mine was doing in a box of junque in the 80's ... anyway, let's make it do some work!
So, two little switching power supplies, one for the DOB-50 and CTC-5 as they have similar operating voltages, and one higher voltage one for the DOB-80, a simple op-amp comparator to output the pulses to an Arduino to process and display the results. 
The power supplies are controlled using two MC3406AD's, driving an IRF840. I'll just refer to the component numbers on the top supply, the bottom one is almost identical. The back EMF from the inductor L2 is rectified by a UF4007. There's a feed back loop, R14,15 & 16 and the pot is used to adjust the HT.. The supply is smoothed by a C-R-C filter C13, R19 and C14 (which is absent from the lower supply, I was concerned about the top supply driving two tubes)  R22 limits the current into our tube's anode. R25 provides a load for the tube, and the output is fed to a comparator opamp, which drives Q5 via R29, and triggers the arduino input.

I've included a meter driver on the output of the arduino, for that authentic "3.6 roentgen, not great, not terrible" moment, a speaker output for added "China Syndrome" atmosphere, and an interface for an I2C display, for some actual empirical data.
I've also added a pin to monitor the battery level.

A PCB is duly designed, and ordered from PCBWay.









A pleasant morning spent stuffing the board.... note some of the through hole resistors are mounted off the board, in an attempt to prevent them tracking to the ground plane.

Note I've not fitted the Arduino yet, let's get the power supplies sorted first.






First, measure between pin 5 of each power supply IC and ground and set each HT control to give the maximum resistance to ground, this should give us the lowest output voltage to start with.

Now we're going to be dealing with high voltages here, not a fat lot of current behind it, but it will certainly bite if not kill, so be wary.

Connect up a 5 volt bench supply, and current limit it to about 500 mA.

Something's very wrong with mine.... I can't adjust the output voltage above 290V, and my FETs are getting hot, and it's making a nasty buzzing noise. ... Checking though my work, and I've fitted 33nF and 22nF capacitors in place of C7, C3 and C1 resulting in the switching frequency being far too low..... thankfully nothing is damaged.

Firstly set up the "top" power supply, measuring
the high voltage from R19 to ground.









Adjust using R15, and set for 390V












Now, following the same procedure for the bottom power supply, this time adjusting for 550V.

It's worth noting here, that removing the 5V supply to the board, the HT collapses very quickly to safe levels. There's not a fat lot of capacitance here to stay charged up, and the feedback loop discharges this quickly.




The more observant of you will notice that I've socketed the arduino. For some unexplained reason, I've got and used pin 0 and 1 for other things than serial coms, making it impossible to programme in situ. Silly.

After a little bit of tweaking, I've got readings from the CTC5 tube, but nothing from either the DOB-50 or DOB-80.  On closer inspection of the original board, on which the tubes were mounted showed the wiring to the tubes is very corroded. Using some sockets recovered from a DIL socket, I cleaned up the tube pins and connected straight to the tube.






Still nothing. I switched the CTC5 tube into the DOB-50 circuit, and it counts ... Sure enough further testing shows I've got two duff tubes, and looking at them under the microscope shows cracking around the glass where the pins enter... Damn. I suppose they've been kicking round in a box of junque for years, I shouldn't be suprised...

I've included the code for the triple tube in my github, although it's not anywhere near finished and does contain errors, feel free to use is as a starting block only. I'll concentrate on a single tube variant, as that's all I've now got...


So, using the existing PCB, things are looking good. The top power supply is removed, and the lower adjusted to 420V to better suit the CTC5 tube.

I've added a link wire from arduino digital pin 7 to pin 3, so we can use an interrupt to count the pulses, rather than polling.

Software can be found on my github at https://github.com/andydoswell/geiger_counter

The pulses are counted. The instantanious Counts Per Minute (CPM) is based on the time elapsed between the last two pulses, also an actual CPM is calculated (the actual number of counts in the last minute), a long term average (since start up), and counts per hour.

The peak level is displayed on a meter, and decayed slowly in the software.

When the software is started, the meter displays FSD (allowing FSD to be set with R35) , and then the battery level.

The meter display looks like this when in use... a couple of pulses in quick succession will give a high peak reading ... if it stays that way, begin to panic....

(Excuse the B&O VU meter, I had it to hand!)





LCD display looks like this... Battery Level is displayed to left, followed by the instant CPM (CPM) and Actual CPM (ACPM). On the next line is a trend indicator, showing if the last Actual CPM is greater or less than the LTA (Long term average), and actual counts per hour (CPH) .






I'd like my counter to be portable, so I can wander round the countryside after the virus has passed, and scare people... So we're going to need a power supply, preferably re-chargeable.


I've got some of these modules from eBay, normally found inside small power banks. The USB socket is used to charge a single LiPo cell. This in turn, feeds a 5V boost supply. Almost ideal, except the 5V booster is always running, and although there's a protection circuit in it to prevent the battery volts falling too low and damaging the cell, I'd rather it was switched, so a modification is needed. You can see in the photo, the USB charging circuit is very much on the left of the board and the booster on the right...


All we need to do is cut the track that connects battery + and the booster, and fit a switch. We also want to monitor the battery voltage, so we can take this from there to JP7 (which feeds A0) on our PCB.

First things first, connect a battery (I used a 18650 cell) and carefully set the output voltage to 5.0V using the small pot on the board, just below the output terminals.. Now remove the battery, and cut the track where marked on this helpfully annotated photo...









And solder on some wires as shown... The green wires go to the on/off switch, and the thin grey wire goes to JP7 on the PCB, to monitor the battery voltage.












A suitable (if a bit too big!) enclosure is ordered from Electromart2000 on eBay. I've had a few enclosures from them, and they seem to be of good quality, not too expensive, and made here.









The front panel cut outs for the meter and display are drawn out in LibreCAD ...









Imported into Laserweb ...










and the front panel is laser cut with a 3.5W Laser etcher... Fume extraction on!





... it took a while!







This is speeded up 4000 times!



After an hour and a lot later , the front panel is finished.











The parts are still just held on, and are knocked out...













Looks good :) As I was now using a 50uA FSD meter, I added 91K in series with it, to allow adjustment to FSD using the pot on the board.

















The on off switch is added, the LED and speaker, then ....












... I knocked my one remaining good tube off the shelf and promptly stood on it. Suffice to say it no longer works. I'm not happy.










Still, gives me a great excuse to try some more :)

Some different tubes are ordered from Russia. They take a while to arrive, due to COVID-19, but are superbly packed...












Here's what I've bought, in comparison to the CTC5 tube I ruined...













Here's the spec for the SBM20 ...

Minimum Anode Resistor (meg ohm) 1.0
Recommended Anode Resistor (meg ohm)    circuit diagram 5.1
Recommended Operating Voltage (volts) 400
Operating Voltage Range (volts) 350 - 475
Initial voltage (volts) 260 - 320
Plateau length (volts) at least 100
Maximum Plateau Slope (%/100 volts) 10
Minimum Dead Time (at U=400V, micro sec) 190
Working range (mkR/s) 0.004 - 40
Working range (mR/h) 0.014 - 144
Gamma Sensitivity Ra226 (cps/mR/hr) 29
Gamma Sensitivity Co60 (cps/mR/hr) 22
Inherent counter background (cps) 1
Tube Capacitance (pf) 4.2
Life (pulses) at least 2*1010

The huge SMB19 tube

Operating Voltage Range (volts): 350 – 475V
Initial voltage (volts): 260 – 320V
Recommended Operating Voltage (volts) : 400V
Minimum Dead Time (at U=400V, micro sec): 250us
Plateau Inclination: 0.1%/V
Working temperature: -60 to + 70 C
Counting speed: max. 2000 imp/s
Inherent counter background (cps) 1.83 Pulses/s
Interelectrode Capacitance 10pF
Load Resistance 5 – 10 MOhms
Sensitivity to gamma radiation:
MED – 3.0 mR ∙ s -1;
247.5 mR -1 ± 26mkR -1
Length: 195mm
Diameter: 18mm

The SBM 19 tube is apparently very sensitive...

Now we know how delicate these tubes are, I'm going to make some enclosures for them from some PVC pipe. I'll cut a window in the pipe, in an attempt to prevent any low energy beta from being absorbed by the pipe...

34mm OD plastic PVC drain pipe, and end caps...












Window marked out, and ends drilled....












... and the window cut out with a rotary tool.













Some dense packing foam (actually the foam the replacement tubes came in) is marked out, and some foam washers made to support the tubes.











The washers are (very carefully!) pushed over the ends of the tube...











... and pushed down inside the tube, along with a piece of wire to connect to the electrode at the other end...










I bought some PCB 6.3mm fuse holders which are just the job for fitting to the tube's electrode connector. Here's a tip, don't get them from eBay, they're very expensive. I got a pack from RS for much less money.








Nice ...












Repeat at the other end...












The end caps are the sort that usually push into the ends of tubular furniture. Ideal for the job.











One is drilled to take the BNC socket, and the wires are soldered on, observing polarity...










The process is repeated for the substantially larger SBM 19 tube. The electronics is checked, and the voltage adjusted to 400V for these tubes.

The SBM20 tube produces about 5 CPM here, whereas the SBM19 tube is most definitely the more sensitive of the tubes, and produces about 75 CPM. It will even detect the americium source in a smoke detector, giving a noticable increase over background.

SBM20 ...













SMB19 ...



I've really enjoyed this project. What it has brought home though is the need for a 3D printer in the workshop. I could have 3D printed all the cases for the instrument, and probes, and saved hours of time. If there's any company wishing to "sponsor" me with a machine for review, please feel free to drop me a line below!

Incidentally, want to know what happens if you accidentally short the high voltage to an arduino analogue pin?
An accident occurred during development (these things happen) , unbelievably the Micro still works, except every analogue pin now reads about 40ohms to ground and gives no results!... ah well...