DIY Doser

johnamon

New member
I have been frustrated with my cheap Marine Magic doser for a while :deadhorse: - it works reliably however programming it is a real pain. So I decided to build my own doser with all the functionality of the Marine Magic doser and a few sweet added functions :-

  1. No clunky screen or buttons - wireless Programming via my laptop**
  2. Doses defined in ml rather than inferred from seconds of pump action **
  3. Pump calibration to support the above function
  4. Doses will be automatically spread out over the day in increments defined by the volume dosed **
  5. Boost Doses can be added, and will be added incrementally along with the next 24hours's dosing **
  6. Resumes dosing automatically on power failure **

The functions above marked with a ** are all those which my the marine magic doser does not have! Ooh yeah - I forgot that on my DIY doser the clock doesn't reset on a power failure - another improvement over the marine magic unit...

So how does the poor old Marine Magic doser look after it's open heart surgery?? Not too shabby :beer:

attachment.php


From below & on I've described how I built the DIY doser. I have made certain design decisions purely from my own understanding of what is best - if you choose to recreate the doser with modifications please do let us all know what you've changed so all the forum can benefit - but please don't ask me how to program your changes for you ;-)

The cost of the DIY doser is approximately :-

  • Arduino UNO clone x2 £13.98
  • NRF24L01 Wireless Module x 2 £1.29
  • Real Time Clock Module x1 £2.00
  • Transistors x 2 £1 (guess - I already had some in my bits box)
  • Capacitors x 2 £1 (again a guess)
  • Peri Pumps x2 £17.18
  • Tupperware Box to House the Doser x2 £5
  • TOTAL ~£42

Missing from the list above is a 12v power adaptor - I have borrowed the one from my older doser :dance:

So I have decided to use my favourite hobby microcomputer, the Arduino along with NRF24L01 wireless chips to allow wireless programming.

You'll perhaps have noticed that there are two arduino's on the list above?? One of the Arduino's (which we'll call the "˜doser' arduino from now on) will be used to run the dosing calculations, sequence & activate the peri-pumps.

Here's how the 'doser' arduino looks when all wired in :-

attachment.php


The second arduino (which we'll call the "˜programmer') will be solely used to program the doser. In actual fact the programmer took a lot longer to code than the first!

Here's how the programmer looks :-

attachment.php


Before we start programming Arduino's - we need to wire "˜em up first with the various components. The doser arduino requires an NRF24L0, a Real Time Clock (RTC) and a small additional capacitor. In theory you could do without a RTC - but I like it. Wire up the NRF24L01 as-per the excellent guide on maniacbug's (http://maniacbug.wordpress.com/2011/11/02/getting-started-rf24/) website.

The programmer arduino requires an NRF24L01 and a small (~10uf) additional capacitor. Again the NRF24L01 must be wired as-per maniacbug's guide linked to previously.

You need to download maniacbug's fantastic NRF24L01 library and install it in your Arduino library folder. Please don't ask me how to do this - please google for the right answer.

You need to download the real time clock library (https://github.com/adafruit/RTClib) and install it in your Arduino library folder

You need to download the fantastic TimeAlarms (http://www.pjrc.com/teensy/td_libs_TimeAlarms.html) library and install it in your Arduino library folder.

The arduino's will run out of RAM unless we use Serial.printf in place of Serial.print as normal. To enable this we must modify print.h (in OS X right click the arduino application, click "˜Show Package Contents' then look under Contents -> Resources -> Java -> hardware -> arduino -> cores -> arduino )

To include the steps shown in http://playground.arduino.cc/Main/Printf section "œadding printf to print class"

Now you're finally ready to go!!

Open up my Transmitter.ino file and upload it to your "˜programmer' arduino (the one without the RTC). Open up my Receiver.ino file and upload it to your "˜doser' arduino.

Now, with your programmer arduino connected to the computer and the dose arduino connected either to your computer or to an external power source

Determine which port to which your arduino is connected and run "˜Putty' on Windows or "˜screen' on OS X (google all that if you don't know how to). Alternative as a poorer but functioning option - Open up the arduino serial monitor and you should be presented with the following list of options :-

attachment.php


Work your way through the dosing options to ensure your aquarium will be dosed correctly.

Now you are ready to build a mini transistor board to function the 12v pumps - this is required to have the 5v arduino function the 12v pumps. The board in-situ is as follows :-

attachment.php


Now, hook your pumps up to your transistor board and your transistor board to the Arduino PWR, GND, 6 &7 pins.

Place this all neatly in a box and glue / stick things so that you don't have any short circtuis or crossed wires and you now have a nice programmable Doser.

:strooper:
 

Attachments

  • IMG_4885_1.jpg
    IMG_4885_1.jpg
    51.4 KB · Views: 0
  • IMG_4880.jpg
    IMG_4880.jpg
    35.3 KB · Views: 0
  • IMG_4883.jpg
    IMG_4883.jpg
    57.2 KB · Views: 0
  • Screen Shot 2014-11-23 at 10.10.03.png
    Screen Shot 2014-11-23 at 10.10.03.png
    100.4 KB · Views: 0
  • IMG_4886_1.jpg
    IMG_4886_1.jpg
    59.6 KB · Views: 0
Forgive my ignorance but I did not find where the small (~10uf) additional capacitor needs to be installed. Is that simply a filter cap installed between input V+ and GND on the transmitter boards? That's what google seems to be telling me but wanted to be sure before I jack up one of my boards.

Also would the type of cap make a difference? I've got a wide assortment laying around to choose from.

Thanks.
 
What version Arduino are you running this on?

I'm trying to compile and upload the sketches on 1.0.5 and keep getting an error:
'class HardwareSerial' has no member named 'printf'
 
Hi zachts,

Did you perform the following from my instructions :-

To include the steps shown in http://playground.arduino.cc/Main/Printf section "œadding printf to print class"​

Hope that helps?

And the 10uf caps need to go either soldered directly between Vcc and Gnd on the NRF24L01 board - or the sloppy way which I did - poke the capacitor terminals in the 3.3v and Gnd headers on the arduino board - then poke the power lines to the NRF24L01 in aswell which should keep everything nice and snug.

You can just about see the top of the capacitor poking out of the 3.3v and gnd headers on the second and last photos in my original post. Whichever way you do it remember to check the capacitor polarity to ensure it's the right way round. Because I went the sloppy 'poke it in the hole' route - I did take the extra trouble to trim the capacitor legs to ensure it wasn't too much of a snagging risk.



What version Arduino are you running this on?

I'm trying to compile and upload the sketches on 1.0.5 and keep getting an error:
'class HardwareSerial' has no member named 'printf'
 
Forgive my ignorance but I did not find where the small (~10uf) additional capacitor needs to be installed. Is that simply a filter cap installed between input V+ and GND on the transmitter boards? That's what google seems to be telling me but wanted to be sure before I jack up one of my boards.

Also would the type of cap make a difference? I've got a wide assortment laying around to choose from.

Thanks.

Sorry, I missed the last question. I'm not 100% sure - I used electrolytic because that's what I had. If you happen to have ceramic capacitors then I 'think' you can ignore the polarity.... If you have issues with the wireless signal being inconsistent then adding further capacitors has helped other hobbyists obtain a stable connection.
 
Last edited:
What version arduino are you using to compile your code and upload to your arduinos? Should be listed at the top of the window when you open the arduino IDE. I tried with 1.0.5 and also with the latest version 1.0.6 and get the same error with both.

I was also wondering if you also modified any other files besides print.h?

Since when I try to compile your sketches I get the error that says 'class HardwareSerial' has no member named 'printf'

which would seem to indicate that HardwareSerial.h needs to reference printf or something like that.

Programming isn't my strong suit, but something isn't adding up in the code somewhere.

Could you post your previous version or whichever version you are running currently, or just a zip file of your arduino directory?

I'm hoping to have things up and running this weekend.

Thanks!

:beer:
 
Last edited:
I'm using 1.0.6 for os x.

I just found out that I can't upload my libraries folder because of forum file size limits, however please see a screengrab of my libraries folder attached.

attachment.php


because the issue is with printf it sounds like something's gone wrong following the instructions at the bottom of here.
 

Attachments

  • Screen Shot 2014-12-10 at 07.15.23.jpg
    Screen Shot 2014-12-10 at 07.15.23.jpg
    26.7 KB · Views: 0
Thanks. I have all the libraries. Unless I happened to download a different version of something, but I don't think that's the issue I'm having. I'll dig into the print.h stuff a little more latter this week and try again.

Could you upload your directory to drop box as you did previously with the sketches?

Getting all the hardware pieced together, so hopefully I'll have the sketch running and everything done this weekend, fingers crossed!
 
Thanks. I have all the libraries. Unless I happened to download a different version of something, but I don't think that's the issue I'm having. I'll dig into the print.h stuff a little more latter this week and try again.

Could you upload your directory to drop box as you did previously with the sketches?

Getting all the hardware pieced together, so hopefully I'll have the sketch running and everything done this weekend, fingers crossed!

Here's a copy of the libraries folder, however they are all standard libraries so you shouldn't gain anything by downloading them

You didn't say explicitly whether or not you'd modified the print.h file? If not then that's 100% you're stumbling block. If you're on a mac then the print.h within the package contents...
 
Here's a copy of the libraries folder, however they are all standard libraries so you shouldn't gain anything by downloading them

You didn't say explicitly whether or not you'd modified the print.h file? If not then that's 100% you're stumbling block. If you're on a mac then the print.h within the package contents...

I did modifying per the arduino page instructions, but perhaps I got something wrong in the process. I'm in the process of double checking everything and I'll let you know.

Thanks again!
 
Would you mind posting your modified print.h file? Apparently I'm not editing it right despite wasting countless hours trying to make the darn thing work.......
 
here you go..

Thanks!

No idea what I was doing wrong with my attempt to copy and past the code from the arduino site into my print.h file. Only difference between yours (which works) and my attempt is a few extra returns where you pasted the code in?

Oh well, the sketch compiles now so all I now need to do is finish up my hardware and give it a test run.

Woo!
 
pictures or it didn't happen :strooper:

Thanks!

No idea what I was doing wrong with my attempt to copy and past the code from the arduino site into my print.h file. Only difference between yours (which works) and my attempt is a few extra returns where you pasted the code in?

Oh well, the sketch compiles now so all I now need to do is finish up my hardware and give it a test run.

Woo!
 
Teaser.......

This was before, running on a lamp timer and adjusting the solution concentrations to meet demmand or boost levels.......

picture.php
 
Back
Top