Archives mensuelles : octobre 2015

Project : Fish feeder with Arduino Deek-Robot pro mini ATmega 328

Idea comes from :

and my work :

Arduino deek-Robot pro mini ATmega328

A counterfeit Deek Robot Pro Mini from the backside.


Download sketch to arduino Deek-Robot pro mini from arduino uno

Initial problem comes from difficulties to download sketch directly from PC/scratch to arduino pro mini : no USB to serial driver available for my PC.

Solution consists in using arduino uno as a downloader

IMPORTANT : select Arduino as ISP. See below :


Select the righ card :



Picture of Wiring and Programing!

The servo motor

TowerPro SG90

data sheet :


Reducing voltage from 9V to 5V

As a reminder only : not used (5V charger used instead)

Typically a LM7805 is used (or LM2940)

The 7805 needs 7V minimum and the 2940 can work from 5.5V
They can both handle upto a 35V input.

Use a LDO regulator like the LM1117T, LM2931, or equiv. The cheaper 7805 or 78L05 will work, but you won’t get the full capacity out of the battery. If you plan on doing much experimenting it would be better to get a power supply, even a wall wart, instead of the typically weak 9V battery (

See if you can get hold of an old car charger for a mobile phone that has an output of about 5V. You should be able to change one resistor to get exactly 5V. This saves having to source all the chokes etc.

Source code

// 2015, october 4th
// inspired from :
// see :
// important note regarding deek-robot pro mini : press reset button and release when RX starts blinking !

#include <Servo.h> 
Servo myservo; // create servo object to control a servo 
 // a maximum of eight servo objects can be created 
int pos = 0; // variable to store the servo position 

//long FISHFEEDER = 43200000; // 12 hours between feeding
long FISHFEEDER = 20; // 12 hours between feeding
long endtime; 
long now;

void blink_led() {
 digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
 delay(1000); // wait for a second
 digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
 delay(1000); // wait for a second

void release() {
 // release the servo to shut down noise ...
 //digitalWrite(9, LOW);

void setup() {
 myservo.attach(9); // attaches the servo on pin 9 to the servo object 
 myservo.write(0); // move to initial position
 pinMode(13, OUTPUT); //led confims loop is looping !
 delay(15); // wait a moment before going further
 blink_led(); // just for fun

void loop() {
 now = millis();
 endtime = now + FISHFEEDER;
 while(now < endtime) { // wait until endtime arrives ...
 delay(9000); // 20000 -> 9000 wait for 20 s before continue loop
 now = millis(); // get time
 // place to test if button pressed, 
 // ie : if we want to feed the fish now

 } // end loop : waiting for 12 hours
 // loop is finished : it is time to feed the fish !

} // end loop

void move() {
 setup(); // attach motor only when needed (it makes noise)
 // one way
 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 
 // back way
 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 
 myservo.write(0); // origin
 release(); // detach motor
} // end move

// end program

Learn more