So one of my recent projects has been to use an Arduino to control some gas solenoids. This is a fairly simple task but is my first using an Arduino and first timing coding in C, although I have experience with other languages.
The program has three setting: standby, purging and gas flowing.
The difference being which solenoids are activated. None on standby, 4 of 6 during purging and all 6 during gas flow. As of the 3rd of December my relay board hasn’t arrived so I have been using LEDs to simulate the solenoids being activated, once the relay board arrives I should be able to run properly for the first time, and re-route the horrible yellow and orange wires that currently stretch all across my board.
The code is designed to be as fail safe as possible so if it doesn’t detect certain signals it reverts to standby.
The more complicated parts of this project were communicating with a set of digital scales which allows the Arduino to have some idea of what it is filling and allow it to auto-stop itself if the item becomes too full.
The scales use as RS232 connections which naturally operates on a -15/+15 V dc signal, which is incompatible with the 0-5V dc pins on the Arduino Uno I am using. This is easily remedied with the use of the MAX232 board I have invested in, although a homebrew chip would be very simple to make myself I don’t trust my clumsy fingers or soldering skills!
The program itself takes an initial weight measurement, which is then used as a comparison against any further weights recorded, allowing the program to stop once a defined weight increase is reached. At this stage a purge is required and the program will not let the flow commence again until a 60 second purge is completed, including a displayed timer to allow the user to know how long they have to purge for.
If you have any questions relating to Arduino, or just some experiences you want to share, let me know in the comments!