Today we’ll be taking a quick look at the Netcomm NB6 Rev2 ADSL2+ Modem Router which has a date code of 2010/28th week. It’s an entry level modem/router which can also connect via USB which is how ADSL modems used to connect back in the day.
The usual 4 screws later and we’re in.
There are 4 additional screws holding the board down however they are positioned right on the outside of the board which could mean they didn’t have much space on the board. All electrolytic capacitors on board are branded Lelon.
From our last part we looked at testing the idea with the EPM240 board, in this part we’ll switch over to the EPM3064 CPLD to move away from the development board.
The Altera EPM3064ALC44-10N is a low cost 100MHz CPLD for $3 in a PLCC 44pin package with 64 LEs and 34 usable pins. The oscillator I’m using is 50MHz which I pulled from another board and all we need is to connect it to VCC, pull it’s enable pin high and that’s it. I was curious about how much current it consumed, it was about 13-15mA.
We can connect our USB Blaster to our CPLD by connecting up the 4 wires, TCK to TCK, TDI to TDI, TDO to TDO and TMS to TMS; as you can see you don’t connect them together like you do for the MISO of one device the MOSI of the other.
From our last post, we connected 4 hard drives with SATA to USB controllers to our Raspberry Pi with an LCD and were able to assemble our RAID5 array. Now we’ll be looking into putting it together into the Netgear ReadyNAS enclosure, powering on/off with a relay, temperature monitoring, backup/activity LEDs, and so on.
(sneak peak of the NAS4Pi built)
Relay for power switch, RPi power off and temperature monitoring of mosfets
To be able to switch on and off the NAS4Pi, I’ve hooked up a relay which is using ATtiny25 that switches on the SMPS. The only issue is that we need to give the relay 5V at 80mA, so I’ve just put on a LM7805 with a heatsink to power the ATtiny and relay and it’s temperature hovers around 50C or so. One thing I didn’t notice with relays initially was that you should have a diode connected up to the coil because otherwise when you switch off the relay you’ll have some backEMF.
When we’d like to switch off the RPi, we shouldn’t just switch the power off at any time instead we’ll use a power off line which when it goes high will tell the RPi to shutdown and we will wait about half a minute for it to shutdown before switching the relay off.
From our previous post, we took on the task to build our own alarm system and have the PIR, door sensor and some of the server code built. In this part we’ll add the remote and look at some attempted improvements.
(sneak peak of remote, PIR, siren and server all working together)
For the remote control, all that’s required is two buttons for alarm on and off plus an LED to show when the button is pressed.
// Increment our 256bit random number
// Generate the random block (160 bit) using SHA1 from our random number
// Set data_out to say we are a remote control
// Check in the with server
// On or off?
// Generate the new rc code to use and generate the SHA1 block (160 bit) from our rc code
sha1(data_out,rc_code,128);// SHA1 of our rolling code
// Transmit a few times to ensure the server gets it
We can use the same PIR code to send a random SHA1 block, receive the rolling code addition which will be 32bit this time to cover switching the on/off alarm a lot of times and then we’ll quickly send the rolling code a few times.
After seeing a few solar garden lights as a quick project I decided to make my own version using the ATtiny13A so it can be low cost but have decent functionality. I didn’t an RGB LED so I went with red, green and yellow LEDs and in terms of the solar panel I have a 4V 50mA one.
(sneak peak of the end result)
My first initial thought was to use a Lipoly battery to power everything, use a diode with the solar panel to recharge the battery with an LDO to 3.7-3.9V if needed. My main concern is leaving the Lipoly outside and it heating up quite a lot so I’ve decided to go with AA batteries.
After a few iterations of the design, I went with 3x AA batteries to be recharged and the charging will be switched on using a PNP transistor, I’m going for 1.4V per AA battery. Originally I wanted to go with a N or P mosfet however since the Vds would be less than 1V so it wouldn’t be able to switch on. One unintended feature of the PNP design in this case is that it’ll automatically charge up the 3x AA batteries if they are 0.6V lower than the solar panel.
As part of my CPLD Logic Analyser project, I might want to easily adjust the clock and since the CPLD that I’m using doesn’t have a PLL module, we’ll have to buy our own clock generator.
The Cypress CY22150 chip allows you to generate a clock up to 200MHz from a 8-30 MHz crystal using I2C and has multiple outputs / clock dividers. For the price of $2.77 it’s not too bad and for me was actually cheaper than buying a 100MHz crystal from my supplier.
There are a few settings we need to configure – the crystal frequency, crystal capacitors, which outputs to enable and clock multipliers and dividers. This may seem a bit complex at first but Cypress have made a CyberClocks program that can assist us with these settings.
I have a 16MHz crystal, so we enter that on the top left. The VCO is given to us in another section of this program (Option > VCO Calculator) as shown below, I enter in the Reference as the crystal and desired clock as 133MHz.
The main feature is that you can now add some male headers and convert it into an Arduino shield so you can program your ATtiny with your Arduino if you don’t have a dedicated programmer.
I’ve added another LED for the MISO so if this LED lights it means that your ATtiny is able to communicate with your programmer. Another small improvement was to move the 6 and 10 pin headers a bit more apart so that you can fit in IDC socket connectors.
It’s retro teardown time, today we’ll be taking a look at a game called Galaxian 2 made by Futuretronics which was build in 1981 so we’ve had this around for a long time. You can either play single player or with someone who controls the alien ships.
We used to have a joystick mounted for easier control on the single player controls. For anyone who owns one of these games you might notice a potentiometer near the second player’s controls, this was a modification that one of my relatives made to it to increase or decrease the game speed; and I always thought it that this game had that feature by default! It takes 4x C batteries, has a DC jack too and of course is missing it’s battery cover.
Here’s a video of me playing the game and listening to the game over music.
Previously I made a ATtiny GPS Long Lat logger to record the GPS co-ordinates to an EEPROM and now it’s time to implement the full functionality of my project which is to check an accelerometer for motion, monitor the GPS until we are in a certain area and then send an SMS. If it’s a few KM away from the area, then it’ll turn the GPS off for a few minutes and check again later but if it’s close to the area, it will keep checking the GPS as long as movement is detected within 1 minute.
I was using the ATtiny2313 before however it didn’t have any ADCs so I’ve switched to the ATmega88 which is approximately the same price. To reduce power I have a mosfet for the accelerometer, GPS and mobile phone. The mobile I’m using this time is the Nokia 3210 which cost me $22 from Ebay, the battery seemed to discharge after a couple of days so I was trying out different options.
// Reset PC6 1|o |28 PC5 N Mosfet for MMA7361 accelerometer
// RX GPS PD0 2| |27 PC4 N Mosfet for GPS
// TX SMS PD1 3| |26 PC3 N Mosfet for Nokia 3120
// PD2 4| |25 PC2 X Axis
// PD3 5| |24 PC1 Y Axis
// PD4 6| |23 PC0 Z Axis
// VCC 7| |22 GND
// GND 8| |21 AREF
// XTAL PB6 9| |20 AVCC
// XTAL PB7 10| |19 PB5 SCK
// PD5 11| |18 PB4 MISO
// PD6 12| |17 PB3 MOSI
// PD7 13| |16 PB2 Optoisolator for Nokia 3120 power button
// PB0 14| |15 PB1 LED
The Nokia 3210 seems to power up from ~2.3V to 3.4V, so one option is to try a 3.7V Li-ion with a diode to drop it however after some experimentation it switches only stays on for a few seconds.