Feed on
Posts
Comments

I’ve been meaning to play around with accelerometers and found the MMA7361 on Ebay for $3.

IMG_2972

I checked if there was a MMA7361 library for the Arduino which there was so I tried it out but I kept receiving the same readings even if I disconnected the accelerometer from the Arduino – maybe I was doing something wrong. I briefly looked at the code and it seems they were doing a lot but the pin out of the MMA7361 made me believe it should be easy. Edit: I found there is a working example in Arduino > Sensors > ADXL3xx

mma1

I looked up the datasheet and found it’s pretty straight forward if you just want to read the x, y, z axis, a simple ADC reading of each pin should be all that we need. There is a sleep pin (SL) which puts it to sleep which makes it only draw 3uA. Some other pins include the 0g pin which goes high when all axis’s are at 0g, a self test pin (ST) and a g select pin (GS) that allows you to choose 1.5g or 6g sensitivity.

With some other accelerometers I believe you can have it pull a pin high if it detects movement but the one I got it doesn’t have that functionality – it would be very useful for battery powered designs. One thing to note is that 0g is about half of the VCC. The Z axis is only half VCC when the board vertical.

Continue Reading »

Just a small update on the AT Mini Matrix Ctrl which has now been updated to v0.4 that now allows for us to save space to store text without using animations and have the text scroll right to left. Download: AT_Mini_Matrix_Ctrl_v0.4

#define A 0
#define B 1
#define C 2
...

// Text array
prog_uchar ledLetters[26][8] PROGMEM = {
  {24,8,20,20,20,28,34,119}, // A
  {124,34,34,60,34,34,34,124}, // B
  {30,34,64,64,64,64,34,28}, // C
  ...

I’ve added a text array so we don’t have to store letters as animations.

Continue Reading »

The PCBs for the AT Mini Matrix Ctrl (new name for the AT Mini LED Matrix) have arrived!

IMG_2953

IMG_2952

After cutting up the PCB by hand, we are ready to build it. There’s a small mistake with middle PCB’s silkscreen being the wrong way round.

IMG_2958 IMG_2959

Soldered an ATmega168 with programming wires on the bottom, the 32KHz crystal, 1K SMD resistors and LED matrix on the top. There’s a small grap between the LED maxtrix and the PCB, thought it would fit right on but the 32KHz crystal must be a little too big.

Continue Reading »

When you work in IT, you see all kinds of network cables, some are labelled, some aren’t, some places I can imagine have a mess of cables so I thought how could tracing a cable be easier? I know that cable tracers exist but you have to unplug the network cable in order to trace the cable, how about making an in-line network cable tracer that you can install once and leave it there?

(sneak peak of the outcome)

My first thought was to somehow fit LEDs to existing cables and have a button which would light up the cable but this means that all network cables would need to be replaced so this isn’t suitable. So it’s time to take a look at a network cable and what we can do with it.

eth-2

From Wikipedia, we can look at the wiring scheme where we have 2 pairs of cables used for transmitting and 2 pairs of cables for receiving.

Continue Reading »

When I was placing an order for some parts I happened to find an I2C digital potentiometer (MCP4017T) on special at 4 cents each, so I bought some and now that I re-check the price they are 70 cents each.

IMG_2932

The package it comes in is a SC70-6 which is even smaller than the ATtiny10 (side by side comparison above, ATtiny85 on the right too).

Digital potentiometers can be useful if you want to change your resistance without tweaking your pot with a screwdriver, the example which I’ll be showing is adjusting the contrast on an 16×2 LCD module, it can make your project be more professional if you had it all inside a case. Another use could be an op-amp with an adjustable gain.

dpot1

There are different pot options you can go with – 5K, 10K, 50K or 100K, I went with the 10K version. With a 10K pot, you can adjust it from 0 ohms to 10K ohms in this case in 128 steps of 75 ohms.

Continue Reading »

From Part 6.5, the PIR PCBs arrived and now I’ve got all the PIR sensors (except 1) on them. When I connected up these PCBs to the PIRs I found that randomly they would go off when the alarm server had them switch on. Eventually I found that the modification I made to the broken PIR had to be made to all PIRs.

What I’m looking to do now is to see which sensors are checking in with the server which will also serve as a way to check if the 3V battery for the PIR PCB has gone flat. When the PIRs/Siren are sending their random number to check in, the last byte is 0 or 1 to say if they are a PIR or Siren.

alarmp7-1

By modifying the higher bits of the last byte to say which device it is. For example, 00000101 would mean sensor 1 has checked in.

#define SENSOR_NO 1 // 1 to 6
// Set last data_out number to 0 to indicate to the server that we are a PIR
data_out[20] = (1<<(SENSOR_NO+1));

We define our sensor number which we need to change for each PIR/Siren and then shift 1 to the appropriate place.

data_in[20] = data_in[20] & 0x01;
if (data_in[20] == SIREN_REQUEST) {

For the server we just need to ignore any of the higher bits and check the last digit only (by using & 0×01) and now it all works together just fine.

Continue Reading »

Following on from Part 1, we decided to use the ATmega48A instead of using an ATtiny with 2 shift registers and have an example animation working. In this part we’ll look at adding the 32.768KHz crystal, keeping track of the date/time and using PGM to store the LED animations.

atled-1

We plug in our 32.768KHz crystal to the XTAL/TOSC pins but before we start to use the crystal there is a start up sequence and other considerations which we need to follow that’s shown on the ATtiny48A datasheet.

// Enable the 32.768KHz crystal as a RTC
TIMSK2 = 0; // Disable the Timer/Counter2 interrupts by clearing OCIE2x and TOIE2
ASSR = (1<<AS2); // Select clock source by setting AS2 as appropriate
TCNT2 = 0;// Write new values to TCNT2, OCR2x, and TCCR2x
OCR2A = 0;
OCR2B = 0;
TCCR2A = 0;
TCCR2B = (1<<CS22) | (1<<CS21) | (1<<CS20); // 1024 prescaler for 8 seconds overflow on 32.768KHz crystal
//TCCR2B = (1<<CS22) | (1<<CS20); // 128 prescaler for 1 second overflow on 32.768KHz crystal
while ((ASSR & ((1<<TCN2UB) | (1<<OCR2AUB) | (1<<OCR2BUB) | (1<<TCR2AUB) | (1<<TCR2BUB))) != 0); // To switch to asynchronous operation: Wait for TCN2xUB, OCR2xUB, and TCR2xUB ASSR
TIFR2 = 0; // Clear the Timer/Counter2 Interrupt Flags
TIMSK2 |= (1<<TOIE2); // Enable overflow interrupt

// After a Power-up Reset or wake-up from Power-down or Standby mode, the user should be aware of the fact
// that this Oscillator might take as long as one second to stabilize
_delay_ms(1000);

sei(); // Turn on interrupts

We have our start up sequence above which I’ve made from the PDF. We select the clock source with by enabling AS2, reset all the registers and select our prescaler which I’ve chosen to give us the highest overflow of 8 seconds because exact timing isn’t that important to me and means power will be saved too – instead of waking up every second it just wakes up every 8 seconds.

Continue Reading »

The ATtiny25 Tiny Temperature Logger v1.0 has now been released.

A25TTL_v1.0_Built A25TTL_Reader_v1.0_Built

I’ve only got enough stock for a couple A25TTL’s so if there is a lot of interest I’ll order some more parts.

IMG_2917

Although since I panelised the PCBs, I had to cut them myself which took much longer than I would have thought but I’ve got lots of PCBs in stock.

You can buy the ATtiny25 Tiny Temperature Logger here.

It’s been nearly 2 years since I last worked on my Gameboy Cartridge Reader (GBCartRead) and I never released a PCB but it has been something I’ve been meaning to do for a while which I can now check off my list.

Gameboy_Cart_Shield_v1.0_Top_Built

I received the PCBs for the Gameboy Cart Shield a few days ago, soldered all the components and noticed that somewhere along the lines I didn’t connect up the VCCs together so I have a bodge wire on the bottom of the board. Something I should have done was make the silkscreen text much larger than what it current is.

Gameboy_Cart_Shield_v1.0_Bottom_Built

The Gameboy Cart Shield PCB is now available for sale.

The PIR PCBs have arrived to be used on my alarm system.

IMG_2673

It all fits in nicely, with the nRF24L01 on top of the ATtiny and the 3V battery holder on the bottom.

After testing 4 PIR boards at a time it seemed to work however after a few days of testing there seemed to be a board which would fail to connect. I connected up my logic analyser to a working PIR board and then to the one that wasn’t working after some time and below is the capture after it loads the random data to transmit.

Working PIR
p6.5-1

Not working PIR
p6.5-2

As you can see both request the status by sending 0×07 however the response is 0x2E vs 0×42 (Also notice how it sends us the reply on the same packet that we send the status request).

Continue Reading »

Older Posts »