Arduino pump timer with GLCD

I’ve been making a timer for my garden watering system as I have bought a few cheap timers from Amazon / Ebay in the past but they were either rubbish or went faulty within a year so I decided to make my own. I used a 240×64 graphic LCD salvaged from an old & obsolete HP 9100C digital sender which I have had in my cupboard for around 14 years. It has a standard parallel interface so can be connected to an Arduino easily. The reason behind using such an over the top LCD for such a simple device was because around 13 years ago I intended to make a status monitor for my PC using LCDStudio software to drive it. The LCD was connected to the PC’s parallel port and housed in a project box containing the negative voltage generator (more on this later) and the backlight board. Anyway needless to say I got it to work; you can find some old photos of it in the project notes.

The completed water pump timer

Like many things I never got round to actually using the status monitor partly because the LCDStudio software was not being actively developed and such didn’t work on newer operating systems. Also my new PC didn’t have legacy parallel ports and I could not get it to work with a USB to parallel converter nor a PCI-E parallel card. So it got forgotten about until I decided to see if I could get that screen working on an Arduino. To cut a long story short, I did and made a few test circuits including a text adventure game, serial terminal and a graphic LCD clock. I got bored of that adventure game and had no need for a 40 pixel wide serial terminal nor did I need another clock so I modified the clock into a water pump timer. The LCD screen uses up almost all of the pins on an Arduino Uno / Nano so it wasn’t much use to me for anything else. Said clock code came from a demo for the T6963C library which needed major modification to work on modern versions of the Arduino IDE as it was still using the .pde file extensions.

So on to further details about how I went about making it…

Continue reading →

Further update on battery testers

If you have been reading my blog you will have noticed I made two Arduino based NIMH AA battery testers around 2 years ago. One was the first Arduino project I made but it needed some improvement and as I had mentioned in one of my previous posts I’m really running out of things to make; I don’t want to end up with a load of gadgets I’ll never use. So I decided to revisit some of my earlier projects and either scrap / repurpose them or improve them. The second tester I made does not really need further improvement as I have already done that and it only gets used once in a while. It is sufficient for my needs so I’m not that concerned about it’s shortcomings. This one however I have plans to turn it into a 12V lead acid battery tester but for now I decided to improve the display layout and make better use of the limited 16×2 LCD.

I had already changed the voltage reference from the inaccurate voltage divider method to a TL431 2.5V reference IC so in preparation for the conversion into a 12V SLA tester I have released an updated version of the NIMH tester code with the improved display layout I plan to use for the 12V version. The project page is here.

So next update I will probably show the completed 12V SLA battery tester although I have also been working on a 24V LiFePO4 version of it too which is complete and working but again needs further improvement. That will be shown in a future blog post when I feel the code is release ready. The pump control timer I mentioned before will get a full project page too when I get round to it. The priority now is to convert the AA tester into a 12V battery tester as I have a ton of them to test.

Gas and smoke detector update

A while ago I made a rather silly project as I had a spare MQ2 sensor laying round left over from a previous experiment. I decided to build a circuit that simply displays the analog value from the sensor on a 7 segment display. It was a bit pointless but it did detect gas, farts 🙂 and smoke. I have since modified the project so it displays more meaningful results. I used an example to calculate the parts per million reading from the sensor by using a formula that works it out from the sensor’s response curve. This is found in the device’s data sheet. I still don’t expect it to be accurate but it definitely works.

I’m going to be re-visiting some of my earlier projects and either scrapping or improving them now that I have learnt more about embedded programming and Ansi C / C++.

The original post and modified code is here.

A large animated LED matrix clock with various time display modes

Clock showing pong on my AV stand

Just over 2 years ago I bought an Arduino Uno development board and began to see what I could do with it. I looked online for inspiration and came across this pong clock by Nick’s LED projects. I immediately thought now that’s cool and wanted to make one for myself and set about trying to source the parts. I had difficulty finding the LED panels used in Nick’s clock (I could only find the larger 5mm LED modules) and used ebay’s feature to email me if any of the ones I wanted became available.

I forgot about it for a while and in the meantime I made a few basic projects mainly based on someone else’s code and modified it accordingly then the email dropped in my mailbox that some of the 3mm LED matrixes were now available. I could only get red ones and they took a long time to arrive from China. I also ordered the case made from a jewelry box as suggested by Brett Oliver who is another maker who built Nick’s clock and made his own customisations to it. I don’t know why but I put those parts into a cupboard and forgot about them.

I came across them a month or two back and decided to put the clock together and make a few customisations which included changing some of the modes, adding PIR support so the display turns off when there’s no-one in the room and adding a separate 7 segment display which displays the time when the matrix is off and room temperature when matrix is on.

Anyway that’s the intro, let me show you a bit more about it:-

Continue reading →

I’m still here; a pong clock, SLA battery tester & crappy Chinese fakes…

Just a quick update; I’ve got a couple of electronics projects on the go which should be finished after Christmas. One is a personal project which is a modified version of an animated clock using two 24×16 modules from sure electronics. That displays some pong animations amongst other stuff. It’s still a WIP but I hope to get it completed soon. The other is a modified version of the AA battery tester I built – one of my first projects. I have changed it so that it can test LiFepo4 batteries with a nominal voltage of 24V. It can also be used to test car batteries and other high capacity lead acid batteries. It works but just needs a few tweaks.

Secondly I have returned to the 8051 microcontroller and built a replacement logic board for a 20 year old LED sign which is obsolete. This was for work not personal use so I am unable to post anything on this site about it due to IP reasons but basically the old controller board had around 30 chips on it of circa 1980 which was replaced with a board containing a Silicon Labs C8051F342 microcontroller, a RS232 chip and a couple of logic gates. The board works perfectly replicating the original sign’s functions with the added benefit of a much lower power consumption and faster updating of the displayed data. Of course the biggest benefit is we no longer have to potentially scrap 300+ signs and can continue to support them.

I’ll be posting information on the LifePO4 battery tester and pong clock in the next month or two.

Continue reading →

The useful TL431 chip

I haven’t made any electronics projects for a while now but I was working on some circuits at work that used a TL431 shunt regulator. This chip can be used to provide a 2.5V voltage reference and also 5V with the addition of two 10K resistors between the Ref pin and supply voltage and another to ground. A 470 ohm resistor on the input to the circuit limits current so not to damage anything. I looked at using one to improve the accuracy of one of my previous projects, an AA rechargeable battery tester.

I had made two testers based on completely different designs, the second uses the 1.1V internal reference to calculate the supply voltage which is used as a reference. The former simply uses a 10K resistor attached to the 3.3V out to the vref pin so it is nowhere near as accurate as the second tester I built. The second tester can also test up to 3 batteries at once.


Going back to the first tester I will use one of the TL431 chips to provide a 2.5V reference and hopefully that will improve accuracy as the 3.3V supply is provided by the CH340 on this clone and is far from ‘3.3V’. I don’t expect the accuracy to improve by much but it’s gonna be better than using a supply voltage as a reference as these can vary especially with cheap voltage regulators found on the Arduino clones. As the tester will only be measuring 1.5V max, 2.5V reference is enough. Unless of course you wanted to modify it to test lithium cells in which case you would need to configure the TL431 to provide a 5V reference instead.

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 →

British Gas Hive Thermostat no signal issues

I recently replaced my home heating controls with the Hive system from British Gas as my old system had developed a fault with the receiver not switching on the boiler intermittently due to a faulty relay contact. The Hive system worked great for about 3 months until the other day when I noticed it was cold and the heating wasn’t working.

Thinking there was a fault with the boiler I had a look but everything was OK. The Hive receiver was showing the green light indicating that everything was OK. However everything was not OK. The hive thermostat just showed “NO SIGNAL” and no amount of resetting both the thermostat nor receiver would make it work. I decided to move the thermostat next to the boiler and hey presto! It worked. Took it back downstairs and no signal again. What was going on?

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 →

Salvaging electronic components from old electronics… Not worth it?

I’ve seen a few websites where other electronics hobbyists talk about where they get their parts from and many do what I did about 25 years ago; salvage components from scrap electronics by desoldering them. I must admit it’s something I do from time to time; when I throw out old electronics I see if there are any parts worth keeping but mostly there isn’t. Some people on those forums desolder capacitors and resistors for re-use; to me this just isn’t worth it considering the price of components nowadays. Also there is the problem that here in the UK and most EU countries it is illegal to take stuff from the dump or out of dumpsters. It is counted as stealing as once you dump something it becomes the property of the city council or waste company. Many companies smash up equipment before disposal to prevent reuse as well.

Continue reading →

What to do with a blown / faulty ATmega328 – Don’t throw it out… It may still be useful.

In one of my past arduino projects I accidentally damaged a Arduino Mega328 MCU (or it may have been faulty to begin with) but I decided to keep hold of it in case I needed it for a very basic project that didn’t need many ports.

The chip’s pins all functioned OK but it had a strange problem; when the serial port was actively sending data or any other pins on port D were being used, some of the other pins were going ‘partially high’ when they shouldn’t. I noticed this when I connected a 7 segment display to the board as several segments flickered or lit dimly when adjacent pins were high. Any attempts at multiplexing or any other high speed manipulation of port D’s pins resulted in some other pins’s output voltages dropping significantly. The display had adequate resistors and I even tried connecting it via a ULN2803 IC to no avail.

Continue reading →

A simple Arduino gas detector example.


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 →