Ocra small Christmas crib

The small Christmas crib, the mikromedia card for PIC 32 and the Arduino Mega 2560

The suite «Mouskouri».
This suite is the heart and brain of my small Christmas crib. It consists of three softwares: a sketch for the Microcontroller ATMEL Atmega 328P-PU, used in the Arduino UNO. This sketch realizes the timing of the crib and at known intervals, but with standard deviations, sends via the serial port a command to the mikromedia for PIC 32, slave board, consisting of one byte representing the song of a specific bird or the bellowing ox or the braying of the donkey or the croaking frog. Also at foreordained intervals it turns on or off the yellow LED of the Sun, the two micro lamps in the two turrets or the starry sky. This software is written in pseudo C of Arduino. The first mikromedia for PIC 32 continuously cycles waiting for the byte coming from the microcontroller ATMEL and when the byte is received it starts playing the mp3 file in which there is the song of the specific bird and then it returns to cycle. This software is written in mikroBasic for PIC 32 [mikroElektronika]. The second mikromedia plays in random Christmas songs coming out from the sound system of the crib. The tracks follow one after another with a pseudorandom mechanism of choice. This software is written in mikroC for PIC 32 of mikroElektronika. The suite is named after the famous Greek singer Nana Mouskouri who sings her beautiful version of "Amazing Grace" in the crib.

View of the crib technological parts.

How it works: The Crib days are of 230 seconds: 120 seconds are dedicated to the night and 110 to the day. During the day the sun is shining and at night the stars light up in the sky and so the two lanterns in front of the two towers. Diurnal birds sing during the day and nocturnal in the evening. The time for a song of a bird is always the same, but the song is chosen with pseudorandom mechanism between the songs of thirty diurnal and five nocturnal birds. There is also occasionally the lowing of the ox [probability 50%], the braying of the donkey [probability 50%], the croaking of a frog [30% probability]. At dawn the cock crows [probability 70%] or the lark sings [probability 30%]. Shutdowns and start-ups of microlamps can be synchronous [probability 25%] or out of phase [75% probability] and can be delayed or advanced for a few seconds. Singing carols follow each other continuously and are chosen by a pseudorandom mechanism  and reproduced by the amplified loudspeakers shown in the picture. The operation of the crib is cyclical and automatic. External settings affect the audio volume and tonal balance. Everything is managed by three firmwares  in the two mikromedia cards for PIC 32 and in the Arduino Mega 2560 [at the center of the picture], that represent the heart and brain of the crib.

This mini crib participated, from December 04 2014 to January 06 2015, to the exhibition of Nativity Scenes in Agropoli [SA] and called "Agropoli in Presepe.".

Photo gallery