element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
1 Meter of Pi
  • Challenges & Projects
  • Design Challenges
  • 1 Meter of Pi
  • More
  • Cancel
1 Meter of Pi
Blog Gr0G - 15 - Improvements
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: amgalbu
  • Date Created: 13 Dec 2020 1:24 PM Date Created
  • Views 419 views
  • Likes 2 likes
  • Comments 0 comments
  • 1meterofpi
  • gr0g
  • 1meter of pi
Related
Recommended

Gr0G - 15 - Improvements

amgalbu
amgalbu
13 Dec 2020

Here is a list of previous posts

Gr0G - 01 - Introduction

Gr0G - 02 - Why aeroponics?

Gr0G - 03 - High-pressure system design

Gr0G - 04 - Mechanical design

Gr0G - 05 - Electrical design

Gr0G - 06 - Building the box

Gr0G - 07 - Playing with the Gertbot

Gr0G - 08 - Installing LEDs

Gr0G - 09 - The control board

Gr0G - 10 - Software design

Gr0G - 11 - Building the box (2)

Gr0G - 12 - Building the high-pressure system

Gr0G - 13 - Building the high-pressure system (2)

Gr0G - 14 - Piping

Gr0G - 15 - Improvements

Gr0G - 16 - Remote UI

Gr0G - 17 - Remote UI (2)

Gr0G - 18 - Conclusions

 

Source code available at https://github.com/ambrogio-galbusera/gr0g, https://github.com/ambrogio-galbusera/gr0g-ble-android and https://github.com/ambrogio-galbusera/gr0g-ble

 

Some days of testing have underlined that some improvements are required. The first improvement will be the installation of more efficient LEDs because the light provided by the LED strips is not sufficient for the plants to grow healthy

I have 5 high-efficiency LEDs (yes, one is missing... but let's start with these) from a previous project, where I made some experiments on VLC (Visual Light Communication). May you be interested, this is the link to that project: LEDRoadTestPlus - Post 1 . I will also reuse the evaluation board for the TPS92512 to drive and dim LEDs.

The TPS92512EVM-001TPS92512EVM-001 evaluation module (EVM) helps designers evaluate the operation and performance of the TPS92512HV buck switching regulator designed for high-current LED-drive applications. The TPS92512HV device is designed to control the drive of high-brightness light emitting diodes and features a wide input voltage range (12 V to 48 V), PWM dimming capability, analog dimming capability, adjustable/syncable switching frequency, and input undervoltage protection.

 

image

VIN will come directly from the 12V power supply. To dim the LEDs, I will use a PWM signal connected to the PDIM pin, which, as the evaluation kit's user manual states,

 

The PDIM test point connects directly to the PDIM pin of the TPS92512 device. Leave open for normal operation. If PWM dimming is used, apply a square wave with a low level of GND and a high level of between 2 V and 4.5 V. The dimming frequency range is 100 Hz to 1 kHz.

The TPS92512 incorporates a PWM dimming input pin, which directly controls the enable/disable state of the internal gate driver. When PDIM is low, the gate driver is disabled. The PDIM pin has a 1 µA pull-up current source, which creates a default ON state when the PDIM pin is floating. When PDIM goes low, the gate driver shuts off and the LED current quickly reduces to zero. A square wave of variable duty cycle should be used and should have a low level below 0.79 V and a high level of 1.45 V or above.

The TPS92512 uses a sample-and-hold switch on the error amplifier output. During the PDIM off-time the COMP voltage remains unchanged. Also, the error amplifier output is internally clamped low. These techniques help the system recover to its regulation duty cycle quickly. The dimming frequency range is 100 Hz to 1 kHz and the minimum duty cycle is only limited in cases where the BOOT capacitor can discharge below its under-voltage threshold of 2 V (VIN is within 2 V of the total output voltage).

 

The Raspberry Pi 4's  PWM0 signal will be used. This is a 3.3V output, so it compatible with the specification for the PDIM input

image

I built a bracket where the LEDs will be mounted. The bracket will be joined to the bracket that I built to handle the Pimoroni Enviro board

imageimage

 

With cardboard, I created a sort of "cube" around the frame and finally I glued the LEDs to the cardboard

image

 

Here is the LEDs installed in the Gr0G box

 

imageimageimage

 

To enable the PWM output, the following lines have to be added to file /boot/config.txt

dtoverlay=pwm,pin=12,func=4

 

where

pin=12 says to the pwm overlay to use pin 12 and

func=4 says to use function 4 (which means hardware PWM)

 

Strangely, I was not able to drive PWM using Rpi.GPIO library. The workaround I followed is to write directly to sysfs as shown in the following code

 

os.system("echo 0 > /sys/class/pwm/pwmchip0/export")
os.system("echo 1000000 > /sys/class/pwm/pwmchip0/pwm0/period")
os.system("echo 500000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle")
os.system("echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable")

 

period and duty_cycle are expressed in nanoseconds. So, when 1000000 (1 million) is written to period, the PWM hardware generates a square wave at 1 kHz

I added the control of the new PWM output to the LightController class. No other changes have to be done (thanks Separation of Concerns!)

 

Here is a video showing the new LEDs at work, simulating a day and night cycle

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube