se99paj
Posts: 16
Joined: Tue Mar 17, 2015 1:03 pm

Any tips for beginner project - Radio Alarm Clock

Thu Mar 30, 2017 9:51 am

So I've been in the market for a new bedside table alarm clock, but the ones available are all pretty dull, I'd like to think that I can do something better by leveraging a Raspberry Pi. I've done some research and it all seems fairly feasible but as this is a first time project I wanted to get some advice how I should approach this.

I have lots of ideas for features to include, but think I really need to keep it simple first, then incrementally add new capabilities overtime (In theory from a certain point I won't need to add much hardware and the new features would be from software changes)

At the moment my basic features are:
  • Show the time
    Play the radio at a certain time and for set duration
    Start alarm at a certain time
    Snooze the alarm
Raspberry Pi Zero W - I've seen other projects using a larger Pi, but not sure if that is overkill, I'm hoping a wireless Pi would be sufficient and lightweight
Clock Display - The Adafruit 1.2" 4-Digit 7-Segment Display looks good for this and they have useful Python scripts already for displaying the time (As this needs 5V I'm assuming I can pull this from the GPIO)
Amplifier - There are a few options here, the JustBoom Amp Zero (If I understand it right) can be stacked on the Pi and if I use the right header I'll still be able to use the GPIO for other components. (Definitely need to understand the do's/don'ts for using the GPIO and stacking)
Speakers - Not too worried about these yet, but will need something to play the radio and alarm noise.
Snooze button - Need someway to snooze the alarm

The one bit I'm struggling with is thinking about hardware/software at the same time, should I really just buy the hardware and get them setup on a breadboard first, then start thinking about the software. I've already done some research in software and some projects are very complicated, should I just start small i.e. get the time to work first, then scale up with additional scripts to control specific features? I'm heading to the bookshop later so will try and find something on learning python for Raspberry Pi.

capran
Posts: 2
Joined: Tue May 02, 2017 8:49 pm

Re: Any tips for beginner project - Radio Alarm Clock

Tue May 02, 2017 8:53 pm

I just decided to do the exact same project!

I haven't decided on which SBC to use either.

For my alarm clock, I want to use an old broken alarm clock radio, and just re-use the case, speaker, LED display and buttons.

I'm a just a bit of a hardware tinkerer, more along the software side. Haven't done this level of hardware hacking before so would need some assistance and pointers.

I own a Raspberry Pi 3B as well a PocketCHIP (getchip.com, but they're currently retooling the $9 CHIP model and it's not on sale anymore), I'd rather save both for other uses, so I was wondering if anyone knew of any places to get more that aren't over-priced?

I can't find any Zeros for less than $24 (bundled with other stuff), and it doesn't have built-in power management like the CHIP does. I think the CHIP would be great for the use-case, but I don't really want to sacrifice the only one I have since you can't get a replacement right now. On the other hand, Raspberry Pis have better support and instructions.

I'd like to keep the budget for the project under $40-ish. I know I'll need a small amplifier for the speaker, and some way to connect the LED display. Not sure what else. Battery back-up would be a huge plus.

Any thoughts?

DazzF
Posts: 22
Joined: Sun Aug 19, 2012 5:32 pm

Re: Any tips for beginner project - Radio Alarm Clock

Sat May 06, 2017 4:34 pm

Hi,

Been working on my project for a little while now.

Pi3 with official touch screen, usb DAB dongle for digital radio. Was going to use a cheap set of usb powered speakers, the ones that power off usb but take the audio via the audio jack as this solves the amplifications and speaker requirements in one.

I'm developing the functionality in Qt5.8 as it's qml Radio component will pick up the usb DAB dongle and the qml audio component can stream internet radio.

It will be built into a Yacto image as I can configure the OS exactly as I want

klricks
Posts: 6615
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Any tips for beginner project - Radio Alarm Clock

Sat May 06, 2017 11:49 pm

capran wrote:.........For my alarm clock, I want to use an old broken alarm clock radio, and just re-use the case, speaker, LED display and buttons.

I'm a just a bit of a hardware tinkerer, more along the software side. Haven't done this level of hardware hacking before so would need some assistance and pointers.

....
Unless you can find the schematic / service manual for the radio or at least datasheet on the LED display, then attempting to re use existing components will be next to impossible. Even with documentation it won't be a simple.....hook this wire to that solution. So IMO not feasible.

Other issues to consider:
The RPi has stereo output so you would probably want to use 2 speakers and 2 channel amp.

For timekeeping the RPi needs to be connected to the Internet by WIFI or Ethernet
-OR-
An add-on Real Time Clock module with battery backup
-OR-
An Atomic clock module
-OR-
A combination of one or more of the above.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

capran
Posts: 2
Joined: Tue May 02, 2017 8:49 pm

Re: Any tips for beginner project - Radio Alarm Clock

Tue May 09, 2017 8:44 pm

Unless you can find the schematic / service manual for the radio or at least datasheet on the LED display, then attempting to re use existing components will be next to impossible. Even with documentation it won't be a simple.....hook this wire to that solution. So IMO not feasible.

Other issues to consider:
The RPi has stereo output so you would probably want to use 2 speakers and 2 channel amp.

For timekeeping the RPi needs to be connected to the Internet by WIFI or Ethernet
-OR-
An add-on Real Time Clock module with battery backup
-OR-
An Atomic clock module
-OR-
A combination of one or more of the above.
Yeah, I attempted to figure out the LED clock display from the old alarm clock, but I couldn't get any of the segments to light up after I stripped all 16 wires on it and connected to the breadboard. I tried every combination of touching ground and +5V to each wire. Shrug. Probably would have been too complicated anyway (as you said). I might just have to find a clock display with I2C or serial, Adafruit makes one for $10, but kind of wanted to find one that's cheaper.

The kit from Kuman I got (https://www.amazon.com/gp/product/B01DR ... UTF8&psc=1) has a 16x2 LCD, but the instructions provided are only for Arduino or Raspberry Pi not for CHIP, so I don't know how exactly to wire it to the CHIP. Even if I did, would need to modify the code, not sure about that part either.

I did test out the LCD on my Pi 3 just for something to do. There's python code examples, but I never learned the language myself (haven't touched programming in close to 20 years). Will need to do some experimenting with it.

I used this amp https://www.amazon.com/gp/product/B01DK ... UTF8&psc=1 successfully with the CHIP. Not sure how to wire it to the Pi. I only used 1 speaker and it sounds fine for a talk radio stream. I may end up using 2 speakers though eventually.

I will be using wifi since I obviously want streaming audio, so time via NTP isn't a problem.

se99paj
Posts: 16
Joined: Tue Mar 17, 2015 1:03 pm

Re: Any tips for beginner project - Radio Alarm Clock

Wed Jul 05, 2017 3:49 pm

capran wrote:I might just have to find a clock display with I2C or serial, Adafruit makes one for $10, but kind of wanted to find one that's cheaper.
I made some progress with this but never finished the project, I had problems streaming the radio and setting an alarm at the sametime. Also managed to make my code so complicated that I confused myself.

But saying that the Adafruit clock display was the easiest bit of the project - They even had a clock script in the examples.

User avatar
bensimmo
Posts: 4187
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Any tips for beginner project - Radio Alarm Clock

Wed Jul 05, 2017 4:36 pm

You could always pop your code up, github may be easier and see if anyone can help tidy it up.

User avatar
DeckerEgo
Posts: 19
Joined: Sun Oct 27, 2013 2:08 pm
Contact: Website

Re: Any tips for beginner project - Radio Alarm Clock

Wed Sep 27, 2017 1:57 am

Man, sorry I missed this post!

I created the Hack Clock for this very purpose - see http://hackclock.deckerego.net/

The hardware setup you describe is pretty much exactly what I have spec'd for the Hack Clock, and software is ready to install. Once you get the hardware constructed and software installed you can define what you want the clock to do either by coding in blocks or by using Python - examples are provided as well.

Hope this helps!

hfolkers
Posts: 6
Joined: Thu Dec 22, 2016 12:38 pm

Re: Any tips for beginner project - Radio Alarm Clock

Wed Mar 28, 2018 1:05 pm

capran wrote:
Tue May 09, 2017 8:44 pm
I tried every combination of touching ground and +5V to each wire. Shrug.
This way you probably blow each LED.
LED's are not like normal light bulbs, if you feed them with "unlimited" current (everything more than 20mAh for most LED's) they will burn out. You have to use a resistor to limit the current. It is not complicated, but a little bit different than you thought... Don't stop with a drawback, now you learned something so on to the next step :)

Return to “Other projects”