MOBILE HOME Technical Tips


The clock tells the time by playing back recording of sound by the user. The user record saying "one", "two"... till 59. these short recorded tracks are played by the PIC following the hours and the minutes on the display. There are 60 tracks for minutes and 24 tracks for hours. Each track is 1.6 second long. Total memory for the 84 tracks is 4.5 MB.
The Menu has the options of setting hours and minutes, recording and playing the minutes and hours tracks.
The LCD module is 1 line 16 characters. 2 lines module or 20 character modules can be used too.
The PIC16F876A's ADC
digitizes the sound and store it in the SD card (not SDHC). The PIC's CCP is used as a DAC to convert the digital data back to audio. The sound is converted to 20KHz 8 bits mono in a format similar to .wav files. The quality of the audio is reasonable.
SD card interface the PIC in SPI mode. Reading and writing data is in multi-blocks. Memory is used at the rate of 20KB/s. The SD error display indicates error sent by the SD card. The software doesn't use any file system, it just uses absolute memory addresses (raw).
Audio input is 1Vp-p , you can use the mic circuit or other source. The CCP in PWM mode gives 20KHz wave with duty cycle modulated to the audio amplitude. A low pass filter removes the 20KHz component. I added a simple 2 transistors amplifier to boost the power to drive 32 Ohm speaker.
Good free specifications for SD can be found in SanDisk PDF:
You are free to use the circuit diagram and software with no limitations.

Circuit Description
See also Technical Tips

PIC and LCD supply is 5V. The SD Card supply is only 3.3V (3-3.6V) The 3.3V is generated by dropping the 5V with 2 diodes.
Audio input at pin 2 is 1Vp-p max. Voltage over 2Vp-p can damage the PIC input protection. 100K and 12K resistors give 0.6V DC input which is the middle of 1.25V range of the ADC.
One option is to boost the pic output by the Simple Audio Amp. You can use a 32 Ohm speaker. For use with another amplifier connect via the low pass filter.
8MHz crystal is a time base for the audio recording. 32768Hz crystal is a time base for the clock. Capacitors may need to be changed depending on the type of crystal used.
Digital outputs from the PIC to the SD card use 1K and 2K resistors to reduce the 5V signals to 3.3V. SD output at pin 7 is 3.3V but is enough to drive the PIC's input.
Stop, Rec, Pause and Play are pushbuttons.
LCD display and driver has 14 way connector, 10 connections are used, 4 bits data bus is selected. There is a big selection of LCD modules, and they are very similar in characteristics i.e. DM1601, ACM1601.
Vss - Supply GRD.
Vdd - Supply 5V
Vo - Contrast Adjust
RS - Register Select
R/W - Data Read/Write
E - Enable
D4-D7 - Data Bus Lines
LCD module is 20K pot is the LCD contrast, make sure it is set.
Talk PB is also the PB for Record and Play.

The Timer1 oscillator circuit draws very little power
during operation. Due to the low-power nature of the
oscillator, it may also be sensitive to rapidly changing
signals in close proximity.
The oscillator circuit, shown in Figure 12-3, should be
located as close as possible to the microcontroller.
There should be no circuits passing within the oscillator
circuit boundaries other than VSS or VDD.
If a high-speed circuit must be located near the oscillator
(such as the CCP1 pin in Output Compare or PWM
mode, or the primary oscillator using the OSC2 pin), a
grounded guard ring around the oscillator circuit, as
shown in Figure 12-4, may be helpful when used on a
single-sided PCB or in addition to a ground plane.


Comments and questions

Copy the number from the picture It stops net-robots from adding comments.

02.05.2017 - 15:47
Name: Moty
Comment: Hi Sangatee, Click button DOWNLOAD SOFTWARE , If it doesn't work send your email address and I'll send you the code.

02.05.2017 - 10:57
Name: Sangatee
Comment: Please can I get program code

12.09.2016 - 21:51
Name: mike
Comment: i find this very useful, thanx pls

19.04.2016 - 08:47
Name: dipen
Comment: while simulating on proteus,clock doesnot advances

12.10.2014 - 10:33
Name: Moty
Comment: Hi Abraham. My full name is Moty Santos Jelahlibahd.

11.10.2014 - 15:32
Name: Abraham
Comment: can I get your name? I want to reference u you I my Project.

02.06.2014 - 12:08
Name: Moty
Comment: Hi Yusa. 2 GB SD allows for about 20 minutes for each track. The clock doesn't advance during playing the tracks so for the clock showing the right time a track has to be limited to 2 seconds.

02.06.2014 - 02:09
Name: Yusa
Comment: How many seconds can a track be.