DIY Dosing Pump Controller Atmega128

BeanAnimal

Premium Member
I have been working on a DIY dosing pump controller for the last several months. Progress has been slow but steady.

I will try and keep this thread updated with the progress and at times fill in the back story (program flow charts, code snippets, whatever).

The project will be fully documented on my website (still working on the content, but more interested in finishing the project first).

I have looked at many different dosing controllers but have not been drawn to any particular brand. Each lacks features that I would like to have in a controller.

This is NOT a step-by-step instruction guide or a HOW-TO article, but rather a build log for those who like to build electronics projects. I will consider providing the source code, board layouts and a parts list once the project is complete.

My Hardware criteria:
-Atmega128 based
-use Basic code ( I hate C and hate assembly)
-single rotary encoder for navigation and setup
-Real Time Clock
-Ethernet interface
-Serial interface
-LCD (at leat 4*20)
-15A lead per channel
-suitable flyback and surge protection
-low SMT count (I hate soldering SMT)

My Function criteria:
-capable of at least 3 dosing channels
-independent channel operation
-split dose into user configurable intervals (1-48, one-shot)
-set dosing window (1 - 24 hours)
-set dosing start time each day
-set dosing days (M-F, every other, every 3rd, etc)
-calibration for use with any capacity pump
-float switches to enable-disable pumps baed on one or more solution levels.
-schedule hold function for each channel

I think that is it...

Anway, photos will follow as soon as I can get them uploaded to my server.
 
So here is the PCB. I will post the latest schematic at a later date (there are some corrections). I have had to modify 2 traces and 1 wiring harness due to errors in the PCB layout.

The board is double sided with plated holes, full soldermask and silkscreen. I paid $50 for (2) pieces from a prototyping shop ( pcbnet.com ). The order was 50% off of the normal prototyping price! It is a shame I left errors in the design.

The good news is that all of my custom footprints (Relays, ET-AVR, Wiznet, etc) were perfect!
dosing_pump_raw_pcb.jpg


The next photo is the partially populated board. The RED daughter board is the WIZNET810-MJ ethernet board. It is SPI based and uses only a few pins from the AVR. The open space in the top right is for the ET-AVR Atmega128 daughter board.

The ET-AVR board is from futurlec. I decided to use it so that I did not have to solder the tiny Mega128 down (did I mentioned I hate solder SMT). The ET-AVR board simply consists of the Atmega chip, an oscillator and a few filter caps, an led and some headers. It does nothing special but carry the processor and save me the trouble of soldering it myself!

The lower left corner is the power supply. I had to provide both 3.3V (for the WIZNET board) and 5V for the rest of the board.

Lower right is the battery holder and real time clock. Upper left is the RS232 transceiver and header.
dosing_pump_partial_pcb.jpg
 
A few shots showing the fully populated board with the ET-AVR stamp pressed into its headers. The wiznet board is soldered in place but the ET-AVR is on .1mm headers in case I need to remove it (I.E. if I fry it during programming).

Doisng_controller_fully_populated_1.jpg


Doisng_controller_fully_populated_2.jpg
 
A closeup of the PSU heatsinks and filter caps. I went a little overkill here because I don't want power glitches to endager the system stability.
dosing_controller_psu.jpg



The WIZNET magnetics. The board has pins for all relevant lights (TX/RX/COL/Etc) but I opted not to extend those to the controller or LEDs. I could care less, and the mag jack has lights on it anyway.

dosing_controller_wiznet.jpg


Here is a shot of the ET-AVR card. As you can see it is rather simple. Just a Mega128 with a crystal, reset button and trimpot for ther ADC voltage reference (not used in this project). The yellow header is the ISP programming interface. The black header is PORTC of the AVR and not used.
dosing_controller_et-avr.jpg
 
This is great! Very interesting - I'm officially on board. :D

BTW - what's the limit on number of channels?
 
Last edited:
Here is the project is on the bench. The soldering stations are Weller digital temp controlled units. The scope is a 100MHZ Tektronix (currently being used to show pre-regulator power supply ripple from the wal-wart).

dosing_controller_bench_1.jpg



A tigher shot showing the breadboard and El-backlight driver. I currently have the driver disconnected (kept getting shocked and was afraid I would kill the AVR). The LCD has a blue EL-backlight! I plan on putting the driver as far away from the PCB as I can, as it has proven to be pretty noisy. The paper in the upper left hand corner is the screen flow chart for the different menu levels and display screens. It was done in Visio.

I built the cables with the crimper seen on the desk (don't ask how much that cost!) and cgridII connectors from Amp. The left "thing" is the rotary encoder that is used to scroll through menu items and settings. It has a built in button that acts as the "enter" button. The right "thing" is the contrast potentiometer. The backlight will be software controlled.

dosing_controller_bench_2.jpg
 
Just another shot of the board with power on it. I put a blue power LED on my board. i will move it to the case as soons as the project is complete.
dosing_controller_bench_3.jpg


The 4*20 LCD showing the dosing schedule summary screen. The backlight is not on for these photos. I am not happy with the driver, it is too green. I am going to swap it for a lower freq. unit to drive the display much bluer.
dosing_controller_lcd.jpg



So thats it for now. I am working on the MENU code this weekend. The controller can already turn the relays ON-OFF with hard coded parameters. I just need to work on getting the menus driven data entry and flash storage working.
 
The laptop screen that is connected to the controllers ISP port. As you can see.. I am writing in basic. The compiler/IDE is from MCSELEC.COM (MCS Electronics) and is called BASCOM-AVR. It is by far the best compiler I have used for Micros. (Did I say I hate C and Assembly). I tried to play around with PICs and PICBASIC, PROTON, Etc, but the AVR/BASCOM combo is just too flippin awesome to not use!

dosing_controller_bascom-avr.jpg
 
That's really cool, Bean. Let me know if you decide to make a run of these. I have a favor that I can call in from a PCB maker. You're welcome to the favor since I'll never use it.

Jason
 
Thanks lakee... I have my doubts about the ethernet controller. I did not breadboard this first. The building blocks are rather simple, the only unknown is the WIZNET module. I know it will work to some extent, but not sure how well. The code to get it running is rather bulky and I am afraid it will not meet my expectations.
 
<a href=showthread.php?s=&postid=13707552#post13707552 target=_blank>Originally posted</a> by GlassReef
This is great! Very interesting - I'm officially on board. :D

BTW - what's the limit on number of channels?

Well I have three relays on board with associated transistors. There are maybe 24 or so free I/0 pins. I may write the code to handle 16 channels. It would not be hard to add external relay boards.

I am also building a lighting (sunrise, sunset, etc) controller based on similar architexture with a touchscreen. This has to get done first though.
 
damn Steve, you caught me!

I thought I was careful when I took those photos. how did you know that just off to the right there is a pick and place machine and a a wave soldering line.

There is nothing for sale here. The project is simply for my enjoyment. It is posted here for the enjoyment of others who like to build such devices, just like the 555 feeding timer project and the upcoming liighting controller.

If anybody makes any money, it will be the dishonest person or company that steals the design and sells it as their own.

Now, please find your way out of this thread, as it is clear that you are only here to be antagonistic.
 
i was hoping for a very serious tread from bean. now i have to say that steve needs to let his big brother play with his electric toys by him self and just sit and watch or go play with your own electric toys.
i want bean to finish this and i am here just to watch cuz this is WAY out of leage
 
If I wanted to use a PLC, I would have used a PLC. I don't want to use a PLC. I enjoy designing and building electronics projects, not coding ladder logic. My current interest is in the use of AVR microcontrollers and expansion of my basic and bascom-avr programming skills.

This is not an "experiment" to see "if" it will work. It is a project that implements what I have learned about electronics. It is well thought out with a clear articulation of the goals, operating parameters and expectations.

Furthermore, this project is a building block to more complex projects I have planned (and started). To gain the same functionality from a PLC is NOT simple or inexpensive or reasonable without also building external logic devices to augment the PLCs lack of complex programming functionality.

Steve, I am going to kindly ask you again to please leave this thread. It is about my project, NOT YOU or YOUR PROJECTS. Want to talk about PLCS? Start a thread.
 
<a href=showthread.php?s=&postid=13710965#post13710965 target=_blank>Originally posted</a> by BeanAnimal
If I wanted to use a PLC, I would have used a PLC. I don't want to use a PLC. I enjoy designing and building electronics projects, not coding ladder logic. My current interest is in the use of AVR microcontrollers and expansion of my basic and bascom-avr programming skills.

This is not an "experiment" to see "if" it will work. It is a project that implements what I have learned about electronics. It is well thought out with a clear articulation of the goals, operating parameters and expectations.

Furthermore, this project is a building block to more complex projects I have planned (and started). To gain the same functionality from a PLC is NOT simple or inexpensive or reasonable without also building external logic devices to augment the PLCs lack of complex programming functionality.

Steve, I am going to kindly ask you again to please leave this thread. It is about my project, NOT YOU or YOUR PROJECTS. Want to talk about PLCS? Start a thread.
To me it looks and functions like a Programmable Logic Controller - 3 channel :D but if you dont want comments or suggestions thats fine by me :D
 
Steve,

How can I be any more clear. I do not have any interest in using an off the self PLC. This thread is not about phidgets or PC based I/O cards. It is not about x-10 or Proflux or ACjr or Lighthouse, or any other means of dosing control. It is about the project I described in the first post. It is MY logic controller built to my specifications and running my software. PERIOD.

I have not asked for your suggestions or opinions and have also made it very clear that I am not interested in them. I very clearly asked that you refrain from further comment here and I am going to kindly ask again. Please go away and beg for attention someplace else.
 
wow that is so kewl, wish i could do stuff like that, started going to school for electronics but had to drop out due to financial issues and bad roomates....... keep up the good work man!
 
Back
Top