Electronics

Electronics

Πέμπτη 18 Μαΐου 2017

WS2812B In A Stair

This project is based on sjowett's "How to 'bling' Up A Boring Staircase" which is very easy to be built. The main parts are 2 PIR sensors which detect the move of the person if he is in the upper or the bottom part of the staircase, a photoresistor which detects if it's day or night, depending on this resistance the light of the staircase might not light because who needs to turn on his staircase if it's a day? :) , finally we have our arduino and our WS2812B led strip with it's power supply.

Each RGB LED draws approximately 50 mA when it is set to full brightness and powered at 5 V. This means that for every 30 LEDs you turn on, your LED strip could be drawing as much as 1.5 A. Be sure to select a power source that can handle your strip’s current requirements. Also you need to put a capacitor between 100μF - 1000 μF near the + and - of the power supply, also a small resistor between 100-470 Ω to the data signal which connects arduino to led strip.

https://www.dropbox.com/home/Light%20Staircase

In comparison to the original sketch I had to do the followinf modifications :
1) int alarmValueTop = LOW; // Variable to hold the PIR status
int alarmValueBottom = LOW; // Variable to hold the PIR status
2) pinMode(alarmPinTop, INPUT); // for PIR at top of stairs initialise the input pin and use the internal restistor
pinMode(alarmPinBottom, INPUT); // for PIR at bottom of stairs initialise the input pin and use the internal restistor
3) if (alarmValueTop == HIGH && downUp != 2)
if (alarmValueBottom == HIGH && downUp != 1)
4) THE MOST CRITICAL! try this project in dark, because I was putting my hand in front of the LDR to raise the resistance while I had my light turned on the led strip wasn't performing how it supposed to do and while it started to work right eventually it was stopping. SO try this project at dark!




Τετάρτη 26 Απριλίου 2017

Wi-Fi Jammer with ESP8266-01

The ESP8266 is a low-cost WiFi chip which can be used with other Electronic Platforms . You can relate to it as the WiFi which is present in your Laptops , Smartphones , Tablets , etc . In this project which mostly programming than electronics we will make a WiFi Jammer. What is a WiFi Jammer? Imagine that you are in a bar with your friends and nobody talks to each other since they are looking at their phone, now here is where the wifi jammer comes into game, you activate it with 2 easy steps and this little chip sends some conflict signals to the local WiFi provider which confuses it. This project is based on Alexan24's project from instructables, but some more projects had to be added for the final version.
WARNING : WORKS ONLY WITH 3.3V AND NOT 5V . ESP8266 WILL PROBABLY FRY AT 5V .
ENSURE TX ,RX , Vcc ARE AT 3.3V BEFORE CONNECTION .





TX of  Arduino connects at Tx of ESP
Rx of Arduino Connects at Rx of ESP with a voltage divider which makes RX to receive 3.3V
Vcc and CH_Pd connects at 3.3V!!!!! 5V Will fry it!
Gnd connects at Gnd of Arduino and Source
GPIO0 connects at Gnd when we upload the code
RST connects momently at 3.3V when we upload the code 
(warning: espcomm_sync failed
error: espcomm_open failed)
These errors occured because I didn't ground the reset pin even if I was powering ESP from a different source than Arduino. My proposal it to power ESP with an external supply with the use of an AMS1117 at 3.3v .






Setting up the Environment .
Software Arduino Environment v 1.6.4 or greater
Installing with Boards Manager Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager.
It have packages available for Windows, Mac OS, and Linux (32 and 64 bit).
Install Arduino 1.6.4 (or greater) from the Arduino website ( I have 1.6.11) . Start Arduino and open Preferences window.
Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.

Go to Tools > Board > Boards Manager
Type in esp8266
Select version 2.0.0 and click on Install (must be version 2.0.0!)
Go to File > Preferences
Open the folder path under More preferences can be edited directly in the file
Go to packages > esp8266 > hardware > esp8266 > 2.0.0 > tools > sdk > include
Open user_interface.h with a text editor
Scroll down and before #endif add following lines:
typedef void (*freedom_outside_cb_t)(uint8 status);
int wifi_register_send_pkt_freedom_cb(freedom_outside_cb_t cb);
void wifi_unregister_send_pkt_freedom_cb(void);
int wifi_send_pkt_freedom(uint8 *buf, int len, bool sys_seq);
don't forget to save!
Go to the SDK_fix folder of this project
Copy ESP8266Wi-Fi.cpp and ESP8266Wi-Fi.h
Paste these files here packages > esp8266 > hardware > esp8266 > 2.0.0 > libraries > ESP8266WiFi > src
Open esp8266_deauther > esp8266_deauther.ino in Arduino
Select your ESP8266 board at Tools > Board and the right port at Tools > Port
If no port shows up you may have to reinstall the drivers.
Depending on your board you may have to adjust the Tools > Board > Flash Frequency and the Tools > Board > Flash Size. In my case i had to use a 80MHz Flash Frequency, and a 4M (1M SPIFFS) Flash Size
Upload!
Note: If you use a 512kb version of the ESP8266, you need to comment out a part of the mac vendor list in data.h.
Your ESP8266 Deauther is now ready!

How to use it

First start your ESP8266 by giving it power.
You can use your smartphone if you have a USB OTG cable.
Scan for Wi-Fi networks and connect to pwned. The password is deauther.
Once connected, you can open up your browser and go to 192.168.4.1.
You can now scan for networks.





 more infos you can find from the author of this project at : https://github.com/spacehuhn/esp8266_deauther#how-to-use-it






Σάββατο 12 Μαρτίου 2016

Security with Radio and Pir Modules

This project is part of a failed project I had in mind, my basic aim was to make a 3 transmitter - 1 receiver construction, and have the 3 transmitters placed in different spots of a location and when someone pass in front of them they could send a radio signal to a receiver, which could be placed anywhere, unfortunatelly I had to find out by the hard way (after lot of trial & error and lot of reading) that this can't happen due to the fact that these transmitters work at 433 Mhz and when more than one transmitters are turned on, the signals of them conflict and the result is random, most of the time they didn't work, but when only one transmitter is on the system works like a charm, well what can you say....you get what you pay and for 1 euro this pair is good for its money.

Have in mind to increase the distance we have to make some modifications :
A) Supply more than 5V voltage to the transmitter, this can happen when you overlap the 7805 part and supply it directly toe its pin.
B) In arduino programming keeping "vw_setup" at low numbers, I have it at 600 which is very good
C) Place a wire both at receiver and transmitter acting as an antenna which should be around 17.3 cm

Following these advices we can have the best results at the distance part.

The whole project isn't hard to construct and it's arduino free, meaning that it can be programmed through arduino environment and later work completelly independent, following the pictures and the schematics it should take you a couple of hours to construct.

P.S. you will see a green wire at the receiver which was my first antenna, but it didn't work well so I had to modify it and place a straight 17.3 cm brown cable. Also you will see 3 leds, the reason was that in the beginning I had in mind to make 3 transmitters but it didn't work, so you will only need just 1 led, and 1 buzzer, there is also a pot which controls the loudness of the buzzer and also a switch which turns on/off the buzzer.





















Code and Virtual Wire library here : https://www.dropbox.com/sh/wnjl7x154wvsp72/AABP6oAhA4S7u2TGpAeVwX64a?dl=0

Rock Band With Electronic Components (Just for fun)













Κυριακή 14 Φεβρουαρίου 2016

Mini CNC Plotter with Arduino

A great project based on "Ardumotive_com's" and "BIGDOG1971's" instructables. Both are very good explained projects and you can take the basic idea how this project is working and how to make it from skratch. Their basic difference is at the end (at that part I had my problem but I'll come with it later) since they use different program to convert the inkfile's svg to gcode, by converting our draw or text to this extension and by running the gctrl program which is a patch for processing we can make arduino communicate with our physical world and start drawing. So for the programing part we need :
a)Arduino IDE
b)Processing, which can be downloaded from here : https://processing.org/
c)Gtcrl update, which can be downloaded from the link I provide at the end of the article
d)Inkspace, which can be downloaded from https://inkscape.org/en/download/windows/ (Authors of both articles suggest you should download version 0.48.5)
e)The program to convert the inkspace's files to g-codes, https://github.com/martymcguire/inkscape-unicorn


First of all we need 2 cd-rom drives so we can make the X & Y axis : 




After this we need to connect some wires from the motors, later on we'll speak how to recognise these two coils inside this stepper motor. After we solder 4 wires to the end of the motors it is advised to put some hot glue for more safety.


Next is to mark the 4 corners where we will drill to put the mounting screws so that we can put the drivers upon them. It is advised, for the Y axis, the bottom screws can be as close they can to the south base, on the other hand the X axis screws (which is rotated 90 degrees in comparance with the Y axis) should be at the top of their base. I used a trick with nuts and bolts so I can later fix the leverage of my construction!





Final step is to make the Z axis, here everybody makes he is own patent, I've destroyed one more cd-rom so that I could have a mechanism on rails which can go up and down later I've attached to this mechanism the servo motor, so when the motors moves up and left, this mechanism helps the pen to move up and down, all this construction is attached with hot glue to the X axis.






For the electronics parts the things are less complicated. I used a 7805 voltage regulator with a heatsink, so I can feed the 2 stepper motors, the 1 servo motor plus the 2 L293D drivers and the arduino. You can connect the input pin of the 7805 to the Vin of arduino if you want since the arduino has an on-board voltage regulator. Also we should add 2 capacitors in the input and the output stage of the voltage regulator, they should be around 10 μF/16 v. In the pictures you can see how I've connected them, also the way my motors are connected to the board help me switch the cables quickly so I can find the right order later on the setup.
The stepper motor inside has two coils (that's why we have 4 cables!!) now if we take a multimeter and turn the knob to the resistor it should show us an indication to the right 2 cables, we should mark these two, then the other two cables make the other coil of the motor so if we measure it we should have another indication.
So the first pair of cables are connected to pins 3 & 6 of L293 and the other pair to pins 11 & 14. The same applies for the X axis too. If everything is ready we connect our arduino to our pc and load the X-axis example and run it, if we see some move then we are on the right track, else we should change the connections until we see some move. We should follow the same route for the Y-axis, by loading the Y-axis example and watch for some movement in our construction and by changing the order of our cables until we see. Finally we should load the Z-axis example and see our servo move up and down. If everything is ok we should load the "cnc-plotter.ino" to our arduino and close the program, our chip is ready now! Now it's time for use of Gctrl and Inkspace but I won't enter in details since there are already great examples in the internet that you should follow!






And here is the schematic thanks to ardumotive and Mixalhs Vasilakhs for their great project :

As a final comment I would like to remind you what I've written in the beginning of this article, that basically I've followed 2 projects which are great, in the end when my plotter started to draw all the images were mirrored, after a bit of search since I was thinking that it had to do with a problem in inkspace i've come to the answer. Mixalhs and the friend from Brasil connect differently not only the motors but also the arduino outputs. So follow both methods for the mechanical build and mix their ideas but with the electronics stay with Mixalhs approach!

Arduino codes and schematics here : https://www.dropbox.com/sh/w1uu1q6a4jmmlld/AAANbGKyS_X6WNVEzAMzLVbua?dl=0