Tuesday, July 6, 2021

programming ATtiny85 w/arduino uno to send binary data via rf433

 this was 'easy' but way harder than it should have been.  

The overall process for loading the board and programming steps is well documented on the web.

The following were the 'mistakes' I was making, specifically not executing several steps and/or not in the correct order

1) Before you program the ATtiny85 board you need to upload the ArduinoISP example sketch to your Arduino Uno.  When you upload the sketch the board should be arduino uno and the programmer should be Arduino as ISP.


2) After the ArduinoISP sketch successfully loads, jumper the reset pin on the arduino.  Jumpering the uno reset pin (required for programming the ATtiny85) before executing this step resulted in failure for me.


3) Selections in the tools menu when programming the ATtiny85

- board:  ATtiny25/45/85

- Processor: ATtiny85 

- Clock: Internal 8Mhz

- Programmer "Arduino as ISP".  Do not use ArduinoISP


4) upload your desired sketch.  


Other notes

I wound up jumpering the reset pin on the arduino to the 5V on ICSP header.  Conventional wisdom on the web was to use 10 uF capacitor between reset & ground on the arduino board so proceed at your own risk


3) Pin wiring for execution of arduino code to send RF433

Power supply

-  5v to ATtiny Vcc (physical pin 8) & Transmitter Vcc

- Ground to ATtiny GND (physical pin 4) & Transmitter GND

- ATtiny PB3 (physical pin 2) to Transmitter Data pin


4) code

the following code successfully sent binary '161611' via RF433 to receiver set up on raspberry pi3 


// start with very simple sketch to send code
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
  // Transmitter is connected to Attiny Pin PB3  <--
  // That is physical pin2
  mySwitch.enableTransmit(3);
}
void loop() {
    mySwitch.send(151611, 24);
    delay(1000);
  }


 

 

Sunday, June 20, 2021

Motioneye on Raspberry Pi w/ wyze v2 camera & NAS storage

 


my setup

- Pi 4 running Raspbian GNU/Linux 10 (buster)

- Docker w/ motioneye & docker-wyze-bridge containers

-WD MyCloud NAS (remote access disabled)

- Windows 10

- Wyze v2 indoor cam w/ rtsp 

- Wyze v3 outdoor cam (docker-wyze-bridge


key steps

- mount NAS share to Pi folder.  

sudo mount -t cifs -o rw,guest,vers=1.0 //[ip_address of NAS drive]/[NAS folder name]  [mount point]

- start motioneye container (from https://github.com/ccrisan/motioneye/wiki/Install-in-Docker)

docker run --name="motioneye" \

    -p 8765:8765 \

    --hostname="motioneye" \

    -v /etc/localtime:/etc/localtime:ro \

    -v /etc/motioneye:/etc/motioneye \

    -v /mount/point:/var/lib/motioneye \  

    --restart="always" \

    --detach=true \

    ccrisan/motioneye:master-armhf


- from browser open motioneye  

-  add camera. for wyze v2 camera 

device =  rtsp://192,168.x.xxx/live and username/password same as wyze app

storage device = custom path (default and only option)

root directory = /var/lib/motioneye (the -v  /mount/point:/var/lib/motioneye from above maps to the NAS drive 








Sunday, June 6, 2021

ESP8266 wifi

lessons learned from building a door/window sensor using the ESP-1 (8266) and this tutorial as a guide


$5 DIY Wireless MQTT Smart Home Window Sensors (original & 'fixed')

https://www.youtube.com/watch?v=BoYVr2UwWWg

https://www.youtube.com/watch?v=2kLZ7DlP9KU&t=60s

Executive Summary.  Could not get the sensor to work reliably due to issues with CR2032 battery (not enough mAh to power up chip) & reed switch (stopped going completely open when magnet removed).  

Even though Ithe end results were unsatisfactory it was a great learning experience covering arduino programming of a ESP-1 module and setting up an MQTT server.  

Details of issues

(using arduino sensor script from the original video (i.e. without the ip address of the chip)

power.

-  It was working great during bread board testing using a dedicated power supply (3.3V).  When I went to test after assembling the sensor using CR2032 coin cell battery it would not work.  Google searches identified potential issue with that particular chip requiring ~ 320mAh to power up and connect to wifi while the CR2032 can only provide ~200mAh.

- I then connected to 2 AAA batteries and that solved the power issue although now I did not have a nice 3d printed container

The author mentioned he had one 'power hungry' chip (of 10) that would not work unless connected to a power supply.  All 5 of my ships would not work so wondering if there was a design change on the chip in the last 3 years?


reed switch

- After confirming the 2 aaa battery setup was working on a table top, I  used velcro to attach the sensor and magnets to the door and got inconsistent results.  

- delay in getting 'open' message. 

> Initially I thought this could be due to weak wifi signal at the door from home router. signal strength at the location was in the -55 to  - 60 dB range. Looked online and that should have been good enough.

> read one post that having the wifi sensor close to the ground reduces the transmit signal.  As the chip was flush against the door frame was wondering if this was an issue.  I aligned the wifi chip so it was perpendicular to the frame while the reed switch would still be parallel to the magnets.   Inconsistent results (i.e. sometime never got a 'open' message. other times it would show up 20 seconds later)

>I then checked the reed switch resistance using a volt meter and leads hooked up to either side.  I got expected reading (1) when magnet was nearby (i.e. less than 2mm) but did not always get zero when magnet moved away.  When I got zero I got an 'open' message.  


Final Thoughts

I am not sure I figured out the exact cause(s) but am sure I could not get the sensor to work reliably after spending hours trouble shooting. 

Overall this project was a great learning experience as I start to get into DIY home automation as it tied together programming a ESP wifi chip (8266) via arduino, setting up a MQTT server, homebridge, home assistant on Rapsberry pi and flow programming (nodeRed).


 



-







Sunday, May 2, 2021

DIY - Battery Plug for Apple Wireless Bluetooth Keyboard A1314

I got the Apple Wireless Bluetooth Keyboard A1314 keyboard for free then noticed it was missing the end cap for the battery compartment.

readers digest version - made a plastic 5/8" bolt from some instaMold I had and a 5/8" nut. used aluminum foil to complete the circuit.  still a work in progress but functional. 

while I will probably 'splurge' for a new end cap online at some point, this turned into an opportunity to try out the instaMold I have had for a long time but never opened.



details

-Before proceeding, I wanted to know if the keyboard worked.  Put in 2 fresh AA batteries with a small piece of tin foil to connect the circuit between the end of the battery and the inside wall of the battery compartment.  Used my pinky finger to compress in the batteries and complete the circuit.  It worked.

- first step was to determine the thread size.  I did some initial queries on line that seemed to narrow it down to 5/8".  Went to local hardware store, with keyboard, to verify 5/8" bolt would fit.  Gently as the threads are aluminum.  Verified 5/8".  

- I was hoping they had a nylon 5/8" bolt that I could dremel but all they had was Zinc 1 1/2 in length and that was way too heavy and long, even for a prototype.

- Decided to try to make one using instaMold since operating environmentwill be benign

- Used a 5/8" nut as a mold and coated inside with some vegetable oil.





- Used about a tablespoon of the plastic beads.  That was 2x what I needed.

- pressed the softened plastic into the nut then used a coin (quarter) to create a slot on one side.   

- only minor issue was I was not paying close attention and some of the plastic formed to the outside of the nut and had to be trimmed in order to back out the plastic bolt.

- the width of the nut is 2x what is needed so will need to be trimmed if trying to make it flush

- after inserting the 2 AA batteries (positive end towards the middle) I cut a couple of small pieces of tin foil and placed on the negative end of the last battery making sure some of the aluminum touched the inside of the cylinder.  This is needed to complete the circuit.  trying to put it on the thread of the plastic bolt does not work due to the tolerances.

- result is ugly but functional until I get around to creating an amazon order over $25 so I get free shipping


Things to pay attention to or try if there is a next time


- length of bolt.  I pushed the softened plastic all the way into the nut with the nut laying flat on a countertop.  this made sure the plastic conformed to the threads and also had a flat end.   It also resulted in a bolt that was 2x too long.  Could try and cut the bolt via dremel or and insert a metal bolt in one end to shorten the effective width of the nut and therefore the length of the bolt. while I don't think having a flat end is critical, i would be concerned that only trying to push the plastic half way would not get plastic to conform properly to the nut threads.

- as you can rework the plastic easily by just reheating, I would create the thread part first with a simple handle to unscrew the bolt from the nut.  then reheat just the top part to create the slot.  




Friday, March 26, 2021

Miata NA Seat Reupholstery

After 30 years & 241K miles time was time to deal with the deteriorated cloth seats.  

The youtube video on replacing the seat with leather was great and inspired me but  wanted to stay with cloth and did not see anything on line that was basically a oem replalcement.   Passenger side was actually not too bad.  Drivers side had ripped fabric in multiple places and foam showing. 

https://www.youtube.com/watch?v=_mi1HVCnRv0








Short version
- went to a local shop and they did an amazing job for $700.  
- As they did not have an exact color match, I chose "Ascot'  as wanted something a little unique 
- Included zippers in the headrest, foam where needed and back pocket on passenger side so essentially OEM except for the color.
- Very satisfied and no regrets not trying to DIY.  
- Only 'issue' is the brand new seats accentuate the faded black interior























Details

In talking with local upholstery shops - two options
1 - One wanted me to order the replacement covers and they would install
2 - The other would do it all

The latter was highly recommended from multiple sources and only $100 more expensive.
Since I was able to see the fabric and color scheme in person my comfort level was much higher than ordering on line.  In addition I couldn't find any cloth on line so I went with the local shop do it all option.

Color decision.  They did not have an 'exact' replacement so what ever I chose would be a "one off'. 
- Dark Grey, Steel and Slate were 'safe' choices but decided if it was going to be different might as well make it unique. 









Friday, February 26, 2021

Miata NA Shifter rebuild

 91 miata - 241K miles.  1st time doing the procedure

- very straightforward and not difficult.  everything is easily accessible. 45 minutes including taking pictures.  i did spend an hour looking at various you tube videos ahead of time.

- lots of good you tube videos I found this one to be the most helpful


Short version

 https://www.youtube.com/watch?v=53Vz15GdKd0

- also this writeup from the miata.net https://forum.miata.net/vb/showthread.php?p=8041867

- get a kit.  In addition to both upper and lower dust boots having failed, the two 'wavy' washers were toast, the plastic guide was chipped and and nylon cup was missing.

Details

As the above video & write up are comprehensive will just provide some highlights

- i went with moss miata kit ($90).  ordered monday and showed up thursday. .  Only minor complaint is the upper boot dust cover did not have metal reinforcement for the 4 10mm bolts.  it was just rubber while their picture showed the miata OEM part with the metal reinforcement.  

- my shift knob was on tight and could not budge by hand. had to wrap with towel and use a pipe wrench to loosen

- I used a small amount of liquid dishwashing soap (vice grease or vaseline) on the shifter shaft to remove/install the boot covers.

- The shifter came out of the turret easily although the nylon cup at the end was missing.  Could not see it in the turret after removing the oil so who knows what happened to it? 

- Oil was at the fill line but definitely needed to be replaced.  went with 80W-90 gear oil. $7 for a quart at local O'reilly's. 



- i used a pump from a $1 liquid soap dispenser to pump out the oil.

- The turkey baster I had was not able to get in deep enough into the turret.





- Both 'wavy' washers were toast.  The upper one was in three pieces that thankfully came apart after removal of the shifter assembly.

-The lower one (attached to the bushing in the turret) was cracked. This was not evident until after removing the bushing.


- the plastic guide was chipped at the top.









- i left it in neutral and it seated on 2nd try. i installed the lower dust cover afterwards.

- i used a small amount of liquid soap on the gear shift as lubrication when putting on the boot covers (vice vaseline or grease)



Monday, January 11, 2021

NVIDIA ASUS 750 ti HDMI port not providing signal to Dell 4K monitor

My Dell 4K monitor was not getting a signal from my ASUS NVIDIA 750 ti graphics card.

Wound up buying a dual link HDMI (f) to DVI (m) adapter ($5 at Fry's) and works great.

3480 x 2160 resolution at 60hz

Not sure the HDMI port on the graphics card ever worked.  Had been using the VGA port and the HDMI from the built in graphics on my motherboard for a dual monitor set up.  The built in board (Intel HD graphics 530) would drive the 4K monitor but only at 30 hz.

windows 10

8 gb DDR 3 memory

ASUS mobo

ASUS GeForce 750Ti graphics card

Intel i5-6500 CPU

Dell U2720Q 4K monitor.  Comes with both HDMI and Display port cables