Arduino dosing controller build

Sv490665;22542252I'm beginning to realize that with the money spent on this project I will probably meet or exceed the cost of buying a manufactured doser. But said:
:crazy1:

pretty much what I found, too, especially when I take into account the time I've spent! A lot of the problem is all the extra stuff I bought that I didn't need but bought when I was trying to figure out how to put the whole thing together.

There are many people that have posted their builds (including dozens of threads here on RC) Most people readily share their experience and insight, but part of the reason people make their own is to customize it for their needs and to figure it out themselves, which leads to a lot of time and extra money spent :hmm4:
 
I think that depends on what kind of LCD. if it is a touch screen. The thing might slow it down. then if it is a 16x2 with buttons? I do know, you should be able to drive some moonlighting at worst with it.
 
I went ahead and ordered that part for my LCD screen, and yes, it is a standard 1602 LCD, no buttons, 16 pins. Soon all my parts will be here so I can finally build the prototype and start programming!:dance:
 
I went ahead and ordered that part for my LCD screen, and yes, it is a standard 1602 LCD, no buttons, 16 pins. Soon all my parts will be here so I can finally build the prototype and start programming!:dance:

Did you order the part from ebay or Adafruit? Bear in mind that ebay parts don't have any support except what you can dig up from Googling your part. Adafruit has libraries designed for their I2C backpack board, and because it's a popular product another guy wrote a better library for it.

I'm currently building a fertilizer doser for my high tech planted nano with arduino. Here's what I'm using and how many pins each takes up on the microcontroller: 20x4 lcd screen with the Adafruit I2C backpack (2 pins), four momentary pushbuttons for up/down/enter/esc (4 pins), a DeadOn RTC from sparkfun (4 pins), and I'll just control the pumps with transistors and diodes to allow me to run 12V pumps (3 pins). I was even going to do the buttons with I2C using an expander IC but using the layout I did allowed me to do the simpler thing and give each button a pin on the microcontroller.

I'm just breadboarding and messing with the code now, but when I make the actual doser I'm going to just use the microcontroller chip (ATMega328p...or I may use a different ATMega chip with more memory if I need it) and some minimal support circuitry for it in lieu of the arduino itself. Arduino boards are best for prototyping because you can plug things in and out, there's USB interface, USB power, and you can upload sketches continually to check how your project responds with the new code...but they're like $20-$60 a piece. The microcontroller chip is $3 on Mouser, support parts for the chip (crystal oscillator, caps, resistors...) are about $3-$7 depending on what you have. By subbing the bare chip in for the arduino, you save yourself some money and retain the usefulness of the arduino for the future!

Just my $0.02
 
Did you order the part from ebay or Adafruit? Bear in mind that ebay parts don't have any support except what you can dig up from Googling your part. Adafruit has libraries designed for their I2C backpack board, and because it's a popular product another guy wrote a better library for it.

I'm currently building a fertilizer doser for my high tech planted nano with arduino. Here's what I'm using and how many pins each takes up on the microcontroller: 20x4 lcd screen with the Adafruit I2C backpack (2 pins), four momentary pushbuttons for up/down/enter/esc (4 pins), a DeadOn RTC from sparkfun (4 pins), and I'll just control the pumps with transistors and diodes to allow me to run 12V pumps (3 pins). I was even going to do the buttons with I2C using an expander IC but using the layout I did allowed me to do the simpler thing and give each button a pin on the microcontroller.

I'm just breadboarding and messing with the code now, but when I make the actual doser I'm going to just use the microcontroller chip (ATMega328p...or I may use a different ATMega chip with more memory if I need it) and some minimal support circuitry for it in lieu of the arduino itself. Arduino boards are best for prototyping because you can plug things in and out, there's USB interface, USB power, and you can upload sketches continually to check how your project responds with the new code...but they're like $20-$60 a piece. The microcontroller chip is $3 on Mouser, support parts for the chip (crystal oscillator, caps, resistors...) are about $3-$7 depending on what you have. By subbing the bare chip in for the arduino, you save yourself some money and retain the usefulness of the arduino for the future!

Just my $0.02

Or you can just get arduino mini from ebay, still has usb and all the pins, but only ~$8 and way smaller.
 
Did you order the part from ebay or Adafruit? Bear in mind that ebay parts don't have any support except what you can dig up from Googling your part. Adafruit has libraries designed for their I2C backpack board, and because it's a popular product another guy wrote a better library for it.

I ordered my i2c backpack from ebay, it's a no-namer and I bought it cause it was cheap. I wonder if it is so closely hardwared to the adafruit version that I could snag their code? I'm not afraid of support issues for the backpack- where there's a will there is definitely a way.
 
Ok, so i got my parts in the mail. Now I'm starting to wire up my prototype but a few problems.. First, I want my LCD i2c adapter hooked up. It is shown below on my arduino board, but Because I am stacking the motor shield on top, how do I hook it up to the motor shield? I soldered the motor shield with some female pin connectors in lower right corner, they appear to be 5v and grounds. But what about analog pins 4 and 5 for i2c adapter? Also, how do I hook up the Rtc to the motor shield? After that, hooking up power cords to arduino and motor shield, then the power lines for pump motors are a breeze.

picture.php


picture.php


picture.php
 
The header shield should just stack. it isn't going to have anything but power. until you run your script. If you have problems with two things needing the same pin? That's just if you have enough pins and what you assign in your script. just because the shield can use all the pins and plugs in. does not mean they are being used. its really in the script and overall if you have enough pins for what you want. I ended going with the mega for more pins.
 
As others suggested switching out for stacking headers makes it easy to make quick changes but you could just as quickly solder onto the unused pins that you need either on top of the motor shield or on the bottom of the uno. It's still easily un-doable just needs the use of the soldering iron.....

For testing purposes you can also just yous jumpers to make connections, it's not pretty but for testing before soldering it gets the job done.
 
As others suggested switching out for stacking headers makes it easy to make quick changes but you could just as quickly solder onto the unused pins that you need either on top of the motor shield or on the bottom of the uno. It's still easily un-doable just needs the use of the soldering iron.....

For testing purposes you can also just yous jumpers to make connections, it's not pretty but for testing before soldering it gets the job done.

AAAAHHHH... I get it. So how do I know which pins from the Arduino board my motor shield actually needs and uses? Once that is determined then I can figure which pins I now have available. I have a soldering iron and I'm getting pretty clean with my connections. I will order those headers. Also, why wouldn't the creators of the motor shield make it with stacking headers?

...Sorry for all the noob questions but there's just a few details here that have really hung me up, and even when I do research it's really hard to find answers to my specific questions sometimes. Once these hardware issues are worked out I'm on to programming. Thank you, once again, for all your contributions.

EDIT: I think I found the answer to the pins being used, can anyone validate this? I got it from adafruit's website.

---What pins are not used on the motor shield?

All 6 analog input pins are available. They can also be used as digital pins (pins #14 thru 19)

Digital pin 2, and 13 are not used.

The following pins are in use only if the DC/Stepper noted is in use:
Digital pin 11: DC Motor #1 / Stepper #1 (activation/speed control)
Digital pin 3: DC Motor #2 / Stepper #1 (activation/speed control)
Digital pin 5: DC Motor #3 / Stepper #2 (activation/speed control)
Digital pin 6: DC Motor #4 / Stepper #2 (activation/speed control)

The following pins are in use if any DC/steppers are used
Digital pin 4, 7, 8 and 12 are used to drive the DC/Stepper motors via the 74HC595 serial-to-parallel latch

The following pins are used only if that particular servo is in use:
Digitals pin 9: Servo #1 control
Digital pin 10: Servo #2 control

---Which pins are connected to the DC/Stepper motors?
The DC/Stepper motors are NOT connected to the Arduino directly. They are connected to the 74HC595 latch which is spoken to by the Arduino. You CANNOT talk directly to the motors, you MUST use the motor shield library.
 
Last edited:
I think the choice to not use stacking headers for them is partly due to the use of screw terminals. They may be so tall that they would not allow a board to sit cleanly on top and definitely would be hard to use if another board is stacked. Also they may not want someone to think they can use multiple motor shields in a stack, which may be possible with some other types of shields, but these apparently require their specific pins.
 
Alright- I ordered some stacking headers and a solder sucker to swap out these pin headers on the motor shield. I wouldn't go to all this work if I didn't care about the footprint of the hardware, but I love the modularity of stacking shields and still having function of the pins on top to use. Plus- when I'm done with the project I am trying to fit it into as small of a project box as possible.
 
I swapped out the headers on the motor shield for stackable and made my connections. Other than adding my rotary encoder to control the LCD, At this point does it look like all my hardware is wired up correctly? As soon as I get confirmation I can begin with programming. Black power supply into arduino is 12v 750mA. Gray power supply into motor shield is 6v 500mA. Each of the peristaltic pumps are 6v 30mA.

Also... Where do I make my connections for the rotary encoder?

picture.php


picture.php


picture.php
 
I need to catch up now and get my arduino and screen..........
.........but at least it's working, :lolspin:

picture.php
 
Following along... trying to build one myself, but I'm starting to think I bit off more than I should have with this project
 
I need to catch up now and get my arduino and screen..........
.........but at least it's working, :lolspin:

Zachts, I noticed you put what I think are resistors or diodes? between motor leads to reduce conductive kickback right? I wonder if I should do the same or does my motor shield protect from that problem? Also, do I need to put resistors anywhere else in my circuitry?

Mbingha, not sure what gear you've got already but I'm trying to make this build so I can do an instruction thread for total noobs. I'm working out every angle so in the end, the instructions will give people an exact parts list, totally clear step by step building instructions, and finally the debugged code ready for download so it's super easy for anyone to build their own doser. I have zero experience in programming or micro controllers, this is my first project like this. So I bet you could do it too! :beer:
 
Last edited:
Zachts, I noticed you put what I think are resistors or diodes? between motor leads to reduce conductive kickback right? I wonder if I should do the same or does my motor shield protect from that problem? Also, do I need to put resistors anywhere else in my circuitry?

I've never used nor researched the motor sheild you've got but I would expect it isolates the arduino from the motors in the same way the relay board I have does. (my relay board uses optocouplers to isolate the control signal from pump power, they are only on/off for my setup.

The diodes were part of the stock wire harness and I kept them since it allows my motors to operated off of down to 4 volts or up to 24 volts. But yes I believe that is why they were there for the pumps intended life as ink cartridge filling pumps. Can't hurt though, and on my motors without the diode they need 12 volts to start up. My plan has been to calibrate them based on run time as at 5 volts they pump very slowly which is what I'm doing at the moment with a lamp timer, but may improve that with PWM later, but in my testing the slowest I can go with them is the same as with a 5v input so I'll be keeping it a bit simpler but hope to gain/contribute from/to your build as you go along.

right now the two clear pumps are doing two part dosing and the two blue ones are doing ATO duty as they pump much faster.
 
Last edited:
Back
Top