H2S gas detector for battery charging with auto charger cut off

I posted back in January about a project I had in mind for our battery charging area at work to automatically turn off the power to the battery chargers if dangerous levels of toxic Hydrogen Sulphide were detected. The project was cancelled but resurrected about 3 months later when another battery failed releasing gas and we looked at this project again and decided it was a good idea to try building it.

Hydrogen Sulphide detector for battery charging areas.

So for the last two months I have been testing it and found that being based on a cheap MQ-136 sensor (good quality H2S sensors are very expensive) it performs reasonably well. With such a cheap sensor accurate readings of H2S are not really possible but it does detect gas and turn off the power which is exactly what we wanted it to do.

The project is based on an arduino as the controller with warning / status messages displayed on an LCD and gas level from 1-9 shown on an LED display. An alarm sounds when dangerous gas levels are present and the power to the chargers is turned off.

Continue reading

Arduino 6 input DVM 0 to +50V range

This is a project I built for work as an add on to our battery tester which is able to test up to six batteries at once. The battery tester is controlled by a PLC and does not show voltages in real time so we had no idea how long the battery runtime was remaining. A voltmeter that showed the battery voltage under test was required as our tester cuts off the battery at 10.5V for 12V and 21V for 24V lead acid batteries. At first I planned to use a standard panel meter and a six way switch to select the battery under test. This however proved to be quite (in comparison to alternatives) an expensive way of doing this.

Arduino 6 input voltmeter

I decided to make use of a few spare parts I had laying round in the workshop and make a digital voltmeter that could monitor six battery voltages at once on a single LCD. This would obviously have to be microcontroller based so I chose the Arduino over the 8051 due to it’s built in ADC and ease of use. As you can see from the photo the project uses a 20×4 character LCD and also monitors the temperature of the heatsink the load resistors are mounted to. A DS18B20 one wire digital thermometer was used for this and the battery voltage monitoring wires were connected to the Arduino’s ADC ports A0-A5 via a voltage divider.

Continue reading

A simple Arduino gas detector example.

Overview

So you may be wondering why I tried this. Well, I wrote some code to check for dangerous gases released when charging lead acid batteries as a safety concern at work. This came about because we charge lots of sealed lead acid batteries which usually charge without any problems but on one occasion one battery had failed causing the room to fill with a rotten egg stink. This is not just a bad smell; in fact it was Hydrogen Sulphide we were smelling which is very toxic in large concentrations. This definitely was bad; the entire building stunk on both floors and it took all day to get rid of the stink with windows open. In the middle of winter I might add. Faulty batteries can also release hydrogen which is explosive if in a sealed room and with a high enough concentration although modern SLA batteries do not give off nowhere near as much as flooded types. However H2S gas is bad for your health in any concentration and is produced by all lead acid batteries when misused or overcharged. Such gases are also found in rubbish dumps and sewers and other areas with decomposing organic matter in enclosed spaces.

So I wrote code for a sensor that would detect these gases and display the levels on a LCD display triggering visual and audible alarms if thresholds were met. The software also triggered a relay which could turn off the chargers and turn on an extractor fan. Often batteries were left on charge overnight and automatic gas detection and prevention was a must. I also planned to add a remote monitoring facility as well.

Anyway for reasons I cannot explain the project was cancelled so I simplified my code and added a methane sensor to the mix as well. You guessed it; there is another use for my code…

Continue reading

Building an LCD alarm clock & DS1307 RTC accuracy

I’ve been working on a new Arduino project; the ultimate alarm clock which shows the time and date on a 16×2 LCD module and features multiple alarms with repeat / auto arm and radio function. I used a Tiny DS1307 RTC and EEPROM module which is a breadboard / veroboard compatible PCB containing a DS1307 RTC chip and a 24C32 i2C EEPROM. There is also a place for a DS18B20 thermal sensor but mine did not have this installed.

The clock functions great but I have found that the RTC module gains time about 6 seconds a day. This is due to a number of issues; the quality of the crystal used, the position of it on the PCB, the value of the load capacitors and it’s questionable if the DS1307 is a genuine Maxim chip or not. The module came from Banggood (China) at a cost of only a few pence of the chip itself (in bulk) so who knows.

The DS1307 is not known for it’s accuracy though; the DS3231 is a better choice if you need accuracy as it works with the basic functions of the DS1307 libraries. It just lacks some features such as onboard NVRAM. As I needed to use this NVRAM to store alarm settings etc I had to go with the DS1307 and write some code to halt the Arduino for 6 seconds then write the time back to the DS1307 minus 6 seconds. This should work in theory bringing the accuracy in line with the DS3231 and DS3232 RTC chips.

I have been testing it for a few days and I can now post the rest of the project details.

Continue reading

NIMH battery tester – firmware version 2. Now with improved voltage reading accuracy.

In my last post I built a multiple AA battery tester but it used the 5V as a voltage reference which wasn’t ideal and was giving readings that were good but could be better. I modified the code to use the 1.1V internal reference of the Mega328 MCU to calculate the actual 5V supply voltage and this has proved to be much better. Voltages measured by the Arduino are now within 10mV when compared with a calibrated DVM.

As far as the battery tester goes this will produce a more accurate mAh rating and a couple of tests show that battery capacity is now within 100mAh instead of the 250mAh as it was before. These measurements were taken at the load resistors as the battery holders and wiring produced a voltage drop between 30 and 110mV which at 550mA load current is fairly acceptable. If you wish to build this project please refer to my previous post as all the build details are in there. I will also put the latest firmware download on the project post as well.

Issues to resolve – spurious voltages displayed when no battery present. Does not affect operation but will look into resolving this.

Arduino NIMH battery tester update

Back in October I posted about a basic NIMH battery tester based on an Arduino nano I made some time back which was a successful project and works quite well however it could only test one battery at a time and didn’t apply a constant current load. It was good but not very accurate and I really wanted the ability to test more than one battery at once.

So looking around for inspiration I saw this Rechargeable battery tester on instructables by Brian Hobbs which can test three batteries at once and displays the test progress and results on a Nokia 5110 type LCD. However the code has some small drawbacks such as using the 5V supply as the reference voltage which isn’t the most accurate as the ‘5V’ supply varies depending on the PSU used and / or the voltage regulator.

Arduino based AA NIMH battery tester

As for other things it does not apply a constant current load either but it does measure the voltage drop across the load & calculates load current from that so it’s much more accurate than my previous project. So far the project has been built hardware wise and is running the original source code with some slight changes to provide indication of test status on a series of LED’s as well as the LCD so test status can be seen from a glance.

Continue reading

Arduino scrolling clock and custom message on 5×7 matrix

Introduction

I’ve been playing around with a red 5×7 dot matrix LED display module which I have had in my spares box for a while. I thought about making some sort of scrolling message display as an Arduino project but could not find any more of these modules online as I’d need at least another seven. However I did have an Arduino Nano, a small case with a scratched lid and a piece of veroboard that just happened to fit the box exactly.

I needed to practice my programming skills and after a few attempts of trying to get the display connections right I was able to make some characters appear on the display. It wasn’t anything useful so following a few examples on the internet I ended up with a scrolling message that was hard coded into the program.

Arduino based scrolling message display

Completed messaging display in ABS case

For this to be of any use I needed to be able to upload messages to it so I wrote some code to store the incoming serial data into a buffer then into an array to be displayed. However I couldn’t get it working right; it took ages to transfer the message and every time you wanted to change the message you had to power it off and on again.

It turned out I’d got some of the curly braces in the wrong positions in one of the ‘for’ loops which was causing the delays. I stuffed it into the case (the scratch was on the part which would be cut out for the display window) and then thought, that’s nice and put it in the cupboard and forgot about it.

Continue reading

Sanyo 1970’s LED clock / radio resurrection (well sort of)

In the quest to make something useful out of a load of old junk I’ve found in my cupboards I came across my old clock radio I’ve had since 1978 a while back and decided to do something with it rather than throw it out. It actually worked but it had an ‘accident’ with the floor a few years ago which had broken the casing and cracked the main PCB.

1970’s clock in new casing with Arduino based temperature display on 7 segment LED’s

I have no idea why I just didn’t throw it out then but I had replaced it with a cheapo clock off ebay which projected the time onto the ceiling with some superbright LED’s and mini LCD’s. Quite innovative but that piece of crap lasted a few months before breaking prompting me to replace it yet again. Well the second replacement failed by randomly corrupting the display and resetting itself. Not ideal if you want to set up an alarm that can reliably wake you up. Acctim? Craptim more like.

On one of my earlier posts I made an alarm clock using an 8051 microcontroller but the alarm was unsatisfactory so in order to avoid more cheap Chinese electronics that doesn’t work I decided to make something out of what remained of the 1970’s alarm clock. The clock PCB was functional as was the LED display but it was very dim and had small segments. It also drew a lot of current (nearly 600mA) and the clock IC, TMS1944AN2L got very hot. I had a Fairchild Semiconductor FCS8000 LED module which is also 1970’s vintage salvaged from another clock but I had a datasheet for this which showed that it is a low current, high brightness module. It draws much less current (and has a bigger display) than the old LED display.

Continue reading

A WIFI spectrum analyzer and Talk-Talk routers suck A$$

A close relative of mine has been having lots of wifi connection issues over the last few months but just on a couple of devices. A scan of the wifi neighborhood showed only a couple of signals from adjacent houses which were too weak to cause a problem.

I tried changing the channels, 150 or 300 bandwidth modes and even tried dropping to 54G compatibility. The problem would be fixed but return a few days later. I tried disabling the wifi adaptor in one of the affected laptops and used a USB adaptor instead. I couldn’t swap the router as this was needed for IPTV (talk talk) and my replacement didn’t support it. Same problem with different adaptors. What was going on? Mobile phones and tablets were fine; just the two Windows 7 / 10 devices refused to work. I needed to scan for interference and here’s where the Arduino came in.

Continue reading

First useful Arduino project – NIMH battery tester

During my clearout of old junk I came across an LCD display fitted into a small plastic case with a PC parallel cable attached which was originally used for a PC status display using LCD smartie. This was used on my old, old, PC (Pentium 4) to display system status messages and music track info from winamp.

As my new PC lacked a parallel port (yeah I could have added one but no PCI slots, just PCI-E) this was relegated to the junk cupboard. So what shall I do with this display and case?

Arduino based NIMH battery tester (image)

Arduino based NIMH battery tester

Well I have a pile of rechargeable AA batteries of various ages and I came across this Arduino based battery tester which looked ideal to test said batteries. Now it just needed a few simple modifications; I added an LED that flashes to get attention when the test is complete and changed some of the screen messages. Simple stuff. After all I was just starting out with the Arduino and I felt this was a great starter project.

Continue reading

Clear-out day – and PSU refurb

A few weeks ago i decided it was time I got rid of some old shite I’ve been keeping for years. I also decided to make this blog and some of my early electronics projects I have featured on this site. Not that they are any use to me nowadays but I want to keep them well, you know just because. The historical and test equipment pages will fill you in on this.

Some stuff was worth improving and refurbishing. Take this bench PSU I made around 25 years ago which was the most useful thing I made as in it had a purpose and was used often. Well actually I made two bench power supplies back then. The original wooden cased model was lacking in voltage and current so I had made another using a basic regulator with a couple of 2N2055 series pass transistors stuffed into a BBC Micro external HDD case. As all parts were salvaged from scrap save a few knobs and switches I didn’t have much flexibility with the design.

Continue reading