Using Simblee Bluetooth to improve one’s sleep

first_img Leave a Reply Cancel reply You must Register or Login to post a comment. This site uses Akismet to reduce spam. Learn how your comment data is processed. Share this:TwitterFacebookLinkedInMoreRedditTumblrPinterestWhatsAppSkypePocketTelegram Tags: Solutions Continue Reading Previous Could lucid dreaming perk-up your productivity?Next Deep learning machine vision system aids blind and visually impairedcenter_img I’ve got more microcontrollers lying around my house than I can count. I also have enough development boards and custom MCU boards of my own design to feed a medium-size city hackathon. What I don’t have are any of those items in permanent use around my house. Other than computer and mobile phone equipment, the only wireless devices I have in permanent operation are two WeMo AC power switches. Pretty pathetic, if I say so myself. Time to change this.The inspiration for this project came to me as a bright light (literally) not long ago. I wanted to sleep in on a recent Saturday morning (I always want to sleep in, but on this particular Saturday, I actually had the opportunity). Sadly, my window blinds do a horrid job of keeping the light out. I think they might even amplify the light on its way through. The image below is set to capture the level of brightness as accurately as possible. On the left — what it is. On the right — what I’d like it to be.(Source: Duane Benson) My solution came with the recent release of the Android version of the Simblee app. The Simblee, if you aren’t familiar, is an Arduino-compatible Bluetooth control system. The Simblee uses the Arduino IDE for programming, coupled with an iPhone or Android app that allows you to easily add sophisticated wireless control to small devices (see Max Maxfield’s Simblee article for more details). The Simblee product and iPhone app have been out for quite a while now, but I’m an Android user, so I couldn’t try it out until the Android app became available.The hardware I’m going to use the Simblee to control a stepper motor connected to a set of black-out blinds. A while back, the Simblee folks gave me a number of chips and breakout boards, so I’m all set there. I also own some Adafruit motor shields. Finally, earlier this year, I designed a Simblee carrier Arduino shield, with 3 volt to 5 volt line level converters, at the request of our esteemed editor Max.Max is well-aware that, despite the fact he asked me to design the board for him months ago, he’s only received one partially functional board without the line-level converters. That was because, in the first iteration of the board, I used open drain line-level converter chips and forgot to include pull-up resistors. Whoops.This new version uses a more traditional push-pull converter chip (Ti TXB0108) for the digital I/O, and a two MOSFET, four resistor converter on the I2C lines. I’ve got a third version of the shield in design that will put the Simblee module directly on an Arduino form-factor PC board. That third variant will be useable as a stand-alone Arduino with Simblee Bluetooth control.The image below shows my test setup. From the top center, clockwise, we see the following:Adafruit motor shield and stepper motorA multi-sensor shield of my design with DS3231 RTC (real-time clock) populatedA Simblee RFD22122 RGB Led / button shieldA Simblee RFD22121 USB programming shieldA Simblee RFD77201 7-GPIO breakout boardMy Arduino form-factor Simblee breakout carrier shieldAn Arduino Uno without the Atmega328P MCU(Source: Duane Benson) With regard to the last item, why an Arduino without the microcontroller, you might ask? In fact the Simblee contains its onw 32-bit MCU and I’m using this to perform all of the computation, so I don’t need the Arduino. However, since nothing else in the stack has a 5 volt supply, I’m using the Uno board as the power supply. What this has taught me is that my Simblee carrier shield needs to have a power input connector and both three and five volt regulators. It already has the 3.3 volt, but without an external regulated 5 volt source, I’m out of luck unless I use the MCU-less Arduino.The complete stack-up is as shown below:(Source: Duane Benson) The basic operation will be to automatically lower the blinds in the evening, and, raise them at different hours, depending on the day — early on weekdays to help get me up for work, and 10:00 or 11:00 a.m. for that extra rest on the weekends. The RTC will take care of the timed raising and lowering, while the app on my phone will allow me to raise and lower the blinds all the way, or partially, without my having to get out of bed.The Simblee communicates to my phone via it’s Bluetooth stack. It talks to the motor shield using its I2C interface. The Simblee is also capable of communicating with cloud-based applications and web sites, so once the basics are working, I’ll set it up for remote control and scheduling, but that will be a story for a future column; meanwhile…The software The Simblee is programmed using the Arduino IDE, both for the microcontroller functionality of the Simblee and for the UI (user interface) on your phone. The microcontroller component is just about identical to and compatible with standard Arduino code. The phone UI is also coded in the Arduino IDE.For example, here’s the code to create the Up Arrow control on my phone: ui_buttonUp = SimbleeForMobile.drawButton(120, 100, 100, “Blinds up”);And here’s the code to call a function when the button is pressed: SimbleeForMobile.setEvents(ui_buttonUp, EVENT_PRESS);There are three modules to the Simblee Arduino-compatible code: SimbleeForMobile, which is used to talk to a mobile phone; SimbleeCOM, which is used for Simblee-to-Simblee communications; and SimbleeCloud, which is used for interfacing with the web. At the moment, I’m only using SimbleeForMobile; I will start to use SimbleeCloud when I’m ready to add web-based remote control.I’m have to say that the Simblee is pretty Arduino compatible. The sample code from Adafruit for the motor shield and RTC worked without modification. I was able to copy and paste the Motor shield and RTC code directly into my Simblee sketch. It doesn’t get much easier than that.The mechanism The on-wall setup is pretty simple, as you can see in the photo below. I use the standard bracket on one side of a roller blind. On the other side, I’m going to use a small piece of flexible tubing to connect the stepper shaft to the roller blinds; this will serve as the mount and the drive shaft. Finally, I’ll use small proximity sensors as limit switches for the blind’s travel.(Source: Duane Benson) As soon as connect the motor shaft to the blind’s roller and mount the light sensors, everything will be ready to go. I also need to change the mounting of the stepper a bit. Right now, when I run it, it resonates through the drywall and sounds like I’m about to be run over by a truck.If I ever get around to designing custom hardware, the Arduino stack will be much smaller, but for now, it’s a bit of an eyesore. On the other hand, this it does add to the geek-cred of the installation.At some time in the future, I’ll add in remote web-based control. I’m also planning on adding a solar panel and lithium battery, thereby making the system completely wireless. I only need enough power in reserve to handle a few up and down cycles, so solar charging should be sufficient. Speaking of which, does anyone know of an easy-to-use chip that will manage Lithium battery charging from a solar panel?last_img read more

Pep Guardiola: Kevin De Bruyne is fresh, recovered … he is a special player

first_imgShare on Facebook Share on Messenger Share on LinkedIn De Bruyne and Sergio Agüero, who has missed the past four games with a muscle problem, face late tests. Guardiola is pleased City are only a point behind the leaders, Liverpool, despite having been without De Bruyne for much of the season and Agüero recently.“We competed with the best starts from Liverpool, Chelsea, Tottenham – and still we are there,” the manager said. “People [also] say we qualify for the Champions League [knockout] in first place and we are second, one point behind Liverpool having played four games against contenders.“The way we played was really good but, of course, we want to be first. We cannot be far away because I think they will all drop few points, especially Liverpool – and Arsenal are also 20 games unbeaten. The level increased a lot compared to the last two or three seasons – how the big teams are playing.”Guardiola defended Gabriel Jesus, who has scored only once in the league – in August – and five times in total for City this season.“The strikers live for scoring goals,” he said. “[But] he’s made a lot of assists, his movement, creating spaces for teammates is there. He’s still he’s a young player, we are going to give him time.“Last game, for example [against Hoffenheim], he was exhausted but he finished like a full-back, making three challenges, and he’s the only striker in the world who can do that. He’s an extra for our pressing game. We have to help him to provide scoring positions and we are fully confident in him.”Everton are the only team Guardiola’s City have failed to beat in two home league matches, drawing each. “I would say that in both games we played top,” he said. “Especially the first one, we played really good.” Manchester City Share via Email Kevin De Bruyne Pep Guardiola news Share on Pinterest Topics Kevin De Bruyne: the stubborn boy who developed into a world beater Share on Twitter Pep Guardiola believes Kevin De Bruyne’s injuries may prove a blessing in disguise for Manchester City because the Belgian will return fresh for the second half of the season.De Bruyne is back in full training after his second knee problem of the campaign.The first ruled him out for two months until mid-October and he has not played since 1 November because of the second, although he is in contention for Saturday’s game at home to Everton.“I think Kevin finished last season exhausted – it was so tough for him,” Guardiola said. “He played a lot of minutes, a lot. It was an incredible performance and after that he went to the World Cup. When he came back I had the feeling he was a little bit tired still, and sometimes people recover quite well, sometimes mentally it takes time.“So that’s why [although] maybe we don’t want any player to be injured, maybe it helped us. Now he’s fresh in his mind, he is recovered and tries again to avoid the injuries and play regularly. And of course he is going to be important for us; he is a special player.” Share on WhatsApp Read more Reuse this contentlast_img read more