Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Wednesday, June 4, 2014

3wire SPI temperature sensor and relay control boards (suitable for Raspberry Pi)

I've been using this LM95071 temperature sensor breakout for quite a while.


Low-power, high-resolution (13-Bit plus sign) digital temperature sensor with an SPI/MICROWIRE compatible interface. 5-pin SOT-23. From Texas Instruments.
Works just fine with the RPi :)

And here is the relay control board:




Coil is 5V DC. Controlled with digital transistor. All you need is 1 GPIO pin from any MCU.
-----------------------------------------------------------------------------------------------------------------

Friday, May 30, 2014

Raspberry Pi camera case and lens

(It's been a while since my last post...)

The RPi camera in a 3D printed case and some wide screen lens attached to it:




I bought the lens from ebay.com. Just search for "Fish Eye Lens for iPhone" or something.

As for the case: www.thingiverse.com/thing:92208
I used these exact files: front | back
-----------------------------------------------------------------------------------------------------------------

Monday, January 14, 2013

Wireless temperature sensor with Raspberry Pi

Finally got some time to play with the Raspberry. Behold the wireless temperature sensor :D




The sensor itself is LM95071. Temperature is read through SPI. The only problem was that after the first read the sensor was put in shutdown mode... I guess this is because the SPI is full duplex and the SI/O pin was left dangling during WR to the sensor (even though I was only reading from it...). The solution was to add pull-down resistor to the SI/O pin (the additional resistor on the picture).

I have Apache web server on the RPi and I'm using WUSB54GC wifi dongle to transmit the temperature over the internet :)


-----------------------------------------------------------------------------------------------------------------

Monday, August 6, 2012

WiFi dongle on Raspberry Pi


A little guide how to use Linksys WUSB54GC WiFi dongle on Raspberry Pi (Raspbian “wheezy” images). The dongle is pretty old but I used it just for the test :)

(1) You need self-powered USB hub!
(2) Plug the dongle in the hub:

pi@raspberrypi:~$ dmesg
[  111.915950] usb 1-1.3.2: new high speed USB device number 5 using dwc_otg
[  112.216207] usb 1-1.3.2: New USB device found, idVendor=13b1, idProduct=0020
[  112.216240] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  112.216261] usb 1-1.3.2: Product: Compact Wireless-G USB Adapter
[  112.216290] usb 1-1.3.2: Manufacturer: Cisco-Linksys
[  112.311511] cfg80211: Calling CRDA to update world regulatory domain
[  112.495964] usb 1-1.3.2: reset high speed USB device number 5 using dwc_otg
[  112.978042] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[  112.981551] Registered led device: rt73usb-phy0::radio
[  112.982146] Registered led device: rt73usb-phy0::assoc
[  112.982727] Registered led device: rt73usb-phy0::quality
[  112.987435] usbcore: registered new interface driver rt73usb

We can also see the drivers are loaded:

pi@raspberrypi:~$ lsmod
Module                  Size  Used by
...
rt73usb                 23490  0
rt2x00usb              12077  1 rt73usb
rt2x00lib              43890  2 rt2x00usb,rt73usb
mac80211              253889  2 rt2x00lib,rt2x00usb
cfg80211              180459  2 mac80211,rt2x00lib


(3) wlan0 interface is automatically created:

pi@raspberrypi:~$ ifconfig
wlan0     Link encap:Ethernet  HWaddr 00:1d:7e:11:c4:56
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


(4) To connect automatically to WiFi AP add this to /etc/network/interfaces:

auto wlan0
iface wlan0 inet dhcp
  wpa-ssid <AP-SSID>
  wpa-psk <KEY>


(5) Restart networking:

pi@raspberrypi:~$ sudo /etc/init.d/networking restart
Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces ... (warning).
Reconfiguring network interfaces...Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/00:1d:7e:11:c4:56
Sending on   LPF/wlan0/00:1d:7e:11:c4:56
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.32.1
DHCPACK from 192.168.32.1
bound to 192.168.32.104 -- renewal in 32936 seconds.
done.


Done!

pi@raspberrypi:~$ dmesg
[  374.243090] wlan0: authenticate with 00:b0:0c:4f:25:10 (try 1)
[  374.244913] wlan0: authenticated
[  374.307729] wlan0: associate with 00:b0:0c:4f:25:10 (try 1)
[  374.312512] wlan0: RX AssocResp from 00:b0:0c:4f:25:10 (capab=0x411 status=0 aid=1)
[  374.312540] wlan0: associated

pi@raspberrypi:~$ ifconfig
wlan0     Link encap:Ethernet  HWaddr 00:1d:7e:11:c4:56
          inet addr:192.168.32.104  Bcast:192.168.32.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:51 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10652 (10.4 KiB)  TX bytes:4726 (4.6 KiB)


Try some ping:

pi@raspberrypi:~$ ping google.com
PING google.com (209.85.148.101) 56(84) bytes of data.
64 bytes from fra07s07-in-f101.1e100.net (209.85.148.101): icmp_req=1 ttl=56 time=34.7 ms
64 bytes from fra07s07-in-f101.1e100.net (209.85.148.101): icmp_req=2 ttl=56 time=46.4 ms
64 bytes from fra07s07-in-f101.1e100.net (209.85.148.101): icmp_req=3 ttl=56 time=45.8 ms
...

So for the test I left it pinging for some time. Haven't seen any issues till now :)

Next step: To avoid using self-powered hub find WiFi dongle with lower power consumption... :/
-----------------------------------------------------------------------------------------------------------------

Friday, August 3, 2012

Raspberry Pi

My long awaited Raspberry Pi finally arrived:


I tried it with Raspbian (wheezy) images:


One of the first impressions is that apparently there is absolutelly no power management (PM) - the board generates a lot of heat :(
Should search for images with some PM optimization (hope they exist).

Hmm... now must think of a good project :D
-----------------------------------------------------------------------------------------------------------------