Monday, 29 October 2012

Garden Gnome update


I presented my Gnome project the other night at a meetup and he gathered enough interest to win me a $500 gift voucher :). Seems people like the idea of a house/yard full of little wireless nodes crammed with sensors and RGB leds with the ability to respond to events. 

I I do like the idea of having pot plants change color if I get an email (different plant per email account) or a yard that glows red if someone is detected in there at night.

Monday, 22 October 2012

Projects of interest

Hi Peoples,

I have 3 projects that I am starting on but want to gauge interest levels. 
All 3 projects will be the basses for other bigger projects.
Projects 2 & 3 are the easiest as I have already done them before in concept.

Project 1 has the most potential in my mind but requires me to work with an overseas vendor with less control over the project. 


Project 1, Arduino Wifi access point shield/Cloud connected Arduino.
Backgound:
Currently you can get Wifi shields and network shields for Arduinos but the Arduino lacks the resources to use the full potential of the these, this includes full featured web pages and full network stack. 

In looking for ways to bridge my RFnodes to the internet I have played around with openWRT and using Arduino to control pocket sized Wifi routers. I have come across small Wifi device that can be used as a accesspoint or in client mode, has 1mb of web space and has a TTL UART for connecting serial devices like an Arduino. The serial port can be used to pass data back to a web service allowing you to have a cloud connected Arduino project. As it only uses the TTL RX/TX pins you have all you other pins free for you project and only requires you to include code if you want to configure the Wifi shield.
You can create web pages in the shield that would allow you to send data to Arduino project and has support for a camera, so you can even create a wifi controlled pan/tilt camera.
  
Goal: 
Bridge Arduino projects to the internet via Wifi.
Make it easier for internet controlled Arduino projects with web interfaces and support web services/cloud services.

Specs:
802.11BG router with support for AP/STA mode
TTL UART
1MB user space for web pages and scripts


Risks&issues:
Still scoping




Project 2, Arduino with H-bridge and Bluetooth

Backgound:
I am looking to make a small PCB with an Atmega88/168/328 with support for the Arduino IDE. The design will be based around the RFnode but without the radio and a 2 channel H-bridge and TTL Bluetooth UART module in its place.

The board will support 2 bidirectional motors and with Bluetooth can be paired and controlled by almost any smartphone.

So making something like a little robot tank that is controlled by your phone will be an trivial task.

Board will be programmed via USB using the V-USB, This also supports making the board act as a HID keyboard/mouse/...

Goal: 
Create a low cost small Bluetooth Arduino with onboard H-Bridge.
By creating a
standard smartphone compatible Bluetooth robot board we might get some more app developers onboard.

Specs:
+ V-USB Arduino (http://www.obdev.at/products/vusb/index.html)
+ 2 channel H-Bridge with support for 2 motors
+ Bluetooth UART module

Risks&issues:
+ Cost to assemble may make this non-economical unless can get numbers



Project 3, Low cost Atmega88 based Arduino 

Backgound:
There have been a few Attiny boards starting to popup that support the Arduino IDE. These boards use the Attiny instead of the Atmega as they are cheaper but do not have all the features of an Atmega. Not only do they not have as much Ram/Flash/Eprom but are also lacking support for some Arduino functions.

An Atmega88 is compatible with a Atmega168/328 and so the Arduino IDE but almost the same price as the Attiny. It should be possible to create a low cost Adruino clone for less then $5 worth of parts. 


Goal: 
Low cost Atmega88 Arduino board for less then $5

Specs:
+ Atmega88(6k application space)
+ V-USB Arduino (http://www.obdev.at/products/vusb/index.html)


Risks&issues:
+ SMD parts (to hard for most people to solder)
+ Cost to assemble may make this non-economical and more expensive then a full feature Arduino unless can get done in large numbers



Thursday, 11 October 2012

A smarter garden Gnome

A smarter garden Gnome.


Still a work in progress but meet one of my garden gnomes. 

I still need to print him a better case to mount the soil moisture pins better and make him more presentable in general.  


At his heart he is powered by one of my RFnodes so he is wireless and has an array of sensors that he reports on back to the network. He currently reports back the light levels, soil moisture, temperature, humidity and having a RGB led that make him glow any color I can have him signal the plants status or as being network I can use the RGB led to make him (and his friends) signal anything the network want him to.

I have some small PIR motion sensors I also want to mount as his nose and print a case that can house the bigger batteries required by the RGB led.



Thursday, 27 September 2012

Recover Arduino Sketch

How to recover an Arduino sketch from after a program crash or system crash.

I was working on some code today then after making a heap of code changes and uploading to boards I walked away from my computer without saving my Sketch. 

Due to some other things I was doing at the time Windows crashed and I had not saved my code yet. After a reboot I confirmed that my code was gone but I did not like the idea of that so went digging for it. I know the Hex file is compiled to the %temp% folder so the Sketch must be there too.

So Start>Run>%temp%

which took me to C:\Users\remote\AppData\Local\Temp\

Then I sorted the folders by date modified and then found this one was timestamped about the same time I last compiled my code.
C:\Users\remote\AppData\Local\Temp\build262859921630184205.tmp\

Opening the folder I see a few C++ files and one of them had the same name as my sketch but with a C++ extension. It was my Aduino Sketch it did have a few things added to it to make it C++ compatible (void's) but is was the code I thought I had lost. 


Tuesday, 25 September 2012

Getting ready for more Rapman upgrades


I have received more parts so soon it will be time to try some more 3D printer mods.

Besides more screws, bolts, washers, bearings and plastic I received a few more parts to use.


  • 30mm 12volt fans. One problem I have with my Rapman is that the extruder overheats and jams when printing sometimes. To overcome this issue I upgraded the part cooling fan and ducted it to cool the extruder more then the part and added a 80mm fan to the side of the printer to help cool everything. This mostly works but effect the head heat up time but helps with  part cooling(on one side). With the smaller fans installed to only the parts that need them I should be able to control the thermals better and be able to get better print quality.
  • LEDs. I am going to add some better lighting around the printhead to help the camera (as I normally leave the room lights off).
  • PTFE TEFLON Tubing. Having a 470gram stepper motor and all the extra supports for it on a printhead seems a little silly to me. I thought that a goal would be to reduce the printheads mass so you don't have to counter/fight as much inertia. So if I mount the fillament feed away from the printhead I and feed the fillament to the printhead via the PTFE tube I should be able to have a printhead that is less then 30% it's current mass. This will allow me to improve the movement speeds of the printhead while reducing the power required to move it and reduce the strain/wobble from the printhead's inertia.
  • New hotend. The hotend on the Rapman comes sealed in fire cement, on my printhead it is crumbling and leaving what looks like sand everywhere.  It is about time for me to replace. I have resurrected the old printhead a few time already but as the resurrections are becoming more involved and makeshift I am expecting it to soon hit a point where I just need to let it die in peace. After it dies I might use it to recycle my waste PLA back into fillament.       
It is now getting to a point where I can almost make a whole new printer, so that might be were this project ends up. I think it should be easy to make a lowcost PLA 3D printer that is a fraction of the price of the current 3D printers available. By limiting it to PLA and dropping the printhead mass you should be able to lower the stepper motor size and power requirement which would allow you to use smaller motors and motor drivers so you could use lower cost of everything leaving you with a smaller cheaper 3D printer.  

Saturday, 22 September 2012

Tinkercad Gnome


I recently discovered https://tinkercad.com.

A very user friendly online CAD application that allows you to quickly design 3D objects and download them as STL files ready for 3D printing. 


Here is a Gnome I created in just a few minutes.
https://tinkercad.com/things/9NMMuTF6O3s-gnome


and here is him after I printed.

The Tinkercad UI is very straight forward and basic and only takes a few minutes to learn and master.


Now for the next step of adding RFnodes to them to create my Gnome army









3D Printer setup

I have upgraded my 3D printer setup.

Now instead of him sitting on a cardboard box he has his own rack and I can have the spools of plastic hanging above him (need to get more plastics to fill the space) 


I have also added one of the routers with openWRT, some LEDs for lighting and a Logitech c270 HD webcam so I can remotely keep an eye on him.  

I am in the process of upgrading his printhead to support better cooling for the extruder and printed part also will have a few built in lights and maybe a small camera.

Once I get my Makibox printer I might have to expand the setup even more.




Wireless mesh-able RGB lights and a ATMEGA88


I thought I might test out using the Atmega88p-20au instead of the Atmega168 as a processor for my RFnode. The Atmega88 is a cheaper version of the Atmega168 with only half the flash. 

I had tried using a Atmega8 before but found it did not run too stable at 3.3volts which I need to do to support USB. The Atmega8 datasheet said it  needs 4.5 - 5.5 volts but I was going to give it a go anyway, It did work but I found that about 1 in 5 times I when flashing it I would get an error and would have to retry.


Reading the datasheet the Atmega88 is identical to the Atmega168 with the main differences being just the amount of flash/ram. So hardware wise I did not need to make any changes except the IC but from a software side I did have to change my code a fair amount to get it down to 6KB. The Atmega does have 8KB of flash but I am using 2KB of that for the bootloader.  

After removing all the sleep/watchdog functions and cutting back the meshing support I was able to get my code to less then 6KB and still be left with a wireless mesh-able RGB light with a just enough code space left to added a few basic sensors. 

This version of the board I made it easier to add a STA301A so it would be easy for me use this board to drive brighter and more power hungry lights or devices around the home and have them all wirelessly controllable from my tablet/phone. 

Friday, 14 September 2012

Burningman wireless bike lights

Some good friends of mine wanted some bike lights for Burning man this year, but did not want just bike lights. 

RGB wireless bike light

So I created them wireless bike lights that beep and flash like a car alarm arming/disarming. When in the on mode the head light is on and a string of LED will pulse allowing them to see and be seen.
  




For the electronics I used one of my Arduino based RFnode as a base but to drive the power hungry LEDs I used a STA301A connected to 3 of the PWM pins of the ATmega168. This allowed me to drive 3 strings of LEDs with PWM support. 


I got a little creative and limited by space and time I mounted the STA301A to the RFnode with some hot glue and mounted surface mount resistors directly to the pins of the IC. Most of the wiring was air wiring as I did not have time to get a customer board fabricated.

For the radio instead of using the nRF24l01+ I found some small key finder fobs that can stay powered from a coin cell battery for months so decided to use them as I could get the power consumption down to less then 1mAh when in sleep mode.   



I was in a bit of a rush to get the units finished before Burningman so I don't have any pictures of the hardware jammed back into the bike light casing and the extra wiring of the LEDs yet. I might add that one they get back.

Tuesday, 21 August 2012

OpenWRT Mjpg_streamer saving to file


By default when you use the file output plugin with mjpg_streamer you can not set the file name just the folder. So what will happen is that folder will quickly fill with time stamped for name picture files. This could be what you want but this is not what I wanted. I wanted a single file in the web server root so I could include it in the web interface.

There are 2 main steps to achieve this. 

  1. Create a shell script that move the snapshot to the web server root(/www/video0.jpg)  
  2. Change the mjpg-streamer service to output snapshot to file and execute shell script to move snapshot


Step 1. The shell script.
This just moves the snapshot to "/www/video0.jpg". The -f is to force overwrite. I called the script "mjpg_save" and saved it to "/usr/bin/


#!/bin/sh
mv -f "$1" '/www/video0.jpg'

don't forget to chmod +x the script



Step 2. Update the service.
You need to edit "/etc/init.d/mjpg-streameradding "\ --output "output_file.so -c /usr/bin/mjpg_save -d 1500" as per below. 
The "-d 1500" is the delay between saving in ms so 1500 = 1.5 seconds. If you have this set too low mjpg-streamer will not get a chance to finish saving this before starting to save the next picture over it leading to corrupt images.  


root@OpenWrt:/etc/init.d# vi mjpg-streamer

#!/bin/sh /etc/rc.common

# Copyright (C) 2009-2011 OpenWrt.org

START=50

SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1

PROG=/usr/bin/mjpg_streamer

error() {
        echo "${initscript}:" "$@" 1>&2
}

section_enabled() {
        config_get_bool enabled "$1" 'enabled' 0
        [ $enabled -gt 0 ]
}

start_instance() {
        local s="$1"

        section_enabled "$s" || return 1

        config_get device "$s" 'device'
        config_get resolution "$s" 'resolution'
        config_get fps "$s" 'fps'
        config_get port "$s" 'port'

        [ -c "$device" ] || {
                error "device '$device' does not exist"
                return 1
        }

        service_start /usr/bin/mjpg_streamer --input "input_uvc.so \
                --device $device --fps $fps --resolution $resolution" \
                --output "output_http.so --port $port" \
                --output "output_file.so -c /usr/bin/mjpg_save -d 1500"
}

stop_instance() {
        local s="$1"

        section_enabled "$s" || return 1

        service_stop /usr/bin/mjpg_streamer
}

start() {
        config_load 'mjpg-streamer'
        config_foreach start_instance 'mjpg-streamer'
}

stop() {
        config_load 'mjpg-streamer'
        config_foreach stop_instance 'mjpg-streamer'
}


If all when well you should be able to access the screenshot from a remote computer using http://routerip/video0.jpg


Monday, 20 August 2012

RFnode 1.3

I received some of the PCBs for the new version of my RFnode so I spent a little time today soldering it all together and testing it out. 

This version of the board has following features.

+RGB led (on PWM pins D5, D6, D10) now can make any color.
+CR2032 lithium coin battery powered or USB powered
+Power selector switch to select between USB power and battery(CR2032)
+USnooBie compatible (http://www.frank-zhao.com/usnoobie/
+Programmable via mini USB port (USBISP) and supports the Arduino IDE (USnooBie bootloader)
+nRF24L01+ 2.4Ghz radio transceiver 
+3.3 Volts @ 12Mhz (onboard voltage regulator)
+Breadboard friendly if you add the header (even mini breadboard)
+Only 46x24mm board size 
+SMD parts (to keep testing my soldering skills)


All assembled with radio and breadboard header, ready to go 


With CR2032 battery 

In mini breadboard, without radio attached

OpenWRT mjpg streamer with more then one camera


The Documentation for mjpg streamer in OpenWRT is very light for information and finding information for the /etc/config/mjpg-streamer file is almost impossible.

So I decided to add some of my notes.
One of the great things I have found with mjpg_streamer is that it can support many cameras I have tested 3 Logitech C270 and will be testing more when I get a bigger USB hub.
To setup mjpg_streamer for the second camera you need to change the device from "video0" to "video1" then for the third camera same again change "video1" to "video2"

Running multiple cameras is not supported by the default service/config so you ether need to edit /etc/init.d/mjpg-streamer to support the extra settings or run mjpg_streamer from the command line


Below is the command line I am using.
mjpg_streamer --input "input_uvc.so --device /dev/video0 --fps 3 --resolution 720x350 --output "output_http.so --port 8080" 


mjpg_streamer --input "input_uvc.so --device /dev/video1 --fps 3 --resolution 720x350 --output "output_http.so --port 8081" 

mjpg_streamer --input "input_uvc.so --device /dev/video2 --fps 3 --resolution 720x350 --output "output_http.so --port 8082" 

I have found that if you put too much load on the processor you get a lot of garbled frames. So if you are using 1280x720 I recommend you don't have a frame rate of 15fps but something low like 1-5fps. You can even mix them up so on one of the robots I am building he has one camera with a low resolution high frame rate and a second camera with a high resolution low frame rate.

  

Friday, 17 August 2012

Now printing with platic

Just purchased an old Rapman that needed a little work from someone in Sydney for a good price. It was kind an impulse buy, I have ordered and have been waiting for a Makibox for a few months(http://www.makible.com/products/makibox-a6-1) but one of the guys called me and asked if I wanted it.  


So I introduce my first PLA testprint. I call him Wobot, took about 5 mins to design in Google Sketchup and takes about 40mins to print.


Wobot in Google Sketchup
Wobot printing


Wobot printed and cleaned up a little, accidently broke his teeth out while cleaning


Before printing with PLA I did try printing with ABS but as I don't have a heated bed I get bad warping and the print quality does not look as good.


Very first print, A happy/sad coin




Here are some of the ABS parts I printed before I got the PLA.

Tuesday, 24 July 2012

Connecting an Arduino Uno to OpenWRT Part2


More OpenWRT progress and a few more issues resolved.

One of the issues I run into was the microSD cards becoming write protected. Even after removing the cards they were write protected on every other device I tried to connect then too. With full size SD cards there was a small switch to enable write protect but not with the microSD cards. I did read a few tricks like using a microSD to SD card adapter then disabling the write protect and formatting the cards but this did not work for me. Not wanting to run into this issue again I have just replaced the microSD cards with USB memory sticks.

Installing OpenWRT to a MR3020n.
Ok I have reinstalled openWRT a few times now and almost have it down to a fine art. This is not a full walk through but the key steps to get openWRT installed and working with a USB memory device. I did connect a TTL serial cable to the router so I did not have to play around with the networking side of things too much.
  1. Format the USB drive with the EXT2 file system, under Windows you can use Free EaseUS® Partition Master 9.1.1 Home Edition
  2. Flash the base image to the router. You can use the web interface to upload the firmware update of if you have a console and the router connected to the web you can use these two commands 
    wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin

    mtd -r write *mr3020*.bin firmware
  3. Now after the router reboots it will have the IP of 192.168.1.1
    before able to SSH to the router you will need to Telnet to it and using the passwd command set a password.
  4. Configure the network settings. You will need to edit /etc/config/network using vi to match the settings of your network. For me that is just enable DHCP so the settings will look this 

     config interface 'loopback'
       
         option ifname 'lo' 
         
         option proto 'static'
         option ipaddr '127.0.0.1' 
         option netmask '255.0.0.0'

     config interface 'lan'
         option ifname 'eth0'
         option type 'bridge'
     
         option proto 'dhcp'
  5. Now you need to reboot and reconnect using the new settings. If using the DHCP and you are not sure what IP the router has you can connect to your DHCP server for the lease details. I cheated and just used the serial console.
  6. Now we need to start installing support for the USB drive and filesystem. We want to install as little as possible until we have the USB driver mounted.

    opkg update

    This will download a list installable packages and needs to be done after every reboot.

    opkg install kmod-usb-storage block-mount kmod-fs-ext4

    This will download a list install the minimum kernel drivers and dependencies.

     
  7. Now to setup the overlay we need to copy the existing overlay files across. So we need to use the following commands

    mkdir /mnt/usb

    So we have somewhere to mount the drive

    mount -t ext2 /dev/sda1 /mnt/usb -o rw,sync

    To mount the drive

    tar -C /overlay -cvf - . | tar -C /mnt/usb -xf -

    To copy the data across


    Now to update fstab to use the sda1 as the overlay 
    vi /etc/config/fstab

    and should look like this
    config mount
            option target        /overlay
            option device        /dev/sda1
            option fstype        ext2
            option options       rw,sync
            option enabled       1
            option enabled_fsck  0


    Now reboot
  8. If all when well if you df -h you should see that you have gone from just a few KB of free space to a few GB of space. Now we can install anything we want and not have to worry about space. So for most people the first thing to do is install and setup the web interface. Just type the following commands

    opkg updateopkg install luci/etc/init.d/uhttpd enable/etc/init.d/uhttpd start
    Now you should be able to open the web interface of the router.
  9. To install a webcam (Logitech c270) use the following command

    opkg install kmod-video-core kmod-video-uvc mjpg-streamer
    This will install the uvc camera driver which is supported by many different webcams and it will install mjpg-streamer which will allow you to stream the webcam.
    To get mjpg-streamer start automatically you need to enable the service ether in the web interface or by running

    /etc/init.d/mjpg-streamer enable


    You may also want to edit

    /etc/config/mjpg-streamer

    I found that some resolutions like the default 640x480@5fps showed a lot of JPG corruption so I tried a few other resolutions and found 1280x720 worked nice but ended up settling on 720x350@10fps

    After editing the settings you will need to stop/start/restart the service for the new settings to take effect
    /etc/init.d/mjpg-streamer stop
    /etc/init.d/mjpg-streamer start

    You should be able to view the webcam via 
    http://%routerIP%:8080/?action=stream
    http://%routerIP%:8080/?action=snapshot

Thursday, 19 July 2012

Connecting an Arduino Uno to OpenWRT


IMAG0375.jpg

Connection an Arduino Uno to TPlink mr3020n running OpenWRT.

After about a days of playing around with OpenWRT I have finally have it communicating with an Arduino Uno. 
The process is too complex to put into a single post so I will have to break the process up into small steps/posts. 
The process requires you to know your way around vi/vim as the base openWRT images do not have a webserver installed. I high recommend you use a usb-ttl serial adapter to connect to the serial console of the router during the process. 

There are also a few things to watch out for,

  1. The wireless and wireless nic has the same MAC address. Don't use both at the same time to connect to the same access point. Your DHCP server does not like this.
  2. After flashing the openWRT image the default IP address is 192.168.1.1 with not gateway set and until there is a root password set there is no SSH. So you need to telnet into the router and set a password and using vi change the network settings in /etc/config/network      
  3. Only 4MB flash. The router is very tight on space. After flashing the openWRT you have only 1.2MB of space free and this disappears quickly. To get more space you need to add a something like a USB flash drive. But by the time you have installed the USB drivers, Filesystem drivers and web interface you are down to less the 150k. I recommend you format the drive as EXT2 and set it up as extroot as the first thing you do otherwise you will be out of space before you have even finished installing your basic drivers. Note that if you get down to less then 100k programs like vi will not let you save changes so try and keep as much flash free. After setting up the USB storage you can then go on installing things like Python and anything else until your heart is content (or until you run out of space on your USB drive)  
  4. Arduino Uno uses usb-cdc so install kmod-usb-acm. The Uno will be detected and mounted as /dev/ttyACM0
    The older Arduino boards with FTDI chips require kmod-usb-serial-ftdi and will be detected and mounted as /dev/ttyUSB0 
    I was having a lot of issues using /dev/ttyACM0 like a serial port so piping data to it does not appear to work too well but if you install socat you can bind a TCP port to it using the following command
    socat tcp-l:1234,reuseaddr,fork file:/dev/ttyAMC0,nonblock,raw,echo=0,waitlock=/var/run/tty,b9600
    After binding a TCP port you can use a loopback connect or a remote telnet connection to port 1234 to communicate to your Arduino.  



Friday, 6 July 2012

RFnodes v1.0 + Bluetooth + Solarbattery

RFnode with Bluetooth and solar battery attached. 
Just a quick post to show a Bluetooth module connected and powered by a solar battery.
What you can't see is that it is connected to my tablet via Bluetooth (only a serial console over Bluetooth)

RFnode 1.2b PCB update



RFnode PCB version 1.2b almost ready for printing and have made many changes with this version (and a few more to come).

Major changes so far:


  • Added SDcard slot for storage on the under side. This will allow the RFnode to be used as a data logger. The problem with SDcard slot is that takes up a large chunk of PCB space and the SDcard libraries take up a lot of programming space so if using a Atmega168 you need to keep a close eye on your program size.
  • Replace Red&Green LEDs with a RGB LED. This opens up the full spectrum of colors. This also means I loose 3 analog I/Os but gain 2 digital I/Os. This leaves me with -3 Analog I/Os (includes 2 for i2c bus)
    -6 Digital I/Os (Includes 2 for serial and 1 for SDcard if used)
  • Breadboard friendly pin header. Now all of the I/Os are on a single 11pin breadboard friendly header. The boards were going to be just for another project I am working but have decided to open it up a little. So that means making the board more general purpose and Arduino hacker friendly.  
  • Better power consumption. I ended up caving in and adding a switch to select power source. It seemed to be the most simplest and cost effective solution to the power consumption issue I was having with the power regulator.
  • Optional pull up resistor pads added for D6 & D8. Makes it easy to add 1wire digital sensors like the DHT11 & DHT22 temperature and humidity sensors.    

Future Changes:
The board still has room to grow so there are some more changes to come.


  • Size. The board has grown a little in this version while I sort out and move features around but is still only approximately 45mm X 35mm. Most of that space is due to connectors and a few parts.
  • Lithium ion support. Looking to add a charge and protection circuitry for Lithium ion battery packs. Looks like a MCP73831T could handle the charging of the battery but now need to source the cut off protection side of things to protect the battery voltage from dropping too low. The problem with this I am running into is cost. It is cheaper to but a phone battery that has this built in then it is to buy the circuit by it's self. Currently I do lithium ion battery protection via software were the software will check the battery voltage then if it is too low will go to sleep (but still consumes a little less then 0.1mAh) 
  • More I/Os. The Radio uses 6 digital I/Os and the RGB LED uses 3 analog I/Os. Then if Using SDcard, serial and i2c bus you only get left with about 4 I/Os so I want to add more I/Os. I know there are chips that allow using the i2c bus to give you an extra few I/Os but I am thinking about something a little more powerful then one of these guys. I am thinking about adding a whole second processor. If I add a second Atmega168/328 I could off load all of the sensor work to the second processor leaving the first processor to handle the communications (USB, Radio, SDcard, RGB LED) then the second processor to handle everything else with almost all of his I/Os (13 digital and 4 Analog).
  • More memory. One of the problems I ran into with creating a meshing protocol with the RFnode beside battery life was lack of memory, routing tables take a lot of space. I did come up with a few memory tricks like creating a u_int8[256] array using the index as the remote RFnode ID then the value being where to address the packet so the next node can follow the same process and pass it on. This allowed to have a routing table of less then 256 nodes in 256bytes of memory. With a Atmega168 this is still about 25% of ram of 50% of EEPROM space and does not leave much space for routing data like number of hops and route health but still possible.
    So to fix the memory issue I am thinking about adding a i2c based ram/flash chip. This will also allow data logging without using the SDcard. 

RFnodes v1.1

RFnode PCB v1.1a
This version of the PCB I move some of the pins around to makes the unit more compact. As the boards normally take 3-4 weeks from time of ordering to arriving I ordered these boards before I had received and tested the Version 1.0 PCBs so had many of the same issues  


Assembled board with DHT11 temperature/humidity sensor attached

AMS1117 power consumption work around.
As a workaround to the AMS1117 power consumption issue I tried adding a diode that helped but only helped by dropped by about 70% and introduced a new issue of voltage drop from the voltage regulator dropping the voltage from 3.3 volts to 2.6 volts. USB still works and the board operates fine but not a long term fix.


I am trying to keep the board as user simple as possible so did not want to add switches. I also want to keep the board cost low so didn't want start adding item that would raise the cost too much (p-channel mosfets









RFnodes v1.0

RFnode v1.0
Time for a second post. This time with pictures.

These little guys are the Version 1.0 RFnodes I was working on, These were the first version I designed so expected a few issues. It is all part of my self inflicted crash coarse into PCB design and SMD (surface mount). This board is a few weeks old now and I have moved on to better designs since. 

The good
  • They are Arduino based (Atmega328/168) 
  • V-USB bootloader (same as USnooBie) http://www.frank-zhao.com/usnoobie/index.php
  • Runs at 12Mhz @ 3.3volts with onboard voltage regulator (AMS1117 3.3)
  • USB or 3 volt coin cell powered (CR2032) 
  • The PCB is designed by me from the ground up (printed in china)
  • Compatible with the USnooBie (as I own a few of them too and over time have found them easier to work with then many Arduinos)
  • Supports V-USB http://www.obdev.at/products/vusb/index.html
  • Uses nRF24L01+ 2.4Ghz radio 
  • Mostly SMD parts (and all soldered by hand) 
  • Some parts not SMD so I could change the sides if I wanted
  • 4 digital IOs (2 used for serial)
  • 6 Analog IOs (2 used for I2C)
  • 2 LEDS (Red/Green) 
  • ISP Header (only used for loading bootloader or adding another SPI device)
  • Can consume <0.1mAh in sleepmode and about 0.5mAh idle (read below)
     
 The Bad
  • The Radio overhang. This was done on purpose for this version of the board so the antenna is free from interference from the main board. After a bit of testing I decided I did not need to position the radio in such a way. 
  • SMD pad sizes. As I am a little new to SMD parts and their required pad sizes on the PCB some of my pads where too small for the part. Well it was only one part, The main power capacitor which I ended up just soldering to the voltage regulator pins.
  • Silk screen. Not all of the silk screen was printed or was too small or mostly off the edge of the board after cutting.   
  • Power consumption. Board was consuming about 17.5mAh so a CR2032 would only last about 6 hours which is less then the maths that said I should be able to get up to about 5 months. Issue turned out to being the AMS1117 power regulator would still consume about 4mAh if power was connected to it's output. I thought it was only meant to consume power if connected to input only. I also found that the radio was consuming about 13.5mAh when idle in RX mode. So after disconnecting the voltage regulator and powering down the radio when not in use I can the power consumption to less then 0.3mAh and less then 0.1mAh when in sleep mode.     
My finger compared to it's size, all soldered by hand (mostly my off hand)






Thursday, 5 July 2012

Time for a new site?

Time for a new site so that means time to start looking for somewhere to host it.
One of the problems I have with my current site is that is so single sided (I post, you read). This might suit some people fine but I like feedback and sometime find comments can contain a wealth of information (and amusement).



So the purpose of this post is just to test out Blogger.com and if it's feature set suits my needs. If it does then many more posts may follow this one. 


sooooo to get started, Testing123
http://www.gr0b.com/0_o/
is still online and may start moving content across slowly.