• Guest
HabraHabr
  • Main
  • Users

  • Development
    • Programming
    • Information Security
    • Website development
    • JavaScript
    • Game development
    • Open source
    • Developed for Android
    • Machine learning
    • Abnormal programming
    • Java
    • Python
    • Development of mobile applications
    • Analysis and design of systems
    • .NET
    • Mathematics
    • Algorithms
    • C#
    • System Programming
    • C++
    • C
    • Go
    • PHP
    • Reverse engineering
    • Assembler
    • Development under Linux
    • Big Data
    • Rust
    • Cryptography
    • Entertaining problems
    • Testing of IT systems
    • Testing Web Services
    • HTML
    • Programming microcontrollers
    • API
    • High performance
    • Developed for iOS
    • CSS
    • Industrial Programming
    • Development under Windows
    • Image processing
    • Compilers
    • FPGA
    • Professional literature
    • OpenStreetMap
    • Google Chrome
    • Data Mining
    • PostgreSQL
    • Development of robotics
    • Visualization of data
    • Angular
    • ReactJS
    • Search technologies
    • Debugging
    • Test mobile applications
    • Browsers
    • Designing and refactoring
    • IT Standards
    • Solidity
    • Node.JS
    • Git
    • LaTeX
    • SQL
    • Haskell
    • Unreal Engine
    • Unity3D
    • Development for the Internet of things
    • Functional Programming
    • Amazon Web Services
    • Google Cloud Platform
    • Development under AR and VR
    • Assembly systems
    • Version control systems
    • Kotlin
    • R
    • CAD/CAM
    • Customer Optimization
    • Development of communication systems
    • Microsoft Azure
    • Perfect code
    • Atlassian
    • Visual Studio
    • NoSQL
    • Yii
    • Mono и Moonlight
    • Parallel Programming
    • Asterisk
    • Yandex API
    • WordPress
    • Sports programming
    • Lua
    • Microsoft SQL Server
    • Payment systems
    • TypeScript
    • Scala
    • Google API
    • Development of data transmission systems
    • XML
    • Regular expressions
    • Development under Tizen
    • Swift
    • MySQL
    • Geoinformation services
    • Global Positioning Systems
    • Qt
    • Dart
    • Django
    • Development for Office 365
    • Erlang/OTP
    • GPGPU
    • Eclipse
    • Maps API
    • Testing games
    • Browser Extensions
    • 1C-Bitrix
    • Development under e-commerce
    • Xamarin
    • Xcode
    • Development under Windows Phone
    • Semantics
    • CMS
    • VueJS
    • GitHub
    • Open data
    • Sphinx
    • Ruby on Rails
    • Ruby
    • Symfony
    • Drupal
    • Messaging Systems
    • CTF
    • SaaS / S+S
    • SharePoint
    • jQuery
    • Puppet
    • Firefox
    • Elm
    • MODX
    • Billing systems
    • Graphical shells
    • Kodobred
    • MongoDB
    • SCADA
    • Hadoop
    • Gradle
    • Clojure
    • F#
    • CoffeeScript
    • Matlab
    • Phalcon
    • Development under Sailfish OS
    • Magento
    • Elixir/Phoenix
    • Microsoft Edge
    • Layout of letters
    • Development for OS X
    • Forth
    • Smalltalk
    • Julia
    • Laravel
    • WebGL
    • Meteor.JS
    • Firebird/Interbase
    • SQLite
    • D
    • Mesh-networks
    • I2P
    • Derby.js
    • Emacs
    • Development under Bada
    • Mercurial
    • UML Design
    • Objective C
    • Fortran
    • Cocoa
    • Cobol
    • Apache Flex
    • Action Script
    • Joomla
    • IIS
    • Twitter API
    • Vkontakte API
    • Facebook API
    • Microsoft Access
    • PDF
    • Prolog
    • GTK+
    • LabVIEW
    • Brainfuck
    • Cubrid
    • Canvas
    • Doctrine ORM
    • Google App Engine
    • Twisted
    • XSLT
    • TDD
    • Small Basic
    • Kohana
    • Development for Java ME
    • LiveStreet
    • MooTools
    • Adobe Flash
    • GreaseMonkey
    • INFOLUST
    • Groovy & Grails
    • Lisp
    • Delphi
    • Zend Framework
    • ExtJS / Sencha Library
    • Internet Explorer
    • CodeIgniter
    • Silverlight
    • Google Web Toolkit
    • CakePHP
    • Safari
    • Opera
    • Microformats
    • Ajax
    • VIM
  • Administration
    • System administration
    • IT Infrastructure
    • *nix
    • Network technologies
    • DevOps
    • Server Administration
    • Cloud computing
    • Configuring Linux
    • Wireless technologies
    • Virtualization
    • Hosting
    • Data storage
    • Decentralized networks
    • Database Administration
    • Data Warehousing
    • Communication standards
    • PowerShell
    • Backup
    • Cisco
    • Nginx
    • Antivirus protection
    • DNS
    • Server Optimization
    • Data recovery
    • Apache
    • Spam and antispam
    • Data Compression
    • SAN
    • IPv6
    • Fidonet
    • IPTV
    • Shells
    • Administering domain names
  • Design
    • Interfaces
    • Web design
    • Working with sound
    • Usability
    • Graphic design
    • Design Games
    • Mobile App Design
    • Working with 3D-graphics
    • Typography
    • Working with video
    • Work with vector graphics
    • Accessibility
    • Prototyping
    • CGI (graphics)
    • Computer Animation
    • Working with icons
  • Control
    • Careers in the IT industry
    • Project management
    • Development Management
    • Personnel Management
    • Product Management
    • Start-up development
    • Managing the community
    • Service Desk
    • GTD
    • IT Terminology
    • Agile
    • Business Models
    • Legislation and IT-business
    • Sales management
    • CRM-systems
    • Product localization
    • ECM / EDS
    • Freelance
    • Venture investments
    • ERP-systems
    • Help Desk Software
    • Media management
    • Patenting
    • E-commerce management
    • Creative Commons
  • Marketing
    • Conferences
    • Promotion of games
    • Internet Marketing
    • Search Engine Optimization
    • Web Analytics
    • Monetize Web services
    • Content marketing
    • Monetization of IT systems
    • Monetize mobile apps
    • Mobile App Analytics
    • Growth Hacking
    • Branding
    • Monetize Games
    • Display ads
    • Contextual advertising
    • Increase Conversion Rate
  • Sundry
    • Reading room
    • Educational process in IT
    • Research and forecasts in IT
    • Finance in IT
    • Hakatonas
    • IT emigration
    • Education abroad
    • Lumber room
    • I'm on my way

Night light with

Night light with 3r33434.  
3r33434.  
With the birth of a child there was a question about a nightlight. Somewhere read that it is necessary for a restful sleep. Quickly accustomed to sleep with a dim light. It is very convenient to wake up from screams and howls in the middle of the night and see what the baby is complaining about (if you can understand). Also in dim light, you can soothe, turn over and continue to sleep. 3r33434.  
3r33434.  
First, a test sample of the lamp was made from a piece of yellow LED strip (12 volts), which was used for 1.5 years. 3r33434.  
3r33434.  
3r3115. 3r33434.  
3r33434.  
3r33434.  
In addition to the fragility of the design, it became annoying every morning to remove the power supply of the lamp from the outlet. I get up in the morning, from the street in the room comes enough light. Thus, the lamp is wasted for several hours every day. Once again in half a year, the Chinese controller of the RGB tape forgot the current setting and it was necessary to search for the control panel to remind it how to work. I decided to make a new lamp with automatic shutdown, with color adjustment using potentiometers and radio. 3r33434.  
3r33434.  
Quickly assembled a prototype based on arduino nano. Debugged basic functionality. 3r33434.  
3r33434.  
3r3334. 3r33434.  
3r33434.  
Taking this opportunity I tried Fritzing. I did not like it, but the pictures are vivid and “funny”. Apparently nothing new has been invented. 3r33434.  
3r33434.  
3r33434.  
3r33434.  
Replaced the “nano” with a little-known, arduino-compatible module with a built-in radio transceiver (8-bit controller, performance and farsh-erring is comparable to “Nano”). At home, I already have one device running at 868 MHz, this will be the second. Brief specifications from the manufacturer's website:
 
3r33434.  
Brief specifications [/b]
3r33434.  
3r33434.  
3r33434.  
3r3365. 3r33434.  
3r33434.  
I do not see big problems to do the same on ESP8266 (there is a convenient online firmware builder for LUA scripts). A little harder on Bluetooth (for flashing the HM-10 module you need an inexpensive programmer, an environment for developing and understanding the protocol). Although you can use the Bluetooth module with Arduina. But I used ZUNo, because it’s been waiting for me for a long time, and the entire infrastructure for connecting and managing similar devices to one network is ready (I’m talking about the network controller of a smart home). 3r33434.  
For all used legs on the Arduino there were analogues in the module. 3r33434.  
3r33434.  
3r376. 3r33434.  
3r33434.  
To work with the module from the Arduino IDE you need to configure it (a description of the settings is on the manufacturer's website). The miracle did not happen. When trying to compile, I received the error “doesn't support“ for ”statement with empty columns or without body!”. I used the Adafruit_NeoPixel library. I climbed into it and saw how many cycles it had and closed it. I had to go back to the manufacturer's site and look for examples of working with LEDs (an example was quickly found). So, I'm not the first who faced a similar problem. 3r33434.  
3r33434.  
In order for this lamp to be controlled by radio in the Arduino code you need to add a macro and implement several functions:
 
3r33434.  
ZUNO_SETUP_CHANNELS (
ZUNO_SWITCH_MULTILEVEL (getRed, setRed),
ZUNO_SWITCH_MULTILEVEL (getGreen, setGreen),
ZUNO_SWITCH_MULTILEVEL (getBlue, setBlue),
ZUNO_SWITCH_BINARY (switch_getter, switch_setter)
); 3r33434. 3r33434. 3r33434.  
This macro describes a Z-Wave device with three multi-level switches (RGB control) and one simple switch (simple on /off). 3r33434.  
3r33434.  
I have the simplest implementation of functions (as in the examples on the manufacturer’s website). You can see in the attached listing. 3r33434.  
3r33434.  

Selection of the case

3r33434.  
I already had a case. 3r3114. Sealed with a transparent cover
. Under the cover fit 25 LEDs. The tests were successful. The lamp has a large margin in brightness for my room. The cover of this case is transparent, so I decided to dissipate the light a little. 3r33434.  
3r33434.  
3r33434.  
3r33434.  
Sketched colored beads and acrylic cubes, filled with transparent epoxy. The paint from the colored beads dissolved under the influence of the resin. 3r33434.  
3r33434.  
3r33434.  
3r33434.  
The most interesting thing is that the cover from the hermetic case leaked and almost all of the resin leaked. I do not know where I managed to hit the lid, but after drying the crack is clearly visible. 3r33434.  
3r33434.  
3r3138. 3r33434.  
3r33434.  
Printed circuit board made photoresistive. 3r33434.  
3r33434.  
3r3147. 3r33434.  
3r33434.  
3r3152. 3r33434.  
3r33434.  
After etching and machining
 
3r33434.  
3r3161. 3r33434.  
3r33434.  
I replaced the module with a microcontroller with its prototype, which was lying in the closet (because it’s not a pity, but you need to take care of ZUNo). The first version of ZUNo, but the dimensions are bigger and worse than the antenna, and you can not buy it already. The tests were more or less successful. The last segment had to be soldered. It was originally soldered to the wrong side. And adjust the number of LEDs in the firmware. 3r33434.  
3r33434.  
3r33170. 3r33434.  
3r33434.  
3r? 3175. 3r33434.  
3r33434.  
Here's what happened:
 
3r33434.  
3r3184. 3r33434.  
3r33434.  

Radio control

3r33434.  
Main window with luminaire control channels
 
3r33434.  
3r-33199. 3r33434.  
3r33434.  
Adjust the brightness of one channel LED strip
 
3r33434.  
3r3208. 3r33434.  
3r33434.  
Setting the morning off nightlight
 
3r33434.  
3r33434.  
3r33434.  

Conclusion 3r33247.

3r33434.  
The device is working. It is compact and neat. Powered by charging a mobile phone. 3r33434.  
Of the problems noted:
 
3r33434.  
 
during assembly, I cut off some of the tracks on variable resistors, so in manual mode only one channel can be controlled.
 
Of the 25 LEDs, only 20 work normally. I have a lot of this, so I will most likely leave it to reveal more serious flaws 3r-3240.  
3r33434.  
Sketch of a night light

#include "ZUNO_NeoPixel.h"
#define MAX_PIXELS 20 //NB! Z-Uno can not control more than 25 WS2811 without harming RF communications
#define PIXEL_SIZE 3 //Three colors per pixel
#define BUFF_SIZE (MAX_PIXELS * PIXEL_SIZE)
byte pixel_buff[BUFF_SIZE];
NeoPixel pixels (pixel_buff, BUFF_SIZE);
#define B_PRESSED 1
#define BUTTON_PIN 1 //Digital IO pin connected to the button. This will be
#define DEF_RED 30
#define DEF_GREEN 20
byte red = DEF_RED;
byte green = DEF_GREEN;
byte blue = 0;
#define POWER_ON 1
#define POWER_OFF 0
byte light_power = POWER_ON;
byte last_light_power = POWER_OFF;
ZUNO_SETUP_CHANNELS (
ZUNO_SWITCH_MULTILEVEL (getRed, setRed),
ZUNO_SWITCH_MULTILEVEL (getGreen, setGreen),
ZUNO_SWITCH_MULTILEVEL (getBlue, setBlue),
ZUNO_SWITCH_BINARY (switch_getter, switch_setter)
);
void switch_setter (byte value)
{
Serial.println ("switch");
Serial.print ("value =");
Serial.println (value);
if (value> 1)
light_power = POWER_ON;
else
light_power = POWER_OFF;
}
byte switch_getter ()
{
return light_power;
}
int getRed () {
return red /???;
}
int getGreen () {
return green /???;
}
int getBlue () {
return blue /???;
}
void setRed (byte value) {
red = value * ???;
for (uint8_t i = 0; i 3r33342. pixels.setPixelColor (i, pixels.Color (red, green, blue));
pixels.show (); 3r3437. Serial.print ("set red =");
.Serial.println (value);
}
Void setGreen (byte value) {
Green = value * ???; 3r34337.for pixels.Color (red, green, blue)); 3r343437; pixels.show ();
Serial.print ("set red =");
Serial.println (value); 3r3437.}
3r3437. void setBlue (byte value) {
blue = value * ???;
for (uint8_t i = 0; i < MAX_PIXELS; i++)
pixels.setPixelColor (i, pixels.Color (red, green, blue));
pixels. show (); 3r3437. Serial.print ("set red ="); 3r3437. Serial.println (value); 3r3437.} 3r3437. 3r3437. void set_LEDS () 3r3437. {3r3437. < MAX_PIXELS; i++)
Pixels.setPixelColor (i, pixels.Color (red, green, blue));
Pixels.show (); 3r3r 3437.}
void read_resistors ()
{
red = (analogRead (A0) 2) & 0xff;
green = (analogRead (A1) 2) & 0xff;
blue = (analogRead (A3) 2) & 0xff;
Serial.print (red);
Serial.print ("");
Serial.print (green);
Serial.print ("");
Serial.print (blue);
Serial.print ("");
Serial.println ();
set_LEDS ();
}
#define DEBOUNCE_ACK 10
byte check_button ()
{
static bool oldState = HIGH;
byte debounce_cnt = 0;
static byte ret = 0;
if (digitalRead (BUTTON_PIN) == LOW)
{
if (ret! = B_PRESSED)
while (digitalRead (BUTTON_PIN) == LOW)
{
if (debounce_cnt == DEBOUNCE_ACK)
{
ret = B_PRESSED;
break;
}
else
debounce_cnt ++;
delay (10);
}
}
else
{
debounce_cnt = 0;
ret = 0;
}
return ret;
}
void setup () {
Serial.begin (9600);
pixels.begin ();
pixels.clear ();
pinMode (BUTTON_PIN, INPUT_PULLUP);
}
void loop ()
{
if (check_button () == B_PRESSED)
read_resistors ();
if (last_light_power! = light_power)
{
Serial.println ("set power");
if (light_power == POWER_OFF)
{
Serial.println ("power off");
red = 0;
green = 0;
blue = 0;
}
else
{
Serial.println ("power on");
red = DEF_RED;
green = DEF_GREEN;
blue = 0;
}
set_LEDS ();
last_light_power = light_power;
}
}
3r33434. 3r33434.  
3r33434. ! function (e) {function t (t, n) {if (! (n in e)) {for (var r, a = e.document, i = a.scripts, o = i.length; o-- ;) if (-1! == i[o].src.indexOf (t)) {r = i[o]; break} if (! r) {r = a.createElement ("script"), r.type = "text /jаvascript", r.async =! ? r.defer =! ? r.src = t, r.charset = "UTF-8"; var d = function () {var e = a.getElementsByTagName ("script")[0]; e.parentNode.insertBefore (r, e)}; "[object Opera]" == e.opera? a.addEventListener? a.addEventListener ("DOMContentLoaded", d,! 1): e.attachEvent ("onload", d ): d ()}}} t ("//mediator.mail.ru/script/2820404/"""_mediator") () ();

It may be interesting

  • Comments
  • About article
  • Similar news
This publication has no comments.

weber

Author

15-12-2018, 06:10

Publication Date

Development / Programming

Category
  • Comments: 0
  • Views: 244
Create a Vuex Undo /Redo plugin for
You can buy electronic components in
Digital events in Moscow from December
Introduction to custom CSS properties
FadeObjects - Hide the objects between
A compilation of @pythonetc, september
Write a comment
Name:*
E-Mail:


Comments
Global Dezigns is a Website Development Company in Karachi, Providing services of
website design in karachi
. We are delivering the best partnership across Pakistan. provides a complete range of web development services including web applications, website hosting and maintenance, domain registration, on-page search engine optimization, and website integration with social media platforms such as Facebook, Twitter, LinkedIn, Google Maps, and Google Local Directory. We believe we are well placed to take our knowledge and expertise to the logical next level with the latest web standards.  
  Show/hide text
https://www.globaldezigns.com/



Yesterday, 22:45

mike tomlin

This blog is really great. The information here will surely be of some help to me. Thanks!.mastering physics

Yesterday, 17:57

raymond weber

Coinyspace is the cryptocurrency community and trading forum where members can find any contributors of crypto ecosystem like currencies, exchanges & merchants. Check Out: Bitcoin Merchants
Yesterday, 16:57

noorseo

This is a great high resolution screen which you have shared for the users. Making a website is not an easy task but managing a good website is really a hard work. As far as this website is concerned, I am very happy.https://19216801.1
Yesterday, 16:01

nushra45

i'm satisfied to deem this make recognized Very beneficial for me, as it contains lot of advice. I usually favor to buttonhole The excellent and glad i found this count number in you assertion. thanks Subliminal Hypnosis
Yesterday, 14:56

jahangirkhatri

Adv
Website for web developers. New scripts, best ideas, programming tips. How to write a script for you here, we have a lot of information about various programming languages. You are a webmaster or a beginner programmer, it does not matter, useful articles will help to make your favorite business faster.

Login

Registration Forgot password