Feed on
Posts
Comments

As the nRF24L01 modules are so cheap I bought quite a lot of them and have been thinking about networking them together. I have the idea of using nRF24 to be able to find out which other nRF24’s are around then then eventually be able to forward traffic for one another if it can’t communicate with a nRF24 that may be too far away but that’s an idea for later on.

IMG_2984

The nRF24L01 allows for up to 6 receive addresses but I want to make this much higher so the way I decided to do this was through software and it would allow for up to 255 addresses. It would use all 32 bytes of data that we can send and its format is:

  • From address (byte 0)
  • To address (byte 1) – address 0 means it’s for everyone
  • Forward address (byte 2) – 0 means it’s a normal packet, 1-255 means to forward it to the address
  • Acknowledgement (byte 3) – 0 means no ack is needed, 1 means ack is needed back, 2 is the ack to send back, 3 is the ack to send back when forward is complete
  • Data (byte 4 to 31)

Here’s an example of how it would look:

FROM    TO    FWD    ACK    DATA
1       2     0      1      12345
2       1     0      2      

(more…)

Read Full Post »

A downside of the AT Mini Matrix Ctrl is that if you have your animation only playing a few times an hour that you are very likely to miss it. You could have it running every minute for a specific time but it’s not that great if no one is there to see it.

IMG_2975

The solution to this is to use a PIR module (H8157 on Ebay) to detect if someone is around. The problem is that the PIR module is quite large compared to the led matrix so it would look out of place.

I started looking at IR transmitters/receivers and using them to reflect off a surface which would detect if someone was there however to have decent accuracy you really needed to use quite a bit of current which isn’t what I wanted. So back to square one, what can we do with the PIR module?

atmmc5-3

After researching the PIR sensors themselves, some datasheets (above is a random datasheet I found) said that they already had some noise reduction and some had application examples. The PIR sensors themselves can cost $2 or more even on Ebay which was odd as the PIR module was about $2 itself.

(more…)

Read Full Post »

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.

(more…)

Read Full Post »

AT Mini Matrix Ctrl updated to v0.4

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

https://www.youtube.com/watch?v=4Qi4KpzdbCY

#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.

(more…)

Read Full Post »

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.

(more…)

Read Full Post »

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.

(more…)

Read Full Post »

How to use I2C Digital Potentiometers

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.

(more…)

Read Full Post »

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 & 0x01) and now it all works together just fine.

(more…)

Read Full Post »

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.

(more…)

Read Full Post »

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.

Read Full Post »

« Newer Posts - Older Posts »