-
Finally resuming work
06/28/2015 at 19:48 • 0 commentsMy old alarm clock is now pretty much completely broken, giving me a lot more motivation to work on this project. It also has a DHT22 mounted on the display, using the last remaining wire on the 10 way ribbon cable connecting it to the controller.
It's now actually in use, and while the "alarm" part doesn't quite work yet, it does report the time, temperature, humidity, date, acts as a bedside lamp and of course it still plays tetris.
I've moved the interface around a bit:
What it displays from top to bottom:
- AM/PM and seconds
- separator
- Hour and Minute
- Separator
- Month (word) and day of month
- Day of week and month(number)
- blank
- blank
- blank
- Humidity (%)
- Temperature (Celcius)
- Apparent Temperature (Celsius)
The wires are also hot-glued in place to survive better.
Knowing the temperature is very useful so that when I get out of bed I know exactly to what extent I will freeze to death.
The DHT library needed some modification, because it takes about half a second to get data back from the DHT, and interrupts need to be disabled. Without being updated regularly, the display just goes completely blank, so I replaced any delays in the library with a custom delay function that ran the update display method until the right amount of time had passed, and that worked suprisingly well.
There is a big problem however. One of the connection seems to come loose overnight, and effects the shift register's data signal causing the display to go haywire. This never happens in the day for the week I've been running it, but very consistently at night, so I presume it's got something to do with the very low temperatures. Pressing on the wire fixes it for the day, but that's clearly not a permanent solution. I'll see if I can resolder the faulty connection, which might be a bit difficult as the connection has hot glue over it.
-
System design
08/20/2014 at 18:22 • 0 commentsFor some reason, hackaday projects likes to crop my images, so the left and right bits of my system design is cut off.
The connection to the left leads to the RTC, and on the right of the Pi is an Ethernet connection to a router. Not much.
"Internal sensors" simply refer to a thermometer and humidity sensor at the moment. The RTC could probably fall under this category as well. The sensors will be used so the user can see how cold they will be when they leave their cozy bed. Whether knowing this information is a good or bad thing is up to you :)
The 7 segment display connection is basically a standard 10 way ribbon cable, with pins for power, ground, clock+data+update output for the shift registers controlling the columns, and 4 wires for the 4 bits of the column selection. The final wire is currently unused, but will probably be another ground.
All the other lights (RGB channels for the rotary encoder, and the 2 switch LEDs) are wired to PWM pins so they can be dimmed or pulsed. The rest of the wiring is pretty obvious.
-
Component choice
08/20/2014 at 18:14 • 0 commentsRight now, the prototype is not suitable for a production run with its current components. The display is actually an exchange rate sign from a bank and the main controller is a rather expensive Arduino Mega.
I used the mega mostly for future proofing and because my Uno was in use for another project, but an ATMega328 has enough pins to control all the needed components.
The exchange rate sign is basically a matrix of 7 segment displays. Shift registers on the left for the rows and a 4 bit decoder and some transistors to drive the columns. It’s pretty simple to replicate. However, the display is pretty big, both in size and in digit count. A production version’s display might be a little smaller.
-
Operation at night
08/20/2014 at 18:12 • 0 commentsOne thing that needs to be considered with something like this is what it’s going to be doing at night. The display can’t stay on all night on full brightness for people who can’t sleep in a lit room. There’s also the fact that it wastes electricity.
I wanted to do PWM control of the display, but because of how the addressing system works this isn’t easy. You can, however, do PWM when there’s only one column on.
When the display is in its standby state, it will show the time, vertically, on one of the middle columns. The rotary encoder controls the brightness of the display. Pressing the rotary encoder could perhaps temporarily enable the screen so you can see all the details for as long as its pressed down.
-
The Raspberry Pi
08/20/2014 at 18:12 • 0 commentsThe clock has an RTC built in, so it doesn’t need the Raspberry Pi to operate. It will, of course, be capable of a lot more when the Pi is connected, as it relies on the Pi for the current time and anything internet related.
The Pi will probably consume quite a bit of power too. Perhaps the clock could control the Pi with a relay, and start it up half an hour prior to the alarm going off so it has time to boot and so it can fetch the latest weather forecast to show the User when he/she finally wakes up. This would remove the ability to have real-time notifications though.
It doesn’t need to be a Raspberry Pi, by the way. The communication program is written in Java, so any computer with a USB or Serial port, an internet connection and Java can be used, for example an old laptop.
-
Protocols
08/20/2014 at 18:11 • 0 commentsA lot of communication needs to happen in this project, obviously; otherwise it won’t be a connected project.
The main communication will be between the Arduino Mega and the Raspberry Pi. The Mega would request data from the Pi through its USB Serial connection to a Java program on the Pi, which responds with the appropriate data. The Pi would never send data to the Mega without notice, though the Mega might periodically request for any new notifications.
The Java program on the Pi would then in turn communicate with servers on the Internet to get the exact current time and weather information, or any other relevant information. This is where I’m struggling: I can’t seem to find a working Java weather forecast API, or at least one that works for me. I’m sure I can find one eventually.
-
Component choice
08/20/2014 at 18:11 • 0 commentsRight now, the prototype is not suitable for a production run with its current components. The display is actually an exchange rate sign from a bank and the main controller is a rather expensive Arduino Mega.
I used the mega mostly for future proofing and because my Uno was in use for another project, but an ATMega328 has enough pins to control all the needed components.
The exchange rate sign is basically a matrix of 7 segment displays. Shift registers on the left for the rows and a 4 bit decoder and some transistors to drive the columns. It’s pretty simple to replicate. However, the display is pretty big, both in size and in digit count. A production version’s display might be a little smaller.