baby milkpowder dispencer

hi,

i'm a compleet noob with arduino and programming (i'm a mecanic-welder) but i would like to make a baby milkpowder dispecer with my arduino kit. so the idea is when you turn the pot wich wil give you a value from 1 to 9 displayed on a segmented led display and then when you pres a button the servo wil go back and forth the amount of times wich mapped on the display.

is this feasible ? and how would i aprouch this becauls i cant seem to get my head around repaeting the back and forth motion of the servo

thanx in advance and sorry for the bad english

In the IDE go to Files, Examples, Servo. There is a sweep example that will show how.

Very Feasable

(What is your native tongue? Belgium? there is also a dutch section )

You'll have more issues with sanitation and dispensing hardware if you are handling bulk powder than you will with servo control.

Have you worked through the basic SWEEP sketch for servos?

yes i have tried the examples but i just cant figure out how to conect the dots. the display works and the sweep motion but i cant figure out how to let the servo go back and forth the the disierd amount of times.

Perhaps you could show us your sketch.

Maybe also you could specify what the "desired number of times" might be.

Not to dampen your enthusiasm for innovation of course, but on mentioning this project to my good wife (given that we have absolutely zero familiarity with preparing baby formula), she wonders what is difficult about using the scoop provided with each tin?

:smiley:

:smiley:

OK, just thinking aloud, as it were.

Let me know if I understand you correct, You have a numeric pad where you can enter a number from 1-9. When you press a number the servo should go back and fourth that number of times and also be shown an a segment display? It sounded in your description that you wanted to have the segment display as an input object. It's not, it's pure out put.

This should be pretty easy. in the loop{} you check for input from the number pad. When you get an input you pass the value to a function that is almost a copy of the sweep example but with a while loop around. Run the while loop until it matches the number you pass to the function.

The function that moves the servo could look something like this:

void runServo(int times){
 int runs = 0;                       //counter
  while (runs < times)  {
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  runs++;
  }
}

And you call the functions in the loop like this:

runServo(numberFromPad);

the idea was to have a pot wich you can turn and read the value and display this on a 7 segemented led display going from 0 to 9 , and than use the value wich has been mapped from the pot and use that value to move the servo that amount of times when u push a button.

so if the display is displaying 6 for example than when you push a button the servo would go back and forth 6 times.

i have no code becauls i dont have a clou hot to get this to work ( i just dont seem to get the logic of programming)

its a litle project im doing cauls i dont like getting my hands stuck in the damnd jarr and loose track on the number of scoops :):):slight_smile:

No offense, but.....

  1. I wouldn't trust feeding a baby, my baby, any baby, to my programming skills if I was a self-admitted "compleet noob".

  2. If you can't figure out how to to transfer somethign like powder to a bigger container and count to 6 uninterrupted, you aren't going to figure this project out either. Just saying.

My recommendation: Spend time with the kid and the baby momma instead of spending time on this. Priorities, man.

Again, I suspect thatlike many enquirers here, you have been reading the Arduino "Playground" examples, which can be quite misleading in a variety of ways, and come across the "potentiometer" exercise.

Our Philips microwave oven has been functioning for something approaching 30 years. One might observe that those manufactured more recently are unlikely to achieve anything near such a lifespan. Of course, the ability to actually rebuild the HV fuse and replace rectifiers with those cannibalised from scrap ovens and encasing the control circuit board completely with fly mesh to keep the critters out has been crucial to its longevity.

Anyway, it actually uses a potentiometer - in conjunction with buttons - to set the cooking time in minutes and/ or seconds (one press of the button for minutes, a second for seconds), which works quite well and fast.

Now of course, this mode of operation is very unusual nowadays, and in fact, the potentiometer is getting a bit touchy. If I get too frustrated with it I can probably clean the potentiometer and restore its function. Most systems nowadays use some combination of numeric and up/ down buttons, generally touch pads.

I think your project would be better served by one of the readily available and "dirt cheap" touch pads from eBay - still use the 7 segment display to confirm what has been punched in, but just hit the number and say, "hash" [ # ] to run.

If you really want the rotary control, then little rotary encoders are available which also have a push switch. Rotate it until the correct number comes up, and press to go. These are used for rapid menu navigation on professional equipment such as medical monitors. They are actually easier to implement than a potentiometer as they are simply three digital inputs.